z-axis: misc changes
[clinton/prusa3.git] / box_frame / z-axis.scad
CommitLineData
2159eed1
VAH
1// PRUSA iteration3
2// Z axis
3// GNU GPL v3
4// Josef Průša <josefprusa@me.com>
5// Václav 'ax' Hůla <axtheb@gmail.com>
6// http://www.reprap.org/wiki/Prusa_Mendel
8e93419f 7// http://github.com/josefprusa/Prusa3
2159eed1 8
65a72cd5
T
9// ThingDoc entries
10/**
11 * @id zMotorHolder
12 * @name Z Axis Motor Holder
13 * @category Printed
14 */
1fbe5b71 15
65a72cd5
T
16/**
17 * @id zRodHolder
18 * @name Z Axis Rod Holder
19 * @category Printed
20 */
1fbe5b71
CE
21
22// todo
23
24// - fix motor holder wall removal so it is sensible and actually
25// removes the right thing
26// - fix changing board_thickness, add way to specify # of bolts in
27// side of frame (assume even spacing for now)
28
3506b70b
VAH
29include <configuration.scad>
30
cec35279 31module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thickness=5){
fb91eeba
CE
32 position_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
33 position_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
3506b70b
VAH
34 difference(){
35 union(){
36 // Motor holding part
37 difference(){
38 union(){
fb91eeba
CE
39 zrodholder(thickness=thickness, xlen=45 + zmotor_delta_x + zaxis_delta_x, ylen=48 + 5 + zmotor_delta_y + zaxis_delta_y, zdelta=((i_want_to_use_single_plate_dxf_and_make_my_z_weaker == 0) ? 0 : 5), bottom_x = 50 + zaxis_delta_x + zmotor_delta_x, bottom_y = 15 + zmotor_delta_y + zaxis_delta_y, am_top=0, bottom_thickness=bottom_thickness);
40 translate([position_x, position_y, 0]) {
41 nema17(places=[1, 1, 1, 1], h=bottom_thickness + layer_height, $fn=23, shadow=layer_height + 2);
3506b70b
VAH
42 }
43 }
846248f3 44 // remove any interfering walls
fb91eeba
CE
45 translate([position_x, position_y, layer_height + 2 + 21 +3]) {
46 cube([43 + zmotor_delta_x + zaxis_delta_x,43,42], center = true);
47 }
48
1fbe5b71
CE
49 // motor rotor clearance
50 translate([position_x, position_y, 0]) {
51 cylinder(r=11,h=20, center = true);
846248f3 52 }
d3618a65 53
3506b70b 54 // motor screw holes
cec35279
CE
55
56 // FIXME: y = board_to_xz distance looks supicious --
57 // the smooth rod is offset by a fixed amount so why
58 // would the motor mount be moved in both directions
59 // instead of just away from the frame? X-axis does
60 // not use this to offset the leadscrew hole either.
fb91eeba 61 translate([position_x, position_y, thickness]) {
5e8013bd 62 mirror([0, 0, 1]) translate([0, 0, thickness-8])
1fbe5b71 63 #nema17(places=[1, 1, 1, 1], holes=true, h=bottom_thickness + 1, $fn=small_hole_segments);
854f95f0 64 //shadow=-6 + layer_height);
3506b70b
VAH
65 }
66 }
67 }
68 }
d3618a65 69}
3506b70b
VAH
70
71
cec35279 72module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thickness=5, ylen=44, xlen=34, zdelta=0, bottom_y=14, bottom_x=14, am_top=1){
5cae2970 73 holder_inner_r = 9;
0f6ec51a 74 holder_inner_r2 = 2;
846248f3 75 smooth_rod_insert_radius = bushing_z[0] + 5 * single_wall_width;
3506b70b
VAH
76 difference(){
77 union(){
3506b70b 78 difference(){
cec35279 79 union() {
3506b70b 80 //piece along the flat side of a board
cec35279
CE
81 cube_fillet([bottom_x, ylen, bottom_thickness], vertical=[8, 3, 0, 0]);
82 if (frame_type == frame_alu) {
83 top_radius = am_top ? thickness : thickness / 3;
1fbe5b71 84 cube_fillet([5, ylen, thickness], vertical=[0, 0, 0, 0], top = [top_radius, 0, 0, 0]);
cec35279 85
1fbe5b71
CE
86 // FIXME: make rear/top bit optional, but don't remove entirely
87 // (printer seems to make less noise with the rear bit)
88 %if (am_top) {
cec35279
CE
89 // rear bracket
90 translate ([-board_thickness - 5, 0, 0])
1fbe5b71 91 cube_fillet([5, ylen, thickness], vertical=[0, 0, 0, 0], top = [top_radius, 0, 0, 0]);
cec35279
CE
92 translate ([-board_thickness, 5, 0])
93 cube ([board_thickness, ylen - 6, bottom_thickness/2]);
94 }
95 }
96 else {
97 cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [thickness / 1.7, 0, 0, 5]);
98 }
99
100 //hole for Z axis is thru this
846248f3 101 cube_fillet([xlen + zaxis_delta_x, bottom_y, bottom_thickness], vertical=[3, 0, 0, 3]);
fb91eeba 102 if (bottom_x < board_to_xz_distance - z_delta + zaxis_delta_x) {
9865d15a
CE
103 translate([bottom_x, bottom_y, 0]) {
104 //large fillet that makes it stiffer by lot. Thanks to Marcus Wolschon
105 difference(){
106 cube([holder_inner_r, holder_inner_r, bottom_thickness]);
107 translate([holder_inner_r, holder_inner_r, -0.5])
108 cylinder(r=holder_inner_r, h=bottom_thickness + 1);
109 }
110 }
111 }
cec35279
CE
112 if (frame_type != frame_alu) {
113 translate([5, 5, 0]) {
114 difference(){
115 cube([holder_inner_r2, holder_inner_r2, thickness - 5.5]);
116 translate([holder_inner_r2, holder_inner_r2, -0.5])
117 cylinder(r=holder_inner_r2, h=thickness + 1, $fn=20);
118 }
119 }
0f6ec51a 120 }
0802ac49
CE
121 // leadscrew bearing hole is cut from this
122 if (am_top) {
fb91eeba
CE
123 lead_bearing_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
124 lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
125 translate ([lead_bearing_x, lead_bearing_y, 0]) cylinder (d = bearing_608[0] + 1 + 2, h = bearing_608[2] + layer_height*4);
0802ac49 126 }
3506b70b 127 //piece along cut side of the board
cec35279
CE
128 if (frame_type == frame_box) {
129 translate([-board_thickness, 0, 0])
130 cube_fillet([board_thickness + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
131 } else if (frame_type == frame_alu) {
1fbe5b71 132 side_thickness = 5.0;// - zaxis_delta_y;
846248f3 133
1fbe5b71
CE
134 translate ([0, 0 /* zaxis_delta_y */, 0]) {
135 // back
136 translate([-board_thickness, 0, 0]) {
137 cube_fillet([board_thickness, side_thickness, thickness], vertical = [0, 0, 0, 0], top = [0, 0, 0, 0]);
138 }
139
140 // front
141 //cube_fillet([am_top ? board_to_xz_distance + zaxis_delta_x - smooth_rod_insert_radius : xlen + zaxis_delta_x , side_thickness, thickness], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
142 cube_fillet([am_top ? board_to_xz_distance + zaxis_delta_x - smooth_rod_insert_radius : xlen , side_thickness, thickness / (am_top ? 1 : 1.5)], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
143
144 // extra support for motor
145 if (!am_top) {
146 translate ([0, ylen - side_thickness, 0]) cube_fillet([xlen/* board_to_xz_distance + zaxis_delta_x - smooth_rod_insert_radius */ , side_thickness, thickness/1.5], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
147 }
148 }
846248f3
CE
149
150 // extra support along edge of smooth rod hole
151 radius_diff = smooth_rod_insert_radius - bushing_z[0];
152 hull () {
fb91eeba
CE
153 translate([-board_thickness/3, -zaxis_delta_y/3, 0]) {
154 cube_fillet([board_thickness/3 + board_to_xz_distance + zaxis_delta_x - bushing_z[0] , -zaxis_delta_y/3 , thickness/2], vertical = [2, 0, 4, 0], top = [0, 0, 4, thickness/2]);
846248f3
CE
155 }
156 translate([board_to_xz_distance/2, -zaxis_delta_x + radius_diff/6, 0]) {
fb91eeba 157 cube_fillet([board_to_xz_distance/2 + zaxis_delta_x + smooth_rod_insert_radius*0.75, radius_diff/3 , bottom_thickness*2], vertical = [2, 0, 4, bushing_z[0] * smooth_rod_insert_radius/bushing_z[0]], top = [0, 0, 2, thickness/4]);
846248f3 158 }
cec35279 159 }
5e8013bd 160 } else {
eb40b77a 161 translate([-board_thickness/2, 0, 0])
0f6ec51a 162 cube_fillet([board_thickness/2 + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
5e8013bd
VAH
163 }
164 //smooth rod insert
fb91eeba 165 translate([board_to_xz_distance - z_delta + zaxis_delta_x, 9 + zaxis_delta_y, 0])
1ebfb5d4 166 cylinder(h=bottom_thickness * (am_top ? 1.75 : 1.75), r=smooth_rod_insert_radius);
3506b70b 167 }
0802ac49
CE
168
169 // === difference ===
170
3506b70b 171 //smooth rod hole
fb91eeba 172 #translate([board_to_xz_distance - z_delta + zaxis_delta_x, 9 + zaxis_delta_y, -1]) cylinder(h=am_top ? thickness+20 : bottom_thickness, r=bushing_z[0] + single_wall_width / 4);
3506b70b 173 //inside rouned corner
cec35279
CE
174 if (frame_type != frame_alu) {
175 translate([0, 5, -1]) cylinder(r=0.8, h=100, $fn=8);
176 }
177
0802ac49
CE
178 // leadscrew hole
179 if (am_top) {
fb91eeba
CE
180 lead_bearing_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
181 lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
182 translate ([lead_bearing_x, lead_bearing_y, 0]) {
0802ac49
CE
183 difference () {
184 union () {
185 translate ([0, 0, 1]) cylinder (d = 10.8, h = bearing_608[2]*2);
186 translate ([0, 0, -1]) cylinder (d = 23, h = bearing_608[2]+1);
187 }
1fbe5b71 188 translate ([0, 0, bearing_608[2]-layer_height*2]) cylinder (d = 23 - single_wall_width/2, h = layer_height);
0802ac49
CE
189 }
190 }
191 }
192
5e8013bd 193 //front screws
cec35279
CE
194 if (frame_type == frame_single) {
195 //single plate has both screws on front
196 translate([16, 35, bottom_thickness + 4.5 + zdelta]) rotate([0, -90, 0]) {
197 plate_screw();
198 }
199 translate([16, 15, bottom_thickness + 4.5 + zdelta]) rotate([0, -90, 0]) {
200 plate_screw();
201 }
202 //motor mount has third screw
203 translate([16, 25, bottom_thickness + 4.5 + zdelta + 20]) rotate([0, -90, 0]) {
204 plate_screw();
205 }
206 } else if (frame_type == frame_alu) {
207 // three screws on front
04ddc678
CE
208 translate([18, ylen - board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, -90, 0]) plate_screw();
209 translate([18, 5 + board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, -90, 0]) plate_screw();
210 translate([18, 5 + board_thickness/2, thickness - board_thickness/2]) rotate([0, -90, 0])
cec35279
CE
211 plate_screw();
212
213 // motor mount screw for opposite extrusion
04ddc678 214 translate([18, ylen - board_thickness/2, thickness - board_thickness/2]) rotate([0, -90, 0])
cec35279
CE
215 plate_screw();
216
217 // back plate
04ddc678 218 translate([-board_thickness-18, ylen - board_thickness/2, thickness - board_thickness/2]) rotate([0, 90, 0])
cec35279 219 plate_screw();
04ddc678 220 translate([-board_thickness-18, 5 + board_thickness/2, thickness - board_thickness/2]) rotate([0, 90, 0])
cec35279 221 plate_screw();
04ddc678
CE
222 translate([-board_thickness-18, ylen - board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, 90, 0]) plate_screw();
223 #translate([-board_thickness-18, 5 + board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, 90, 0]) plate_screw();
cec35279
CE
224
225 //side screws
04ddc678
CE
226 #translate([-board_thickness/2, -13, thickness-board_thickness/2]) rotate([-90, 0, 0]) plate_screw();
227 translate([-board_thickness/2, -13, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([-90, 0, 0]) plate_screw();
cec35279
CE
228 } else if (frame_type == frame_box) {
229 translate([16, 30, bottom_thickness+4]) rotate([0, -90, 0]) {
230 plate_screw();
231 }
5e8013bd 232 //side screw
0f6ec51a 233 translate([-board_thickness/2, -11, thickness/2]) rotate([-90, 0, 0]) plate_screw();
b32bbd0f 234 }
3506b70b
VAH
235 }
236 }
237 }
d3618a65 238}
1422dcbd
CE
239
240if (frame_type == frame_alu) {
241 // 2020 aluminum frame parts are larger
7b8e1e54
CE
242 translate([0, -60, 0]) zmotorholder(thickness=55, bottom_thickness=6);
243 translate([0, 60, 0]) mirror([0, 1, 0]) zmotorholder(thickness=55, bottom_thickness=6);
244
245 translate([110 + board_thickness, board_thickness+10, 0]) rotate([0,0,90]) zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=48, bottom_thickness=6);
246 translate([110 + board_thickness, -(board_thickness+10), 0]) rotate([0, 0, -90]) mirror([0, 1, 0]) zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=48, bottom_thickness=6);
247
1422dcbd
CE
248}
249else {
250 translate([10, -50, 0]) zmotorholder();
251 translate([0, 50, 0]) mirror([0, 1, 0]) zmotorholder();
252 translate([67, 14, 0]) rotate([0,0,90]) zrodholder();
253 translate([77, -14, 0]) rotate([0, 0, -90]) mirror([0, 1, 0]) zrodholder();
254}