z-axis: improve strength, cleanup
[clinton/prusa3.git] / box_frame / x-end.scad
CommitLineData
2159eed1
VAH
1// PRUSA iteration3
2// X ends
3// GNU GPL v3
dba99e69 4// Josef Průša <josefprusa@me.com>
3b7acad1 5// Václav 'ax' Hůla <axtheb@gmail.com>
2159eed1 6// http://www.reprap.org/wiki/Prusa_Mendel
8e93419f 7// http://github.com/josefprusa/Prusa3
2159eed1 8
65a72cd5
T
9// ThingDoc entry
10/**
11 * @id xMotorEnd
12 * @name X Axis Motor End
13 * @category Printed
14 */
15
16/**
17 * @id xIdlerEnd
18 * @name X Axis Idler End
19 * @category Printed
20 */
21
2fc35ca2 22include <configuration.scad>
d3618a65 23use <bushing.scad>
eff6608e 24use <inc/bearing-guide.scad>
f705c26c 25use <y-drivetrain.scad>
86c402d8 26
1e67bf0e
VAH
27//height and width of the x blocks depend on x smooth rod radius
28x_box_height = 52 + 2 * bushing_xy[0];
29x_box_width = (bushing_xy[0] <= 4) ? 17.5 : bushing_xy[0] * 2 + 9.5;
58279f58 30bearing_height = max ((bushing_z[2] > 30 ? x_box_height : (2 * bushing_z[2] + 8)), x_box_height);
d3618a65
NZ
31
32module x_end_motor(){
33
690004c7 34 mirror([0, 1, 0]) {
c7eb29ba 35
82bba690 36 x_end_base([3, 3, min((bushing_xy[0] - 3) * 2, 3), 2], len=42, offset=-5, thru=false);
c7eb29ba 37
690004c7
VAH
38
39 translate([0, -z_delta - 2, 0]) difference(){
79b4b60a 40 union(){
f705c26c
VAH
41 intersection() {
42 translate([-15, -34, 30]) cube([20, 60, x_box_height], center = true);
43 union() {
82bba690
VAH
44 translate([-14, -16 + z_delta / 2, 24]) cube_fillet([17.5, 10.5 + z_delta, 55], center = true, vertical=[0, 0, 3, 3], top=[0, 3, 6, 3], $fn=16);
45 //lower arm holding outer stepper screw
46 translate([-10.25, -34, 9]) intersection(){
f705c26c
VAH
47 translate([0, 0, -5]) cube_fillet([10, 37, 28], center = true, vertical=[0, 0, 0, 0], top=[0, 3, 5, 3]);
48 translate([-10/2, 10, -26]) rotate([45, 0, 0]) cube_fillet([10, 60, 60], radius=2);
49 }
50 }
79b4b60a 51 }
82bba690 52 translate([-16, -32, 30.25]) rotate([90, 0, 0]) rotate([0, 90, 0]) nema17(places=[1, 0, 1, 1], h=11);
82e9f136 53 }
c7eb29ba 54
79b4b60a 55 // motor screw holes
690004c7 56 translate([21-5, -21-11, 30.25]){
79b4b60a 57 // belt hole
82bba690 58 translate([-30, 11, -0.25]) cube_fillet([11, 36, 22], vertical=0, top=[0, 1, 0, 1], bottom=[0, 1, 0, 1], center = true, $fn=4);
79b4b60a 59 //motor mounting holes
82bba690 60 translate([-29.5, 0, 0]) rotate([0, 0, 0]) rotate([0, 90, 0]) nema17(places=[1, 1, 0, 1], holes=true, shadow=5.5, $fn=small_hole_segments, h=8);
79b4b60a 61 }
c7eb29ba 62 }
79b4b60a 63 //smooth rod caps
82bba690
VAH
64 //translate([-22, -10, 0]) cube([17, 2, 15]);
65 //translate([-22, -10, 45]) cube([17, 2, 10]);
c7eb29ba 66 }
d3618a65
NZ
67}
68
f705c26c 69module x_end_base(vfillet=[3, 3, 3, 3], thru=true, len=40, offset=0){
d3618a65 70
c7eb29ba
VAH
71 difference(){
72 union(){
f705c26c 73 translate([-10 - bushing_xy[0], -10 + len / 2 + offset, 30]) cube_fillet([x_box_width, len, x_box_height], center=true, vertical=vfillet, top=[5, 3, 5, 3]);
690004c7
VAH
74
75 translate([0, 0, 4 - bushing_xy[0]]) {
76 //rotate([0, 0, 0]) translate([0, -9.5, 0])
11476b31 77 translate([z_delta, 0, 0]) render(convexity = 5) linear(bushing_z, bearing_height);
690004c7 78 // Nut trap
cc573956 79 translate([-2, 18, 5]) cube_fillet([20, 14, 10], center = true, vertical=[8, 0, 0, 5]);
690004c7 80 //}
c7eb29ba
VAH
81 }
82 }
690004c7 83 // here are bushings/bearings
11476b31 84 translate([z_delta, 0, 4 - bushing_xy[0]]) linear_negative(bushing_z, bearing_height);
d3618a65 85
c7eb29ba 86 // belt hole
815fe4ec 87 translate([-14 - xy_delta / 2, 22 - 9 + offset, 30]) cube_fillet([max(idler_width + 2, 11), 55, 27], center = true, vertical=0, top=[0, 1, 0, 1], bottom=[0, 1, 0, 1], $fn=4);
690004c7 88
82bba690 89 //smooth rods
f705c26c 90 translate([-10 - bushing_xy[0], offset, 0]) {
690004c7
VAH
91 if(thru == true){
92 translate([0, -11, 6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
93 translate([0, -11, xaxis_rod_distance+6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
94 } else {
95 translate([0, -7, 6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
96 translate([0, -7, xaxis_rod_distance+6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
97 }
98 }
7b4231d9 99 translate([0, 0, 5 - bushing_xy[0]]) { // m5 nut insert
cc573956
VAH
100 translate([0, 17, 0]) rotate([0, 0, 10]){
101 //rod
82bba690 102 translate([0, 0, -1]) cylinder(h=(4.1 / 2 + 5), r=3, $fn=32);
cc573956
VAH
103 //nut
104 translate([0, 0, 9]) cylinder(r=4.6, h=14.1, center = true, $fn=6);
7b4231d9
VAH
105
106 }
c7eb29ba 107 }
c7eb29ba 108 }
c7eb29ba 109 //threaded rod
690004c7 110 translate([0, 17, 0]) %cylinder(h = 70, r=2.5+0.2);
d3618a65 111}
79b4b60a 112
79b4b60a
VAH
113module x_end_idler(){
114 difference() {
82bba690 115 x_end_base(len=48 + z_delta / 3, offset=-10 - z_delta / 3);
79b4b60a 116 // idler hole
42436753 117 translate([-20, -15 - z_delta / 2, 30]) {
1f623fc7 118 rotate([0, 90, 0]) cylinder(r=m4_diameter / 2, h=33, center=true, $fn=small_hole_segments);
f705c26c
VAH
119 translate([15 - 2 * single_wall_width, 0, 0]) rotate([90, 0, 90]) cylinder(r=m4_nut_diameter_horizontal / 2, h=3, $fn=6);
120
79b4b60a 121 }
815fe4ec 122 translate([-6 - x_box_width, 11, 29.5 - (max(idler_width, 16) / 2)]) cube([x_box_width + 1, 12, 1.5 + max(idler_bearing[0], 16)]);
79b4b60a 123 }
815fe4ec 124 %translate([-14 - xy_delta / 2, -9, 30.5 - (max(idler_width, 16) / 2)]) x_tensioner();
79b4b60a
VAH
125}
126
815fe4ec 127module x_tensioner(len=68, idler_height=max(idler_bearing[0], 16)) {
4e1cf096 128 idlermount(len=len, rod=m4_diameter / 2 + 0.5, idler_height=idler_height, narrow_len=47, narrow_width=idler_width + 2 - single_wall_width);
f705c26c
VAH
129}
130
131
ebec6b3c 132translate([-40, 0, 4 - bushing_xy[0]]) x_tensioner();
82bba690
VAH
133translate([0, -80, 0]) mirror([1, 0, 0]) x_end_idler(thru=true);
134translate([-50, 0, 0]) mirror([1, 0, 0]) translate([-50, 0, 0])
135 x_end_motor();
d3618a65 136
690004c7 137module pushfit_rod(diameter, length){
c7eb29ba 138 cylinder(h = length, r=diameter/2, $fn=30);
82bba690 139 translate([0, -diameter/4, length/2]) cube_fillet([diameter, diameter/2, length], vertical = [0, 0, 1, 1], center = true, $fn=4);
d3618a65 140
82bba690 141 translate([0, -diameter/2-1.2, length/2]) cube([diameter - 1, 1, length], center = true);
d3618a65 142}
eff6608e 143
815fe4ec
VAH
144
145if (idler_bearing[3] == 1) { // bearing guides
146 translate([-39, -60 - idler_bearing[0] / 2, 4 - bushing_xy[0]]) rotate([0, 0, 55]) {
4e1cf096 147 render() bearing_assy();
eff6608e
VAH
148 }
149}