Move everything to box_frame/
[clinton/prusa3.git] / box_frame / bushing.scad
CommitLineData
2159eed1
VAH
1// PRUSA iteration3
2// Bushing/bearing housings
d3618a65 3// GNU GPL v3
2159eed1
VAH
4// Josef Průša <josefprusa@me.com>
5// Václav 'ax' Hůla <axtheb@gmail.com>
d3618a65
NZ
6// http://www.reprap.org/wiki/Prusa_Mendel
7// http://github.com/prusajr/PrusaMendel
8
e5d97a09 9include <configuration.scad>
d3618a65
NZ
10
11/**
12 * @id bushing
13 * @name Bushing
14 * @category Printed
15 * @id bushing
e5d97a09 16 */
d3618a65 17
2fc35ca2 18// Linear bearing options
7c194fdd
VAH
19lm8uu_diameter=(bearing_type==1) ? 16 : 15;
20lm8uu_length=(bearing_type==1) ? 25 : 24;
2fc35ca2
VAH
21lm8uu_radius = lm8uu_diameter / 2;
22block_height = 2*lm8uu_length+17;
23
24// basic building blocks, housings for 1 bushing/bearing
25// at [0,0] there is center of the smooth rod, pointing in Z
d3618a65 26
e5d97a09
VAH
27module linear_bushing_square(h=11) {
28 translate([0,0,h/2]) {
29 difference(){
30 union(){
4bf15d1b
VAH
31 translate([-10.5/2,0,0]) cube([10.5,13.8,h], center = true);
32 cube([13.8,13.8,h], center = true);
3ade0448 33 }
4bf15d1b 34 cube([9,9,h+0.02], center = true);
e5d97a09
VAH
35 }
36 }
37}
38
e5d97a09
VAH
39module linear_bushing_round(h=11) {
40 difference(){
41 union(){
2159eed1 42 translate([-10.5/2,0,h/2]) cube([10.5,13.8,h], center = true);
e5d97a09
VAH
43 cylinder(r=7.5, h=h);
44 }
45 translate([0,0,-0.01]) cylinder(r=5.1, h=h+0.02);
46 }
47}
48
49module linear_bushing_bronze(h=11) {
50 difference(){
51 union(){
2159eed1
VAH
52 translate([-10.5/2,0,h/2]) cube([10.5,13.8,h], center = true);
53 cylinder(r=10.7, h=h);
e5d97a09
VAH
54 }
55 translate([0,0,-0.01]) cylinder(r=8.1, h=h+0.02);
56 }
57}
58
2fc35ca2
VAH
59// select right bushing and cut it at angle, so it can be printed upside down
60module linear_bushing_long(h=30){
e5d97a09
VAH
61 intersection(){
62 if (bushing_type == 0) {
2fc35ca2 63 linear_bushing_square(h);
e5d97a09
VAH
64 }
65 if (bushing_type == 1) {
2fc35ca2 66 linear_bushing_round(h);
e5d97a09
VAH
67 }
68 if (bushing_type == 2) {
2fc35ca2 69 linear_bushing_bronze(h);
e5d97a09
VAH
70 }
71 if (bushing_type == 2) {
72 translate([0, 0, 0]) rotate([0,-55,0]) cube([30, 40, 80], center=true);
73 } else {
74 translate([0, 0, -4]) rotate([0,-45,0]) cube([30, 40, 80], center=true);
75 }
2fc35ca2
VAH
76 }
77}
e5d97a09 78
2fc35ca2 79module linear_bushing(h=65){
2159eed1 80 translate([-9.5,0,h/2]) cube([2,13.8,h], center=true);
2fc35ca2
VAH
81 linear_bushing_long(h);
82 if (h>30) {
83 translate([0,0,h]) mirror([0,0,1]) linear_bushing_long(30);
e5d97a09
VAH
84 }
85}
86
2fc35ca2 87//this is for Z axis
88f30890 88module bushing_negative(h=lm8uu_length+4){
2fc35ca2
VAH
89 if (bearing_choice == 1) {
90 if (bushing_type == 0) {
4bf15d1b 91 translate([0,0,h/2]) cube([9,9,h+0.02], center = true);
2fc35ca2
VAH
92 }
93 if (bushing_type == 1) {
94 translate([0,0,-0.01]) cylinder(r=5.1, h=h+0.02);
95 }
96 if (bushing_type == 2) {
97 translate([0,0,-0.01]) cylinder(r=8.1, h=h+0.02);
98 }
99 } else {
100 translate([0,0,-0.01]) cylinder(r=lm8uu_radius+0.4, h=h+0.02);
101 }
e5d97a09 102
2fc35ca2 103}
e5d97a09 104
b355dcc6 105// this should be more parametric
2fc35ca2
VAH
106module firm_foot(){
107 difference(){
108 union() {
b355dcc6 109 translate([3-0.25,16,0]) cube_fillet([8.5,18,20], top=[11,0,0,0], center=true);
2fc35ca2 110 }
b355dcc6 111 #translate([7,14,0]) rotate([0,-90,0]) screw();
e5d97a09 112 }
d3618a65
NZ
113}
114
2fc35ca2 115module spring_foot(){
d3618a65 116
2fc35ca2
VAH
117 difference(){
118 union() {
5f9be941
VAH
119 translate([0.5,23.5,0]) cube_fillet([3,14,20], top=[11,0,0,0], center=true);
120 translate([5,17,0]) rotate([0,0,-15]) cube_fillet([12,3,20], center=true);
121 translate([5,13,0]) rotate([0,0,25]) cube_fillet([13,3,20], center=true);
73d78aad 122 translate([0,9,0]) cube_fillet([3,6,20], vertical=[0,2,0,0], center=true);
2fc35ca2 123 }
5f9be941 124 translate([2,24,0]) rotate([0,-90,0]) screw();
2fc35ca2
VAH
125 }
126}
127
128module y_bearing(float=false){
129 if (bearing_choice == 2) {
130 linear_bearing(lm8uu_length+4);
131 } else {
132 linear_bushing_long(20);
133 }
134 translate([-9,0,10]) {
135 if (float) {
136 spring_foot();
137 mirror([0,1,0]) spring_foot();
138 } else {
139 firm_foot();
140 mirror([0,1,0]) firm_foot();
141 }
142 }
143}
d3618a65
NZ
144
145
cf659153
VAH
146module linear_bearing(h=0, fillet=false){
147 linear_holder_base((h > lm8uu_length+4)? h : lm8uu_length+4, fillet);
148 translate([-(3)/2-lm8uu_radius+2,0,1]) cube([3,18,2], center = true);
149 translate([-(3)/2-lm8uu_radius+2,0,((h > lm8uu_length+4)? h : lm8uu_length+4)-1]) cube([3,18,2], center = true);
2fc35ca2 150 if ( (h-4)/2 > lm8uu_length){
cf659153 151 translate([-(3)/2-lm8uu_radius+2,0,h/2]) cube([3,18, (h-4)-2*lm8uu_length], center = true);
2fc35ca2
VAH
152 }
153}
154
2159eed1 155module linear_holder_base(length, fillet=false){
d3618a65 156
e5d97a09
VAH
157 difference(){
158 union(){
159 //main block
4bf15d1b 160 translate([-10.5/2,0,length/2]) cube([10.5,lm8uu_diameter+5,length], center = true);
3ade0448 161 translate([0,0,0]) cylinder(h = length, r=lm8uu_radius+2.5, $fn=60);
e5d97a09
VAH
162 }
163 //main axis
86c402d8 164 translate([0,0,-2]) cylinder(h = length+4, r=(lm8uu_diameter+0.4)/2, $fn=50);
e5d97a09
VAH
165 // not needed for zip tie
166 //main cut
4bf15d1b 167 translate([10,0,length/2]) cube([20,14,length+4], center = true);
e5d97a09 168 //smooth entry cut
4bf15d1b 169 translate([12,0,length/2]) rotate([0,0,45]) cube([20,20,length+4], center = true);
2159eed1 170 if (fillet) {
cf659153 171 translate([0,0,length/2 ]) cube_negative_fillet([21,lm8uu_diameter+5,length], vertical=[0,3,3,0]);
2159eed1 172 }
e5d97a09 173 }
d3618a65
NZ
174}
175
d3618a65 176
2fc35ca2
VAH
177%cylinder(r=4, h=90);
178y_bearing();
b355dcc6 179translate([0,52,0]) y_bearing();
73d78aad
VAH
180if (bearing_choice == 2) {
181 translate([-22, 23, 0]) y_bearing();
182} else {
183 translate ([-26,23,0]) mirror([1,0,0]) y_bearing(true);
184}