2 // Bushing/bearing housings
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/josefprusa/Prusa3
12 * @name Y Axis Bearing Holder
16 include <configuration.scad>
18 // ensure that the part length is at least the length of bushing barrel plus add
19 function adjust_bushing_len(conf_b, h, add=layer_height*2) = ((conf_b[2]+add) > h) ? conf_b[2]+add : h;
21 //distance from the flat side of bushing holder to rod center
22 function bushing_foot_len(conf_b, h=10.5, add=4*single_wall_width) = ((conf_b[1]+add) > h) ? conf_b[1]+add : h;
24 function bushing_outer_radius(conf_b) = conf_b[1] + 4*single_wall_width;
26 // basic building blocks, housings for 1 bushing/bearing
27 // at [0,0] there is center of the smooth rod, pointing in Z
29 module linear_bushing_negative_single(conf_b=bushing_xy, h=0){
30 // barrel with the dimensions of a bushing/bearing
31 // to be substracted as needed
32 translate([0, 0, -0.01]) cylinder(r = conf_b[1], h = adjust_bushing_len(conf_b, h) + 0.02);
35 module linear_bearing_negative_single(conf_b=bushing_xy, h=0, shadow=false){
36 // barrel with the dimensions of the bearing
37 translate([0, 0, -0.01 + 3 * layer_height]) cylinder(r = conf_b[1], h = adjust_bushing_len(conf_b, h) + 0.02);
38 if (shadow == false) {
39 translate([0, -conf_b[1]+1, -0.01 + 3 * layer_height]) cube([30, 2 * conf_b[1] - 2, adjust_bushing_len(conf_b, h) + 0.02]);
43 module linear_bushing_single(conf_b=bushing_xy, h=0) {
44 // This is the printed barrel around bushing
45 // with foot pointing to -x
46 translate([-bushing_foot_len(conf_b), -7, 0]) cube([bushing_foot_len(conf_b), 14, adjust_bushing_len(conf_b, h)]);
47 cylinder(r=bushing_outer_radius(conf_b), h=adjust_bushing_len(conf_b, h));
50 module linear_bushing_negative(conf_b=bushing_xy, h=0){
51 // return simple negative stretched all along and a smooth rod
52 translate([0,0,-0.1]) cylinder(r = conf_b[0] + single_wall_width, h=adjust_bushing_len(conf_b, h)+0.2);
53 linear_bushing_negative_single(conf_b, h=adjust_bushing_len(conf_b, h));
56 module linear_bearing_negative(conf_b = bushing_xy, h = 0, shadow=false){
57 //same as linear_bushing_negative, but with z direction constrained parts
58 translate([0,0,-0.1]) cylinder(r = conf_b[0] + single_wall_width, h=adjust_bushing_len(conf_b, h, 8*layer_height)+0.2);
60 linear_bearing_negative_single(conf_b, 0, shadow);
61 if (h > 2*conf_b[2] + 9*layer_height){
62 translate([0,0,h]) mirror([0,0,1]) linear_bearing_negative_single(conf_b, 0, shadow);
66 module linear_negative_preclean(conf_b = bushing_xy) {
67 // makes sure there is nothing interfering
68 // to be substracted before linear()
69 cylinder(r = conf_b[1] + single_wall_width, h=300, center=true);
72 module linear_bushing_sloped(conf_b=bushing_xy, h= 100){
73 // cut the bushing at angle, so it can be printed upside down
75 linear_bushing_single(conf_b, h = h);
76 // hardcoded, may need fixing for different barelled bushings
77 // atm there is only one and I am too lazy
78 translate([0, 0, -2]) rotate([0,-50,0]) cube([30, 40, 80], center=true);
82 module linear_bushing(conf_b=bushing_xy, h=0){
83 // this is the function to be used for type 1 linears (barrel holder)
84 // It has bushing on bottom and for parts longer than 3x the barel length on top too
87 translate([-bushing_foot_len(conf_b), -7, 0]) cube([2, 14, adjust_bushing_len(conf_b, h)]);
88 linear_bushing_single(conf_b);
90 translate([0,0,h]) mirror([0,0,1]) linear_bushing_sloped(conf_b);
93 linear_bushing_negative(conf_b, h);
97 module linear_bearing(conf_b=bushing_xy, h=0){
103 //translate([-bushing_foot_len(conf_b), -7, 0]) cube([4, 14, adjust_bushing_len(conf_b, h, 9*layer_height)]); <- removed for duplicity:)
104 translate([0,0,0]) cylinder(h = adjust_bushing_len(conf_b, h, 9*layer_height), r=bushing_outer_radius(conf_b), $fn=60);
107 translate([12,0,-1]) rotate([0,0,45]) cube([20, 20, 200], center=true);
110 translate([0, -(bushing_outer_radius(conf_b)), 0]) cube([30, 2*bushing_outer_radius(conf_b) , max(h, conf_b[2] + 9 * layer_height)]);
112 // upper clamp for long holders
113 if (h > 2*conf_b[2] + 9*layer_height || conf_b[2] > 45){
114 translate ([0,0, max(h, conf_b[2]) - 8 ]) bearing_clamp(conf_b, 2*(bushing_outer_radius(conf_b)));
117 translate ([0, 0, 10]) bearing_clamp(conf_b, 2*(bushing_outer_radius(conf_b)));
122 translate([0,0,-2]) cylinder(h = adjust_bushing_len(conf_b, h)+10, r=conf_b[1]);
124 translate([0, -conf_b[1]+1, -1]) cube([30, 2*conf_b[1]-2, 200]);
127 translate([-bushing_foot_len(conf_b), -7, 0]) cube([4, 14, adjust_bushing_len(conf_b, h, 9*layer_height)]);
128 linear_negative(conf_b, h);
132 // this should be more parametric
133 module firm_foot(conf_b = conf_b_lm8uu){
136 translate([8.5/2,0,0]) cube_fillet([8.5, 42 + xy_delta * 2, 20], top=[11, 0, 11, 0], center=true);
138 translate([9, 14.5 + xy_delta, 0]) rotate([0, -90, 0]) screw(head_drop=1, $fn=small_hole_segments);
139 translate([9,-14.5 - xy_delta, 0]) rotate([0,-90,0]) screw(head_drop=1,$fn=small_hole_segments);
143 module y_bearing(conf_b=bushing_xy){
149 translate([-bushing_foot_len(conf_b), 0, 10]) firm_foot();
150 if (bushing_xy[2] > 45) {
151 translate([-bushing_foot_len(conf_b), 0, adjust_bushing_len(bushing_xy, 45) - 8]) mirror([0, 0, 1]) firm_foot();
154 linear_negative_preclean();
158 //linear_negative(bushing_xy, 20);
162 module bearing_clamp_brick(conf_b, h){
163 translate([-(m4_nut_diameter/2+conf_b[1]), 0, 0])
164 cube([m4_nut_diameter + 2 * conf_b[1], m4_nut_diameter + 1, h], center = true);
167 module bearing_clamp(conf_b=bushing_xy, h=0){
168 // inspired by John Ridley and Jonas Kühling
172 translate([m3_diameter / 2 + conf_b[1] + 0.3, 0, 0])
173 cylinder(h=h, r = m4_nut_diameter / 2 + 0.5, center = true);
174 translate([m3_diameter / 2 + conf_b[1] + 0.3, 0, 0]) {
175 bearing_clamp_brick(conf_b, h);
177 bearing_clamp_brick(conf_b, h);
180 translate([m3_diameter / 2 + conf_b[1] + 0.3, 0, 0]) {
181 cylinder(r=m3_diameter / 2, h=h+2, center=true,$fn=small_hole_segments);
182 %cylinder(r=m3_diameter / 2, h=h+2, center=true,$fn=small_hole_segments);
189 module linear_negative(conf_b = bushing_xy, h = 0, shadow=false){
190 //selects right negative based on type
191 if (conf_b[3] == 0) {
192 linear_bearing_negative(conf_b, h, shadow);
194 linear_bushing_negative(conf_b, h, shadow);
198 module linear(conf_b = bushing_xy, h = 0){
199 //selects right model based on type
200 if (conf_b[3] == 0) {
201 linear_bearing(conf_b, h);
203 linear_bushing(conf_b, h);
205 %linear_negative(conf_b, h, true);
209 %cylinder(r=bushing_xy[0], h=90);
212 translate([0,52,0]) y_bearing();
214 if (bushing_xy[2] < 45) {
215 translate ([-30,23,0]) mirror([1,0,0]) y_bearing();
218 cube([0.1, 0.1, 0.1]);