x-end/motor: position and size motor arm correctly
[clinton/prusa3.git] / box_frame / x-end.scad
CommitLineData
2159eed1 1// PRUSA iteration3
1ddd0d1f 2// X end prototype
2159eed1 3// GNU GPL v3
1ddd0d1f 4// Josef Průša <iam@josefprusa.cz> and contributors
2159eed1 5// http://www.reprap.org/wiki/Prusa_Mendel
1ddd0d1f
CE
6// http://prusamendel.org
7
8// Also includes code from Wilson and Wilson2, (c) Marty Rice
9// https://github.com/mjrice/wilson
10
11// todo: make x-end height global and make anything relying implicitly
12// on the height of the x-end use that for positioning.
13
14// bearing height, strain relief (&& maybe make dependent upon the bearing diameter)
15
16// major issues with rev 3
17
18// - motor side screw hole conflicts with switch / other rear mount is
19// inaccessible without removing the leadscrew from the nut
20
21// - New idler anti-pitching ribs are too big (new idler I wasn't
22// using is larger so the existing ones worked fine for that one...)
23// NOTE: new idler is meant for integrated toothed idler...
24
d3618a65 25use <bushing.scad>
1ddd0d1f
CE
26include <configuration.scad>
27
eb4a701b
CE
28pushfit_d = bushing_xy[0] * 2 + 0.25;
29thinwall = single_wall_width * 6; // 3 perimeters
30vertical_bushing_base_size = bushing_z[1]*2 + 2 * thinwall;
31
32x_box_length = 45; // TODO: auto-adjust based on bearing size?
33
34module vertical_bushing_base(){
35 translate(v=[-2-vertical_bushing_base_size/4,0,x_box_height/2]) cube(size = [4+vertical_bushing_base_size/2,vertical_bushing_base_size,x_box_height], center = true);
36 cylinder(h = x_box_height, r=vertical_bushing_base_size/2, $fn = 90);
1ddd0d1f
CE
37}
38
eb4a701b
CE
39module vertical_bushing_holes(){
40 // FIXME: is extra cut necessary? check conf_bushing
41 bushing_cut_extra = 0.2; // padding so it's not too tight
42 translate(v=[0,0,-4]) cylinder(h = x_box_height + 3, r=bushing_z[1] + bushing_cut_extra, $fn = 60);
43 translate(v=[0,0,x_box_height-4]) cylinder(h=x_box_height,r=bushing_z[1]-1,$fn=60);
44 // TODO: is slit too wide or too low? Wilson increased width from 1
45 // -> 2 mm, slit also might need to end 1-2mm before the base
46 #rotate(a=[0,0,-50]) translate(v=[thinwall*2 + 1,0,x_box_height/2 - 2]) cube(size = [bushing_z[2]/2, 2 ,x_box_height], center = true);
47 translate([0,0,-1]) cylinder(h=9,r1=bushing_z[1]+thinwall/2+1,r2=4,$fn=60);
1ddd0d1f
CE
48}
49
50
51module nut_trap_base () {
eb4a701b
CE
52 // TODO: cube doesn't line up with edge of base, cylinder is slightly asymmetrical
53 // adapt newer nut trap from prusa i3 mk3 instead of wilson2
1ddd0d1f
CE
54 cube(size=[16,21,8],center=true);
55 translate ([2,0,0]) cylinder(h=8,r=12.5,$fn=50,center=true);
d3618a65
NZ
56}
57
1ddd0d1f 58module nut_trap () {
eb4a701b 59 union() {
1ddd0d1f
CE
60 // center post of brass nut
61 cylinder(h=12,r=5.45,$fn=50,center=true);
62 // holes for m3 screws in brass nut
63 translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
64 #rotate([0,0,90]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
65 rotate([0,0,180]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
66 #rotate([0,0,270]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
67 }
d3618a65 68}
79b4b60a 69
b238c607 70// x position of edge of main block (facing frame), for attaching objects to it
9259f97c 71function x_base_back() = -10 - bushing_xy[0] - x_box_width/2;
b238c607
CE
72// y position of edge of main block facing away from x-axis
73function x_base_outside() = vertical_bushing_base_size/2;
74// y position of edge of main block facing toward the x-axis
75function x_base_inside() = -x_box_length/2 - vertical_bushing_base_size/2;
9259f97c 76
1ddd0d1f
CE
77module x_end_base(){
78// Main block
eb4a701b 79translate(v=[-10 - bushing_xy[0], -x_box_length/2 + vertical_bushing_base_size/2,x_box_height/2]) cube(size = [x_box_width,x_box_length,x_box_height], center = true);
1ddd0d1f 80// Bearing holder
eb4a701b 81 vertical_bushing_base();
1ddd0d1f 82//Nut trap
a4895940 83 translate(v=[-4+zmotor_delta_x,-17-zmotor_delta_y,4]) nut_trap_base ();
79b4b60a
VAH
84}
85
eb4a701b
CE
86// TODO: x translation of belt and smooth rods needs to adapt to
87// x_end_width and motor/idler pulley position.
88
1ddd0d1f 89module x_end_holes(){
eb4a701b 90 vertical_bushing_holes();
1ddd0d1f
CE
91 // Belt hole
92 translate(v=[-1,0,0]){
93 // Stress relief
94 translate(v=[-5.5-10+1.5,-bushing_z[1]-4,30]) cube(size = [20,1,28], center = true);
95 // Cut out for belt (this is NOT centered because the motor isn't centered)
eb4a701b 96 x_box_offset = -x_box_length/2 + vertical_bushing_base_size/2;
1ddd0d1f 97 difference(){
eb4a701b 98 translate(v=[-5.5-10+1.5, x_box_offset ,30]) cube(size = [10, x_box_length + 1,28], center = true);
1ddd0d1f
CE
99
100 // Nice edges
eb4a701b
CE
101 translate(v=[-5.5-10+1.5,x_box_offset,30+23]) rotate([0,45,0]) cube(size = [10,x_box_length + 1,28], center = true);
102 translate(v=[-5.5-10+1.5,x_box_offset,30+23]) rotate([0,-45,0]) cube(size = [10,x_box_length + 1,28], center = true);
103 translate(v=[-5.5-10+1.5,x_box_offset,30-23]) rotate([0,45,0]) cube(size = [10,x_box_length + 1,28], center = true);
104 translate(v=[-5.5-10+1.5,x_box_offset,30-23]) rotate([0,-45,0]) cube(size = [10,x_box_length + 1,28], center = true);
1ddd0d1f 105
eb4a701b 106 }
f705c26c
VAH
107}
108
eb4a701b 109 // FIXME: z rod placement isn't consistent with carriage
1ddd0d1f 110 pushrod_extra_z = 2.5;
eb4a701b
CE
111
112 // FIXME: confirm length of smooth rod doesn't change when x_box_length or bearing size changes
113 // should also make sure this is long enough if x-ends somehow end up larger than 50mm
114 //Bottom pushfit rod
115 #translate(v=[-15,-41.5,bushing_xy[0]+pushrod_extra_z]) rotate(a=[-90,0,0]) pushfit_rod(pushfit_d,50);
116 // Top pushfit rod
117 translate(v=[-15,-41.5,xaxis_rod_distance+bushing_xy[0]+pushrod_extra_z]) rotate(a=[-90,0,0]) pushfit_rod(pushfit_d,50);
118
1ddd0d1f 119// Nut trap
eb4a701b 120 translate(v=[zmotor_delta_x,-17-zmotor_delta_y,3]) rotate ([0, 0, 45]) nut_trap ();
1ddd0d1f 121}
d3618a65
NZ
122
123
1ddd0d1f
CE
124// Final prototype
125module x_end_plain(){
126 difference(){
127 x_end_base();
128 x_end_holes();
129 }
d3618a65 130}
eff6608e 131
1ddd0d1f 132x_end_plain();
815fe4ec 133
1ddd0d1f
CE
134
135module pushfit_rod(diameter,length){
136 translate([0,-0.3,0]) cylinder(h = length, r=diameter/2, $fn=30);
137 translate([0,0.3,0]) cylinder(h = length, r=diameter/2, $fn=30);
eb4a701b 138 // TODO: reintroduce teardrop holes?
1ddd0d1f
CE
139// difference(){
140// translate(v=[0,-diameter/2.85,length/2]) rotate([0,0,45]) cube(size = [diameter/2,diameter/2,length], center = true);
141// translate(v=[0,-diameter/4-diameter/2-0.4,length/2]) rotate([0,0,0]) cube(size = [diameter,diameter/2,length], center = true);
142// }
1ddd0d1f 143
eb4a701b 144}