simplify wiring, keep right and left separated
[challenge-bot] / sonar-table-top-holder.scad
CommitLineData
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
978bd219 7$fn = 60;
8
9// 3/16 inch in mm deck_depth = 4.7625;
10// 1/4 inch in mm - a little to be a squeeze fit
11deck_depth = 6.35 - 0.4;
dac38b58 12sonar_plate_width = 20;
8ca271e9 13// sonar sensor measurements taken with calipers:
49bffb72 14// 10.82 in between, 42.33 outside, 15.82 diameter
8ca271e9 15// measured diameter of 15.82 with calipers,
16// but when printed ends up being too small
17sonar_sensor_radius = 15.82 / 2 + 0.3;
dac38b58 18sonar_sensor_height = 13.8;
49bffb72 19between_sensor_centers = 15.82 + 10.82;
20sonar_plate_length = 3 + between_sensor_centers + sonar_sensor_radius + 3;
74f8c088 21sonar_holder_length = sonar_plate_length + 10;
22sonar_holder_width = sonar_plate_width + 3;
49bffb72 23sonar_holder_depth = 4;
8ca271e9 24
49bffb72 25deck_holder_length = 30;
26deck_holder_width = sonar_holder_width;
74f8c088 27
28module sensors(){
29 translate([between_sensor_centers / 2, 0, 0]){
30 cylinder(r = sonar_sensor_radius, h = sonar_sensor_height);}
31 translate([-between_sensor_centers / 2, 0, 0]){
32 cylinder(r = sonar_sensor_radius, h = sonar_sensor_height);}}
33
49bffb72 34module sensor_holder(){
35 difference(){
36 cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]);
37 translate([sonar_holder_length / 2, sonar_holder_width / 2, -0.05]){
38 sensors();}}
39 translate([sonar_holder_length, 0, 0]){
40 cube([sonar_holder_depth + 0.3, deck_depth - 0.3, deck_depth - 0.3]);
41 translate([sonar_holder_depth + 0.3, 0, 0]){
42 // subtract a little bit (0.3) to make it fit
43 cube([deck_depth - 0.3, sonar_holder_width, deck_depth - 0.3]);}}}
44
74f8c088 45module deck_holder(){
49bffb72 46 cube([deck_holder_length, sonar_holder_depth, sonar_holder_width]);
47 cube([sonar_holder_depth,
48 sonar_holder_depth * 2 + deck_depth,
49 sonar_holder_width]);
50 translate([0, sonar_holder_depth + deck_depth, 0]){
51 cube([deck_holder_length, sonar_holder_depth, sonar_holder_width]);}
52 translate([sonar_holder_depth + deck_depth, 0, 0]){
53 cube([sonar_holder_depth,
54 sonar_holder_depth * 2 + deck_depth,
55 sonar_holder_width]);}}
74f8c088 56
57module sonar_table_top_holder(){
58 difference(){
59 union(){
60 cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]);
61 translate([sonar_holder_length, 0, 0]){
62 deck_holder();}}
63 translate([between_sensor_centers / 2 + sonar_sensor_radius + 3,
64 sonar_holder_width / 2,
65 -1]){
66 sensors();}
67 // cut out a bit of the circle to make it 3d printable,
68 // no severe overhang
69 translate([3 + sonar_sensor_radius,
70 sonar_holder_width - 3.025,
71 sonar_holder_depth / 2 - 0.025]){
72 cube([10, 6.1, sonar_holder_depth + .1], center = true);
73 translate([between_sensor_centers, 0, 0]){
74 cube([10, 6.1, sonar_holder_depth + .1], center = true);}}}}
dac38b58 75
49bffb72 76sensor_holder();