7bcff04f54555c72decb107ad419904916ec15af
[clinton/prusa3.git] / box_frame / x-end-idler.scad
1 // PRUSA iteration3
2 // X end idler
3 // GNU GPL v3
4 // Josef Průša <iam@josefprusa.cz> and contributors
5 // http://www.reprap.org/wiki/Prusa_Mendel
6 // http://prusamendel.org
7 // Alterations for reprap wilson by M. Rice <mrice411@gmail.com>
8
9 include <configuration.scad>
10 use <x-end.scad>
11 use <inc/bearing-guide.scad>
12 use <y-drivetrain.scad>
13
14 // todo:
15
16 // Bearing is being moved back into mount and separate tensioner
17 // removed, need to ensure the width of the slot is wide enough to fix
18 // the bearing plus 1-2mm clearance. Can calculate along with
19 // x_box_width in settings.scad. Unlikely there's any reason to
20 // complicate x_box_width by checking if bearing exceeds the width
21 // calculated based rod diameter.
22
23 // radius of screw hole for pulley (todo: ideally would adjust to
24 // closest screw diameter to idler_bearing inner diameter)
25 pulley_mount_radius = m4_diameter/2;
26 // Y position of the pulley mount, adjusted to clear z bearing
27 // fixme: not sure about z_delta/2 anymore
28 pulley_mount_y = x_base_inside()
29 // ensuring entire bearing fits inside idler
30 + idler_bearing[0]
31 // including flange (even if not using bearing guide since
32 // bearings without will have their own flanges and the size of
33 // those is not configurable)
34 + (idler_assy_r_outer(idler_bearing) - idler_assy_r_inner(idler_bearing))
35 // and recess by 2mm
36 + 2
37 - z_delta / 2;
38 // Z position of pulley mount, adjusted so bottom of idler aligns with
39 // bottom of motor pulley (note: in the x-carriage currently generated
40 // this is backward since the belt runs above the carriage mounting
41 // points)
42 pulley_mount_z = x_motor_shaft_z () + (motor_pulley[0]/2 - idler_bearing[0]/2);
43
44 module x_end_idler_base(){
45 x_end_base();
46 }
47
48 module x_end_idler_holes(){
49 x_end_holes();
50
51 // tensioner mount
52 translate([-20, pulley_mount_y, pulley_mount_z]) {
53 #rotate([0, 90, 0]) cylinder(r=pulley_mount_radius, h=33, center=true, $fn=small_hole_segments);
54 translate([15 - 2 * single_wall_width, 0, 0]) rotate([90, 0, 90]) cylinder(r=m4_nut_diameter_horizontal / 2, h=3, $fn=6);
55 }
56 }
57
58 // Final part
59 module x_end_idler(){
60 mirror([0,1,0]) difference(){
61 x_end_idler_base();
62 x_end_idler_holes();
63 }
64
65 %translate([-14 - xy_delta / 2, 25, pulley_mount_z - (max(idler_width, 16) / 2)]) x_tensioner();
66 }
67
68 module x_tensioner(len=50, idler_height=max(idler_bearing[0], 16)) {
69 // todo: scal narrow_width with size of belt hole, if that becomes scalable
70 idlermount(len=len, rod=m4_diameter / 2 + 0.5, idler_height=idler_height, narrow_len=30, narrow_width=9);
71 }
72
73 translate([-40, 0, 4 - bushing_xy[0]]) x_tensioner();
74
75 x_end_idler();
76
77 if (idler_bearing[3] == 1) { // bearing guides
78 translate([-39, -60 - idler_bearing[0] / 2, 4 - bushing_xy[0]]) rotate([0, 0, 55]) {
79 render() bearing_assy();
80 }
81 }