frame_alu: Reduce bolt head hole depth
[clinton/prusa3.git] / box_frame / z-axis.scad
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 include <configuration.scad>
23
24 module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thickness=5){
25 position_y = board_to_xz_distance + zaxis_delta_y - zmotor_delta_y;
26 position_x = board_to_xz_distance - zaxis_delta_x + zmotor_delta_x;
27 difference(){
28 union(){
29 // Motor holding part
30 difference(){
31 union(){
32 zrodholder(thickness=thickness, xlen=45 + zmotor_delta_x, ylen=44 - zmotor_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, am_top=0);
33 translate([position_y, position_x, 0]) {
34 nema17(places=[0, 1, 1, 1], h=bottom_thickness + layer_height, $fn=23, shadow=layer_height + 2);
35 }
36 }
37 // remove any interfering walls
38 translate([position_y, position_x, layer_height + 2 + 21 +3]) {
39 #cube([43 + zmotor_delta_x + zaxis_delta_x,43,42], center = true);
40 }
41
42 // motor screw holes
43
44 // FIXME: y = board_to_xz distance looks supicious --
45 // the smooth rod is offset by a fixed amount so why
46 // would the motor mount be moved in both directions
47 // instead of just away from the frame? X-axis does
48 // not use this to offset the leadscrew hole either.
49 translate([position_y, position_x, thickness]) {
50 mirror([0, 0, 1]) translate([0, 0, thickness-8])
51 nema17(places=[0, 1, 1, 1], holes=true, h=bottom_thickness + 1, $fn=small_hole_segments);
52 //shadow=-6 + layer_height);
53 }
54 }
55 }
56 }
57 }
58
59
60 module 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){
61 holder_inner_r = 9;
62 holder_inner_r2 = 2;
63 smooth_rod_insert_radius = bushing_z[0] + 5 * single_wall_width;
64 difference(){
65 union(){
66 difference(){
67 union() {
68 //piece along the flat side of a board
69 cube_fillet([bottom_x, ylen, bottom_thickness], vertical=[8, 3, 0, 0]);
70 if (frame_type == frame_alu) {
71 top_radius = am_top ? thickness : thickness / 3;
72 cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [top_radius, 0, 0, 5]);
73
74 if (am_top) {
75 // rear bracket
76 translate ([-board_thickness - 5, 0, 0])
77 cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [top_radius, 5, 0, 0]);
78 translate ([-board_thickness, 5, 0])
79 cube ([board_thickness, ylen - 6, bottom_thickness/2]);
80 }
81 }
82 else {
83 cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [thickness / 1.7, 0, 0, 5]);
84 }
85
86 //hole for Z axis is thru this
87 cube_fillet([xlen + zaxis_delta_x, bottom_y, bottom_thickness], vertical=[3, 0, 0, 3]);
88 translate([bottom_x, bottom_y, 0]) {
89 //large fillet that makes it stiffer by lot. Thanks to Marcus Wolschon
90 difference(){
91 cube([holder_inner_r, holder_inner_r, bottom_thickness]);
92 translate([holder_inner_r, holder_inner_r, -0.5])
93 cylinder(r=holder_inner_r, h=bottom_thickness + 1);
94 }
95 }
96 if (frame_type != frame_alu) {
97 translate([5, 5, 0]) {
98 difference(){
99 cube([holder_inner_r2, holder_inner_r2, thickness - 5.5]);
100 translate([holder_inner_r2, holder_inner_r2, -0.5])
101 cylinder(r=holder_inner_r2, h=thickness + 1, $fn=20);
102 }
103 }
104 }
105 //piece along cut side of the board
106 if (frame_type == frame_box) {
107 translate([-board_thickness, 0, 0])
108 cube_fillet([board_thickness + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
109 } else if (frame_type == frame_alu) {
110 // split piece in front of and behind into separate pieces
111 translate([-board_thickness, 0, 0]) {
112 cube_fillet([board_thickness, 5.0, thickness], vertical = [0, 0, 0, 0], top = [0, 0, 0, 0]);
113 }
114
115 cube_fillet([am_top ? board_to_xz_distance + zaxis_delta_y - smooth_rod_insert_radius : xlen + zaxis_delta_y , 5.0, thickness], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
116
117 // extra support along edge of smooth rod hole
118 radius_diff = smooth_rod_insert_radius - bushing_z[0];
119 hull () {
120 translate([-board_thickness/3, -zaxis_delta_x/3, 0]) {
121 cube_fillet([board_thickness/3 + board_to_xz_distance + zaxis_delta_y - bushing_z[0] , zaxis_delta_x/3 , thickness/2], vertical = [2, 0, 4, 0], top = [0, 0, 4, thickness/2]);
122 }
123 translate([board_to_xz_distance/2, -zaxis_delta_x + radius_diff/6, 0]) {
124 cube_fillet([board_to_xz_distance/2 + zaxis_delta_y + 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]);
125 }
126 }
127 } else {
128 translate([-board_thickness/2, 0, 0])
129 cube_fillet([board_thickness/2 + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
130 }
131 //smooth rod insert
132 translate([board_to_xz_distance - z_delta + zaxis_delta_y, 9 - zaxis_delta_x, 0])
133 cylinder(h=bottom_thickness * (am_top ? 1.75 : 1.75), r=smooth_rod_insert_radius);
134 }
135 //smooth rod hole
136 #translate([board_to_xz_distance - z_delta + zaxis_delta_y, 9 - zaxis_delta_x, -1]) cylinder(h=am_top ? thickness+20 : bottom_thickness, r=bushing_z[0] + single_wall_width / 4);
137 //inside rouned corner
138 if (frame_type != frame_alu) {
139 translate([0, 5, -1]) cylinder(r=0.8, h=100, $fn=8);
140 }
141
142 //front screws
143 if (frame_type == frame_single) {
144 //single plate has both screws on front
145 translate([16, 35, bottom_thickness + 4.5 + zdelta]) rotate([0, -90, 0]) {
146 plate_screw();
147 }
148 translate([16, 15, bottom_thickness + 4.5 + zdelta]) rotate([0, -90, 0]) {
149 plate_screw();
150 }
151 //motor mount has third screw
152 translate([16, 25, bottom_thickness + 4.5 + zdelta + 20]) rotate([0, -90, 0]) {
153 plate_screw();
154 }
155 } else if (frame_type == frame_alu) {
156 // three screws on front
157 translate([18, ylen - board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, -90, 0]) plate_screw();
158 translate([18, 5 + board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, -90, 0]) plate_screw();
159 translate([18, 5 + board_thickness/2, thickness - board_thickness/2]) rotate([0, -90, 0])
160 plate_screw();
161
162 // motor mount screw for opposite extrusion
163 translate([18, ylen - board_thickness/2, thickness - board_thickness/2]) rotate([0, -90, 0])
164 plate_screw();
165
166 // back plate
167 translate([-board_thickness-18, ylen - board_thickness/2, thickness - board_thickness/2]) rotate([0, 90, 0])
168 plate_screw();
169 translate([-board_thickness-18, 5 + board_thickness/2, thickness - board_thickness/2]) rotate([0, 90, 0])
170 plate_screw();
171 translate([-board_thickness-18, ylen - board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, 90, 0]) plate_screw();
172 #translate([-board_thickness-18, 5 + board_thickness/2, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([0, 90, 0]) plate_screw();
173
174 //side screws
175 #translate([-board_thickness/2, -13, thickness-board_thickness/2]) rotate([-90, 0, 0]) plate_screw();
176 translate([-board_thickness/2, -13, bottom_thickness/2 + board_thickness/2 + zdelta]) rotate([-90, 0, 0]) plate_screw();
177 } else if (frame_type == frame_box) {
178 translate([16, 30, bottom_thickness+4]) rotate([0, -90, 0]) {
179 plate_screw();
180 }
181 //side screw
182 translate([-board_thickness/2, -11, thickness/2]) rotate([-90, 0, 0]) plate_screw();
183 }
184 }
185 }
186 }
187 }
188
189 if (frame_type == frame_alu) {
190 // 2020 aluminum frame parts are larger
191 translate([10, -50, 0]) zmotorholder(thickness=55);
192 translate([0, 50, 0]) mirror([0, 1, 0]) zmotorholder(thickness=55);
193 translate([120, 30, 0]) rotate([0,0,90]) zrodholder(thickness=board_thickness * 2 + 5, ylen = 50);
194 translate([120, -30, 0]) rotate([0, 0, -90]) mirror([0, 1, 0]) zrodholder(thickness=board_thickness * 2 + 5, ylen = 50);
195 }
196 else {
197 translate([10, -50, 0]) zmotorholder();
198 translate([0, 50, 0]) mirror([0, 1, 0]) zmotorholder();
199 translate([67, 14, 0]) rotate([0,0,90]) zrodholder();
200 translate([77, -14, 0]) rotate([0, 0, -90]) mirror([0, 1, 0]) zrodholder();
201 }