Thomas Buck před 1 rokem
rodič
revize
21f56b80ff
3 změnil soubory, kde provedl 272 přidání a 18 odebrání
  1. 4
    0
      firmware/README.md
  2. 245
    0
      hardware/external/pico_case.scad
  3. 23
    18
      hardware/trackball.scad

+ 4
- 0
firmware/README.md Zobrazit soubor

@@ -33,6 +33,10 @@ This will use the mass storage bootloader to upload a new uf2 image.
33 33
 For old-school debugging a serial port will be presented by the firmware.
34 34
 Open it using eg. `picocom`, or with the included `debug.sh` script.
35 35
 
36
+For dependencies to compile, on Arch install these.
37
+
38
+    sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib picocom cmake
39
+
36 40
 ## Proper Debugging
37 41
 
38 42
 You can also use the SWD interface for proper hardware debugging.

+ 245
- 0
hardware/external/pico_case.scad Zobrazit soubor

@@ -0,0 +1,245 @@
1
+resolution = 20; //[10, 20, 30, 50, 100]
2
+$fn = resolution;
3
+
4
+show_frame = false; // [true, false]
5
+show_pico = true; // [true, false]
6
+show_lid = false; // [true, false]
7
+show_button = false; // [true, false]
8
+
9
+module rounded_plate(w, h, t, d) {
10
+    translate([0, (d/2), 0])
11
+    cube([w, (h-d), t]);
12
+    translate([(d/2), 0, 0])
13
+    cube([(w-d), h, t]);
14
+    translate([(d/2), (d/2), 0])
15
+    cylinder(h=t, d=d);
16
+    translate([w-(d/2), (d/2), 0])
17
+    cylinder(h=t, d=d);
18
+    translate([(d/2), h-(d/2), 0])
19
+    cylinder(h=t, d=d);
20
+    translate([w-(d/2), h-(d/2), 0])
21
+    cylinder(h=t, d=d);
22
+}
23
+
24
+module usb_port() {
25
+    translate([0.3, 0, 0])
26
+    color("grey")
27
+    difference() {
28
+        union() {
29
+            cube([7.4, 6, 2.7]);
30
+            translate([-0.3, 5.4, -0.1])
31
+            cube([8, 0.6, 2.9]);
32
+        }
33
+    }
34
+}
35
+
36
+module switch() {
37
+    color("grey")
38
+    cube([3.5, 4.5, 1]);
39
+    color("white")
40
+    translate([(3.5/2), (4.5/2), 0])
41
+    cylinder(h=1.5, d=3);
42
+}
43
+
44
+p_w = 21;
45
+p_h = 51;
46
+p_t = 1.0;
47
+os = 0.35;
48
+b = 2;
49
+
50
+module pico() {
51
+    translate([((p_w-8)/2), ((p_h+1.3)-6), p_t])
52
+    usb_port();
53
+
54
+    translate([5.25, 36.6, 0.6])
55
+    switch();
56
+
57
+    difference() {
58
+        color("green")
59
+        cube([p_w, p_h, 1]);
60
+
61
+        translate([((p_w/2)-5.7), 2, -0.01])
62
+        cylinder(h=p_t+0.02, d=2.1);
63
+       
64
+        translate([(p_w-((p_w/2)-5.7)), 2, -0.01])
65
+        cylinder(h=p_t+0.02, d=2.1);
66
+
67
+        translate([((p_w/2)-5.7), (p_h-2), -0.01])
68
+        cylinder(h=p_t+0.02, d=2.1);
69
+
70
+        translate([(p_w-((p_w/2)-5.7)), (p_h-2), -0.01])
71
+        cylinder(h=p_t+0.02, d=2.1);
72
+    }
73
+}
74
+
75
+if (show_pico) {
76
+    translate([(os+b), (os+b), 3.4])
77
+    pico();
78
+}
79
+
80
+if (show_frame) {
81
+    union() {
82
+        difference() {
83
+            // Outer frame
84
+            rounded_plate(p_w+(2*(os+b)), p_h+(2*(os+b)), 10, (2*(os+b)));
85
+            
86
+            // Board cut-out
87
+            translate([b, b, -1])
88
+            cube([p_w+(2*os), p_h+(2*os), 12]);
89
+            
90
+            // USB port cut-out
91
+//            translate([b+os+((p_w-10)/2), b+os+((p_h+1)-6), 3.4])
92
+//            cube([10, 8, 4.7]);
93
+            translate([b+os+((p_w-10)/2), b+(2*os)+p_h-1, 8.1])
94
+            rotate([-90, 0, 0])
95
+            rounded_plate(10, 4.7, 4.7, 2);
96
+            
97
+            // Lid release cut-out
98
+            difference() {
99
+                union() {
100
+                    translate([b+os+((p_w-10)/2), -1, 10-1])
101
+                    cube([10, 8, 2]);
102
+                    translate([b+os+((p_w-6)/2), -1, 10-1])
103
+                    rotate([-90, 0, 0])
104
+                    cylinder(h=4, d=2); 
105
+                    translate([b+os+((p_w-6)/2), -1, 10-2])
106
+                    cube([6, 8, 3]);
107
+                    translate([b+os+((p_w+6)/2), -1, 10-1])
108
+                    rotate([-90, 0, 0])
109
+                    cylinder(h=4, d=2); 
110
+                }
111
+                translate([b+os+((p_w+10)/2), -1, 10-1])
112
+                rotate([-90, 0, 0])
113
+                cylinder(h=4, d=2); 
114
+                translate([b+os+((p_w-10)/2), -1, 10-1])
115
+                rotate([-90, 0, 0])
116
+                cylinder(h=4, d=2); 
117
+            }
118
+            
119
+            // Outer frame
120
+            translate([1, 1, 10-1.2])
121
+            rounded_plate(p_w+(2*(os+b))-2, p_h+(2*(os+b))-2, 2, (2*(os+b))-2);
122
+
123
+            // Left top retainer cut-out
124
+            translate([b+os+(p_w/2)-(3.2/2)-7.1, b+p_h+(2*os), 10-3+0.2])
125
+            cube([3.2, 0.7, 1.0]);
126
+
127
+            // Right top retainer cut-out
128
+            translate([b+os+(p_w/2)-(3.2/2)+7.1, b+p_h+(2*os), 10-3+0.2])
129
+            cube([3.2, 0.7, 1.0]);
130
+
131
+            // Left bottom retainer cut-out
132
+            translate([b+os+(p_w/2)-(4/2)-7.1, b+os-0.7, 10-3+0.2])
133
+            cube([4, 0.7, 1.0]);
134
+
135
+            // Right bottom retainer cut-out
136
+            translate([b+os+(p_w/2)-(4/2)+7.1, b+os-0.7, 10-3+0.2])
137
+            cube([4, 0.7, 1.0]);
138
+
139
+            // Left retainer cut-out
140
+            translate([b-0.7, b+os+(p_h/2)-2, 10-3+0.2])
141
+            cube([0.7, 4, 1.0]);
142
+
143
+            // Right retainer cut-out
144
+            translate([b+(2*os)+p_w, b+os+(p_h/2)-2, 10-3+0.2])
145
+            cube([0.7, 4, 1.0]);
146
+        }
147
+        
148
+        // Left support rail
149
+        translate([b+os+(p_w/2)-(3/2)-5.5, 0, 0])
150
+        cube([3, p_h+(2*(os+b)), 3.4]);
151
+       
152
+        // Right support rail
153
+        translate([b+os+(p_w/2)-(3/2)+5.5, 0, 0])
154
+        cube([3, p_h+(2*(os+b)), 3.4]);
155
+
156
+        // Left top retainer
157
+        translate([b+os+(p_w/2)-(2.2/2)-6.1, b+p_h+(2*os)-0.6, 3.4+1+0.5])
158
+        cube([2.2, 0.6, 0.8]);
159
+
160
+        // Right top retainer
161
+        translate([b+os+(p_w/2)-(2.2/2)+6.1, b+p_h+(2*os)-0.6, 3.4+1+0.5])
162
+        cube([2.2, 0.6, 0.8]);
163
+
164
+        // Left bottom retainer
165
+        translate([b+os+(p_w/2)-(3/2)-5.7, b, 3.4+1+0.])
166
+        cube([3, 0.6, 0.8]);
167
+
168
+        // Right bottom retainer
169
+        translate([b+os+(p_w/2)-(3/2)+5.7, b, 3.4+1+0.5])
170
+        cube([3, 0.6, 0.8]);
171
+    }
172
+}
173
+
174
+if (show_lid) {
175
+    difference() {
176
+        union() {
177
+            translate([1+os, 1+os, 10-1.2])
178
+            rounded_plate(p_w+(2*b)-2, p_h+(2*b)-2, 1, (2*b)-2);
179
+            translate([(os+b), (os+b), 10-3])
180
+            rounded_plate(p_w, p_h, 2, (2*b)-3);
181
+            
182
+            // Left top retainer
183
+            translate([b+os+(p_w/2)-(2.2/2)-7.1, b+p_h+os, 10-3+0.4])
184
+            cube([2.2, 0.6, 0.6]);
185
+
186
+            // Right top retainer
187
+            translate([b+os+(p_w/2)-(2.2/2)+7.1, b+p_h+os, 10-3+0.4])
188
+            cube([2.2, 0.6, 0.6]);
189
+
190
+            // Left bottom retainer
191
+            translate([b+os+(p_w/2)-(3/2)-7.1, b+os-0.5, 10-3+0.3])
192
+            cube([3, 0.6, 0.6]);
193
+
194
+            // Right bottom retainer
195
+            translate([b+os+(p_w/2)-(3/2)+7.1, b+os-0.5, 10-3+0.3])
196
+            cube([3, 0.6, 0.6]);
197
+
198
+            // Left retainer
199
+            translate([b+os-0.6, b+os+(p_h/2)-1.5, 10-3+0.3])
200
+            cube([0.6, 3, 0.6]);            
201
+
202
+            // Right retainer
203
+            translate([b+os+p_w, b+os+(p_h/2)-1.5, 10-3+0.3])
204
+            cube([0.6, 3, 0.6]);            
205
+        }
206
+
207
+        // USB port cut-out
208
+        translate([b+os+((p_w-10)/2), b+p_h+(2*os)-2, 10-4.2])
209
+        cube([10, 8, 2.4]);
210
+
211
+        // Lid release cut-out
212
+        translate([b+os+((p_w-10)/2), -1, 10-4.2])
213
+        cube([10, 8, 3]);
214
+        
215
+        // Switch cut-out
216
+        translate([(os+b)+7, (os+b)+38.85, 0])
217
+        cylinder(h=10, d=5);
218
+        
219
+        // Inset
220
+        translate([(os+b)+1, (os+b)+1, 10-4])
221
+        cube([p_w-2, p_h-2, 3]);
222
+    }
223
+    // Switch surround
224
+    translate([(os+b), (os+b)+38.85-6, 10-2])
225
+    cube([p_w, 1, 1]);    
226
+
227
+    translate([(os+b), (os+b)+38.85+5, 10-2])
228
+    cube([p_w, 1, 1]);    
229
+
230
+}
231
+
232
+
233
+if (show_button) {
234
+    color("red")
235
+    union() {
236
+        translate([(os+b)+7, (os+b)+38.85, 7.5])
237
+        cylinder(h=2.3, d=4.4);
238
+        difference() {
239
+            translate([(os+b)+7, (os+b)+38.85, 6.5])
240
+            cylinder(h=2, d=7.6);
241
+            translate([(os+b)+7, (os+b)+38.85, 6.5])
242
+            cylinder(h=1, d=6.6);
243
+        }
244
+    }
245
+}

