Преглед на файлове

add roller hull and mount for pressfit of rollerholder

phschoen преди 2 години
родител
ревизия
e872dd5ff2
променени са 1 файла, в които са добавени 96 реда и са изтрити 50 реда
  1. 96
    50
      hardware/trackball.scad

+ 96
- 50
hardware/trackball.scad Целия файл

@@ -36,6 +36,21 @@ use <external/cherry_mx.scad>
36 36
 
37 37
 // https://dkprojects.net/openscad-threads/
38 38
 use <external/threads.scad>
39
+//use <threadlib.scad>
40
+
41
+// ######################
42
+// ## Rendering Select ##
43
+// ######################
44
+
45
+//ball_and_roller();
46
+//pico();
47
+//sensor();
48
+//mx_switch_cutout(wall);
49
+//mx_switch_test();
50
+//roller_mount_test();
51
+roller_mount_tri();
52
+//roller_holder();
53
+//trackball();
39 54
 
40 55
 // #######################
41 56
 // #### Configuration ####
@@ -50,7 +65,9 @@ roller_count = 3;
50 65
 wall = 3.0;
51 66
 
52 67
 cut_roller_holder = false;
53
-draw_threads = false;
68
+draw_threads = true;
69
+$c = 0.1;
70
+$e = 0.01;
54 71
 
55 72
 // #######################
56 73
 // ## Raspberry Pi Pico ##
@@ -132,12 +149,14 @@ mx_travel = 3.9;
132 149
 // ### Implementation ###
133 150
 // ######################
134 151
 
152
+m3_thread=2.7;
153
+m2_thread=1.8;
135 154
 roller_thread_dia = roller_dia + 5.0;
136 155
 roller_thread_pitch = 2.0;
137 156
 roller_h = roller_dia + 7.0;
138
-roller_ball_h_off = 0.6;
157
+roller_ball_h_off = 0.4;
139 158
 roller_ball_hold_off = 0.5;
140
-roller_thread_hole = roller_dia + 0.5;
159
+roller_thread_hole = roller_dia - 1;
141 160
 roller_small_hole = sphere_r_at_h(roller_ball_hold_off, roller_dia / 2) * 2;
142 161
 
143 162
 roller_ridge_h = 1.5;
@@ -243,7 +262,6 @@ module sensor() {
243 262
     translate([0, -sensor_l / 2 + sensor_cut_off_y + sensor_cut_h - sensor_cut_edge_to_pin1 - sensor_pin1_to_optical_center, -sensor_chip_h + 1])
244 263
     cylinder(d = 0.2, h = sensor_ball_to_chip_bottom - 1);
245 264
 }
