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