d8ba4f3f9ec43db426967b282c280b24f042ed94
[clinton/prusa3.git] / box_frame / y-drivetrain.scad
1 // PRUSA iteration3
2 // Y drivetrain (idler and stepper holders)
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
9 include <configuration.scad>
10 use <inc/bearing-guide.scad>
11
12 module motorholder(thickness=10){
13 difference(){
14 union(){
15 // Motor holding part
16 translate([29, -21 + 50, 0])
17 {
18 //#cube([42, 42, 2], center=true);
19 difference(){
20 union(){
21 translate([-21 + 4.5, 0, 5]) cube([9, 31, thickness], center=true);
22 nema17([0, 1, 1, 0], thickness=thickness, shadow=false);
23 mirror([0, 0, 1]) translate([0, 0, -10]) nema17([0, 1, 1, 0], thickness=thickness, shadow=7);
24 // Parts joining part
25 translate([-29, -21, 0]) cube([14, 30, thickness]);
26 }
27 // Motor mounting holes
28 translate([0, 0, thickness]) mirror([0, 0, 1]) nema17([0, 1, 1, 0], thickness=thickness, holes=true);
29 }
30 }
31
32 // Front holding part
33 translate([0, 10, 0]) cylinder(h = thickness, r=8);
34 translate([0, 20, 5]) cube([16, 20, thickness], center=true);
35 translate([0, 30, 0]) cylinder(h = thickness, r=8);
36 }
37 translate([0, 10, -1]) cylinder(h = 12, r=4.5);
38 translate([0, 30, -1]) cylinder(h = 12, r=4.5);
39 }
40 }
41
42 module oval(r=4, l=14, h=2){
43 intersection() {
44 union() {
45 translate([l / 2, 0, 0]) cylinder(r=r, h=h, $fn=4);
46 //translate([-l / 2, 0, 0]) cylinder(r=r, h=h, $fn=4);
47 translate([0, 0, h / 2]) cube([l, r * 2, h], center=true);
48 }
49 translate([0, 0, h / 2]) cube([l + r * 1.2, r * 2, h], center=true);
50 }
51 }
52
53 module idlermount(len=42, narrow_len=0, narrow_width=0, rod=threaded_rod_diameter_horizontal / 2, idler_height=16){
54 difference(){
55 union(){
56 //wide part holding bearing
57 translate([- (10 + idler_width) / 2, -25 + narrow_len, 0] ) cube_fillet([10 + idler_width, len + idler_bearing[2] * 1.1 - narrow_len, idler_height]);
58 //For X there is narrow part inside the x-idler
59 if (narrow_len > 0){
60 translate([-narrow_width / 2, -25, 0] ) cube_fillet([narrow_width, len + idler_bearing[2], idler_height], vertical=[0, 0, 2, 2]);
61 mirror([1, 0, 0]) translate([-narrow_width / 2, narrow_len -25, idler_height / 2 ]) fillet(1.5, idler_height - 0.04, $fn=8);
62 translate([-narrow_width / 2, narrow_len -25, idler_height / 2]) fillet(1.5, idler_height - 0.04, $fn=8);
63 }
64 }
65 translate([-12, -9, idler_height / 2]) rotate([90, 0, 90]) oval(r=rod + 0.01, l=12, h=25);
66 translate([0, -15 - single_wall_width, idler_height / 2]) {
67 //nut
68 rotate([90, 0, 0]) cylinder(r=m4_nut_diameter_horizontal / 2, h=3.3, $fn=6);
69 //nut insert
70 translate([0, -3.3, -m4_diameter * 1.5 / 2]) cube([20, 3.3, m4_diameter * 1.5]);
71 }
72
73 translate([0, -19, idler_height / 2]) rotate([90, 90, 0]) cylinder(r=m4_diameter / 2, h=15, $fn=7, center=true);
74 translate([0, len + idler_bearing[2] - 33, idler_height / 2]) {
75 rotate([0, 90, 0]) idler_assy(idler_bearing);
76 translate([0, 10, 0]) cube([idler_width + 1, 20, idler_height + 2], center=true);
77 }
78
79 }
80 }
81
82
83 motorholder();
84 translate([32, 20, 0]) idlermount();
85
86 if (idler_bearing[3] == 1) {
87 translate([0, -12 - idler_bearing[0] / 2, 0]) {
88 bearing_guide_inner();
89 translate([idler_bearing[0] + 10, 0, 0])
90 bearing_guide_outer();
91 }
92 }