246
-
247 265
 module ball_and_roller() {
248 266
     color("red")
249 267
     sphere(d = ball_dia, $fn = 200);
@@ -257,32 +275,30 @@ module ball_and_roller() {
257 275
 }
258 276
 
259 277
 module roller_holder() {
260
-    translate([0, 0, -roller_h + roller_dia / 2 - roller_ball_h_off])
278
+
279
+    echo(roller_h);
280
+    translate([0, 0, -roller_h + roller_dia / 2])
261 281
     difference() {
262 282
         color("magenta")
263 283
         union() {
264
-            translate([0, 0, roller_h - roller_ridge_h])
265
-            cylinder(d = roller_mount_dia, h = roller_ridge_h, $fn = 6);
284
+            // top screw part
285
+            translate([0, 0,  roller_h-roller_dia/2 + roller_ball_h_off-3])
286
+                cylinder(d1 = roller_mount_dia, d2=roller_dia+1,  h = 3);
287
+            cylinder(d = roller_mount_dia, h = roller_h-roller_dia/2 + roller_ball_h_off-3);
266 288
             
267
-            translate([0, 0, roller_h - roller_ridge_h])
268
-            scale([1, 1, -1])
269
-            metric_thread(diameter = roller_thread_dia,
270
-                    pitch = roller_thread_pitch,
271
-                    length = roller_h - roller_ridge_h,
272
-                    internal = false, n_starts = 1,
273
-                    taper = 0.1, leadin = 2,
274
-                    test = !draw_threads);
275 289
         }
276 290
         
277
-        translate([0, 0, -1]) {
278
-            cylinder(d = roller_thread_hole, h = roller_h + 1 - roller_dia / 2 + roller_ball_h_off + roller_ball_hold_off);
279
-            
280
-            cylinder(d = roller_small_hole, h = roller_h + 2);
291
+        translate([0, 0, -$e]) {
292
+            cylinder(d = roller_thread_hole, h = $e+ roller_h - roller_dia / 2 + roller_ball_h_off + roller_ball_hold_off);
281 293
         }
294
+    
295
+        translate([0, 0, roller_h - roller_dia / 2])
296
+            sphere(d = roller_dia , $fn=$fn*4 );
297
+
282 298
         
283 299
         if (cut_roller_holder) {
284 300
             translate([-roller_thread_dia / 2 - 1, -roller_thread_dia, -1])
285
-            cube([roller_thread_dia + 2, roller_thread_dia, roller_h + 2]);
301
+                cube([roller_thread_dia + 2, roller_thread_dia, roller_h + 2]);
286 302
         }
287 303
     }
288 304
     
@@ -291,31 +307,73 @@ module roller_holder() {
291 307
 }
292 308
 
293 309
 module roller_mount() {
294
-    difference() {
295
-        color("cyan")
296
-        cylinder(d = roller_mount_dia, h = roller_h - roller_ridge_h);
297
-        
298
-        translate([0, 0, roller_h - roller_ridge_h])
299
-        scale([1, 1, -1])
300
-        metric_thread(diameter = roller_thread_dia,
301
-                pitch = roller_thread_pitch,
302
-                length = roller_h - roller_ridge_h,
303
-                internal = true, n_starts = 1,
304
-                taper = 0, leadin = 2,
305
-                test = !draw_threads);
306
-        
307
-        if (cut_roller_holder) {
308
-            translate([-roller_thread_dia / 2 - 2, -roller_thread_dia, -1])
309
-            cube([roller_thread_dia + 4, roller_thread_dia, roller_h + 2]);
310
+    echo(roller_h);
311
+    translate([0, 0, -1-roller_h + roller_dia / 2]) {
312
+        difference() {
313
+            cylinder(d=roller_mount_dia+wall,h=roller_h/2);
314
+            translate([0,0,1])
315
+            cylinder(d=roller_mount_dia+$c*2,h=roller_h/2+$e);
310 316
         }
311 317
     }
312 318
 }
313 319
 
314 320
 module roller_mount_test() {
321
+    roller_holder();
315 322
     roller_mount();
323
+}
324
+
325
+module roller_mount_tri() {
326
+
327
+difference() {
328
+    union(){
329
+        difference() {
330
+             hull() {
331
+                translate([0, 0, 0])
332
+                for (r = [0 : roller_count - 1])
333
+                rotate([0, 0, roller_mount_angle_off + 360 / roller_count * r])
334
+                translate([sphere_r_at_h(roller_ball_h - ball_dia / 2, ball_dia / 2), 0, -ball_dia / 2 + roller_ball_h])
335
+                rotate([0, 180 + sphere_angle_at_rh(roller_ball_h - ball_dia / 2, ball_dia / 2), 0])
336
+                translate([0, 0, -roller_h])
337
+                cylinder(d=roller_mount_dia+wall+1,h=roller_h+1);
338
+                
339
+                translate([0,0,-ball_dia/2-5])
340
+                cylinder(d=base_dia,h=$e);
341
+            }
342
+            
343
+            for (r = [0 : roller_count - 1])
344
+            rotate([0, 0, roller_mount_angle_off + 360 / roller_count * r])
345
+            translate([sphere_r_at_h(roller_ball_h - ball_dia / 2, ball_dia / 2), 0, -ball_dia / 2 + roller_ball_h])
346
+            rotate([0, 180 + sphere_angle_at_rh(roller_ball_h - ball_dia / 2, ball_dia / 2), 0])
347
+            translate([0, 0, -roller_h])
348
+            cylinder(d=roller_mount_dia+0.2,h=ball_dia/2+roller_h);
349
+            
350
+            sphere($fn=$fn*4, d=ball_dia+$c*2+1);
351
+            
352
+        }
353
+        for (r = [0 : roller_count - 1])
354
+        rotate([0, 0, roller_mount_angle_off + 360 / roller_count * r])
355
+        translate([sphere_r_at_h(roller_ball_h - ball_dia / 2, ball_dia / 2), 0, -ball_dia / 2 + roller_ball_h])
356
+        rotate([0, 180 + sphere_angle_at_rh(roller_ball_h - ball_dia / 2, ball_dia / 2), 0])
357
+        translate([0, 0, 0])
358
+        roller_mount();
359
+    }
360
+        
361
+        translate([0, 0, 0])
362
+        for (r = [0 : roller_count - 1])
363
+        rotate([0, 0, roller_mount_angle_off + 360 / roller_count * r])
364
+        translate([sphere_r_at_h(roller_ball_h - ball_dia / 2, ball_dia / 2), 0, -ball_dia / 2 + roller_ball_h])
365
+        rotate([0, 180 + sphere_angle_at_rh(roller_ball_h - ball_dia / 2, ball_dia / 2), 0])
366
+        translate([0, 0, -roller_h/2])
367
+        rotate([0,-90,0])
368
+        translate([0,0,2])
369
+        {
370
+        cylinder(d=m2_thread,h=ball_dia);
371
+            translate([0,0,roller_mount_dia/4+wall])
372
+        cylinder(d=m2_thread+1,h=ball_dia);
373
+        }
374
+}
316 375
     
317
-    translate([0, 0, roller_h - roller_dia / 2 + roller_ball_h_off])
318
-    roller_holder();
376
+            
319 377
 }
320 378
 
321 379
 base_dia = pico_l + 9;
@@ -344,16 +402,4 @@ module trackball() {
344 402
     cylinder(d = base_dia, h = wall);
345 403
 }
346 404
 
347
-// ######################
348
-// ## Rendering Select ##
349
-// ######################
350
-
351
-//ball_and_roller();
352
-//pico();
353
-//sensor();
354
-//mx_switch_cutout(wall);
355
-//mx_switch_test();
356
-//roller_mount_test();
357 405
 
358
-//roller_holder();
359
-trackball();

Loading…
Отказ
Запис