forked from jcrocholl/kossel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wheeledCarriage.scad
261 lines (231 loc) · 8.12 KB
/
wheeledCarriage.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
include <configuration.scad>;
use <beltCatch.scad>;
separation = 40;
thickness = 6;
horn_thickness = 13;
horn_x = 8;
belt_width = 6;
belt_x = 5.6;
belt_z = 7;
// Parameters for wheeled base
base_thickness = 11;
wheel_radius = 8; // delrin wheels
extrusion_width = 15;
wheel_offset = 18;
m3_head_radius=5.4/2+0.2;
boltSep = 8; // tension bolt seperation half-dist
module carriage() {
// Timing belt (up and down).
translate([-belt_x, 0, belt_z + belt_width/2]) %
cube([1.7, 100, belt_width], center=true);
translate([belt_x, 0, belt_z + belt_width/2]) %
cube([1.7, 100, belt_width], center=true);
difference() {
union() {
// Main body
hull() {
translate([-9.5,-15,-.5]) cube([19.2,30,1]);
translate([-9.5, -8,thickness-1]) cube([19.2,16,1]);
}
// Ball joint mount horns.
for (x = [-1, 1]) {
scale([x, 1, 1]) intersection() {
translate([0, 0, horn_thickness/2])
cube([separation, 18, horn_thickness], center=true);
translate([horn_x, 0, horn_thickness/2]) rotate([0, 90, 0])
cylinder(r1=14, r2=2.5, h=separation/2-horn_x);
}
}
// side support
for (i=[-1,1]) { hull() {
translate([ 9.8*i,-7.5,12]) scale([1,2,1]) rotate([0,0,22.5]) cylinder(h=1,r=2,$fn=8);
translate([ 9.8*i, 7.5,12]) scale([1,2,1]) rotate([0,0,22.5]) cylinder(h=1,r=2,$fn=8);
translate([ 9.6*i,-18,0]) sphere(2,$fn=8);
translate([ 9.6*i, 18,0]) sphere(2,$fn=8);
translate([14*i,0,0]) cylinder(h=1,r=3,$fn=6);
}}
translate([2.1,-8.1,3.5]) rotate([0,0,180]) beltCatch(9);
translate([2.1, 8.1,3.5]) mirror([1,0,0]) beltCatch(9);
// belt catch support/fill
translate([ 3 ,-24,3.5]) cube([4,48,3.5]);
translate([-1.6,-16,3.5]) cube([6,32,3.5]);
}
// Screws for ball joints.
translate([0, 0, horn_thickness/2]) rotate([0, 90, 0])
cylinder(r=m3_wide_radius, h=60, center=true, $fn=12);
// Lock nuts for ball joints.
for (x = [-1, 1]) {
scale([x, 1, 1]) intersection() {
translate([horn_x, 0, horn_thickness/2]) rotate([90, 0, -90])
cylinder(r1=m3_nut_radius-0.2, r2=m3_nut_radius+0.5, h=8,
center=true, $fn=6);
}
}
}
}
module wheelAxleBrace() {
//hull() {
// cylinder(h=1,r=5,$fn=36);
// translate([0,0,base_thickness-3]) cylinder(h=6,r1=5,r2=3.7,$fn=36);
//}
intersection() {
cylinder(h=base_thickness+3,r=5,$fn=36);
translate([0,0,4]) scale([1,1,3]) sphere(5,$fn=36);
}
}
module wheelAxleHole() {
translate([0,0,-30]) cylinder(h=60,r=m3_wide_radius,$fn=12);
translate([0,0,base_thickness-1]) cylinder(h=10,r=m3_head_radius,$fn=30);
}
module mobileWheelMount(dilation) {
bthick = base_thickness + 2*dilation;
difference() {
union() {
cylinder(h=bthick,r=6.5+dilation,$fn=24);
translate([0,0,bthick/2]) rotate([0,90,0]) hull() {
translate([0,-boltSep,0])cylinder(h=10,r=bthick/2,$fn=6);
translate([0, boltSep,0])cylinder(h=10,r=bthick/2,$fn=6);
}
}
if (dilation==0) { // this is the ACTUAL mount, not a socket, add screw holes
translate([0,0,-2.2]) wheelAxleHole();
translate([0,0,bthick/2]) rotate([0,90,0]) {
for (i=[-boltSep,boltSep]) {
translate([0,i,-3]) wheelAxleHole();
}
}
// move to main #translate([-8,-6,-.1]) cube([3.5,12,1.3]);
}
}
}
module cableCatchBrace() {
hull() {
translate([0, 1.5,12.4]) cube([12 ,3 ,1 ]);
//translate([ 2, 5,11]) cube([6.5,1 ,2.5]);
translate([13,-.5, 5 ]) cube([8,6,5]);
}
// flat pad for stop switch
%translate([4,-7,5]) cube([12,7,5]); // flat pad for stop switch
hull() {
translate([7.5 ,4,7.5]) rotate([90,0,0]) cylinder(r1=3,r2=2.1,h=9,$fn=15);
translate([18 ,4,7.5]) rotate([90,0,0]) cylinder(r1=3,r2=2.1,h=9,$fn=15);
// some extra bracing
translate([13,0,3]) rotate([90,0,0]) scale([2,1,1]) cylinder(r1=4,r2=1,h=1,$fn=22);
}
// more bracing for under belt catch
hull() {
translate([-6,-6,14]) sphere(2,$fn=22);
translate([-10,2,14]) cube([11,1,1]);
translate([-8,4, 4]) sphere(1,$fn=18);
translate([-1,1,14]) sphere(2,$fn=22);
}
}
module wheelBase() {
dx = extrusion_width/2+wheel_radius;
supportSpread = 6;
difference() {
union() {
for (i=[-wheel_offset,wheel_offset]) {
hull() { // main wheel axle screw holder pair
translate([-dx, i,0]) wheelAxleBrace();
translate([-dx+10,(i<0)?i+9:i-9,8]) cylinder(r=2,h=1,$fn=6);
}
}
// tension screw housing pair
translate([0,0,base_thickness/2]) rotate([0,90,0]) {
for (i=[-boltSep,boltSep]) {
translate([0,i,-20]) cylinder(r=4.2,h=41,$fn=36);
}
}
// brace section for mobile mount
//%hull() { // brace section for mobile mount
// translate([ dx- 9,-16,.03]) cube([15,32,base_thickness]);
// translate([ dx-20,-12,4]) cube([11,24,base_thickness-4]);
//}
hull() {
translate([dx+6,-16,base_thickness/2+0.01]) scale([1,1,base_thickness/2]) sphere(1,$fn=36);
translate([dx+6, 16,base_thickness/2+0.01]) scale([1,1,base_thickness/2]) sphere(1,$fn=36);
translate([ 6, 16,base_thickness/2+0.01]) scale([1,1,base_thickness/2]) sphere(1,$fn=36);
translate([ 6,-16,base_thickness/2+0.01]) scale([1,1,base_thickness/2]) sphere(1,$fn=36);
translate([-4,0,10]) rotate([90,0,0]) cylinder(r=1.5,h=14,$fn=24,center=true);
}
// brace between main fixed wheel axles
//%translate([-dx-2,-16,0]) cube([ 7,32,base_thickness]);
hull() {
translate([-dx+2, wheel_offset,6]) scale([1.5,.1,3]) sphere(2,$fn=36);
translate([-dx+2,-wheel_offset,6]) scale([1.5,.1,3]) sphere(2,$fn=36);
}
// fill in little middle-underside gap between braces
//translate([-dx+2, -6,base_thickness*0.55]) cube([ 9,16,3]);
// extra bracing from belt catch to mobile mount rails
translate([0,-15,1]) cableCatchBrace();
translate([0, 15,1]) mirror([0,1,0]) cableCatchBrace();
}
// Adjustable tension screw holes
translate([0,0,base_thickness/2]) rotate([0,90,0]) {
for(i=[-boltSep,boltSep]) {
translate([0,i,-24]) {
cylinder(r=m3_wide_radius,h=60,$fn=12);
cylinder(r1=m3_nut_radius+.4, r2=m3_nut_radius-.2, h=7, $fn=6);
}
}
}
}
}
module wheelBaseHoles() {
dx = extrusion_width/2+wheel_radius;
translate([-dx,-wheel_offset,1]) wheelAxleHole();
translate([-dx, wheel_offset,1]) wheelAxleHole();
translate([dx-6,0,0]) mobileWheelMount(.3);
translate([dx-2,0,0]) mobileWheelMount(.3);
}
module earBrace() {
intersection () {
hull() {
rotate([0,55,0]) scale([2,1,1]) cylinder(r=.4,h=7,$nf=12);
linear_extrude(height=0.1)
polygon(points=[[0,0],[7,1.5],[7,-1.5]], paths=[[0,1,2,0]]);
}
translate([-2,-5,0]) cube([10,10,10]);
}
}
module mobileSupport() {
for (i=[26,30]) {
intersection() {
translate([i ,-8.2,-0.4]) rotate([0,5,-90]) scale([0.8,0.6,0.8]) earBrace();
translate([i-2,-17,.3]) cube([4,8,4]);
}
}
}
use <endstop.scad>;
%translate([0,34.4-2,6.5]) rotate([180,0,0]) endstopCarriage();
difference() { union() {
difference() {
union() {
translate([0,-5+5,base_thickness-.4]) mirror([1,0,0]) carriage();
wheelBase();
}
wheelBaseHoles();
}
translate([23+5,0,0.05]) mobileWheelMount(0);
color("Cyan") {
//%hull() {
// for (i=[-wheel_offset,wheel_offset]) {
// translate([-extrusion_width/2-wheel_radius,i,0])
// cylinder(h=0.4,r=6.65,$fn=24);
// }
//}
//%translate([9,-17,0]) cube([23,34,0.4]);
// support material, forced
translate([ 17.3,0,base_thickness+.9]) scale([0.5,0.6,0.7]) earBrace();
translate([-17.3,0,base_thickness+.9]) mirror([1,0,0]) scale([0.5,0.6,0.7]) earBrace();
translate([5,-1.5*0,.1]) {
mobileSupport();
mirror([0,1,0]) mobileSupport();
}
}
}
translate([-8.5, -20,-.1]) cube([17,60,1.3]); // extra clearance for extrusion rail
translate([ 19 ,-7.5,-.2]) cube([ 5,15,1.4]);
//translate([ 8.5, -6,-.2]) #cube([ 5,12,1]);
}