dac38b58 |
1 | // challenge-bot |
2 | // GNU AGPLv3 (or later at your option) |
3 | // project available at these locations: |
4 | // https://gitorious.org/ozzloy/challenge-bot |
5 | // https://github.com/waynegramlich/challenge-bot |
6 | |
3d01ee80 |
7 | /* |
8 | this holds an hc-sr04 sonar sensor to a 3/16 inch deck. |
9 | http://fritzing.org/projects/hc-sr04-project |
10 | it can hold the sonar sensor either facing down, or forwards. |
11 | when facing down, it can detect if it passes over the edge of a table. |
12 | when facing forwards, it can detect and follow something in front of it. |
13 | */ |
14 | |
978bd219 |
15 | $fn = 60; |
16 | |
17 | // 3/16 inch in mm deck_depth = 4.7625; |
be16f419 |
18 | // 1/4 inch in mm = 6.35 |
19 | // subtract a little to be a squeeze fit |
8b340909 |
20 | deck_depth = 4.7625 - 0.4; |
8ca271e9 |
21 | // sonar sensor measurements taken with calipers: |
49bffb72 |
22 | // 10.82 in between, 42.33 outside, 15.82 diameter |
8ca271e9 |
23 | // measured diameter of 15.82 with calipers, |
8b84f6f3 |
24 | // but when printed ends up being too small, so add some |
651bbf4b |
25 | sonar_diameter = 15.82 + 0.4; |
8b84f6f3 |
26 | sonar_radius = sonar_diameter / 2; |
27 | sonar_height = 13.8; |
28 | between_sonar_centers = sonar_diameter + 10.82; |
29 | // the sonar cylinders are placed on the pcb at slightly different positions |
30 | // from one sensor to the next, so this allows for that variance. |
31 | between_sonar_centers_variance = 2; |
32 | // keep at least this much plastic surrounding the sonar cylinder on all sides |
bc750455 |
33 | buffer = 3; |
8b84f6f3 |
34 | sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer; |
35 | sonar_holder_width = buffer + sonar_diameter + buffer; |
bc750455 |
36 | // sonar_holder_depth is deck_depth minus a little bit to make arm fit |
37 | // into deck holder |
34e9f480 |
38 | sonar_holder_depth = deck_depth - 0.7875; |
8ca271e9 |
39 | |
bc750455 |
40 | deck_holder_length = sonar_holder_depth * 2 + deck_depth + 15; |
74f8c088 |
41 | |
8b84f6f3 |
42 | module sonars(){ |
43 | translate([between_sonar_centers / 2, 0, 0]){ |
44 | cylinder(r = sonar_radius, h = sonar_height);} |
45 | // for the variance with which the physical sonar cylinders are placed |
46 | translate([between_sonar_centers / 2 - between_sonar_centers_variance, 0, 0]){ |
47 | cylinder(r = sonar_radius, h = sonar_height); |
48 | translate([0, -sonar_radius, 0]){ |
49 | cube([between_sonar_centers_variance, sonar_diameter, sonar_height]);}} |
50 | translate([-between_sonar_centers / 2, 0, 0]){ |
51 | cylinder(r = sonar_radius, h = sonar_height);}} |
74f8c088 |
52 | |
8b84f6f3 |
53 | module sonar_holder(){ |
34e9f480 |
54 | elbow_length = deck_depth - 0.5; |
49bffb72 |
55 | difference(){ |
56 | cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]); |
57 | translate([sonar_holder_length / 2, sonar_holder_width / 2, -0.05]){ |
8b84f6f3 |
58 | sonars();}} |
59 | translate([sonar_holder_length, 0, 0]){ |
34e9f480 |
60 | cube([elbow_length, deck_depth, sonar_holder_depth]); |
8b84f6f3 |
61 | translate([elbow_length, 0, 0]){ |
62 | linear_extrude(height = sonar_holder_depth){ |
34e9f480 |
63 | polygon([[ 0, 0], |
8b84f6f3 |
64 | [sonar_holder_depth, 0], |
65 | [sonar_holder_depth, sonar_holder_width / 2], |
34e9f480 |
66 | [ 0, |
67 | sonar_holder_width / 2 + sonar_holder_depth]]);} |
8b84f6f3 |
68 | translate([0, (sonar_holder_width + sonar_holder_depth) / 2, 0]){ |
69 | cube([sonar_holder_depth / 2, |
70 | (sonar_holder_width - sonar_holder_depth) / 2 + 0.8, |
71 | sonar_holder_depth]);} |
60061640 |
72 | translate([-1.7, sonar_holder_width + 0.8, 0]){ |
8b84f6f3 |
73 | linear_extrude(height = sonar_holder_depth){ |
34e9f480 |
74 | polygon([[ 0, 0], |
8b84f6f3 |
75 | [sonar_holder_depth / 2 + 1.7, 4], |
76 | [sonar_holder_depth / 2 + 1.7, 0]]);}}}}} |
49bffb72 |
77 | |
74f8c088 |
78 | module deck_holder(){ |
be16f419 |
79 | deck_holder_width = sonar_holder_width - deck_depth; |
bc750455 |
80 | linear_extrude(height = deck_holder_width){ |
81 | difference(){ |
82 | square([deck_holder_length, sonar_holder_depth * 2 + deck_depth]); |
83 | translate([sonar_holder_depth, sonar_holder_depth]){ |
84 | square(deck_depth);} |
85 | translate([sonar_holder_depth * 2 + deck_depth, sonar_holder_depth]){ |
86 | square([deck_holder_length - (sonar_holder_depth * 2 + deck_depth), |
87 | deck_depth]);}}}} |
74f8c088 |
88 | |
be16f419 |
89 | deck_holder(); |
8b84f6f3 |
90 | translate([0, sonar_holder_depth * 2 + deck_depth + 2, 0]){ |
91 | sonar_holder();} |