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