25cd00a6 |
1 | /* |
2 | Copyright (C) 2015 Daniel Watson |
3 | See the end of the file for license conditions. |
4 | */ |
3d90aff0 |
5 | // challenge-bot |
6 | // GNU AGPLv3 (or later at your option) |
25cd00a6 |
7 | // project available here: |
8 | // https://challenge-bot.com/ |
3d90aff0 |
9 | |
10 | /* |
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. |
16 | */ |
17 | |
18 | $fn = 60; |
19 | |
78a38e00 |
20 | include <oshw-data.scad> |
21 | |
3d90aff0 |
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; |
32 | sonar_height = 13.8; |
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 |
38 | buffer = 3; |
39 | sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer; |
40 | sonar_holder_width = buffer + sonar_diameter + buffer; |
3d90aff0 |
41 | |
3d90aff0 |
42 | // sonar_holder_depth is deck_depth minus a little bit to make arm fit |
43 | // into deck holder |
44 | sonar_holder_depth = deck_depth - 0.7875; |
45 | |
46 | deck_holder_length = sonar_holder_depth * 2 + deck_depth + 15; |
47 | |
3d90aff0 |
48 | module deck_holder() { |
49 | deck_holder_width = sonar_holder_width - deck_depth; |
50 | deck_holder_height = sonar_holder_depth * 2 + deck_depth; |
51 | linear_extrude(height = deck_holder_width) { |
52 | difference() { |
53 | square([deck_holder_length, deck_holder_height]); |
54 | translate([sonar_holder_depth - 0.15, sonar_holder_depth - 0.15]) { |
25cd00a6 |
55 | |
56 | /* |
57 | This file is part of challenge-bot. |
58 | |
59 | Challenge-bot is free software: you can redistribute it and/or modify |
60 | it under the terms of the GNU Affero General Public License as published by |
61 | the Free Software Foundation, either version 3 of the License, or |
62 | (at your option) any later version. |
63 | |
64 | GNU Affero Emacs is distributed in the hope that it will be useful, |
65 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
66 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
67 | GNU Affero General Public License for more details. |
68 | |
69 | You should have received a copy of the GNU Affero General Public License |
70 | along with challenge-bot. If not, see <http://www.gnu.org/licenses/>. |
71 | */ |
3d90aff0 |
72 | square(deck_depth + 0.3); } |
73 | translate([deck_holder_height, sonar_holder_depth - 0.3]) { |
74 | square([deck_holder_length - (deck_holder_height), |
75 | deck_depth + 0.6]); } } } |
76 | translate([deck_holder_length - oshw_dy * 0.05, 0, deck_holder_width / 2]) |
77 | scale([0.1, 1, 0.1]) |
78 | rotate(v = [1, 0, 0], a = 90) |
79 | rotate(90) |
80 | linear_extrude(height = 0.5) |
81 | oshw(); |
82 | translate([deck_holder_length - oshw_dy * 0.05, |
83 | deck_holder_height + 0.5, |
84 | deck_holder_width / 2]) |
85 | rotate(v = [1, 0, 0], a = 90) |
86 | rotate(90) |
87 | scale([0.1, 0.1, 1]) |
88 | linear_extrude(height = 0.5) |
89 | oshw(); } |