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