calculate deltas for thick bearings
[clinton/prusa3.git] / box_frame / z-axis.scad
CommitLineData
2159eed1
VAH
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/prusajr/PrusaMendel
8
3506b70b
VAH
9include <configuration.scad>
10
5e8013bd 11module zmotorholder(thickness=20, bottom_thickness=5){
3506b70b
VAH
12 difference(){
13 union(){
14 // Motor holding part
15 difference(){
16 union(){
f0c2a7f0 17 zrodholder(thickness=thickness, xlen=45, ylen=45);
3506b70b 18 translate([board_to_xz_distance, board_to_xz_distance, 0]) {
5e8013bd 19 nema17(places=[0, 1, 1, 1], h=bottom_thickness + layer_height);
3506b70b
VAH
20 }
21 }
d3618a65 22
3506b70b
VAH
23 // motor screw holes
24 translate([board_to_xz_distance, board_to_xz_distance, thickness]) {
5e8013bd
VAH
25 mirror([0, 0, 1]) translate([0, 0, thickness-8])
26 nema17(places=[0, 1, 1, 1], holes=true, h=bottom_thickness + 1, shadow=5);
3506b70b
VAH
27 }
28 }
29 }
30 }
d3618a65 31}
3506b70b
VAH
32
33
5e8013bd 34module zrodholder(thickness=14, bottom_thickness=5, ylen=42, xlen=34){
5cae2970 35 holder_inner_r = 9;
3506b70b
VAH
36 difference(){
37 union(){
3506b70b
VAH
38 difference(){
39 union(){
40 //piece along the flat side of a board
5cae2970 41 cube_fillet([14, ylen, bottom_thickness], vertical=[8, 3, 0, 0]);
5e8013bd 42 cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [thickness/1.5, 0, 0, 5]);
3506b70b 43 //hole for Z axis is thru this
5cae2970
VAH
44 cube_fillet([xlen, 14, bottom_thickness], vertical=[3, 0, 0, 3]);
45 translate([14,14,0]) {
46 //large fillet that makes it stiffer by lot. Thanks to Marcus Wolschon
47 difference(){
48 cube([holder_inner_r,holder_inner_r,bottom_thickness]);
49 translate([holder_inner_r, holder_inner_r, -0.5])
50 cylinder(r=holder_inner_r, h=bottom_thickness + 1);
51 }
52 }
3506b70b 53 //piece along cut side of the board
5e8013bd 54 if (i_am_box == 1) {
5cae2970
VAH
55 translate([-board_thickness, 0, 0])
56 cube_fillet([board_thickness + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness]);
5e8013bd 57 } else {
5cae2970
VAH
58 translate([-board_thickness/2, 0, 0])
59 cube_fillet([board_thickness/2 + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness]);
5e8013bd
VAH
60 }
61 //smooth rod insert
62 translate([board_to_xz_distance, 9, 0]) intersection() {
63 cylinder(h=bottom_thickness + layer_height, r=(bushing_z[0] + 5 * single_wall_width));
64 if (bushing_z[0] < 5) {
65 translate([0, -5 , bottom_thickness / 2]) cube([20, 20, bottom_thickness + 10], center=true);
5cae2970 66 echo(0);
5e8013bd
VAH
67 } else {
68 translate([0, -bushing_z[0], bottom_thickness / 2]) cube([bushing_z[0] * 4, bushing_z[0] * 4, bottom_thickness + 10], center=true);
69 }
70 }
3506b70b
VAH
71 }
72 //smooth rod hole
5cae2970 73 translate([board_to_xz_distance, 9, -1]) cylinder_poly(h=board_thickness+2, r=bushing_z[0]);
5e8013bd
VAH
74 // cutout
75 translate([board_to_xz_distance-1, 5+(bushing_z[0]), 0.4]) cube([2, 10, 100]);
3506b70b 76 //inside rouned corner
5e8013bd 77 translate([0, 5, -1]) cylinder(r=1.2, h=100, $fn=8);
3506b70b 78 //side screw
5e8013bd
VAH
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
5cae2970
VAH
83 translate([16, 35.5, bottom_thickness+4]) rotate([0, -90, 0]) {
84 screw(head_drop=12, h=122, r_head=4.5);
5e8013bd 85 }
5cae2970
VAH
86 translate([16, 15.5, bottom_thickness+4.5]) rotate([0, -90, 0]) {
87 screw(head_drop=12, h=122, r_head=4.5);
5e8013bd
VAH
88 }
89 } else {
5cae2970 90 translate([16, 30, bottom_thickness+4]) rotate([0, -90, 0]) {
5e8013bd
VAH
91 screw(head_drop=12, h=122, r_head=4);
92 }
93 //side screw
5cae2970 94 translate([-board_thickness/2, 0, thickness/2]) rotate([-90, 0, 0]) screw(h=30, r_head=4.5, head_drop=1);
b32bbd0f 95 }
3506b70b
VAH
96 }
97 }
98 }
d3618a65 99}
5e8013bd
VAH
100translate([0, -2, 0]) mirror([0, 1, 0]) zmotorholder();
101translate([0, 2, 0]) zmotorholder();
5e8013bd
VAH
102translate([21, -62, 0]) zrodholder();
103translate([20, 62, 0]) mirror([0, 1, 0]) zrodholder();