Browse Source

3d model changes. add uv led. thread adapter as separate part. added text. small fixes.

Thomas Buck 1 year ago
parent
commit
bb49d04de8
1 changed files with 176 additions and 40 deletions
  1. 176
    40
      hardware/openchrono.scad

+ 176
- 40
hardware/openchrono.scad View File

@@ -6,16 +6,16 @@ body_gap = 0.1;
6 6
 
7 7
 body_screw_off = 10;
8 8
 body_screw_pos = 20;
9
-body_screw_dia = 3.2;
10
-body_screw_head = 5.8;
9
+body_screw_dia = 3.3;
10
+body_screw_head = 6.0;
11 11
 body_screw_depth = 3.2;
12
-body_screw_insert_dia = 5.0;
13
-body_screw_insert_height = 15.0;
12
+body_screw_insert_dia = 4.8;
13
+body_screw_insert_height = 12.0;
14 14
 
15 15
 lcd_pcb_w = 29.0;
16 16
 lcd_pcb_h = 29.0;
17 17
 lcd_pcb_d = 5.2;
18
-lcd_hole_dia = 2.0;
18
+lcd_hole_dia = 1.9;
19 19
 lcd_hole_w = 6.0;
20 20
 lcd_hole_h = 2.5;
21 21
 lcd_off = 10.0;
@@ -51,7 +51,7 @@ switch_h = 6.5;
51 51
 switch_d = 10.0;
52 52
 switch_plate_w = 20.5;
53 53
 switch_plate_h = switch_h;
54
-switch_dia = 2.6;
54
+switch_dia = 2.4;
55 55
 switch_screw_l = 10.0;
56 56
 switch_screw_d = 15.0;
57 57
 switch_off = 15;
@@ -95,8 +95,45 @@ thread_profile_mac11 = [
95 95
 // debug / testing
96 96
 thread_profile_none = [ false, 0, 0, 0, 0 ];
97 97
 
98
-thread_profile = thread_profile_m14;
99
-thread_base = 1.0;
98
+thread_profiles = [
99
+    thread_profile_1911,
100
+    thread_profile_m14,
101
+    thread_profile_mac11
102
+];
103
+
104
+thread_base = 5.0;
105
+
106
+test_bat_w = 47;
107
+test_bat_h = 59;
108
+test_bat_d = 15;
109
+test_bat_dia = 2.9;
110
+test_bat_off = 30.5;
111
+test_bat_l = 8;
112
+
113
+thread_adapter_screw_inset = 5;
114
+thread_adapter_in_body = 5;
115
+thread_adapter_h = body_screw_insert_height - thread_adapter_in_body;
116
+
117
+enable_gap_support = true;
118
+
119
+text1 = [
120
+    "OpenChrono",
121
+    "Liberation Sans:style=Bold",
122
+    12.0,
123
+    2.0,
124
+    55
125
+];
126
+text2 = [
127
+    "by xythobuz.de",
128
+    "Liberation Sans:style=Bold",
129
+    9.0,
130
+    2.0,
131
+    -60
132
+];
133
+
134
+texts_left = [ text1, text2 ];
135
+
136
+include_uv_leds = true;
100 137
 
101 138
 // how deep things on the outside have to be set in
102 139
 function circle_offset_deviation(off, dia) =
@@ -109,7 +146,12 @@ module lcd_cutout() {
109 146
         for (x = [0, lcd_pcb_w - lcd_hole_w])
110 147
         for (y = [0, lcd_pcb_h - lcd_hole_w])
111 148
         translate([x, y, -1])
112
-            cube([lcd_hole_w, lcd_hole_w, lcd_hole_h + 1]);
149
+        cube([lcd_hole_w, lcd_hole_w, lcd_hole_h + 1]);
150
+        
151
+        // TODO hacky
152
+        if (enable_gap_support)
153
+        translate([0, (lcd_pcb_w - 1) / 2, 0])
154
+        cube([lcd_pcb_w, 1, 9]);
113 155
     }
114 156
             
115 157
     for (x = [0, lcd_hole_off_x])
@@ -180,10 +222,41 @@ module thread(profile, thread_draw) {
180 222
     }
181 223
 }
182 224
 
