2 Copyright (C) 2015 Daniel Watson
3 See the end of the file for license conditions.
6 // GNU AGPLv3 (or later at your option)
7 // project available here:
8 // https://challenge-bot.com/
11 this holds an hc-sr04 sonar sensor to a 3/16 inch deck.
12 http://fritzing.org/projects/hc-sr04-project
13 it can hold the sonar sensor either facing down, or forwards.
14 when facing down, it can detect if it passes over the edge of a table.
15 when facing forwards, it can detect and follow something in front of it.
20 include
<oshw
-data
.scad
>
22 // 3/16 inch in mm deck_depth = 4.7625;
23 // 1/4 inch in mm = 6.35
24 // subtract a little to be a squeeze fit
25 deck_depth
= 4.7625 - 0.4;
26 // sonar sensor measurements taken with calipers:
27 // 10.82 in between, 42.33 outside, 15.82 diameter
28 // measured diameter of 15.82 with calipers,
29 // but when printed ends up being too small, so add some
30 sonar_diameter
= 15.82 + 0.4;
31 sonar_radius
= sonar_diameter
/ 2;
33 between_sonar_centers
= sonar_diameter
+ 10.82;
34 // the sonar cylinders are placed on the pcb at slightly different positions
35 // from one sensor to the next, so this allows for that variance.
36 between_sonar_centers_variance
= 2;
37 // keep at least this much plastic surrounding the sonar cylinder on all sides
39 sonar_holder_length
= buffer
+ between_sonar_centers
+ sonar_diameter
+ buffer
;
40 sonar_holder_width
= buffer
+ sonar_diameter
+ buffer
;
42 // 3/16 inch in mm deck_depth = 4.7625;
43 // 1/4 inch in mm = 6.35
44 // subtract a little to be a squeeze fit
45 deck_depth
= 4.7625 - 0.4;
46 // sonar sensor measurements taken with calipers:
47 // 10.82 in between, 42.33 outside, 15.82 diameter
48 // measured diameter of 15.82 with calipers,
49 // but when printed ends up being too small, so add some
50 sonar_diameter
= 15.82 + 0.4;
51 sonar_radius
= sonar_diameter
/ 2;
53 between_sonar_centers
= sonar_diameter
+ 10.82;
54 // the sonar cylinders are placed on the pcb at slightly different positions
55 // from one sensor to the next, so this allows for that variance.
56 between_sonar_centers_variance
= 2;
57 // keep at least this much plastic surrounding the sonar cylinder on all sides
59 sonar_holder_length
= buffer
+ between_sonar_centers
+ sonar_diameter
+ buffer
;
60 sonar_holder_width
= buffer
+ sonar_diameter
+ buffer
;
61 // sonar_holder_depth is deck_depth minus a little bit to make arm fit
63 sonar_holder_depth
= deck_depth
- 0.7875;
65 deck_holder_length
= sonar_holder_depth
* 2 + deck_depth
+ 15;
67 module
deck_holder() {
68 deck_holder_width
= sonar_holder_width
- deck_depth
;
69 deck_holder_height
= sonar_holder_depth
* 2 + deck_depth
;
70 linear_extrude(height
= deck_holder_width
) {
72 square([deck_holder_length
, deck_holder_height
]);
73 translate([sonar_holder_depth
- 0.15, sonar_holder_depth
- 0.15]) {
76 This file is part of challenge-bot.
78 Challenge-bot is free software: you can redistribute it and/or modify
79 it under the terms of the GNU Affero General Public License as published by
80 the Free Software Foundation, either version 3 of the License, or
81 (at your option) any later version.
83 GNU Affero Emacs is distributed in the hope that it will be useful,
84 but WITHOUT ANY WARRANTY; without even the implied warranty of
85 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
86 GNU Affero General Public License for more details.
88 You should have received a copy of the GNU Affero General Public License
89 along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
91 square(deck_depth
+ 0.3); }
92 translate([deck_holder_height
, sonar_holder_depth
- 0.3]) {
93 square([deck_holder_length
- (deck_holder_height
),
94 deck_depth
+ 0.6]); } } }
95 translate([deck_holder_length
- oshw_dy
* 0.05, 0, deck_holder_width
/ 2])
97 rotate(v
= [1, 0, 0], a
= 90)
99 linear_extrude(height
= 0.5)
101 translate([deck_holder_length
- oshw_dy
* 0.05,
102 deck_holder_height
+ 0.5,
103 deck_holder_width
/ 2])
104 rotate(v
= [1, 0, 0], a
= 90)
107 linear_extrude(height
= 0.5)