y-axis: fix compiler warnings
[clinton/prusa3.git] / box_frame / y-drivetrain.scad
CommitLineData
2159eed1
VAH
1// PRUSA iteration3
2// Y drivetrain (idler and stepper holders)
7e896b17 3// GNU GPL v3
2159eed1
VAH
4// Josef Průša <josefprusa@me.com>
5// Václav 'ax' Hůla <axtheb@gmail.com>
7e896b17 6// http://www.reprap.org/wiki/Prusa_Mendel
8e93419f 7// http://github.com/josefprusa/Prusa3
7e896b17 8
65a72cd5
T
9// ThingDoc entry
10/**
11 * @id yMotorHolder
12 * @name Y Axis Motor Holder
13 * @category Printed
14 */
15
16/**
2c2292dc 17 * @id yIdler
65a72cd5
T
18 * @name Y Axis Belt Idler
19 * @category Printed
20 */
21
7e896b17 22include <configuration.scad>
eff6608e 23use <inc/bearing-guide.scad>
7e896b17
VAH
24
25module motorholder(thickness=10){
26 difference(){
27 union(){
28 // Motor holding part
f705c26c 29 translate([29, -21 + 50, 0])
7e896b17 30 {
7e896b17
VAH
31 difference(){
32 union(){
f705c26c 33 translate([-21 + 4.5, 0, 5]) cube([9, 31, thickness], center=true);
b5fde57b
CE
34 nema17([0, 1, 1, 0], shadow=false);
35 mirror([0, 0, 1]) translate([0, 0, -10]) nema17([0, 1, 1, 0], shadow=7);
7e896b17 36 // Parts joining part
f705c26c 37 translate([-29, -21, 0]) cube([14, 30, thickness]);
7e896b17
VAH
38 }
39 // Motor mounting holes
b5fde57b 40 translate([0, 0, thickness]) mirror([0, 0, 1]) nema17([0, 1, 1, 0], holes=true);
7e896b17
VAH
41 }
42 }
43
44 // Front holding part
f705c26c
VAH
45 translate([0, 10, 0]) cylinder(h = thickness, r=8);
46 translate([0, 20, 5]) cube([16, 20, thickness], center=true);
47 translate([0, 30, 0]) cylinder(h = thickness, r=8);
7e896b17 48 }
8dd48710
JG
49 translate([0, 10, -1]) cylinder(h = 12, r=4.5, $fn=32);
50 translate([0, 30, -1]) cylinder(h = 12, r=4.5, $fn=32);
7e896b17
VAH
51 }
52}
53
67f4a88f 54module oval(r=4, l=14, h=2){
0d8b4afe
VAH
55 intersection() {
56 union() {
57 translate([l / 2, 0, 0]) cylinder(r=r, h=h, $fn=4);
67f4a88f 58 //translate([-l / 2, 0, 0]) cylinder(r=r, h=h, $fn=4);
0d8b4afe
VAH
59 translate([0, 0, h / 2]) cube([l, r * 2, h], center=true);
60 }
61 translate([0, 0, h / 2]) cube([l + r * 1.2, r * 2, h], center=true);
62 }
b325d8c2
KY
63}
64
815fe4ec 65module idlermount(len=45, narrow_len=0, narrow_width=0, rod=threaded_rod_diameter_horizontal / 2, idler_height=16){
7e896b17
VAH
66 difference(){
67 union(){
f705c26c 68 //wide part holding bearing
6229a141 69 translate([- (10 + idler_width) / 2, -25 + narrow_len, 0] ) cube_fillet([10 + idler_width, len + idler_bearing[2] * 1.1 - narrow_len, idler_height]);
0d8b4afe 70 //For X there is narrow part inside the x-idler
f705c26c
VAH
71 if (narrow_len > 0){
72 translate([-narrow_width / 2, -25, 0] ) cube_fillet([narrow_width, len + idler_bearing[2], idler_height], vertical=[0, 0, 2, 2]);
6229a141
VAH
73 mirror([1, 0, 0]) translate([-narrow_width / 2, narrow_len -25, idler_height / 2 ]) fillet(1.5, idler_height - 0.04, $fn=8);
74 translate([-narrow_width / 2, narrow_len -25, idler_height / 2]) fillet(1.5, idler_height - 0.04, $fn=8);
f705c26c 75 }
7e896b17 76 }
4e1cf096
VAH
77 translate([-12, -8, idler_height / 2]) rotate([90, 0, 90]) oval(r=rod + 0.01, l=12, h=25);
78 translate([0, -13 - single_wall_width*2, idler_height / 2]) {
79 // nut for tensioning screw
a67d858f 80 translate([0,0,0]) rotate([90, 0, 0]) cylinder(r=m4_nut_diameter_horizontal / 2, h=3.8, $fn=6);
4e1cf096 81 // nut insert
a67d858f 82 translate([-2, -3.8, -m4_diameter * 1.5 / 2]) cube([20, 3.8, m4_diameter * 1.5+0.3]);
67f4a88f
VAH
83 }
84
4e1cf096 85 // tensioning screw goes here
8dd48710 86 translate([0, -19, idler_height / 2]) rotate([90, 90, 0]) cylinder(r=m4_diameter / 2, h=15, $fn=small_hole_segments, center=true);
4e1cf096 87 // bearing goes there
815fe4ec 88 translate([0, len + idler_bearing[2] - 35, idler_height / 2]) {
4e1cf096
VAH
89 rotate([0, 90, 0]) idler_assy(idler_bearing);
90 translate([0, 10, 0]) cube([idler_width + 1, 20, idler_height + 2], center=true);
91 }
c4e4d509 92
7e896b17 93 }
7e896b17
VAH
94}
95
b325d8c2 96
42e0b559 97motorholder();
4e1cf096 98translate([32, 25, 0]) idlermount();
7337be14 99
eff6608e
VAH
100if (idler_bearing[3] == 1) {
101 translate([0, -12 - idler_bearing[0] / 2, 0]) {
4e1cf096 102 render() bearing_assy();
eff6608e
VAH
103 }
104}