225
+module thread_profile_adapter(profile, draw_profile) {
226
+    difference() {
227
+        thread(profile, draw_profile);
228
+        
229
+        for (r = [45, -45])
230
+        for (r2 = [0, 180])
231
+        rotate([0, 0, r + r2])
232
+        translate([0, (outer_dia - body_screw_insert_dia) / 2 - thread_adapter_screw_inset, -1])
233
+        cylinder(d = body_screw_dia, h = 100);
234
+    }
235
+}
236
+
237
+module thread_adapter() {
238
+    difference() {
239
+        cylinder(d = outer_dia, h = thread_adapter_h);
240
+        
241
+        translate([0, 0, -1])
242
+        cylinder(d = inner_dia, h = thread_adapter_h + 2);
243
+        
244
+        for (r = [45, -45])
245
+        rotate([0, 0, r])
246
+        translate([0, (outer_dia - body_screw_insert_dia) / 2 - thread_adapter_screw_inset, -thread_adapter_in_body])
247
+        cylinder(d = body_screw_insert_dia, h = body_screw_insert_height + 1);
248
+    }
249
+}
250
+
183 251
 module half_body(right_side) {
184 252
     difference() {
185
-        // body
186
-        cylinder(d = outer_dia, h = height);
253
+        union() {
254
+            // body
255
+            cylinder(d = outer_dia, h = height);
256
+            
257
+            translate([0, 0, height])
258
+            thread_adapter();
259
+        }
187 260
         
188 261
         // inner tube
189 262
         translate([0, 0, -1])
@@ -205,6 +278,17 @@ module half_body(right_side) {
205 278
             cylinder(d = led_ridge_dia, h = led_ridge_h);
206 279
         }
207 280
         
281
+        if (include_uv_leds)
282
+        for (x = [1, -1])
283
+        scale([x, 1, 1])
284
+        translate([inner_dia / 2 - 1, 0, led_off / 2])
285
+        rotate([0, 90, 0]) {
286
+            cylinder(d = led_dia, h = led_l + led_ridge_h + 1);
287
+            
288
+            translate([0, 0, led_l + 1])
289
+            cylinder(d = led_ridge_dia, h = led_ridge_h);
290
+        }
291
+        
208 292
         // TODO hacky sensor cable, arduino side
209 293
         for (z = [1, -1])
210 294
         translate([0, 0, height / 2])
@@ -233,6 +317,13 @@ module half_body(right_side) {
233 317
             
234 318
             translate([-inner_dia / 2 - led_l - led_ridge_h - 5, 0, -height / 2 + led_off - 1])
235 319
             cube([led_ridge_dia + 2, led_ridge_dia - 2, led_ridge_h]);
320
+            
321
+            if (include_uv_leds)
322
+            if (z < 0)
323
+            for (x = [0, 5])
324
+            translate([-inner_dia / 2 - led_l - led_ridge_h - x, 0, led_off / 2])
325
+            rotate([0, 90, 0])
326
+            cylinder(d = led_ridge_dia, h = led_ridge_h);
236 327
         }
237 328
     }
238 329
 }
@@ -254,14 +345,9 @@ module screw_holes(with_head) {
254 345
     }
255 346
 }
256 347
 
257
-module left_half(thread_draw) {
348
+module left_half() {
258 349
     difference() {
259
-        union() {
260
-            half_body(false);
261
-            
262
-            translate([0, 0, height])
263
-            thread(thread_profile, thread_draw);
264
-        }
350
+        half_body(false);
265 351
         
266 352
         translate([-outer_dia / 2 - 1, -outer_dia / 2 - 1 + body_gap / 2, height - 1])
267 353
         cube([outer_dia + 2, outer_dia / 2 + 1, 50]);
@@ -322,18 +408,19 @@ module left_half(thread_draw) {
322 408
                 cylinder(d = led_ridge_dia, h = led_ridge_h);
323 409
             }
324 410
         }
411
+        
412
+        for (t = texts_left)
413
+        rotate([0, 0, -t[4]])
414
+        translate([0, outer_dia / 2 - t[3], (height + thread_adapter_h) / 2])
415
+        rotate([0, -90, -90])
416
+        linear_extrude(height = t[3] + 1)
417
+        text(t[0], size = t[2], font = t[1], halign = "center", valign="center");
325 418
     }
326 419
 }
327 420
 
