/
cubo.scad
783 lines (642 loc) · 21.3 KB
/
cubo.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
//FabLab Santander
//machine "cubo"
//licence creative common
//profile:
profilex_length=500;
profiley_length=500;
profilez_length=500;
profile_size=20;
profile_screw_D=5;
// height
h=560;//side plate height
//plates :
th=10; //side and base plate thickness
back_th=3;//back plate thickness
//bearing 627:
bearing_D=22;
bearing_dint=7;
bearing_th=7;
//distance between the 2 guides x
inter_guides_x=profiley_length/2+10+bearing_th/2;
echo("distance between the 2 guides x:",2*inter_guides_x,"mm");
//x trail:
dx_guidey=60;//distance between the 2 guides y
dz_guidey=profile_size/2+bearing_D/2-1.5;//profile_size-0.5;
//x trail plate:
xtrailPlateThickness=3;
//head:
headPlateThickness=5;
headPlate_dx=dx_guidey-profile_size-2;
headPlate_dy=80;
//stepper motor nema17:
motNema17Side=42;
motNema17Dep=47.65;
motNema17AxisD=5;
motNema17AxisL=26;
motNema17ScrewFixD=3;
motNema17ScrewsDist=31;
motNema17FrontD=22;
motNema17FrontH=1.5;
//motor pulley GT2
pulleyTeethDiameter=12;
pulleyDiameter=16;
pulleyThickness=16;
//belts:
belt_th=6;//belt thickness
belt_thi=2;//belt thickness
z_belts=3;
//half distance between pulley in y direction
inter_pulleys_y=profiley_length*0.46;
//head plateform parameters:
head_bearing_axis_z=profile_size/2+bearing_D/2-1.5;
//PLA coil:
d_PLA_coil_inner=51;
d_PLA_coil_outer=200;
h_PLA_coil=72;
head_X=150;
head_Y=0;
//the CUBE machine mounted:
//ensemble();
//structure();
//------------ 3D print: -------------------
//rotate([-90,0,0])xtrailPlate();
//bearingPusher();
//bearingAdaptor();
//stepper_holder();
//pulley_holder();
//rotate([180,0,0])head_plateform();
//rotate([-90,0,0])head_bearing_holder();
//pulley_washer();
//rotate([90,0,0])PLA_pulley_holder();
//rotate([0,90,0])PLA_pulley();
PLA_coil_holder();
//------------ 3D print: -------------------
//dim cube:
cube_length_x = profilex_length+2*thickness_panel;
cube_length_y = profiley_length+2*profile_size;
h_stop_extruder = 120;
height_cube = profilex_length+h_stop_extruder+2*thickness_panel;
//z system:
inter_zguides=300;
module plates()
{
//translate([profilex_length/2,0,0]) provisory_side_plate();
//mirror([1,0,0])translate([profilex_length/2,0,0]) provisory_side_plate();
//translate([profilex_length/2,0,0]) side_plate();
//for (c=[0,1]) mirror([c,0,0])translate([profilex_length/2,0,0]) side_plate();
//side metalic bar for the XY system
bar_th=4;
//front plate:
dx=profilex_length+2*bar_th;
l3=130;//front plate height
dx_base=profilex_length+2*th+2*bar_th;
dy=profiley_length+50;
//l1=100; //side plates width
h2=200;//side plate noze height
backSpace=50;//space at the back for the Z system
dy2=profiley_length+50;//side plate depth
dy_nose=dy2*0.25;//nose depth
rad=dy_nose/2;
hup=profile_size*2.5;
//side metalic bar for the XY system
color([0.8,0.8,0.8])for (c=[0,1]) mirror([c,0,0])
{
difference()
{
translate([profilex_length/2,-dy2/2,-profile_size/2])cube([bar_th,dy2,profile_size]);
for (y=[-1,1])translate ([profilex_length*0.3,y*(inter_guides_x),0])rotate([0,90,0])cylinder(h=200,r=5/2,$fn=20); }
}
color=[.6,.6,.9];
//base plate:
color(color+[0.1,0,0]) translate([-dx_base/2,-dy2/2+dy_nose,-h])cube([dx_base,dy2-dy_nose+backSpace,th]);
//front plate;
//color(color-[0.1,0,0])translate ([-dx/2,-dy2/2+dy_nose,-h+th])rotate([16,0,0]) cube([dx,th,l3]);
//back plate;
color(color-[0.1,0,0])translate ([-dx/2-th,-dy2/2+dy_nose+dy2-dy_nose+backSpace,-h])cube([dx+2*th,back_th,hup+h]);
//side plates
color(color)for (c=[0,1]) mirror([c,0,0])translate([profilex_length/2+th+bar_th,0,0])
{
rotate([0,-90,0])linear_extrude(height=th)
{
polygon([
// z y
[-profile_size*4,-dy2/2],
[hup,-dy2/2],
[hup,dy2/2+backSpace],
[-h+th,dy2/2+backSpace],
[-h+th,-dy2/2+dy_nose]
]);
}
}
//side plates
//for (c=[0,1]) mirror([c,0,0])translate([profilex_length/2,0,0])
// {
// color("orange")
// difference()
// {
// union()
// {
// //top:
// translate ([0,-dy2/2,-h2+20]) cube([thickness_panel,dy2,h2]);
// //bottom:
// translate ([0,-dy2/2+dy_nose,-h+20]) cube([thickness_panel,dy2-dy_nose,h]);
// //round
// translate ([0,-dy2/2+rad,-h*0+20-h2])rotate([0,90,0])cylinder(r=rad,h=th,$fn=30);
// }
// for (y=[-1,1])translate ([profilex_length*0.3,y*(inter_guides_x),0])rotate([0,90,0])cylinder(h=200,r=5/2,$fn=20);
// }
// }
echo("base plate size (mm):",dx_base,dy2-dy_nose+backSpace,th);
echo("side plates (2x) size (mm):",dy2/2+backSpace-(-dy2/2),hup-(-h+th),th);
echo("dy nose (mm):",dy_nose);
//echo("back plate size (mm):",dx-2*th,l2,th);
echo("front plate size (mm):",dx,l3,th);
}
module ensemble()
{
//the clothes of the machine:
//cover();
plates();
provisory_zsystem();
//guides for x translation
for (i=[-1,1])
translate([-profilex_length/2,i*(-profiley_length/2-10-bearing_th/2),0])rotate([0,90,0])color([0.2,0.2,0.2])import ("profil_ratrig_500mm.stl");
//guides for y translation
translate([head_X,0,0])//Y carriage ensemble
{
for (i=[-1,1])
{
//guides y
translate([i*-dx_guidey/2,profiley_length/2,dz_guidey])rotate([90,0,0])color([0.2,0.2,0.2])import ("profil_ratrig_500mm.stl");
//bearings:
for (j=[-1,1]) translate([i*-dx_guidey/2,j*(profiley_length/2+bearing_th/2+10),dz_guidey])rotate([90,0,0])
{
bearing();
bearingAdaptor();
}
//screw for bearings:
color([0.4,0.4,0.4])for (j=[-1,1])translate([i*-dx_guidey/2,j*(profiley_length/2+10),dz_guidey])rotate([90,0,0])cylinder(r=profile_screw_D/2,h=20,$fn=30,center=true);
}
//lower bearings
for (j=[-1,1]) translate([0,j*(profiley_length/2+bearing_th/2+10),-dz_guidey])
{
rotate([90,0,0])bearing();
rotate([90,0,0])bearingAdaptor();
//screw for bearings:
color([0.4,0.4,0.4])translate([0,-profile_size/2,0])rotate([90,0,0])cylinder(r=profile_screw_D/2,h=30,$fn=30,center=true);
}
//xtrail side plates:
translate([0,profiley_length/2+xtrailPlateThickness/2,dz_guidey+profile_size/2])
{
xtrailPlate();
bearingPusher();
}
mirror([0,1,0]) translate([0,profiley_length/2+xtrailPlateThickness/2,dz_guidey+profile_size/2])
{
xtrailPlate();
bearingPusher();
}
//head:
translate([0,head_Y,dz_guidey])
{
//bearings
for (x=[-1,1]) for (y=[-1,1]) translate([x*dx_guidey/2,y*headPlate_dy*0.4,head_bearing_axis_z])rotate([0,0,90]) rotate([90,0,0])bearing();
for (x=[-1,1]) translate([x*dx_guidey/2,0,-head_bearing_axis_z])rotate([0,0,90]) rotate([90,0,0])bearing();
//head plateform:
head_plateform();
//head bearings holder (with springs to push down the bearings
for (y=[-1,1])translate([0,y*headPlate_dy*0.44,head_bearing_axis_z])head_bearing_holder();
// extuder:
//prusa i2 extruder:
//translate([0,0,headPlateThickness])color("blue")rotate([0,0,0])import("extruder.stl");
//extruder head alone:
color("gray")translate([0,0,5])extruder();
}
//pulleys fixed on the Y guides:
for (x=[-1,1])for (y=[-1,1])translate([-x*dx_guidey/2,y*(profiley_length*0.45-bearing_D),z_belts])
{
bearing();
translate([0,0,-bearing_th])pulley_washer();
}
}//end of X carriage ensemble
translate([0,0,z_belts])
{
for (c=[0,1]) mirror([0,c,0])
{
//stepper holder:
translate([-profilex_length/2+motNema17Side/2,inter_pulleys_y,-17])stepper_holder();
//pulley holder:
translate([profilex_length*0.47,-inter_guides_x-profile_size/2,-17])pulley_holder();
}
for (y=[-1,1])
{
//stepper motors:
translate([-profilex_length/2+motNema17Side/2,y*inter_pulleys_y,-17])rotate([0,-90,0])color("skyblue")motor_nema17();
//GT2 pulleys on steppers:
color("grey")translate([-profilex_length/2+motNema17Side/2,y*inter_pulleys_y,-pulleyThickness*0.7]) pulley();//bearing();
//pulleys on the other side:
translate([profilex_length*0.47,y*inter_pulleys_y,0]) bearing();
}
//pulleys on the other side:
for (c=[0,1]) mirror([0,c,0])translate([profilex_length*0.42,inter_pulleys_y-20,0]) bearing();
//belt at right
color("blue")for (c=[0,1]) mirror([0,c,0])translate([profilex_length*0.47+bearing_D/2,inter_pulleys_y*0.05,-belt_th/2])rotate([2,0,0])cube([belt_thi,inter_pulleys_y*1.9,belt_th],center=true);
//belts:
for (y=[-1,1])
{
color("blue")translate([-profilex_length/2+motNema17Side/2,y*(inter_pulleys_y+bearing_D/2),-belt_th/2])cube([inter_pulleys_y*2,belt_thi,belt_th]);
color("blue")translate([-profilex_length/2+motNema17Side/2,y*(inter_pulleys_y-bearing_D/2),-belt_th/2])cube([profiley_length/2,belt_thi,belt_th]);
color("blue")translate([head_X+dx_guidey/2,y*(inter_pulleys_y-bearing_D/2),-belt_th/2])cube([profiley_length/2-head_X-dx_guidey,belt_thi,belt_th]);
}
//belts on the x rail:
color("blue")for (x=[-1,1]) translate([head_X-x*dx_guidey/2+x*bearing_D/2,-inter_pulleys_y+bearing_D,-belt_th/2])cube([belt_thi,inter_pulleys_y*2-bearing_D*2,belt_th]);
}
translate([-profilex_length/2+40,-100,-h+th])rotate([0,0,90])
{
PLA_pulley_holder();
PLA_pulley();
}
translate([0,0,-h+th])rotate([0,0,90])
{
color("black")translate([0,0,5])PLA_coil();
PLA_coil_holder();
}
}
module head_plateform()
{
//bearing holders size:
aay=36;
aax=5;
aaz=28;
coefy=0.44;
coefx=0.35;
difference()
{
union()
{
//main base:
translate([-headPlate_dx/2,-headPlate_dy/2,0]) cube([headPlate_dx, headPlate_dy,headPlateThickness]);
//bearings holders:
//for (x=[-1,1]) for (y=[-1,1]) translate([x*(headPlate_dx-aax)*0.5-aax/2,y*headPlate_dy*0.4-aay/2,0])cube([aax,aay,aaz]);
//lower bearing holders:
for (x=[-1,1]) translate([x*(headPlate_dx-aax)*0.5-aax/2,-aay/2,-aaz])cube([aax,aay,aaz]);
//reinforcement for lower bearing axis:
//for (x=[-1,1]) translate([x*headPlate_dx*0.55,0,-head_bearing_axis_z]) rotate([0,90,0])cylinder(r=18/2,h=9,$fn=20,center=true);
for (x=[-1,1]) translate([x*headPlate_dx*0.55,0,-head_bearing_axis_z]) cube([9,36,17],center=true);
//reinforcement for upper bearings pushers:
for (x=[-1,1])for (y=[-1,1])translate([headPlate_dx*coefx*x,y*headPlate_dy*coefy,-4])cylinder(r=7/2,h=8,$fn=20,center=false);
}
//big hole:
translate([0,0,-1])scale([1,1.4,1])cylinder(r=14,h=50,$fn=30);
//holes to fix the extruder:
for (y=[-1,1])translate([0,25*y,-1])cylinder(r=2,h=50,$fn=30);
//holes for the bearings pushers
for (x=[-1,1])for (y=[-1,1])translate([headPlate_dx*coefx*x,y*headPlate_dy*coefy,0])cylinder(r=4/2,h=headPlate_dx+2,$fn=20,center=true);
//holes for bearing axis:
for (x=[-1,1]) translate([x*dx_guidey/2,0,-head_bearing_axis_z]) rotate([0,90,0])cylinder(r=2,h=40,$fn=20,center=true);
//belt place:
for (v=[-1,0])mirror([v,0,0])translate([-dx_guidey/2+bearing_D/2-0,0,-dz_guidey+z_belts])cube([belt_thi*2+1,40,belt_th+2],center=true);
//holes for belt pressing:
for (v=[-1,0])mirror([v,0,0])for (y=[-1,1]) translate([-dx_guidey/2,13*y,-dz_guidey+z_belts]) rotate([0,90,0])cylinder(r=2.5/2,h=40,$fn=20,center=true);
//chamfer:
for (v=[-1,0])mirror([0,v,0])translate([0,0,-head_bearing_axis_z*1.65])rotate([10,0,0])cube([headPlate_dx*2,headPlate_dy,headPlate_dx/3],center=true);
}
}
//head lower bearing holder:
module head_bearing_holder()
{
coefx=0.35;
difference()
{
union()
{
//body
translate([0,0,-2])cube([dx_guidey-bearing_th-2, 8,12],center=true);
translate([0,0,-6])cube([dx_guidey-profile_size-2, 8,12],center=true);
}
//space for springs:
translate([0,0,4])cube([dx_guidey-bearing_th-14, 8+2,12],center=true);
//holes for spring screws:
for (x=[-1,1])translate([headPlate_dx*coefx*x,0,0])cylinder(r=3.5/2,h=headPlate_dx+2,$fn=20,center=true);
//holes for bearings screws:
for (x=[-1,1])translate([headPlate_dx*coefx*x,0,0])rotate([0,90,0])cylinder(r=4/2,h=headPlate_dx+2,$fn=20,center=true);
}
}
//stepper motor holder:
module stepper_holder()
{
difference()
{
//main plate
translate([-motNema17Side/2,-motNema17Side/2,0])cube([motNema17Side,65,4]);
//place for the stepper head:
translate([0,0,-1])cylinder(r=(motNema17FrontD+1)/2,h=20,$fn=30);
//holes to fix on the rails with M5 screws:
for (x=[-1,1]) translate([10*x,33.5,-1])cylinder(r=5/2,h=20,$fn=30);
//hole to fix the stepper motor nema17
for (x=[-1,1])for (y=[-1,1])translate([motNema17ScrewsDist/2*x,motNema17ScrewsDist/2*y,-1])cylinder(r=3.5/2,h=20,$fn=30);
}
}
//pulley holder:
module pulley_holder()
{
ax=20;
ay=50;
difference()
{
//main plate
translate([-ax/2,0,0])cube([ax,ay,4]);
//hole for the pulley axis:
translate([0,inter_guides_x+profile_size/2-inter_pulleys_y,-1])cylinder(r=(5)/2,h=20,$fn=30);
//holes to fix on the rails with M5 screws:
for (x=[-1,1]) translate([5*x,profile_size/2,-1])cylinder(r=5/2,h=20,$fn=30);
}
}
module xtrailPlate()
{
xtrailPlate_dz=profile_size;
a=profile_size;
dy=a;
difference()
{
union()
{
//plate to attach the 2 y profiles:
translate([-(dx_guidey+profile_size)/2,-xtrailPlateThickness/2,-xtrailPlate_dz]) cube([dx_guidey+profile_size,xtrailPlateThickness,xtrailPlate_dz]);
//plate that connects the lower bearing:
translate([-(profile_size)/2,-xtrailPlateThickness/2,-xtrailPlate_dz*1.7]) cube([a,xtrailPlateThickness,xtrailPlate_dz]);
//rounded plate:
translate([0,xtrailPlateThickness/2,-xtrailPlate_dz*1.6]) rotate([90,0,0]) cylinder(h=xtrailPlateThickness,r=xtrailPlate_dz*0.5,$fn=70);
//vertical reinforcement:
translate([-xtrailPlateThickness/2,-a*0.3,-a*1.8]) cube([xtrailPlateThickness,a*0.3,a*1.8]);
//horizontal reinforcement:
translate([-(dx_guidey-profile_size-2)/2,-a*0.3,-xtrailPlateThickness]) cube([dx_guidey-profile_size-2,a*0.3,xtrailPlateThickness]);
// screw pressing holder:
translate([0,-a+xtrailPlateThickness/2,-a*1.6])translate([-a/4,0,-a/2]) cube([a/2,a,a/2]);
}
//holes
translate([0,0,-dz_guidey-a/2])
for (i=[-1,1]) for (k=[-1,1])translate([i*-dx_guidey/2,0,k*dz_guidey])rotate([90,0,0])cylinder(r= profile_screw_D/2,h=40,$fn=20,center=true);
// screw pressing holder:
translate([0,-a+xtrailPlateThickness/2,-a*1.6])
{
translate([-a/8,-a/2,-a/2-1]) cube([a/4,profile_size,a/2+2]);
//hole for rotation axis:
translate([-a/4-1,a/4,-a/4]) rotate([0,90,0]) cylinder(r=2.5/2,h=a/2+2,$fn=20);
}
//hole for pressing screw:
translate([0,a*-0.1,-a*2.5])cylinder(r=2.5/2,h=a,$fn=20);
}
}
module bearingPusher()
{
a=profile_size;
translate([0,0,1])
difference()
{
union()
{
//hold the axis screw:
translate([-(a*0.2)/2,-a,-a*2.75]) cube([a*0.2,a/2,a*1.1]);
//hold the bearing screw:
translate([-a/2/2,-a,-a*2.75]) cube([a/2,a/2*2.7,a*0.5]);
}
//hole/space for pressing screw
translate([0,a*-0.1,-a*3])cylinder(r=5/2,h=a,$fn=20);
//hole for rotation axis:
translate([-a*0.5,-a*0.675,-a*1.9])rotate([0,90,0])cylinder(r=3.5/2,h=a,$fn=20);
//hole threaded to fix the bearing axis:
translate([0,a*1.9,-a*2.5])rotate([90,0,0])cylinder(r=4.8/2,h=2*a,$fn=20);
}
}
//windows cube:
module cover()
{
difference(){
ensemble_cube();
translate([0,0,-height_cube/2+h_stop_extruder])
union(){
cube([2*cube_length_x,cube_length_y-cube_length_x*2/5,+height_cube*3/5],center=true);
rotate([0,0,90])
translate([-cube_length_x/2,0,0])
cube([cube_length_x,cube_length_y-cube_length_x*2/5,height_cube*3/5],center=true);
rotate([0,90,0])
translate([-cube_length_x/2,0,0])
cube([cube_length_x,cube_length_y-cube_length_x*1/4,height_cube*3/5],center=true);
}
}
}
module ensemble_cube()
{
//upper panel:
color("orange")
translate ([-cube_length_x/2,-cube_length_y/2-thickness_panel,h_stop_extruder-thickness_panel])
cube([cube_length_x,cube_length_y+2*thickness_panel,thickness_panel]);
//bottom panel:
color("orange")
translate ([-cube_length_x/2,-cube_length_y/2-thickness_panel,-height_cube+h_stop_extruder])
cube([cube_length_x,cube_length_y+2*thickness_panel,thickness_panel]);
//left panel:
color("orange")
translate ([cube_length_x/2-thickness_panel,-cube_length_y/2-thickness_panel,-height_cube+h_stop_extruder+thickness_panel])
cube([thickness_panel,cube_length_y+thickness_panel,height_cube-2*thickness_panel]);
//right panel (Left mirrored):
mirror(0,1,0){
color("orange")
translate ([cube_length_x/2-thickness_panel,-cube_length_y/2-thickness_panel,-height_cube+h_stop_extruder+thickness_panel])
cube([thickness_panel,cube_length_y+thickness_panel,height_cube-2*thickness_panel]);
}
//back panel:
color("orange")
translate ([-cube_length_x/2,cube_length_y/2,-height_cube+h_stop_extruder+thickness_panel])
cube([cube_length_x,thickness_panel,height_cube-10*thickness_panel]);
//front panel:
color("cyan")
translate ([-cube_length_x/2,-cube_length_y/2-2*thickness_panel,-height_cube+h_stop_extruder])
cube([cube_length_x,thickness_panel,height_cube]);
//tirador puerta:
color("black")
translate([cube_length_x/2-50,-cube_length_y/2-3*thickness_panel,-height_cube/2+h_stop_extruder])
sphere(r=12.5,$fn=20);
}
/*
plates use to test the X Y system:
*/
module provisory_side_plate()
{
h=100;
dy=profiley_length+50;
color("orange")
difference()
{
translate ([0,-dy/2,-h+20]) cube([thickness_panel,dy,h]);
for (y=[-1,1])translate ([profilex_length*0.3,y*(inter_guides_x),0])rotate([0,90,0])cylinder(h=200,r=5/2,$fn=20);
}
}
module provisory_zsystem()
{
dx=profilex_length+th*4;
dy=profiley_length+50;
//guides for z translation:
for (x=[-1,1])
translate([-inter_zguides/2*x,(dy/2)+profile_size/2,-h+th])rotate([0,0,0])color([0.2,0.2,0.2])import ("profil_ratrig_500mm.stl");
// bearings for z movement:
for (x=[-1,1])translate([-inter_zguides/2*x,(dy/2)+3*profile_size/2,-250])rotate([0,90,0])bearing();
//3D printing bed:
dxbed=profilex_length-100;
dybed=profiley_length-100;
color([1,1,1,0.7])translate([0,30,-400])cube([dxbed,dybed,5],center=true);
}
module bearingAdaptor()
{
color("pink")
translate([0,0,-bearing_th/2])
difference()
{
cylinder(r=bearing_dint/2,h=bearing_th,$fn=20);
translate([0,0,-1])cylinder(r=profile_screw_D/2,h=bearing_th+2,$fn=20);
}
}
// bearing
module bearing()
{
color([0.8,0.8,0.8])
translate([0,0,-bearing_th/2])
difference()
{
cylinder(r=bearing_D/2,h=bearing_th);
translate([0,0,-1])cylinder(r=bearing_dint/2,h=bearing_th+2);
}
}
module pulley()
{
difference()
{
union()
{
cylinder(r=pulleyDiameter/2,h=pulleyThickness/2);
translate([0,0,pulleyThickness*0.5])cylinder(r=pulleyTeethDiameter/2,h=pulleyThickness/2,$fn=30);
translate([0,0,pulleyThickness*0.9])cylinder(r=pulleyDiameter/2,h=pulleyThickness*0.1);
}
translate([0,0,-1]) cylinder(r=motNema17AxisD/2,h=pulleyThickness+2,$fn=30);
n=20;
for (a=[0:n-1]) rotate([0,0,a*360/n]) translate([pulleyTeethDiameter*0.5,0,pulleyThickness*0.7]) cube([2,1,pulleyThickness*0.4],center=true);
}
}
module pulley_washer()
{
difference()
{
union()
{
cylinder(r=(bearing_D+8)/2,h=2,$fn=60);
cylinder(r=(bearing_dint+2)/2,h=3,$fn=60);
}
translate([0,0,-1]) cylinder(r=(5)/2,h=4+2,$fn=30);
}
}
module motor_nema17()
{
//moteur
difference()
{
translate([-motNema17Dep/2,0,0]) cube (size=[motNema17Dep,motNema17Side,motNema17Side],center=true);
//screw holes:
for(i=[-1,1])for(j=[-1,1])translate([-8,i*motNema17ScrewsDist/2,j*motNema17ScrewsDist/2]) rotate([0,90,0]) cylinder(h=10,r=1.5,$fn=10);
}
//rehaut
rotate([0,90,0]) cylinder(h=motNema17FrontH,r=motNema17FrontD/2,center=false,$fn=20);
//axe moteur
translate([motNema17FrontH,0,0])rotate([0,90,0]) cylinder(h=motNema17AxisL,r=motNema17AxisD/2,center=false,$fn=20);
}
module extruder()
{
difference()
{
union()
{
cylinder(h=3.8,r=16/2,$fn=40);
translate([0,0,-3.8]) cylinder(h=6,r=12/2,$fn=40);
translate([0,0,-3.8-6+3]) cylinder(h=3,r=16/2,$fn=40);
translate([0,0,-3.8-6+3-1.5]) cylinder(h=1.5,r=8/2,$fn=40);
translate([0,0,-3.8-6+3-1.5-1]) cylinder(h=1,r=16/2,$fn=40);
for (z=[0:11]) translate([0,0,-3.8-6+3-1.5-1-2.5*z])cylinder(h=1,r=22/2,$fn=40);
translate([0,0,-3.8-6+3-1.5-1-25-18]) cylinder(h=18,r=5/2,$fn=40);
//fan:
translate([0,24,-24])cube([27,7,30],center=true);
//fan holder
translate([0,27/2,-20])cube([22,20,26],center=true);
translate([0,5,-45])cube([16,20,11.6],center=true);
}
translate([0,0,-60]) cylinder(h=100,r=1.75/2,$fn=40);
translate([0,0,-5]) cylinder(h=10,r=5/2,$fn=40);
}
}
//PLA_pulley();
// PLA_pulley_holder();
module PLA_pulley()
{
ri=8;
re=14;
ht=17;
translate([0,0,17])rotate([0,90,0])translate([0,0,-(ht+2*ht/10)/2])difference()
{
union()
{
cylinder(r=re,h=ht/10,$fn=40);
translate([0,0,ht/10])cylinder(r1=re,r2=ri,h=ht/3,$fn=40);
translate([0,0,ht/10+ht/3])cylinder(r1=ri,r2=ri,h=ht/3,$fn=40);
translate([0,0,ht/10+2*ht/3])cylinder(r1=ri,r2=re,h=ht/3,$fn=40);
translate([0,0,ht/10+ht])cylinder(r=re,h=ht/10,$fn=40);
}
//hole to let throught a M4 screw:
translate([0,0,-1])cylinder(r=2.2,h=60,$fn=30);
}
}
module PLA_pulley_holder()
{
l=23;
h=27;
d=16;
difference()
{
union()
{
for (r=[0,1]) mirror([r,0,0]) translate([l/2,-d/2,-1])cube([3,d,h]);
translate([-l/2,-d/2,-1])cube([l,d,3]);
}
//hole for base fixation:
translate([0,0,-4])cylinder(r=2.4,h=10,$fn=20);
//holes for axis, M4 threaded:
translate([0,0,h-d/2])rotate([0,90,0])cylinder(r=1.6,h=80,$fn=20,center=true);
}
}
module PLA_coil()
{
difference()
{
cylinder(r=d_PLA_coil_outer/2,h=h_PLA_coil,$fn=100);
translate([0,0,-1])cylinder(r=d_PLA_coil_inner/2,h=h_PLA_coil+2,$fn=30);
}
}
module PLA_coil_holder()
{
th=3;
bearing_D=22;
bearing_dint=7;
bearing_th=7;
difference()
{
union()
{
for (a=[0,90]) rotate([0,0,a])
translate([-(d_PLA_coil_inner-2)/2,-th/2,0])cube([d_PLA_coil_inner-2,4,h_PLA_coil/2]);
for (a=[0,90]) rotate([0,0,a])
translate([-(d_PLA_coil_inner+10)/2,-th/2,0])cube([d_PLA_coil_inner+10,4,4]);
cylinder(r=bearing_D*1.5/2,h=bearing_th*2,$fn=20);
cylinder(r=bearing_dint*1.5/2,h=h_PLA_coil/2,$fn=20);
}
translate([0,0,-1])cylinder(r=(bearing_D+1)/2,h=bearing_th+1,$fn=20);
translate([0,0,-1])cylinder(r=(5.2)/2,h=h_PLA_coil,$fn=20);
}
}