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/prusajr/PrusaMendel
9 include <configuration.scad>
11 // ensure that the part length is at least the length of bushing barrel plus add
12 function adjust_bushing_len(conf_b, h, add=layer_height*2) = ((conf_b[2]+add) > h) ? conf_b[2]+add : h;
14 //distance from the flat side of bushing holder to rod center
15 function bushing_foot_len(conf_b, h=10.5, add=4*single_wall_width) = ((conf_b[1]+add) > h) ? conf_b[1]+add : h;
17 function bushing_outer_radius(conf_b) = conf_b[1] + 4*single_wall_width;
19 // basic building blocks, housings for 1 bushing/bearing
20 // at [0,0] there is center of the smooth rod, pointing in Z
22 module linear_bushing_negative_single(conf_b=bushing_xy, h=0){
23 // barrel with the dimensions of a bushing/bearing
24 // to be substracted as needed
25 translate([0, 0, -0.01]) cylinder(r = conf_b[1], h = adjust_bushing_len(conf_b, h) + 0.02);
28 module linear_bearing_negative_single(conf_b=bushing_xy, h=0, shadow=false){
29 // barrel with the dimensions of the bearing
30 translate([0, 0, -0.01 + 3 * layer_height]) cylinder(r = conf_b[1], h = adjust_bushing_len(conf_b, h) + 0.02);
31 if (shadow == false) {
32 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]);
36 module linear_bushing_single(conf_b=bushing_xy, h=0) {
37 // This is the printed barrel around bushing
38 // with foot pointing to -x
39 translate([-bushing_foot_len(conf_b), -7, 0]) cube([bushing_foot_len(conf_b), 14, adjust_bushing_len(conf_b, h)]);
40 cylinder(r=bushing_outer_radius(conf_b), h=adjust_bushing_len(conf_b, h));
43 module linear_bushing_negative(conf_b=bushing_xy, h=0){
44 // return simple negative stretched all along and a smooth rod
45 translate([0,0,-0.1]) cylinder(r = conf_b[0] + single_wall_width, h=adjust_bushing_len(conf_b, h)+0.2);
46 linear_bushing_negative_single(conf_b, h=adjust_bushing_len(conf_b, h));
49 module linear_bearing_negative(conf_b = bushing_xy, h = 0, shadow=false){
50 //same as linear_bushing_negative, but with z direction constrained parts
51 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);
53 linear_bearing_negative_single(conf_b, 0, shadow);
54 if (h > 2*conf_b[2] + 9*layer_height){
55 translate([0,0,h]) mirror([0,0,1]) linear_bearing_negative_single(conf_b, 0, shadow);
59 module linear_negative_preclean(conf_b = bushing_xy) {
60 // makes sure there is nothing interfering
61 // to be substracted before linear()
62 cylinder(r = conf_b[1] + single_wall_width, h=300, center=true);
65 module linear_bushing_sloped(conf_b=bushing_xy, h= 100){
66 // cut the bushing at angle, so it can be printed upside down
68 linear_bushing_single(conf_b, h = h);
69 // hardcoded, may need fixing for different barelled bushings
70 // atm there is only one and I am too lazy
71 translate([0, 0, -2]) rotate([0,-50,0]) cube([30, 40, 80], center=true);
75 module linear_bushing(conf_b=bushing_xy, h=0){
76 // this is the function to be used for type 1 linears (barrel holder)
77 // It has bushing on bottom and for parts longer than 3x the barel length on top too
80 translate([-bushing_foot_len(conf_b), -7, 0]) cube([2, 14, adjust_bushing_len(conf_b, h)]);
81 linear_bushing_single(conf_b);
83 translate([0,0,h]) mirror([0,0,1]) linear_bushing_sloped(conf_b);
86 linear_bushing_negative(conf_b, h);
90 module linear_bearing(conf_b=bushing_xy, h=0){
96 //translate([-bushing_foot_len(conf_b), -7, 0]) cube([4, 14, adjust_bushing_len(conf_b, h, 9*layer_height)]); <- removed for duplicity:)
97 translate([0,0,0]) cylinder(h = adjust_bushing_len(conf_b, h, 9*layer_height), r=bushing_outer_radius(conf_b), $fn=60);
100 translate([12,0,-1]) rotate([0,0,45]) cube([20, 20, 200], center=true);
103 translate([0, -(bushing_outer_radius(conf_b)), 0]) cube([30, 2*bushing_outer_radius(conf_b) , max(h, conf_b[2] + 9 * layer_height)]);
105 // upper clamp for long holders
106 if (h > 2*conf_b[2] + 9*layer_height || conf_b[2] > 45){
107 translate ([0,0, max(h, conf_b[2]) - 8 ]) bearing_clamp(conf_b, 2*(bushing_outer_radius(conf_b)));
110 translate ([0, 0, 10]) bearing_clamp(conf_b, 2*(bushing_outer_radius(conf_b)));
115 translate([0,0,-2]) cylinder(h = adjust_bushing_len(conf_b, h)+10, r=conf_b[1]);
117 translate([0, -conf_b[1]+1, -1]) cube([30, 2*conf_b[1]-2, 200]);
120 translate([-bushing_foot_len(conf_b), -7, 0]) cube([4, 14, adjust_bushing_len(conf_b, h, 9*layer_height)]);
121 linear_negative(conf_b, h);
125 // this should be more parametric
126 module firm_foot(conf_b = conf_b_lm8uu){
129 translate([8.5/2,0,0]) cube_fillet([8.5, 42 + xy_delta * 2, 20], top=[11, 0, 11, 0], center=true);
131 translate([9, 14.5 + xy_delta, 0]) rotate([0, -90, 0]) screw(head_drop=1, $fn=small_hole_segments);
132 translate([9,-14.5 - xy_delta, 0]) rotate([0,-90,0]) screw(head_drop=1,$fn=small_hole_segments);
136 module y_bearing(conf_b=bushing_xy){
142 translate([-bushing_foot_len(conf_b), 0, 10]) firm_foot();
143 if (bushing_xy[2] > 45) {
144 translate([-bushing_foot_len(conf_b), 0, adjust_bushing_len(bushing_xy, 45) - 8]) mirror([0, 0, 1]) firm_foot();
147 linear_negative_preclean();
151 //linear_negative(bushing_xy, 20);
155 module bearing_clamp_brick(conf_b, h){
156 translate([-(m4_nut_diameter/2+conf_b[1]), 0, 0])
157 cube([m4_nut_diameter + 2 * conf_b[1], m4_nut_diameter + 1, h], center = true);
160 module bearing_clamp(conf_b=bushing_xy, h=0){
161 // inspired by John Ridley and Jonas Kühling
165 translate([m3_diameter / 2 + conf_b[1] + 0.3, 0, 0])
166 cylinder(h=h, r = m4_nut_diameter / 2 + 0.5, center = true);
167 translate([m3_diameter / 2 + conf_b[1] + 0.3, 0, 0]) {
168 bearing_clamp_brick(conf_b, h);
170 bearing_clamp_brick(conf_b, h);
173 translate([m3_diameter / 2 + conf_b[1] + 0.3, 0, 0]) {
174 cylinder(r=m3_diameter / 2, h=h+2, center=true,$fn=small_hole_segments);
175 %cylinder(r=m3_diameter / 2, h=h+2, center=true,$fn=small_hole_segments);
182 module linear_negative(conf_b = bushing_xy, h = 0, shadow=false){
183 //selects right negative based on type
184 if (conf_b[3] == 0) {
185 linear_bearing_negative(conf_b, h, shadow);
187 linear_bushing_negative(conf_b, h, shadow);
191 module linear(conf_b = bushing_xy, h = 0){
192 //selects right model based on type
193 if (conf_b[3] == 0) {
194 linear_bearing(conf_b, h);
196 linear_bushing(conf_b, h);
198 %linear_negative(conf_b, h, true);
202 %cylinder(r=bushing_xy[0], h=90);
205 translate([0,52,0]) y_bearing();
207 if (bushing_xy[2] < 45) {
208 translate ([-30,23,0]) mirror([1,0,0]) y_bearing();
211 cube([0.1, 0.1, 0.1]);