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