remove unused sections of deck and sonar holders
[challenge-bot] / 3d-printables / deck-holder-data.scad
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
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
15 $fn = 60;
16
17 include <oshw-data.scad>
18
19 // 3/16 inch in mm deck_depth = 4.7625;
20 // 1/4 inch in mm = 6.35
21 // subtract a little to be a squeeze fit
22 deck_depth = 4.7625 - 0.4;
23 // sonar sensor measurements taken with calipers:
24 // 10.82 in between, 42.33 outside, 15.82 diameter
25 // measured diameter of 15.82 with calipers,
26 // but when printed ends up being too small, so add some
27 sonar_diameter = 15.82 + 0.4;
28 sonar_radius = sonar_diameter / 2;
29 sonar_height = 13.8;
30 between_sonar_centers = sonar_diameter + 10.82;
31 // the sonar cylinders are placed on the pcb at slightly different positions
32 // from one sensor to the next, so this allows for that variance.
33 between_sonar_centers_variance = 2;
34 // keep at least this much plastic surrounding the sonar cylinder on all sides
35 buffer = 3;
36 sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer;
37 sonar_holder_width = buffer + sonar_diameter + buffer;
38
39 // 3/16 inch in mm deck_depth = 4.7625;
40 // 1/4 inch in mm = 6.35
41 // subtract a little to be a squeeze fit
42 deck_depth = 4.7625 - 0.4;
43 // sonar sensor measurements taken with calipers:
44 // 10.82 in between, 42.33 outside, 15.82 diameter
45 // measured diameter of 15.82 with calipers,
46 // but when printed ends up being too small, so add some
47 sonar_diameter = 15.82 + 0.4;
48 sonar_radius = sonar_diameter / 2;
49 sonar_height = 13.8;
50 between_sonar_centers = sonar_diameter + 10.82;
51 // the sonar cylinders are placed on the pcb at slightly different positions
52 // from one sensor to the next, so this allows for that variance.
53 between_sonar_centers_variance = 2;
54 // keep at least this much plastic surrounding the sonar cylinder on all sides
55 buffer = 3;
56 sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer;
57 sonar_holder_width = buffer + sonar_diameter + buffer;
58 // sonar_holder_depth is deck_depth minus a little bit to make arm fit
59 // into deck holder
60 sonar_holder_depth = deck_depth - 0.7875;
61
62 deck_holder_length = sonar_holder_depth * 2 + deck_depth + 15;
63
64 module deck_holder() {
65 deck_holder_width = sonar_holder_width - deck_depth;
66 deck_holder_height = sonar_holder_depth * 2 + deck_depth;
67 linear_extrude(height = deck_holder_width) {
68 difference() {
69 square([deck_holder_length, deck_holder_height]);
70 translate([sonar_holder_depth - 0.15, sonar_holder_depth - 0.15]) {
71 square(deck_depth + 0.3); }
72 translate([deck_holder_height, sonar_holder_depth - 0.3]) {
73 square([deck_holder_length - (deck_holder_height),
74 deck_depth + 0.6]); } } }
75 translate([deck_holder_length - oshw_dy * 0.05, 0, deck_holder_width / 2])
76 scale([0.1, 1, 0.1])
77 rotate(v = [1, 0, 0], a = 90)
78 rotate(90)
79 linear_extrude(height = 0.5)
80 oshw();
81 translate([deck_holder_length - oshw_dy * 0.05,
82 deck_holder_height + 0.5,
83 deck_holder_width / 2])
84 rotate(v = [1, 0, 0], a = 90)
85 rotate(90)
86 scale([0.1, 0.1, 1])
87 linear_extrude(height = 0.5)
88 oshw(); }