328
-module right_half(thread_draw) {
421
+module right_half() {
329 422
     difference() {
330
-        union() {
331
-            half_body(true);
332
-            
333
-            translate([0, 0, height])
334
-            rotate([0, 0, 180])
335
-            thread(thread_profile, thread_draw);
336
-        }
423
+        half_body(true);
337 424
         
338 425
         translate([-outer_dia / 2 - 1, -outer_dia / 2 - 1 + body_gap / 2, height - 1])
339 426
         cube([outer_dia + 2, outer_dia / 2 + 1, 50]);
@@ -343,6 +430,12 @@ module right_half(thread_draw) {
343 430
         translate([outer_dia / 2 - arduino_w -((outer_dia / 2) - (inner_dia / 2) - arduino_w) / 2, arduino_d / 2, -arduino_h / 2 + height / 2])
344 431
         rotate([90, 0, 0])
345 432
         arduino_cutout();
433
+    }
434
+}
435
+
436
+module right_half_aaa_bat() {
437
+    difference() {
438
+        right_half();
346 439
         
347 440
         for (a = [0, bat_angle, -bat_angle])
348 441
         rotate([0, 0, a])
@@ -351,40 +444,83 @@ module right_half(thread_draw) {
351 444
     }
352 445
 }
353 446
 
354
-module assembly_closed(thread_draw) {
355
-    right_half(thread_draw);
447
+module right_half_testing() {
448
+    difference() {
449
+        right_half();
450
+        
451
+        difference() {
452
+            translate([-test_bat_w / 2, outer_dia / 2 - circle_offset_deviation(test_bat_w / 2, outer_dia), (height - test_bat_h) / 2])
453
+            cube([test_bat_w, test_bat_d + 1, test_bat_h]);
454
+            
455
+            // TODO hacky
456
+            if (enable_gap_support)
457
+            translate([-0.5, 14, 20])
458
+            cube([1, 13, test_bat_h + 2]);
459
+        }
460
+        
461
+        for (x = [test_bat_off / 2, -test_bat_off / 2])
462
+        translate([x, outer_dia / 2 - circle_offset_deviation(test_bat_w / 2, outer_dia) - test_bat_l, height / 2])
463
+        rotate([-90, 0, 0])
464
+        cylinder(d = test_bat_dia, h = outer_dia / 2);
465
+        
466
+        // TODO hacky power cable
467
+        translate([15, -10, 60])
468
+        rotate([-90, 0, 12])
469
+        cylinder(d = 6.0, h = outer_dia);
470
+    }
471
+}
472
+
473
+module assembly_closed() {
474
+    //right_half_aaa_bat();
475
+    right_half_testing();
356 476
     
357 477
     rotate([0, 0, 180])
358
-    left_half(thread_draw);
478
+    left_half();
479
+    
480
+    translate([0, 0, height + thread_adapter_h + 0.5])
481
+    thread_profile_adapter(thread_profiles[0], false);
359 482
 }
360 483
 
361
-module assembly_opened(angle, thread_draw) {
484
+module assembly_opened(angle) {
362 485
     translate([-outer_dia / 2, 0, 0]) {
486
+        //rotate([0, 0, angle / 2])
487
+        //translate([outer_dia / 2, 0, 0])
488
+        //right_half_aaa_bat();
489
+        
363 490
         rotate([0, 0, angle / 2])
364 491
         translate([outer_dia / 2, 0, 0])
365
-        right_half(thread_draw);
492
+        right_half_testing();
366 493
         
367 494
         rotate([0, 0, -angle / 2])
368 495
         translate([outer_dia / 2, 0, 0])
369 496
         rotate([0, 0, 180])
370
-        left_half(thread_draw);
497
+        left_half();
371 498
     }
372 499
 }
373 500
 
374
-module print() {
501
+module print(all_thread_adapters) {
375 502
     translate([outer_dia / 2 + 5, 0, 0])
376
-    left_half(true);
503
+    left_half();
504
+    
505
+    //translate([-outer_dia / 2 - 5, 0, 0])
506
+    //right_half_aaa_bat(true);
377 507
     
378 508
     translate([-outer_dia / 2 - 5, 0, 0])
379
-    right_half(true);
509
+    right_half_testing();
510
+
511
+    if (all_thread_adapters)
512
+    for (p = [0 : len(thread_profiles) - 1])
513
+    translate([(p - floor(len(thread_profiles) / 2)) * (outer_dia + 5), -outer_dia / 2 - 5, 0])
514
+    thread_profile_adapter(thread_profiles[p], true);
380 515
 }
381 516
 
382 517
 //lcd_cutout();
383 518
 
384
-//left_half(false);
385
-//right_half(false);
519
+//left_half();
520
+//right_half();
386 521
 
387
-//assembly_closed(false);
388
-//assembly_opened(90, false);
522
+//assembly_closed();
523
+//assembly_opened(90);
389 524
 
390
-print();
525
+//print(true);
526
+print(false);

Loading…
Cancel
Save