Browse Source

add roller hull and mount for pressfit of rollerholder

phschoen 2 years ago
parent
commit
e872dd5ff2
1 changed files with 96 additions and 50 deletions
  1. 96
    50
      hardware/trackball.scad

+ 96
- 50
hardware/trackball.scad View File

36
 
36
 
37
 // https://dkprojects.net/openscad-threads/
37
 // https://dkprojects.net/openscad-threads/
38
 use <external/threads.scad>
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
 // #### Configuration ####
56
 // #### Configuration ####
50
 wall = 3.0;
65
 wall = 3.0;
51
 
66
 
52
 cut_roller_holder = false;
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
 // ## Raspberry Pi Pico ##
73
 // ## Raspberry Pi Pico ##
132
 // ### Implementation ###
149
 // ### Implementation ###
133
 // ######################
150
 // ######################
134
 
151
 
152
+m3_thread=2.7;
153
+m2_thread=1.8;
135
 roller_thread_dia = roller_dia + 5.0;
154
 roller_thread_dia = roller_dia + 5.0;
136
 roller_thread_pitch = 2.0;
155
 roller_thread_pitch = 2.0;
137
 roller_h = roller_dia + 7.0;
156
 roller_h = roller_dia + 7.0;
138
-roller_ball_h_off = 0.6;
157
+roller_ball_h_off = 0.4;
139
 roller_ball_hold_off = 0.5;
158
 roller_ball_hold_off = 0.5;
140
-roller_thread_hole = roller_dia + 0.5;
159
+roller_thread_hole = roller_dia - 1;
141
 roller_small_hole = sphere_r_at_h(roller_ball_hold_off, roller_dia / 2) * 2;
160
 roller_small_hole = sphere_r_at_h(roller_ball_hold_off, roller_dia / 2) * 2;
142
 
161
 
143
 roller_ridge_h = 1.5;
162
 roller_ridge_h = 1.5;
243
     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])
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
     cylinder(d = 0.2, h = sensor_ball_to_chip_bottom - 1);
263
     cylinder(d = 0.2, h = sensor_ball_to_chip_bottom - 1);
245
 }
264
 }
246
-
247
 module ball_and_roller() {
265
 module ball_and_roller() {
248
     color("red")
266
     color("red")
249
     sphere(d = ball_dia, $fn = 200);
267
     sphere(d = ball_dia, $fn = 200);
257
 }
275
 }
258
 
276
 
259
 module roller_holder() {
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
     difference() {
281
     difference() {
262
         color("magenta")
282
         color("magenta")
263
         union() {
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
         if (cut_roller_holder) {
299
         if (cut_roller_holder) {
284
             translate([-roller_thread_dia / 2 - 1, -roller_thread_dia, -1])
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
 }
307
 }
292
 
308
 
293
 module roller_mount() {
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
 module roller_mount_test() {
320
 module roller_mount_test() {
321
+    roller_holder();
315
     roller_mount();
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
 base_dia = pico_l + 9;
379
 base_dia = pico_l + 9;
344
     cylinder(d = base_dia, h = wall);
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…
Cancel
Save