|
@@ -0,0 +1,413 @@
|
|
1
|
+// 0=none, 1=usb, 2=bluetooth
|
|
2
|
+add_optional_module = 2;
|
|
3
|
+
|
|
4
|
+face_width = 130;
|
|
5
|
+face_height = 150;
|
|
6
|
+face_wall = 6.0;
|
|
7
|
+
|
|
8
|
+border_bottom = 3.55;
|
|
9
|
+border_top = 3.65;
|
|
10
|
+
|
|
11
|
+inner_width = 126.65;
|
|
12
|
+inner_height = 148;
|
|
13
|
+inner_depth = 10;
|
|
14
|
+
|
|
15
|
+top_wall_height = 15.0;
|
|
16
|
+top_support_height = 12;
|
|
17
|
+top_support_depth = 1.9;
|
|
18
|
+bottom_wall_width = 119.5;
|
|
19
|
+bottom_wall_height = 6.75;
|
|
20
|
+
|
|
21
|
+cutout_width = 118.4;
|
|
22
|
+cutout_height = 145;
|
|
23
|
+cutout_bottom = 1.7;
|
|
24
|
+bottom_cut_width = cutout_width + 4;
|
|
25
|
+bottom_cut_height = 3;
|
|
26
|
+bottom_cut_depth = inner_depth;
|
|
27
|
+
|
|
28
|
+connector_dist_x = 0;//12;
|
|
29
|
+connector_dist_y = 17;//30;//15;
|
|
30
|
+connector_off_x = 25; //18;
|
|
31
|
+connector_off_y = 58;//65; //105;
|
|
32
|
+connector_dia_outer = 14.0;
|
|
33
|
+connector_len_top = 21.7;
|
|
34
|
+connector_dia_post = 4.3;
|
|
35
|
+connector_len_post = 15.5;
|
|
36
|
+connector_ring_dia = 7.5;
|
|
37
|
+conenctor_ring_tab_width = 2.0;
|
|
38
|
+connector_ring_tab_len = 1.0;
|
|
39
|
+connector_ring_height = 2.7 + 0.3;
|
|
40
|
+
|
|
41
|
+screw_a_head_height = 2.0;
|
|
42
|
+screw_a_head_d1 = 6.2;
|
|
43
|
+screw_a_head_d2 = 3.5;
|
|
44
|
+screw_a_off_z = top_wall_height + top_support_height / 2;
|
|
45
|
+screw_a_dist = 22.0 - screw_a_head_d2;
|
|
46
|
+
|
|
47
|
+screw_b_head_height = 2.0;
|
|
48
|
+screw_b_head_d1 = 7.5;
|
|
49
|
+screw_b_head_d2 = 5.0;
|
|
50
|
+screw_b_off_z = 9.8 + screw_b_head_d2 / 2;
|
|
51
|
+screw_b_dist = 82.8 - screw_b_head_d2;
|
|
52
|
+
|
|
53
|
+open_size_w = 77;//71;
|
|
54
|
+open_size_h = 40;//39;
|
|
55
|
+open_off_x = 46;
|
|
56
|
+open_off_y = 6;
|
|
57
|
+disp_w = 79;
|
|
58
|
+disp_h = 43;
|
|
59
|
+disp_d = 38;
|
|
60
|
+
|
|
61
|
+pcb_width = 96;//93;//72;
|
|
62
|
+pcb_length = 72;//93;
|
|
63
|
+pcb_height = 42;
|
|
64
|
+pcb_off_x = 85;
|
|
65
|
+pcb_off_y = 6;
|
|
66
|
+pcb_screw_dist_length = 64;//86;
|
|
67
|
+pcb_screw_dist_width = 86;//64;
|
|
68
|
+pcb_hole_dia = 3.2;
|
|
69
|
+
|
|
70
|
+button_width = 10.0;
|
|
71
|
+button_length = 30;
|
|
72
|
+button_post_height = 11.15;
|
|
73
|
+button_post_dia = 7.0;
|
|
74
|
+button_post_hole = 2.4;
|
|
75
|
+button_pcb_width = 42.2;
|
|
76
|
+button_pcb_height = 31.8;
|
|
77
|
+button_pcb_depth = 1.5;
|
|
78
|
+button_pcb_hole_dist_x = 32;
|
|
79
|
+button_pcb_hole_dist_y = 12;
|
|
80
|
+button_off_x = 6.3;
|
|
81
|
+button_off_y = 15;
|
|
82
|
+button_off_top = 14.8 + 14.15 / 2;
|
|
83
|
+
|
|
84
|
+nut_width = 20;
|
|
85
|
+nut_height = 17;
|
|
86
|
+nut_depth = 1.0;
|
|
87
|
+nut_gap = 0.5;
|
|
88
|
+nut_holder_width = (inner_width - cutout_width) / 2;
|
|
89
|
+nut_holder_height = 22.75;
|
|
90
|
+nut_holder_depth = 10 + border_bottom + inner_depth;
|
|
91
|
+nut_holder_off_y = 53.4;
|
|
92
|
+
|
|
93
|
+bt_width = 20.5;
|
|
94
|
+bt_height = 40.6;
|
|
95
|
+bt_depth = 1.0;
|
|
96
|
+bt_hole_dia = 3.2;
|
|
97
|
+bt_hole_dist_x = 1.4 + bt_hole_dia / 2;
|
|
98
|
+bt_hole_dist_y = 1.7 + bt_hole_dia / 2;
|
|
99
|
+bt_off_x = 8;
|
|
100
|
+bt_off_y = 105;
|
|
101
|
+bt_post_height = 2;
|
|
102
|
+bt_post_dia = 6;
|
|
103
|
+
|
|
104
|
+text_depth = 2;
|
|
105
|
+text_type = "RD DPH5005";
|
|
106
|
+text_type_font = "Liberation Sans:style=Bold";
|
|
107
|
+text_type_size = 10;
|
|
108
|
+text_type_off_x = 8;
|
|
109
|
+text_type_off_y = 75;//13;
|
|
110
|
+
|
|
111
|
+text_author = "xythobuz 2021";
|
|
112
|
+text_author_font = "Liberation Sans:style=Bold";
|
|
113
|
+text_author_size = 8;
|
|
114
|
+text_author_off_x = 25;
|
|
115
|
+text_author_off_y = 6;
|
|
116
|
+
|
|
117
|
+text_max = [ "0-50 Volt", "0-5 Amps", "0-150 Watt" ];
|
|
118
|
+text_max_font = "Liberation Sans:style=Bold";
|
|
119
|
+text_max_size = 10;
|
|
120
|
+text_max_line_space = 3;
|
|
121
|
+text_max_off_x = 15;
|
|
122
|
+text_max_off_y = 97;
|
|
123
|
+
|
|
124
|
+$fn = 42;
|
|
125
|
+
|
|
126
|
+module screw(type, length = 30) {
|
|
127
|
+ if (type == 0) {
|
|
128
|
+ translate([0, 0, -0.01])
|
|
129
|
+ cylinder(d2 = screw_a_head_d1, d1 = screw_a_head_d2, h = screw_a_head_height);
|
|
130
|
+
|
|
131
|
+ translate([0, 0, -length])
|
|
132
|
+ cylinder(d = screw_a_head_d2, h = length);
|
|
133
|
+ } else {
|
|
134
|
+ translate([0, 0, -0.01])
|
|
135
|
+ cylinder(d2 = screw_b_head_d1, d1 = screw_b_head_d2, h = screw_b_head_height);
|
|
136
|
+
|
|
137
|
+ translate([0, 0, -length])
|
|
138
|
+ cylinder(d = screw_b_head_d2, h = length);
|
|
139
|
+ }
|
|
140
|
+}
|
|
141
|
+
|
|
142
|
+module text_cutouts() {
|
|
143
|
+ translate([face_width - text_type_off_x, face_height - text_type_off_y, text_depth])
|
|
144
|
+ rotate([0, 180, 0])
|
|
145
|
+ linear_extrude(text_depth + 1)
|
|
146
|
+ text(text_type, size = text_type_size, font = text_type_font);
|
|
147
|
+
|
|
148
|
+ translate([face_width - text_author_off_x, text_author_off_y, text_depth])
|
|
149
|
+ rotate([0, 180, 0])
|
|
150
|
+ linear_extrude(text_depth + 1)
|
|
151
|
+ text(text_author, size = text_author_size, font = text_author_font);
|
|
152
|
+
|
|
153
|
+ for (i = [0 : len(text_max) - 1])
|
|
154
|
+ translate([face_width - text_max_off_x, face_height - text_max_off_y - i * (text_max_size + text_max_line_space), text_depth])
|
|
155
|
+ rotate([0, 180, 0])
|
|
156
|
+ linear_extrude(text_depth + 1)
|
|
157
|
+ text(text_max[i], size = text_max_size, font = text_max_font);
|
|
158
|
+}
|
|
159
|
+
|
|
160
|
+module nut_holder(only_cutout = 0) {
|
|
161
|
+ difference() {
|
|
162
|
+ if (!only_cutout)
|
|
163
|
+ color("green")
|
|
164
|
+ cube([nut_holder_width, nut_holder_height, nut_holder_depth]);
|
|
165
|
+
|
|
166
|
+ union() {
|
|
167
|
+ translate([(nut_holder_width - nut_depth - 2 * nut_gap) / 2, (nut_holder_height - nut_width - 2 * nut_gap) / 2, nut_holder_depth - nut_height - nut_gap])
|
|
168
|
+ cube([nut_depth + 2 * nut_gap, nut_width + 2 * nut_gap, nut_height + nut_gap + 1]);
|
|
169
|
+
|
|
170
|
+ translate([-1, (nut_holder_height - nut_width / 2) / 2, nut_holder_depth - nut_height])
|
|
171
|
+ cube([nut_holder_width / 2 + 1, nut_width / 2, nut_height + 1]);
|
|
172
|
+
|
|
173
|
+ translate([nut_holder_width / 2, (nut_holder_height - nut_width / 2) / 2, nut_holder_depth - nut_height / 2])
|
|
174
|
+ cube([nut_holder_width / 2 + 1, nut_width / 2, nut_height / 2 + 1]);
|
|
175
|
+ }
|
|
176
|
+ }
|
|
177
|
+
|
|
178
|
+ %color("red")
|
|
179
|
+ if (!only_cutout)
|
|
180
|
+ translate([(nut_holder_width - nut_depth) / 2, (nut_holder_height - nut_width) / 2, nut_holder_depth - nut_height])
|
|
181
|
+ cube([nut_depth, nut_width, nut_height]);
|
|
182
|
+}
|
|
183
|
+
|
|
184
|
+module face_body() {
|
|
185
|
+ // base / face plate
|
|
186
|
+ cube([face_width, face_height, border_bottom]);
|
|
187
|
+
|
|
188
|
+ // side supports
|
|
189
|
+ translate([(face_width - inner_width) / 2, 0, border_bottom])
|
|
190
|
+ cube([inner_width, inner_height, inner_depth]);
|
|
191
|
+
|
|
192
|
+ // top support wall
|
|
193
|
+ translate([0, face_height - border_bottom, 0])
|
|
194
|
+ cube([face_width, border_bottom, top_wall_height]);
|
|
195
|
+
|
|
196
|
+ // second top support wall
|
|
197
|
+ translate([(face_width - inner_width) / 2, face_height - border_bottom, top_wall_height])
|
|
198
|
+ cube([inner_width, top_support_depth, top_support_height]);
|
|
199
|
+
|
|
200
|
+ // bottom support wall
|
|
201
|
+ translate([(face_width - bottom_wall_width) / 2, 0, inner_depth + border_bottom])
|
|
202
|
+ cube([bottom_wall_width, cutout_bottom, bottom_wall_height]);
|
|
203
|
+}
|
|
204
|
+
|
|
205
|
+module connector_ring_tab(s) {
|
|
206
|
+ difference() {
|
|
207
|
+ union() {
|
|
208
|
+ cylinder(d = connector_ring_dia + s * 3, h = connector_ring_height + s * 2);
|
|
209
|
+
|
|
210
|
+ translate([-conenctor_ring_tab_width / 2, 0, 0])
|
|
211
|
+ cube([conenctor_ring_tab_width + s, connector_ring_dia / 2 + connector_ring_tab_len + s, connector_ring_height + s * 2]);
|
|
212
|
+ }
|
|
213
|
+
|
|
214
|
+ if (s != 0)
|
|
215
|
+ translate([0, 0, -1])
|
|
216
|
+ cylinder(d = connector_dia_post, h = connector_ring_height + 2);
|
|
217
|
+ }
|
|
218
|
+}
|
|
219
|
+
|
|
220
|
+module connector() {
|
|
221
|
+ translate([0, 0, -connector_len_post + 0.1])
|
|
222
|
+ cylinder(d = connector_dia_post, h = connector_len_post + 0.1);
|
|
223
|
+
|
|
224
|
+ connector_ring_tab(0);
|
|
225
|
+
|
|
226
|
+ translate([0, 0, connector_ring_height])
|
|
227
|
+ cylinder(d = connector_dia_outer, h = connector_len_top);
|
|
228
|
+}
|
|
229
|
+
|
|
230
|
+module pcb_holes(h) {
|
|
231
|
+ for (i = [-pcb_screw_dist_length / 2, pcb_screw_dist_length / 2])
|
|
232
|
+ for (j = [-pcb_screw_dist_width / 2, pcb_screw_dist_width / 2])
|
|
233
|
+ translate([i, j, -1])
|
|
234
|
+ cylinder(d = pcb_hole_dia, h = h + 2);
|
|
235
|
+}
|
|
236
|
+
|
|
237
|
+module pcb() {
|
|
238
|
+ difference() {
|
|
239
|
+ cube([pcb_length, pcb_width, pcb_height]);
|
|
240
|
+
|
|
241
|
+ translate([pcb_length / 2, pcb_width / 2, 0])
|
|
242
|
+ pcb_holes(pcb_height);
|
|
243
|
+ }
|
|
244
|
+}
|
|
245
|
+
|
|
246
|
+module disp() {
|
|
247
|
+ cube([open_size_w - 4, open_size_h - 4, disp_d]);
|
|
248
|
+
|
|
249
|
+ translate([-(disp_w - open_size_w + 4) / 2, -(disp_h - open_size_h + 4) / 2, -2])
|
|
250
|
+ cube([disp_w, disp_h, 2]);
|
|
251
|
+}
|
|
252
|
+
|
|
253
|
+module button(posts = 1, pcb = 1, switch = 1) {
|
|
254
|
+ color("orange")
|
|
255
|
+ if (pcb)
|
|
256
|
+ translate([0, 0, 0.1])
|
|
257
|
+ difference() {
|
|
258
|
+ translate([0, -0, 0])
|
|
259
|
+ cube([button_pcb_width, button_pcb_height, button_pcb_depth]);
|
|
260
|
+
|
|
261
|
+ for (i = [1, -1])
|
|
262
|
+ translate([button_pcb_width / 2 + i * button_pcb_hole_dist_x / 2, button_pcb_height - button_off_top - i * button_pcb_hole_dist_y / 2, -1])
|
|
263
|
+ cylinder(d = button_post_hole + 1, h = button_pcb_depth + 2);
|
|
264
|
+
|
|
265
|
+ translate([button_pcb_width / 2, button_pcb_height - button_off_top, -1])
|
|
266
|
+ cylinder(d = 12, h = button_pcb_depth + 2);
|
|
267
|
+ }
|
|
268
|
+
|
|
269
|
+ color("green")
|
|
270
|
+ if (posts)
|
|
271
|
+ for (i = [1, -1])
|
|
272
|
+ translate([button_pcb_width / 2 + i * button_pcb_hole_dist_x / 2, button_pcb_height - button_off_top - i * button_pcb_hole_dist_y / 2, -button_post_height])
|
|
273
|
+ difference() {
|
|
274
|
+ cylinder(d = button_post_dia, h = button_post_height);
|
|
275
|
+
|
|
276
|
+ translate([0, 0, -1])
|
|
277
|
+ cylinder(d = button_post_hole, h = button_post_height + 2);
|
|
278
|
+ }
|
|
279
|
+
|
|
280
|
+ color("red")
|
|
281
|
+ if (switch)
|
|
282
|
+ translate([(button_pcb_width - button_width) / 2, button_pcb_height - button_width / 2 - button_off_top, -button_length])
|
|
283
|
+ cube([button_width, button_width, button_length]);
|
|
284
|
+}
|
|
285
|
+
|
|
286
|
+module bluetooth_pcb(post, pcb, holes) {
|
|
287
|
+ color("blue")
|
|
288
|
+ if (pcb)
|
|
289
|
+ difference() {
|
|
290
|
+ cube([bt_width, bt_height, bt_depth]);
|
|
291
|
+
|
|
292
|
+ for (i = [bt_hole_dist_x, bt_width - bt_hole_dist_x])
|
|
293
|
+ for (j = [bt_hole_dist_y, bt_height - bt_hole_dist_y])
|
|
294
|
+ translate([i, j, -1])
|
|
295
|
+ cylinder(d = bt_hole_dia, h = bt_depth + 2);
|
|
296
|
+ }
|
|
297
|
+
|
|
298
|
+ color("green")
|
|
299
|
+ if (post)
|
|
300
|
+ for (i = [bt_hole_dist_x, bt_width - bt_hole_dist_x])
|
|
301
|
+ for (j = [bt_hole_dist_y, bt_height - bt_hole_dist_y])
|
|
302
|
+ translate([i, j, -bt_post_height])
|
|
303
|
+ difference() {
|
|
304
|
+ cylinder(d = bt_post_dia, h = bt_post_height);
|
|
305
|
+
|
|
306
|
+ translate([0, 0, -1])
|
|
307
|
+ cylinder(d = bt_hole_dia, h = bt_post_height + 2);
|
|
308
|
+ }
|
|
309
|
+
|
|
310
|
+ if (holes)
|
|
311
|
+ for (i = [bt_hole_dist_x, bt_width - bt_hole_dist_x])
|
|
312
|
+ for (j = [bt_hole_dist_y, bt_height - bt_hole_dist_y])
|
|
313
|
+ translate([i, j, -15])
|
|
314
|
+ cylinder(d = bt_hole_dia, h = 21);
|
|
315
|
+}
|
|
316
|
+
|
|
317
|
+module face() {
|
|
318
|
+ difference() {
|
|
319
|
+ color("green")
|
|
320
|
+ face_body();
|
|
321
|
+
|
|
322
|
+ // inner cutout
|
|
323
|
+ translate([(face_width - cutout_width) / 2, cutout_bottom, face_wall])
|
|
324
|
+ cube([cutout_width, cutout_height, inner_depth + border_bottom + top_support_height]);
|
|
325
|
+
|
|
326
|
+ translate([(face_width - bottom_cut_width) / 2, cutout_bottom, face_wall])
|
|
327
|
+ cube([bottom_cut_width, bottom_cut_height, bottom_cut_depth]);
|
|
328
|
+
|
|
329
|
+ // holes for power connectors
|
|
330
|
+ for (i = [0 : 2])
|
|
331
|
+ translate([connector_off_x + ((i == 1) ? connector_dist_x : 0), i * connector_dist_y + connector_off_y, connector_ring_height - 0.01])
|
|
332
|
+ rotate([180, 0, 90])
|
|
333
|
+ connector();
|
|
334
|
+
|
|
335
|
+ // top screws
|
|
336
|
+ for (i = [0 : 1])
|
|
337
|
+ translate([i * screw_a_dist + (face_width - screw_a_dist) / 2, face_height - screw_a_head_height - border_bottom + top_support_depth + 0.1, screw_a_off_z])
|
|
338
|
+ rotate([-90, 0, 0])
|
|
339
|
+ screw(0);
|
|
340
|
+
|
|
341
|
+ // bottom screws
|
|
342
|
+ for (i = [0 : 1])
|
|
343
|
+ translate([i * screw_b_dist + (face_width - screw_b_dist) / 2, screw_b_head_height - 0.1, screw_b_off_z])
|
|
344
|
+ rotate([90, 0, 0])
|
|
345
|
+ screw(1);
|
|
346
|
+
|
|
347
|
+ // DPH5005
|
|
348
|
+ translate([open_off_x, face_height - open_size_h - open_off_y, -1])
|
|
349
|
+ cube([open_size_w, open_size_h, face_wall + 2]);
|
|
350
|
+
|
|
351
|
+ // nut_holders
|
|
352
|
+ translate([(inner_width) / 2 + (face_width - inner_width) / 2, nut_holder_off_y, 0])
|
|
353
|
+ for (i = [-1, 1])
|
|
354
|
+ scale([i, 1, 1])
|
|
355
|
+ translate([(inner_width) / 2 - nut_holder_width, 0, 0])
|
|
356
|
+ nut_holder(1);
|
|
357
|
+
|
|
358
|
+ text_cutouts();
|
|
359
|
+
|
|
360
|
+ translate([pcb_off_x, pcb_off_y + pcb_width / 2, -1])
|
|
361
|
+ pcb_holes(face_wall + 2);
|
|
362
|
+
|
|
363
|
+ translate([button_off_x, button_off_y, face_wall + button_post_height])
|
|
364
|
+ button(0, 0, 1);
|
|
365
|
+
|
|
366
|
+ // bluetooth
|
|
367
|
+ if (add_optional_module == 2)
|
|
368
|
+ translate([bt_off_x, bt_off_y, face_wall + bt_post_height])
|
|
369
|
+ bluetooth_pcb(0, 0, 1);
|
|
370
|
+ }
|
|
371
|
+
|
|
372
|
+ // nut_holders
|
|
373
|
+ translate([(inner_width) / 2 + (face_width - inner_width) / 2, nut_holder_off_y, 0])
|
|
374
|
+ for (i = [-1, 1])
|
|
375
|
+ scale([i, 1, 1])
|
|
376
|
+ translate([(inner_width) / 2 - nut_holder_width, 0, 0])
|
|
377
|
+ nut_holder();
|
|
378
|
+
|
|
379
|
+ // power connectors
|
|
380
|
+ for (i = [0 : 2])
|
|
381
|
+ translate([connector_off_x + ((i == 1) ? connector_dist_x : 0), i * connector_dist_y + connector_off_y, connector_ring_height - 0.01])
|
|
382
|
+ rotate([180, 0, 90]) {
|
|
383
|
+ %color("blue")
|
|
384
|
+ connector();
|
|
385
|
+
|
|
386
|
+ color("cyan")
|
|
387
|
+ translate([0, 0, -face_wall + 2 * 0.3])
|
|
388
|
+ connector_ring_tab(-0.3);
|
|
389
|
+ }
|
|
390
|
+
|
|
391
|
+ // DPH5005
|
|
392
|
+ %color("orange")
|
|
393
|
+ translate([open_off_x + 2, face_height - open_size_h - open_off_y + 2, 0])
|
|
394
|
+ disp();
|
|
395
|
+
|
|
396
|
+ %color("orange")
|
|
397
|
+ translate([-pcb_length / 2 + pcb_off_x, pcb_off_y, face_wall + 2])
|
|
398
|
+ pcb();
|
|
399
|
+
|
|
400
|
+ translate([button_off_x, button_off_y, face_wall + button_post_height]) {
|
|
401
|
+ button(1, 0, 0);
|
|
402
|
+ %button(0, 1, 1);
|
|
403
|
+ }
|
|
404
|
+
|
|
405
|
+ // bluetooth
|
|
406
|
+ if (add_optional_module == 2)
|
|
407
|
+ translate([bt_off_x, bt_off_y, face_wall + bt_post_height]) {
|
|
408
|
+ bluetooth_pcb(1, 0, 0);
|
|
409
|
+ %bluetooth_pcb(0, 1, 0);
|
|
410
|
+ }
|
|
411
|
+}
|
|
412
|
+
|
|
413
|
+face();
|