Changing repository link in comments to correct Github URL.
[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 include <configuration.scad>
10
11 module zmotorholder(thickness=(i_am_box == 0 ? 38 : 23), bottom_thickness=5){
12 difference(){
13 union(){
14 // Motor holding part
15 difference(){
16 union(){
17 zrodholder(thickness=thickness, xlen=45, ylen=44, zdelta=((i_want_to_use_single_plate_dxf_and_make_my_z_weaker == 0) ? 0 : 5));
18 translate([board_to_xz_distance, board_to_xz_distance, 0]) {
19 nema17(places=[0, 1, 1, 1], h=bottom_thickness + layer_height, $fn=23, shadow=layer_height + 2);
20 }
21 }
22
23 // motor screw holes
24 translate([board_to_xz_distance, board_to_xz_distance, thickness]) {
25 mirror([0, 0, 1]) translate([0, 0, thickness-8])
26 nema17(places=[0, 1, 1, 1], holes=true, h=bottom_thickness + 1, $fn=small_hole_segments);
27 //shadow=-6 + layer_height);
28 }
29 }
30 }
31 }
32 }
33
34
35 module zrodholder(thickness=(i_am_box == 0 ? 14 : 15), bottom_thickness=5, ylen=44, xlen=34, zdelta=0){
36 holder_inner_r = 9;
37 holder_inner_r2 = 2;
38 difference(){
39 union(){
40 difference(){
41 union(){
42 //piece along the flat side of a board
43 cube_fillet([14, ylen, bottom_thickness], vertical=[8, 3, 0, 0]);
44 cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [thickness / 1.7, 0, 0, 5]);
45 //hole for Z axis is thru this
46 cube_fillet([xlen, 14, bottom_thickness], vertical=[3, 0, 0, 3]);
47 translate([14, 14, 0]) {
48 //large fillet that makes it stiffer by lot. Thanks to Marcus Wolschon
49 difference(){
50 cube([holder_inner_r, holder_inner_r, bottom_thickness]);
51 translate([holder_inner_r, holder_inner_r, -0.5])
52 cylinder(r=holder_inner_r, h=bottom_thickness + 1);
53 }
54 }
55 translate([5, 5, 0]) {
56 difference(){
57 cube([holder_inner_r2, holder_inner_r2, thickness - 5.5]);
58 translate([holder_inner_r2, holder_inner_r2, -0.5])
59 cylinder(r=holder_inner_r2, h=thickness + 1, $fn=20);
60 }
61 }
62 //piece along cut side of the board
63 if (i_am_box == 1) {
64 translate([-board_thickness, 0, 0])
65 cube_fillet([board_thickness + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
66 } else {
67 translate([-board_thickness/2, 0, 0])
68 cube_fillet([board_thickness/2 + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
69 }
70 //smooth rod insert
71 translate([board_to_xz_distance - z_delta, 9, 0])
72 cylinder(h=bottom_thickness / 2, r=(bushing_z[0] + 5 * single_wall_width));
73 }
74 //smooth rod hole
75 translate([board_to_xz_distance - z_delta, 9, -1]) cylinder(h=board_thickness+20, r=bushing_z[0] + single_wall_width / 4);
76 //inside rouned corner
77 translate([0, 5, -1]) cylinder(r=0.8, h=100, $fn=8);
78 //side screw
79 //translate([-board_thickness/2, 0, thickness/2-1.5]) rotate([-90, 0, 0]) screw(h=30, r_head=4);
80 //front screws
81 if (i_am_box != 1) {
82 //single plate has both screws on front
83 translate([16, 35, bottom_thickness + 4.5 + zdelta]) rotate([0, -90, 0]) {
84 plate_screw();
85 }
86 translate([16, 15, bottom_thickness + 4.5 + zdelta]) rotate([0, -90, 0]) {
87 plate_screw();
88 }
89 //motor mount has third screw
90 translate([16, 25, bottom_thickness + 4.5 + zdelta + 20]) rotate([0, -90, 0]) {
91 plate_screw();
92 }
93 } else {
94 translate([16, 30, bottom_thickness+4]) rotate([0, -90, 0]) {
95 plate_screw();
96 }
97 //side screw
98 translate([-board_thickness/2, -11, thickness/2]) rotate([-90, 0, 0]) plate_screw();
99 }
100 }
101 }
102 }
103 }
104 translate([10, -50, 0]) zmotorholder();
105 translate([0, 50, 0]) mirror([0, 1, 0]) zmotorholder();
106 translate([67, 14, 0]) rotate([0,0,90]) zrodholder();
107 translate([77, -14, 0]) rotate([0, 0, -90]) mirror([0, 1, 0]) zrodholder();