-
Notifications
You must be signed in to change notification settings - Fork 28
/
Metamaquina_2_extruders.scad
2840 lines (2279 loc) · 71.2 KB
/
Metamaquina_2_extruders.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
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// (c) 2013 Metamáquina <http://www.metamaquina.com.br/>
//
// Author:
// * Felipe C. da S. Sanches <[email protected]>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
include <Metamaquina2.h>;
include <BillOfMaterials.h>;
extruder_wiring_radius = 6;
YEndstopHolder_distance = 66;
//utils
use <utils.scad>;
use <mm2logo.scad>;
use <rounded_square.scad>;
use <tslot.scad>;
//subassemblies
include <endstop.h>;
include <heated_bed.h>;
use <lasercut_2_extruders.scad>;
use <RAMBo.scad>;
use <jheads.scad>;
//parts
include <NEMA.h>;
include <coupling.h>;
include <washers.h>;
include <bolts.h>;
include <nuts.h>;
include <spacer.h>;
include <lm8uu_bearing.h>;
include <jheads.h>;
include <PowerSupply.h>;
use <608zz_bearing.scad>;
use <domed_cap_nuts.scad>;
use <belt-clamp.scad>;
use <cable_clips.scad>;
//3d printed parts
include <ZLink.h>;
use <bar-clamp.scad>;
top_cable_clips = [
//[type, angle, y, z]
//upper wiring:
["RA9", 90, -70,130]];
left_cable_clips = [
//[type, angle, y, z]
//upper wiring:
["RA9", 90, 80,200],
["RA9", 180, 120,310],
["RA9", 0, 120,230],
//lower wiring:
["RA13", -90, 80,170],
["RA13", 0, 120,130],
["RA13", 180, 120,60],
["RA13", 90, 180,30],
//ymotor wire:
["RA6", 90, 65,30]];
right_cable_clips = [
//[type, angle, y, z]
//lower wiring (power supply):
["RA13", 90, 185,35],
["RA13", 90, 115,35]];
bottom_cable_clips = [
//[type, angle, y, z]
//lower wiring:
["RA13", -90, -100,0],
["RA13", 90, 0,0],
["RA13", -90, 100,0]];
bearing_sandwich_spacing = 12;
//coordinates of the RAMBo electronics board
RAMBo_x = 1;
RAMBo_y = 133;
rods_radius_clearance = 0.04; //extra room for the X and Z rods
//For the actual build volume we avoid using the marginal
//region around the heated bed
HeatedBed_X = BuildVolume_X + 15; // 215 mm
HeatedBed_Y = BuildVolume_Y + 20; // 220 mm
hack_couplings = 5; // for astethical purposes, the z-couplings are animated rotating <hack_couplings> times slower than the correct mechanical behaviour
time = $t;
function carx_demo(time) = sin(360*time*7)*BuildVolume_X/2;
function cary_demo(time) = cos(360*time*7)*BuildVolume_Y/2;
//function carz_demo(time) = (0.5+0.5*sin(360*time))*0.3*BuildVolume_Y/2 + 0.7*BuildVolume_Y/2;
function carz_demo(time) = time*BuildVolume_Z;
function coupling_demo(time) = (360*carz_demo(time)/1.25)/hack_couplings;
/* Positioning of the extruder assembly */
XCarPosition = -100; //carx_demo(time);
YCarPosition = 0; //cary_demo(time);
ZCarPosition = 150; //carz_demo(time);
//-------------------------
//machine configs:
/* whether or not to add holes for a PowerSupply manufactured by Hiqua and sold
by Nodaji in Brazil */
HIQUA_POWERSUPPLY=true;
/* dimensions of the machine feet */
feetwidth = 50;
feetheight = 12;
/*Here are a bunch of constants that determine the overall positioning
and dimensions of the several acrylic/plywood panels:*/
BuildPlatform_SidePanels_distance = 40;
SidePanels_distance = HeatedBed_X + 2*BuildPlatform_SidePanels_distance;
RightPanel_baseheight = 92;
RightPanel_basewidth = 2*(HeatedBed_Y)+10;
//Z_rods_distance = 388; //PrusaAir2
Z_rods_distance = SidePanels_distance + 2*(z_rod_z_bar_distance + NEMA17_width/2 + 5);
//TODO: machine_width = ?;
machine_height = BuildVolume_Z + 207.2; //why?
XZStage_offset = 20;
XZStage_position = RightPanel_basewidth/2 + XZStage_offset;
z_max_endstop_x = XZStage_position - 41;
z_max_endstop_y = machine_height - 19;
z_min_endstop_x = z_max_endstop_x - 28;
z_min_endstop_y = 109;
baseh = 35;
ArcPanel_rear_advance = 105;
horiz_bars_length = SidePanels_distance + 2*(m8_nut_height + m8_washer_thickness);
base_bars_height = 17;
base_bars_Zdistance = 50;
bar_cut_length=13;
Y_rod_length = RightPanel_basewidth - 2*(bar_cut_length + m8_diameter/2) + 24;
Y_rod_height = base_bars_Zdistance + base_bars_height + 10.2;//TODO
BottomPanel_width=60;
Z_rod_sidepanel_distance = (Z_rods_distance - SidePanels_distance)/2 + thickness;
heatedbed_spring_length = 13; //TODO:
heatedbed_spring_compressed_length = 7.4; //TODO:
compressed_spring=1;
YPlatform_height = Y_rod_height + lm8uu_diameter/2;
pcb_height = YPlatform_height + thickness +
heatedbed_spring_compressed_length*compressed_spring + heatedbed_spring_length*(1-compressed_spring);
BuildPlatform_height = pcb_height + heated_bed_pcb_thickness + heated_bed_glass_thickness;
//machine_x_dim is the actual width of the whole machine
machine_x_dim = Z_rods_distance+2*(lm8uu_diameter/2+thickness);
XEnd_extra_width = 30;
XEnd_box_size = lm8uu_diameter/2 + z_rod_z_bar_distance + ZLink_rod_height;
//height of the bottom panel acrylic/plywood sheet:
BottomPanel_zoffset = feetheight + NEMA17_length + 2;
Z_rod_length = machine_height - BottomPanel_zoffset + thickness;
Z_bar_length = thickness + machine_height - BottomPanel_zoffset - motor_shaft_length;
margin=4;
tslot_extra=thickness+margin; //todo
XPlatform_width = X_rods_distance + X_rods_diameter + 2*margin + 2* tslot_extra;
XEnd_width = XPlatform_width+XEnd_extra_width;
num_extruders = 1;
extra_extruder_length = 50; //TODO
extruder_dist = 9; //distance between extruders
XCarriage_padding = 6;
XCarriage_nozzle_hole_radius = 20;
XCarriage_width = XPlatform_width + 22;
//XCarriage_width = XPlatform_width;
//XCarriage_width = XEnd_width;
XCarriage_length = 82 + (num_extruders-1) * extra_extruder_length;
XCarriage_lm8uu_distance = XCarriage_length - 30;
nozzle_hole_width = 50;
nozzle_hole_length = machine_x_dim - 2*XEnd_box_size - nozzle_hole_width - 2*thickness - 2*20;
belt_offset = 26;
belt_width=5;
belt_clamp_height = 9;
PulleyRadius = 6;
IdlerRadius = 11;
XMotor_height = 31;
XIdler_height = XMotor_height + PulleyRadius - IdlerRadius;
X_rod_length = machine_x_dim - 2*thickness;
X_rod_height = XMotor_height + PulleyRadius - lm8uu_diameter/2 - 2*thickness;
XCarriage_height = thickness + X_rod_height + lm8uu_diameter/2;
nozzle_tip_distance = jhead_length-jhead_instalation_depth - thickness - XCarriage_height;
echo(str("nozzle_tip_distance:", nozzle_tip_distance));
RightPanel_backwidth = 55;
RightPanel_backheight = machine_height - RightPanel_baseheight;
rear_backtop_advance = XZStage_position - (XPlatform_width/2 + XEnd_extra_width + 10) - RightPanel_backwidth;
RightPanel_topheight = 30;
RightPanel_topwidth = XZStage_position + 30 - rear_backtop_advance;
ArcPanel_width = SidePanels_distance - 2 * thickness;
ArcPanel_height = 140; //TODO: make it depend on the machine height
SidePanel_TSLOT_SHAPES = [
//parameters => [x, y, angle]
[rear_backtop_advance+RightPanel_topwidth-25, machine_height+thickness, 180],
[rear_backtop_advance+5, machine_height+thickness, 180]
];
SidePanel_TSLOTS = [
//parameters => [x, y, width, angle]
//tslots for arc panel
[XZStage_position - ArcPanel_rear_advance + thickness/2, machine_height-50, 50, 0],
[XZStage_position - ArcPanel_rear_advance + thickness/2, machine_height-ArcPanel_height, 50, 0],
//tslots for bottom panel (without joints)
[XZStage_position + BottomPanel_width/2 + BottomPanel_width/4, BottomPanel_zoffset + thickness/2, 0, 0],
[XZStage_position + -BottomPanel_width/2 - BottomPanel_width/4, BottomPanel_zoffset + thickness/2, 0, 0]
];
TopPanel_TSLOTS = [
//parameters => [x, y, width, angle]
[-ArcPanel_width/2, ArcPanel_rear_advance - thickness/2, 50, -90],
[25, ArcPanel_rear_advance - thickness/2, 50, 90],
[ArcPanel_width/2, ArcPanel_rear_advance - thickness/2, 50, 90],
[-Z_rods_distance/2 + Z_rod_sidepanel_distance - thickness/2, -30, 50, 0],
[-Z_rods_distance/2 + Z_rod_sidepanel_distance - thickness/2, RightPanel_topwidth-60, 50, 0],
[Z_rods_distance/2-Z_rod_sidepanel_distance + thickness/2, -30, 50, 0],
[Z_rods_distance/2-Z_rod_sidepanel_distance + thickness/2, RightPanel_topwidth-60, 50, 0]
];
XEndMotor_back_face_TSLOTS = [
//parameters => [x, y, width, angle]
[XPlatform_width/2 - thickness,
thickness,
XPlatform_height - thickness,
0],
[-XPlatform_width/2 - XEnd_extra_width + thickness,
thickness,
XPlatform_height - thickness,
0]
];
XEndIdler_back_face_TSLOTS = [
//parameters => [x, y, width, angle]
[XPlatform_width/2 + XEnd_extra_width - thickness,
thickness,
XPlatform_height - thickness,
0],
[-XPlatform_width/2 + thickness,
thickness,
XPlatform_height - thickness,
0]
];
// 2d shapes for laser-cutting:
module RodEndTop_face(){
RodEnd_face(z_rod_z_bar_distance+8);
}
module SecondaryRodEndTop_face(){
SecondaryRodEnd_face(z_rod_z_bar_distance+8);
}
module RodEndBottom_face(){
RodEnd_face(0, third_hole=false);
}
module RodEnd_face(L, third_hole=true){
R=12;
r=6;
difference(){
union(){
translate([-R,-R])
rounded_square([R,2*R], corners=[R,0,R,0]);
translate([0,-R])
rounded_square([L+r,2*R], corners=[0,r,0,r]);
}
//holes
translate([L, -(R-4)])
M3_hole();
translate([L, (R-4)])
M3_hole();
if (third_hole){
translate([-(R-4), 0])
M3_hole();
}
}
}
//!SecondaryRodEnd_face(z_rod_z_bar_distance+8);
module SecondaryRodEnd_face(L, third_hole=true){
R=12;
r=6;
difference(){
RodEnd_face(L, third_hole=true);
circle(r=m8_diameter/2 + rods_radius_clearance);
translate([L-8,0])
circle(r=m8_diameter/2 + 2);
}
}
module YMotorHolder_face(){
r = 12;
H = (50-2*r)*sqrt(2) + 2*r;
hack=r*0.8; //this should be refactored using hull();
render(){
difference(){
union(){
polygon(points=[[base_bars_height + base_bars_Zdistance/2 - H/2 + hack, 0], [base_bars_height + base_bars_Zdistance/2 - H/2, 0], [base_bars_height + base_bars_Zdistance/2 - H/2, 50+r], [base_bars_height + base_bars_Zdistance/2 + H/2, 50+r], [base_bars_height + base_bars_Zdistance/2 + H/2, 30]]);
translate([base_bars_height,0])
rotate([0,0,30]) circle(r=r, $fn=6);
translate([base_bars_height + base_bars_Zdistance,30])
rotate([0,0,30]) circle(r=r, $fn=6);
translate([base_bars_height + base_bars_Zdistance/2, 60])
rotate([0,0,-45])
rounded_square([50,50], corners=[r,r,r,r], center=true);
}
translate([base_bars_height + base_bars_Zdistance/2, 60])
rotate([0,0,-45])
NEMA17_holes();
//holes for rear bars
translate([base_bars_height,0])
rotate([0,0,30]) circle(r=m8_diameter/2);
translate([base_bars_height + base_bars_Zdistance,30])
rotate([0,0,30]) circle(r=m8_diameter/2);
translate([25,25])
rotate(-45)
zip_tie_holes();
}
}
}
module holes_for_motor_wires(){
height=40;
x=120;
heights = [60,120,180];
translate([210, height])
zip_tie_holes();
translate([x+20, height])
zip_tie_holes();
translate([x, height-10])
rotate([0,0,45])
zip_tie_holes(d=7);
translate([50, height-10])
zip_tie_holes(d=5);
for (h = heights){
translate([x, h])
rotate([0,0,90])
zip_tie_holes(d=20);
}
}
//!MachineLeftPanel_face();
module MachineLeftPanel_face(){
difference(){
union(){
MachineSidePanel_face();
//extra area for mounting the ZMIN endstop:
translate([145,76])
trapezoid(h=30, l1=50, l2=80, r=10);
}
for (clip=left_cable_clips){
assign(type=clip[0], angle=clip[1], x=clip[2], y=clip[3]){
translate([x,y])
rotate(angle)
cable_clip_mount(type);
}
}
translate([RAMBo_x, RAMBo_y]){
RAMBo_holes();
RAMBo_wiring_holes();
}
translate([120,180]){
//hole for the XMotor wire. Should be large enough to let the
//motor connector to pass through it.
hull(){
for (i=[-1,1])
translate([i*NEMA17_connector_width/2, 0])
circle(r=NEMA17_connector_height/2+1);
}
//and a zip tie to keep it in place:
translate([0,-10])
rotate(90)
zip_tie_holes();
}
translate([z_max_endstop_x, z_max_endstop_y])
z_max_mount_holes();
translate([z_min_endstop_x, z_min_endstop_y])
z_min_mount_holes();
//holes_for_motor_wires();
//holes_for_z_endstop_wires();
//holes_for_x_motor_and_endstop_wires();
//holes_for_endstops();
}
}
module holes_for_endstops(){
translate([30,265])
zip_tie_holes();
}
module holes_for_z_endstop_wires(){
translate([80,337]){
zip_tie_holes(d=7);
translate([7,0])
hull()
zip_tie_holes(r=2, d=10, bom=false);
translate([120,0])
zip_tie_holes(d=7);
translate([60,0])
zip_tie_holes(d=7);
}
}
module holes_for_x_motor_and_endstop_wires(){
translate([80,240]){
hull(){
rotate([0,0,90])
zip_tie_holes(d=12, r=2, bom=false);
}
translate([0,10])
rotate([0,0,90])
zip_tie_holes(d=12);
}
}
powersupply_Xposition = rear_backtop_advance+RightPanel_backwidth - XZStage_offset - 5;
powersupply_Yposition = base_bars_height*2 + 33 + 20;
//!MachineRightPanel_face();
module MachineRightPanel_face(){
difference(){
union(){
MachineSidePanel_face();
//extra area just to keep the machine symmetric (the other side panel uses this extra area for mounting the ZMIN endstop)
translate([145,76])
trapezoid(h=30, l1=50, l2=80, r=10);
}
for (clip=right_cable_clips){
assign(type=clip[0], angle=clip[1], x=clip[2], y=clip[3]){
translate([x,y])
rotate(angle)
rotate([180,0])
cable_clip_mount(type);
}
}
if (HIQUA_POWERSUPPLY){
translate([powersupply_Xposition - PowerSupply_width, powersupply_Yposition])
PowerSupply_mount_holes();
}
//zip-tie holes for RAMBo power wires
// not necessary anymore (spiral tube or contractile mesh)
translate([30 + feetwidth,feetheight*2.5]){
//translate([10,-3])
//rotate([0,0,90])
//zip_tie_holes();
//translate([20,2])
//zip_tie_holes(d=10);
//translate([120,10])
//zip_tie_holes();
}
}
}
module bar_cut(l=2*bar_cut_length){
hull()
for(i=[-1,1])
translate([i*l/2,0]) circle(r=m8_diameter/2);
}
//!MachineSidePanel_face();
module MachineSidePanel_face(){
union(){
difference(){
MachineSidePanel_plainface();
//holes for inserting front bars
translate([30, base_bars_height]) bar_cut();
translate([0, base_bars_Zdistance + base_bars_height]) bar_cut();
//holes for inserting rear bars
translate([RightPanel_basewidth-30, base_bars_height]) bar_cut();
translate([RightPanel_basewidth, base_bars_Zdistance + base_bars_height]) bar_cut();
//cut for attaching bottom panel
translate([XZStage_position - BottomPanel_width/2, BottomPanel_zoffset - slot_extra_thickness/2])
square([BottomPanel_width, thickness + slot_extra_thickness]);
translate([XZStage_position - 12, feetheight-5]){
//hole for z motors wiring
rounded_square([24, 24+5], corners=[5,5,5,5]);
//zipties to protect the Z-motor wiring from mechanical stress
translate([12,37])
rotate(45)
zip_tie_holes();
}
tslot_shapes_from_list(SidePanel_TSLOT_SHAPES);
tslot_holes_from_list(SidePanel_TSLOTS);
}
//tslots for top panel
translate([rear_backtop_advance-20, machine_height+thickness/2])
rotate([0,0,-90])
TSlot_joints();
translate([rear_backtop_advance + RightPanel_topwidth - 50, machine_height+thickness/2])
rotate([0,0,-90])
TSlot_joints();
}
}
//!MachineRightPanel_face();
//!MachineSidePanel_plainface();
module MachineSidePanel_plainface(){
r1=0.1;
r2=60;
H=150;
k=19;
union(){
hull(){
translate([rear_backtop_advance-k, machine_height-r1]) circle(r=r1);
translate([r2, RightPanel_baseheight + H]) circle(r=r2);
}
//top
translate([rear_backtop_advance, machine_height - RightPanel_topheight])
rounded_square([RightPanel_topwidth, RightPanel_topheight], corners=[0, 15, 0, 0]);
//back
translate([rear_backtop_advance, RightPanel_baseheight])
square([RightPanel_backwidth, RightPanel_backheight]);
polygon(points = [ [rear_backtop_advance-k, machine_height], [rear_backtop_advance, machine_height], [rear_backtop_advance, RightPanel_baseheight], [0,RightPanel_baseheight], [0,RightPanel_baseheight + H]]);
//base
translate([0,RightPanel_baseheight - baseh])
rounded_square([RightPanel_basewidth, baseh], corners=[0,0,0,15]);
polygon(points = [ [30, feetheight], [0,RightPanel_baseheight - baseh], [30,RightPanel_baseheight - baseh]]);
translate([30, feetheight])
square([RightPanel_basewidth-60,RightPanel_baseheight - feetheight]);
polygon(points = [ [RightPanel_basewidth-30, feetheight], [RightPanel_basewidth,RightPanel_baseheight - baseh], [RightPanel_basewidth-30,RightPanel_baseheight - baseh]]);
//feet
translate([RightPanel_basewidth-30-feetwidth,0])
rounded_square([feetwidth, feetheight], corners=[5, 5, 0, 0]);
translate([30,0])
rounded_square([feetwidth, feetheight], corners=[5, 5, 0, 0]);
}
}
module TopPanel_holes(){
translate([Z_rods_distance/2,0]){
//holes for Zrod and Zbar
circle(r = m8_diameter/2 + rods_radius_clearance);
translate([8, 0])
M3_hole();
translate([-z_rod_z_bar_distance - 8, -8])
M3_hole();
translate([-z_rod_z_bar_distance - 8, 8])
M3_hole();
translate([-z_rod_z_bar_distance,0]){
//This hole's diameter is considerably larger than the threaded rod diameter
// in order to allow slightly bent rods to freely move. Otherwise, we would potentially have more whobble as a result of a tightly fixed rod.
circle(r=(m8_diameter+4)/2);
}
}
}
module MachineArcPanel_face(){
render(){
difference(){
union(){
translate([-ArcPanel_width/2, ArcPanel_height - 53])
square([ArcPanel_width,53]);
translate([-ArcPanel_width/2, 0])
rounded_square([20,ArcPanel_height], corners=[5,5,5,5]);
translate([+ArcPanel_width/2-20, 0])
rounded_square([20,ArcPanel_height], corners=[5,5,5,5]);
polygon(points=[ [-ArcPanel_width/2, 0], [-ArcPanel_width/2, ArcPanel_height],[-ArcPanel_width/2 + 60, ArcPanel_height], [-ArcPanel_width/2 + 10, 0] ]);
polygon(points=[ [ArcPanel_width/2, 0], [ArcPanel_width/2, ArcPanel_height],[ArcPanel_width/2 - 60, ArcPanel_height], [ArcPanel_width/2 - 10, 0] ]);
//tslots for top panel
translate([0,ArcPanel_height + thickness/2]){
translate([-ArcPanel_width/2, 0])
rotate([0,0,-90])
TSlot_joints();
translate([25, 0])
rotate([0,0,90])
TSlot_joints();
translate([ArcPanel_width/2, 0])
rotate([0,0,90])
TSlot_joints();
}
//tslots for left panel
translate([-ArcPanel_width/2 - thickness/2, 0]){
translate([0, ArcPanel_height - 50])
TSlot_joints();
//translate([0, ArcPanel_height/2 - 25])
//TSlot_joints();
TSlot_joints();
}
//tslots for right panel
translate([ArcPanel_width/2 + thickness/2, 0]){
translate([0, ArcPanel_height - 50])
TSlot_joints();
//translate([0, ArcPanel_height/2 - 25])
//TSlot_joints();
TSlot_joints();
}
}
//Metamaquina2 logo
translate([-191/2, ArcPanel_height - 44])
MM2_logo();
//tslots for top panel
translate([0,ArcPanel_height + thickness]){
translate([-ArcPanel_width/2 + 25, 0])
rotate([0,0,180])
t_slot_shape(3,16);
rotate([0,0,180])
t_slot_shape(3,16);
translate([ArcPanel_width/2 - 25, 0])
rotate([0,0,180])
t_slot_shape(3,16);
}
//tslots for right panel
translate([ArcPanel_width/2 + thickness, 0]){
translate([0, 25])
rotate([0,0,90])
t_slot_shape(3,16);
/*
translate([0, ArcPanel_height/2])
rotate([0,0,90])
t_slot_shape(3,16);
*/
translate([0, ArcPanel_height - 25])
rotate([0,0,90])
t_slot_shape(3,16);
}
//tslots for left panel
translate([-ArcPanel_width/2 - thickness, 0]){
translate([0, 25])
rotate([0,0,-90])
t_slot_shape(3,16);
/*
translate([0, ArcPanel_height/2])
rotate([0,0,-90])
t_slot_shape(3,16);
*/
translate([0, ArcPanel_height - 25])
rotate([0,0,-90])
t_slot_shape(3,16);
}
}
}
}
//These are auxiliary parts for tightening up the extruder wiring when it passes through the TopPenal hole.
module top_wiring_hole_aux(r=5, border=4){
difference(){
hull(){
circle(r=10 + border);
translate([13,0]) circle(r=3/2 + border);
translate([-13,0]) circle(r=3/2 + border);
}
circle(r=r);
translate([13,0]) M3_hole();
translate([-13,0]) M3_hole();
}
}
module top_hole_for_extruder_wires(){
translate([0,120]){
circle(r=10);
translate([13,0]) M3_hole();
translate([-13,0]) M3_hole();
}
}
//!MachineTopPanel_face();
module MachineTopPanel_face(){
sidewidth=78;
difference(){
union(){
translate([-machine_x_dim/2,-30])
rounded_square([sidewidth, 60], corners=[30, 2, 0, 0]);
translate([machine_x_dim/2 - sidewidth,-30])
rounded_square([sidewidth, 60], corners=[2, 30, 0, 0]);
//%translate([-5,112]) square([10.20,15.20]);
translate([0,60]){
translate([-machine_x_dim/2,-30])
rounded_square([sidewidth, 100], corners=[0, 0, sidewidth, 0]);
translate([machine_x_dim/2 - sidewidth,-30])
rounded_square([sidewidth, 100], corners=[0, 0, 0, sidewidth]);
}
translate([0,127])
rounded_square([Z_rods_distance - 2*Z_rod_sidepanel_distance + 8*thickness, 61], corners=[10,10,10,10], center=true);
}
for (clip=top_cable_clips){
assign(type=clip[0], angle=clip[1], x=clip[2], y=clip[3]){
translate([x,y])
rotate(angle)
cable_clip_mount(type);
}
}
top_hole_for_extruder_wires();
tslot_holes_from_list(TopPanel_TSLOTS);
TopPanel_holes();
mirror([1,0,0]) TopPanel_holes();
}
}
module BottomPanel_holes(){
//holes for Z rods
translate([Z_rods_distance/2,0]){
circle(r=m8_diameter/2 + rods_radius_clearance);
translate([0, -8]) M3_hole();
translate([0, 8]) M3_hole();
//translate([8, 0]) M3_hole();
}
//holes for ZMotors
translate([Z_rods_distance/2 - z_rod_z_bar_distance, 0])
NEMA17_holes(r=27/2); //This should be large enough to let the coupling pass through the hole
//tslot cuts for side panels
translate([Z_rods_distance/2 - Z_rod_sidepanel_distance + thickness, -BottomPanel_width/2 -BottomPanel_width/4])
rotate([0,0,90])
t_slot_shape(3,16);
translate([Z_rods_distance/2 - Z_rod_sidepanel_distance + thickness, BottomPanel_width/2 + BottomPanel_width/4])
rotate([0,0,90])
t_slot_shape(3,16);
}
module heatedbed_bottompanel_hole(){
translate([20,5])
heated_bed_wire_passthru_hole();
}
module zip_tie_holes(d=12, r=m3_diameter/2, bom=true){
if (bom)
BillOfMaterials("Zip tie");
for (i=[-1,1]){
translate([0,d/2*i])
circle(r=r, $fn=20);
}
}
module Y_belt(){
BillOfMaterials("GT2 belt for the Y axis");
translate([2.5, 0, 66])
rotate([0,0,-90])
rotate([90,0,0]){
belt(bearings = [
[/*x:*/ RightPanel_basewidth/2 - bar_cut_length,
/*y:*/ 0,
/*r:*/ IdlerRadius],
[/*x:*/ -RightPanel_basewidth/2 + bar_cut_length,
/*y:*/ 0,
/*r:*/ IdlerRadius],
[/*x:*/ -RightPanel_basewidth/2 + bar_cut_length + 30,
/*y:*/ -base_bars_Zdistance,
/*r:*/ IdlerRadius]
],
belt_width = belt_width);
}
}
module YEndstopHolder_face(){
width = 25;
height = 13.5;
r = 5;
translate([-width/2,0])
difference(){
union(){
rounded_square([width,height], corners=[0,0,r,r]);
translate([width,-thickness/2])
rotate(90)
TSlot_joints(width);
}
translate([width/2,-thickness])
t_slot_shape(3,16);
}
}
module YEndstopHolder_sheet(){
BillOfMaterials(category="Lasercut wood", partname="Y Endstop Holder");
material("lasercut")
linear_extrude(height=thickness)
YEndstopHolder_face();
}
//!MachineBottomPanel_face();
module MachineBottomPanel_face(){
render(){
difference(){
union(){
rounded_square([machine_x_dim, BottomPanel_width], corners=[BottomPanel_width/2,BottomPanel_width/2,BottomPanel_width/2,BottomPanel_width/2], center=true);
square([Z_rods_distance - 2*Z_rod_sidepanel_distance, 2*BottomPanel_width], center=true);
}
//cut off some unnecessary material
translate([0,BottomPanel_width/2 + 42])
rounded_square([Z_rods_distance - 2*Z_rod_sidepanel_distance - 60, BottomPanel_width], corners=[30,30,30,30], center=true);
translate([0,-BottomPanel_width/2 - 42])
rounded_square([Z_rods_distance - 2*Z_rod_sidepanel_distance - 60, BottomPanel_width], corners=[30,30,30,30], center=true);
for (clip=bottom_cable_clips){
assign(type=clip[0], angle=clip[1], x=clip[2], y=clip[3]){
translate([x,y])
rotate(angle)
rotate([180,0])
cable_clip_mount(type);
}
}
BottomPanel_holes();
mirror([1,0,0]) BottomPanel_holes();
translate([-Z_rods_distance/2 + Z_rod_sidepanel_distance + thickness + 16, 30])
heatedbed_bottompanel_hole();
y_max_endstop_mount_holes();
y_min_endstop_mount_holes();
}
}
}
//!XPlatform_bottom_face();
module XPlatform_bottom_face(remove_frontal_bridge=1){
r = 14*remove_frontal_bridge;
s = 42*remove_frontal_bridge;
render(){
difference(){
union(){
translate([-machine_x_dim/2 + thickness, -XPlatform_width/2+s])
square([machine_x_dim - 2 * thickness, XEnd_width-s]);
translate([-machine_x_dim/2 + thickness, -XPlatform_width/2])
rounded_square([XEnd_box_size+thickness+r, XEnd_width], corners=[0,r,0,0]);
translate([+machine_x_dim/2 - 2*thickness - XEnd_box_size - r, -XPlatform_width/2])
rounded_square([XEnd_box_size+thickness+r, XEnd_width], corners=[r,0,0,0]);
}
//hole for extruder nozzle:
hull()
for (i=[-1,1])
translate([i*nozzle_hole_length/2,0]) circle(r=nozzle_hole_width/2);
x_carriage_screw_driver_access_holes();
rotate([0,0,180])
translate([-machine_x_dim/2, 0])
XEndIdler_bottom_holes();
translate([-machine_x_dim/2, 0])
XEndMotor_bottom_holes();
}
}
}
module XEndMotor_bottom_holes(){
r=2;
//hole for lm8uu holder
translate([0, -20])
rounded_square([bearing_sandwich_spacing + 3*thickness + r, 40], corners=[0,r,0,r]);
//These 2 pairs of ziptie holes
// are meant to hold the XMotor cable in place
translate([20, 55])
rotate(90)
zip_tie_holes();
translate([32, 45])
rotate(90)
zip_tie_holes();
//hole for M8 nut&rod
translate([thickness + XEnd_box_size - ZLink_rod_height, 0])
rotate([0,0,360/12]) circle(r=8.5, $fn=6);
//tslot holes
translate([thickness, XPlatform_width/2 + XEnd_extra_width - thickness])
rotate([0,0,-90])
TSlot_holes(width=XEnd_box_size);
translate([thickness, -XPlatform_width/2 + thickness])
rotate([0,0,-90])