-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgroovemount-old.scad
311 lines (250 loc) · 7.32 KB
/
groovemount-old.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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
include <MCAD/units/metric.scad>
use <MCAD/fasteners/nuts_and_bolts.scad>
use <MCAD/fasteners/threads.scad>
use <MCAD/shapes/cylinder.scad>
use <MCAD/shapes/2Dshapes.scad>
use <MCAD/shapes/polyhole.scad>
use <MCAD/array/along_curve.scad>
use <utils.scad>
effector_od = 60;
effector_id = 40;
effector_h = 8;
effector_screwsize = M4;
effector_screwhole_d = effector_screwsize + 0.3;
effector_screw_orbit_r = 25;
arm_thickness = 8;
arm_width = 15;
jhead_lip_h = 3.7;
jhead_lip_d = 16;
jhead_groove_d = 12;
jhead_groove_h = 5.4;
bowden_tube_d = 4.5;
use_ptc = false;
// ptc settings
bowden_connector_d = 12;
// non-ptc settings
cap_nut_size = M4;
cap_thread_length = 10;
cap_thread_d = 16;
cap_thread_pitch = 2;
cap_thread_clearance = 0.9;
cap_supported_length = 5;
// don't modify
cap_thread_minor_d = cap_thread_d - cos (30) * cap_thread_pitch * 10 / 8;
cap_length = cap_thread_length + cap_supported_length - cap_thread_pitch;
mounting_plate_d = jhead_lip_d + 19;
mounting_plate_h = 5;
mounting_plate_screwsize = M3;
mounting_plate_screwhole_d = mounting_plate_screwsize + 0.3;
mounting_plate_screw_orbit_r = (mounting_plate_d + jhead_lip_d) / 4;
nut_tolerance = 0.01;
$fs = 0.4;
$fa = 1;
module round (r)
{
offset (r = r)
offset (r = -r)
children ();
}
module slot_basic_shape ()
{
linear_extrude (height = arm_thickness)
round (2)
round (-5)
union () {
circle (d = mounting_plate_d);
for (a = [0:120:359])
rotate (a, Z)
intersection () {
circle (d = effector_od);
translate ([0, -arm_width / 2])
square ([effector_od, arm_width]);
}
}
}
module place_effector_screwholes ()
{
mcad_rotate_multiply (3, angle = 120)
translate ([effector_screw_orbit_r, 0])
children ();
}
module effector_screwholes ()
{
place_effector_screwholes ()
mcad_polyhole (d = effector_screwhole_d, h = 1000, center = true);
}
module effector_nutholes ()
{
translate ([0, 0, -epsilon])
place_effector_screwholes ()
rotate (90, Z)
mcad_nut_hole (size = effector_screwsize, tolerance = nut_tolerance);
}
module place_mounting_plate_screwholes ()
{
mcad_rotate_multiply (3, angle = 120)
translate ([mounting_plate_screw_orbit_r, 0])
children ();
}
module mounting_plate_screwholes ()
{
place_mounting_plate_screwholes ()
mcad_polyhole (d = mounting_plate_screwhole_d, h = 1000, center = true);
}
module mounting_plate_nutholes ()
{
translate ([0, 0, -epsilon])
place_mounting_plate_screwholes ()
mcad_nut_hole (size = mounting_plate_screwsize, tolerance = nut_tolerance);
}
module stretch (length = 100, axis = X)
{
hull ()
mcad_linear_multiply (2, separation = length, axis = axis)
children ();
}
module jhead_groove_slot ()
{
rotate (360 / 3 / 2, Z) {
// groove inner diameter
stretch ()
mcad_polyhole (d = jhead_groove_d, h = 1000, center = true);
// secondary lip
translate ([0, 0, arm_thickness - jhead_groove_h])
stretch ()
mirror (Z)
mcad_polyhole (d = jhead_lip_d, h = 1000);
}
}
module slot_piece ()
{
difference () {
slot_basic_shape ();
jhead_groove_slot ();
effector_screwholes ();
effector_nutholes ();
mounting_plate_screwholes ();
mounting_plate_nutholes ();
}
}
module basic_top_plate ()
{
difference () {
cylinder (d = mounting_plate_d, h = mounting_plate_h);
// reduce this size by 0.1 for interference fit
translate ([0, 0, -epsilon - 0.1])
mcad_polyhole (d = jhead_lip_d, h = jhead_lip_h + epsilon);
mounting_plate_screwholes ();
}
}
module top_plate_ptc ()
{
difference () {
basic_top_plate ();
// hole for ptc
translate ([0, 0, -epsilon])
mcad_polyhole (d = bowden_connector_d,
h = mounting_plate_h + epsilon * 2);
}
}
module top_plate_nut ()
{
difference () {
union () {
basic_top_plate ();
relief = 1;
translate ([0, 0, mounting_plate_h])
difference () {
metric_thread (
diameter = cap_thread_d,
pitch = cap_thread_pitch,
length = cap_thread_length
);
// chamfered entrance
chamfer_depth = cap_thread_pitch;
translate ([0, 0, cap_thread_length - chamfer_depth])
difference () {
ccube ([cap_thread_d, cap_thread_d, chamfer_depth * 2],
center = X + Y);
cylinder (d1 = cap_thread_d,
d2 = cap_thread_d - chamfer_depth * 2,
h = chamfer_depth);
}
}
// filleted base of thread
translate ([0, 0, mounting_plate_h])
filleted_cylinder (d = cap_thread_minor_d, h = relief,
fillet_r = cap_thread_pitch);
}
// bowden tube hole
translate ([0, 0, -epsilon])
mcad_polyhole (d = bowden_tube_d,
h = mounting_plate_h + cap_thread_length + epsilon * 2);
// m4 nut hole (allow to freely rotate so we can fine-tune tube level)
translate ([0, 0, mounting_plate_h + cap_thread_length + 0.6])
mirror (Z)
//mcad_nut_hole (size = cap_nut_size, tolerance = nut_tolerance);
mcad_polyhole (
d = mcad_metric_nut_ac_width (cap_nut_size) + nut_tolerance * 2,
h = mcad_metric_nut_thickness (cap_nut_size)
);
}
}
module top_plate ()
{
if (use_ptc)
top_plate_ptc ();
else
top_plate_nut ();
}
module top_plate_cap ()
{
wall_thickness = 2;
difference () {
union () {
od = cap_thread_d + wall_thickness * 2;
cylinder (d = od, h = cap_length);
linear_extrude (height = cap_supported_length)
round (r = 2)
difference () {
od2 = od + 10;
circumference = od2 * PI;
notch_d = 5;
notches = round (circumference / notch_d / 2);
circle (d = od2);
for (a = [0:360/notches:359.99])
rotate (a, Z)
translate ([od2 / 2 + notch_d * .2, 0])
circle (d = notch_d);
}
// fillets
translate ([0, 0, cap_supported_length - epsilon])
filleted_cylinder (d = od, h = 2, fillet_r = 2);
}
// thread
translate ([0, 0, cap_supported_length])
metric_thread (diameter = cap_thread_d + cap_thread_clearance,
pitch = cap_thread_pitch,
length = cap_thread_length + epsilon,
internal = true);
// chamfered entrance
chamfer_depth = cap_thread_pitch;
translate ([0, 0, cap_length + epsilon])
mirror (Z)
cylinder (d1 = cap_thread_minor_d + chamfer_depth * 2,
d2 = cap_thread_minor_d,
h = chamfer_depth);
// hole for bowden tubep
translate ([0, 0, -epsilon])
mcad_polyhole (d = bowden_tube_d, h = 1000);
}
}
translate ([0, 0, arm_thickness]) {
top_plate ();
%translate (
[0, 0, mounting_plate_h + cap_thread_length + cap_supported_length])
mirror (Z)
top_plate_cap ();
}
slot_piece ();
epsilon = 0.015;