Header change, minor fiddling with bushings, x-carriage refactor part I
[clinton/prusa3.git] / bushing.scad
1 // PRUSA iteration3
2 // Bushing/bearing housings
3 // GNU GPL v3
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
8
9 include <configuration.scad>
10
11 /**
12 * @id bushing
13 * @name Bushing
14 * @category Printed
15 * @id bushing
16 */
17
18 // Linear bearing options
19 lm8uu_diameter=(bearing_type==0) ? 16 : 15;
20 lm8uu_length=(bearing_type==0) ? 24 : 25;
21 lm8uu_radius = lm8uu_diameter / 2;
22 block_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
26
27 module linear_bushing_square(h=11) {
28 translate([0,0,h/2]) {
29 difference(){
30 union(){
31 translate([-10.5/2,0,0]) cube([10.5,13.8,h], center = true);
32 cube([13.8,13.8,h], center = true);
33 }
34 cube([9,9,h+0.02], center = true);
35 }
36 }
37 }
38
39 module linear_bushing_round(h=11) {
40 difference(){
41 union(){
42 translate([-10.5/2,0,h/2]) cube([10.5,13.8,h], center = true);
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
49 module linear_bushing_bronze(h=11) {
50 difference(){
51 union(){
52 translate([-10.5/2,0,h/2]) cube([10.5,13.8,h], center = true);
53 cylinder(r=10.7, h=h);
54 }
55 translate([0,0,-0.01]) cylinder(r=8.1, h=h+0.02);
56 }
57 }
58
59 // select right bushing and cut it at angle, so it can be printed upside down
60 module linear_bushing_long(h=30){
61 intersection(){
62 if (bushing_type == 0) {
63 linear_bushing_square(h);
64 }
65 if (bushing_type == 1) {
66 linear_bushing_round(h);
67 }
68 if (bushing_type == 2) {
69 linear_bushing_bronze(h);
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 }
76 }
77 }
78
79 module linear_bushing(h=65){
80 translate([-9.5,0,h/2]) cube([2,13.8,h], center=true);
81 linear_bushing_long(h);
82 if (h>30) {
83 translate([0,0,h]) mirror([0,0,1]) linear_bushing_long(30);
84 }
85 }
86
87 //this is for Z axis
88 module bushing_negative(h=65){
89 if (bearing_choice == 1) {
90 if (bushing_type == 0) {
91 translate([0,0,h/2]) cube([9,9,h+0.02], center = true);
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 }
102
103 }
104
105 module firm_foot(){
106 difference(){
107 union() {
108 translate([0,13,0]) cube_fillet([3,18,20], top=[11,0,0,0], center=true);
109 }
110 translate([1.5,14,0]) rotate([0,-90,0]) screw();
111 }
112 }
113
114 module spring_foot(){
115
116 difference(){
117 union() {
118 translate([0,34,0]) cube_fillet([3,14,20], top=[11,0,0,0], center=true);
119 translate([7,28,0]) cube_fillet([16,3,20], center=true);
120 translate([7,14,0]) cube_fillet([16,3,20], center=true);
121 translate([12,21,0]) intersection() {
122 difference(){
123 cylinder(r=8.5,h=20, center=true);
124 cylinder(r=5.5,h=21, center=true);
125 }
126 translate([5,0,0]) cube([10,30,20], center=true);
127 }
128 translate([0,10,0]) cube_fillet([3,10,20], vertical=[0,3,0,0], center=true);
129 }
130 translate([1.5,34,0]) rotate([0,-90,0]) screw();
131 }
132 }
133
134 module y_bearing(float=false){
135 if (bearing_choice == 2) {
136 linear_bearing(lm8uu_length+4);
137 } else {
138 linear_bushing_long(20);
139 }
140 translate([-9,0,10]) {
141 if (float) {
142 spring_foot();
143 mirror([0,1,0]) spring_foot();
144 } else {
145 firm_foot();
146 mirror([0,1,0]) firm_foot();
147 }
148 }
149 }
150
151
152 module linear_bearing(h=65, fillet=false){
153 linear_holder_base(h, fillet);
154 translate([-(10-5.5)/2-lm8uu_radius+2,0,1]) cube([10-5.5,20,2], center = true);
155 translate([-(10-5.5)/2-lm8uu_radius+2,0,h-1]) cube([10-5.5,20,2], center = true);
156 if ( (h-4)/2 > lm8uu_length){
157 translate([-(10-5.5)/2-lm8uu_radius+2,0,h/2]) cube([10-5.5,20, (h-4)-2*lm8uu_length], center = true);
158 }
159 }
160
161 module linear_holder_base(length, fillet=false){
162
163 difference(){
164 union(){
165 //main block
166 translate([-10.5/2,0,length/2]) cube([10.5,lm8uu_diameter+5,length], center = true);
167 translate([0,0,0]) cylinder(h = length, r=lm8uu_radius+2.5, $fn=60);
168 }
169 //main axis
170 translate([0,0,-2]) cylinder(h = length+4, r=(lm8uu_diameter+0.8)/2, $fn=50);
171 // not needed for zip tie
172 //main cut
173 translate([10,0,length/2]) cube([20,14,length+4], center = true);
174 //smooth entry cut
175 translate([12,0,length/2]) rotate([0,0,45]) cube([20,20,length+4], center = true);
176 if (fillet) {
177 translate([0,0,carriage_l/2 ]) cube_negative_fillet([21,lm8uu_diameter+5,carriage_l], vertical=[0,2,2,0]);
178 }
179 }
180 }
181
182
183 %cylinder(r=4, h=90);
184 y_bearing();
185 translate([0,46,0]) y_bearing();
186 translate ([-30,23,0]) mirror([1,0,0]) y_bearing(true);