+ 23
- 18
hardware/trackball.scad Zobrazit soubor

@@ -48,9 +48,9 @@ use <external/pico_case.scad>
48 48
 //roller_mount_tri();
49 49
 
50 50
 //trackball_top();
51
-trackball_bottom();
51
+//trackball_bottom();
52 52
 
53
-//assembly();
53
+assembly();
54 54
 //print();
55 55
 
56 56
 // #######################
@@ -168,8 +168,8 @@ mx_travel = 3.9;
168 168
 
169 169
 base_dia = 62;
170 170
 
171
-m3_thread = 2.7;
172
-m2_thread = 1.8;
171
+grub_screw_dia = 2.8;
172
+grub_channel_dia = 4.0;
173 173
 
174 174
 roller_thread_dia = roller_dia + 5.0;
175 175
 roller_h = roller_dia + 7.0;
@@ -242,6 +242,19 @@ usb_cutout_h_add = 0.6;
242 242
 
243 243
 assembly_dist = 20;
244 244
 
245
+roller_holder_sider_cut = 1.5;
246
+roller_holder_h_compensation = -0.1;
247
+
248
+bottom_add_wall = 4;
249
+
250
+screw_dia = 3.2;
251
+screw_off = base_dia / 2 - 10;
252
+screw_head_d = 6.0;
253
+screw_head_h = 3.5;
254
+screw_angles = [ 15, -15, 180 + 15, 180 - 15 ];
255
+screw_insert_dia = 4.8;
256
+screw_insert_h = 6.0;
257
+
245 258
 function sphere_r_at_h(h, r) = r * sin(acos(h / r));
246 259
 function sphere_angle_at_rh(h, r) = acos(h / r);
247 260
 
@@ -397,17 +410,19 @@ module roller_holder() {
397 410
     difference() {
398 411
         color("magenta")
399 412
         union() {
400
-            // top screw part
401 413
             translate([0, 0,  roller_h-roller_dia/2 + roller_ball_h_off-3])
402 414
             cylinder(d1 = roller_mount_dia, d2=roller_dia+1,  h = 3);
403 415
             
404 416
             cylinder(d = roller_mount_dia, h = roller_h-roller_dia/2 + roller_ball_h_off-3);
405 417
         }
406 418
         
419
+        translate([-roller_mount_dia / 2 - 1, roller_mount_dia / 2 - roller_holder_sider_cut, -1])
420
+        cube([roller_mount_dia + 2, roller_mount_dia / 2 + 1, roller_h + 2]);
421
+        
407 422
         translate([0, 0, -$e])
408 423
         cylinder(d = roller_thread_hole, h = $e+ roller_h - roller_dia / 2 + roller_ball_h_off + roller_ball_hold_off);
409 424
     
410
-        translate([0, 0, roller_h - roller_dia / 2])
425
+        translate([0, 0, roller_h - roller_dia / 2 + roller_holder_h_compensation])
411 426
         sphere(d = roller_dia, $fn = $fn * 2);
412 427
 
413 428
         if (cut_roller_holder)
@@ -471,10 +486,10 @@ module roller_mount_tri_body() {
471 486
     translate([0, 0, -roller_h/2])
472 487
     rotate([0,-90,0])
473 488
     translate([-2, 0, 2]) {
474
-        cylinder(d = m2_thread, h = ball_dia);
489
+        cylinder(d = grub_screw_dia, h = ball_dia);
475 490
         
476 491
         translate([0, 0, roller_mount_dia / 4 + wall])
477
-        cylinder(d = m2_thread + 1, h = ball_dia);
492
+        cylinder(d = grub_channel_dia, h = ball_dia);
478 493
     }
479 494
         
480 495
     // sensor lens
@@ -685,8 +700,6 @@ module trackball_top() {
685 700
     }
686 701
 }
687 702
 
688
-bottom_add_wall = 4;
689
-
690 703
 module trackball_bottom_wrap() {
691 704
     %rotate([0, 180, 0])
692 705
     pico_wrap();
@@ -734,14 +747,6 @@ module usb_cutout() {
734 747
     }
735 748
 }
736 749
 
737
-screw_dia = 3.2;
738
-screw_off = base_dia / 2 - 10;
739
-screw_head_d = 6.0;
740
-screw_head_h = 3.5;
741
-screw_angles = [ 15, -15, 180 + 15, 180 - 15 ];
742
-screw_insert_dia = 4.8;
743
-screw_insert_h = 8.0;
744
-
745 750
 module trackball_bottom() {
746 751
     difference() {
747 752
         trackball_bottom_wrap();

Loading…
Zrušit
Uložit