/* Copyright 2016 Daniel Watson See the end of the file for license conditions. */ /* challenge-bot // GNU AGPLv3 (or later at your option) // project available here: // https://challenge-bot.com/ */ /* this holds an hc-sr04 sonar sensor to a 3/16 inch deck. http://fritzing.org/projects/hc-sr04-project it can hold the sonar sensor either facing down, or forwards. when facing down, it can detect if it passes over the edge of a table. when facing forwards, it can detect and follow something in front of it. */ $fn = 50; sonar_diameter_measured = 15.82; sonar_diameter_print_fudge = 0.5; sonar_diameter = sonar_diameter_measured + sonar_diameter_print_fudge; sonar_radius = sonar_diameter / 2; between_sonar_cans = 10.82; between_sonar_centers = sonar_diameter + between_sonar_cans; // the sonar cylinders are placed on the pcb at slightly different positions // from one sensor to the next, so this allows for that variance. between_sonar_centers_variation = 2; wall_thickness = 3; screw_radius_measured = 2.8; screw_radius_print_fudge = 0.3; screw_radius = screw_radius_measured + screw_radius_print_fudge; module sonar_sensors_2d(sonar_radius, between_sonar_centers, between_sonar_centers_variation) { hull(){ circle(sonar_radius); translate([between_sonar_centers_variation, 0]){ circle(sonar_radius); } } translate([between_sonar_centers, 0]) { circle(sonar_radius); } } module sonar_holder_outline_2d(sonar_radius, between_sonar_centers, wall_thickness) { holder_radius = sonar_radius + wall_thickness; holder_diameter = holder_radius * 2; hull() { circle(holder_radius); translate([between_sonar_centers, 0]) { circle(holder_radius); } translate([sonar_radius + between_sonar_centers, -holder_radius]) { square([holder_diameter * 2, holder_diameter]); } } } module sonar_binder_clip_holder(sonar_radius, between_sonar_centers, between_sonar_centers_variation, wall_thickness) { difference() { sonar_holder_outline_2d(sonar_radius, between_sonar_centers, wall_thickness); sonar_sensors_2d(sonar_radius, between_sonar_centers, between_sonar_centers_variation); translate([sonar_radius + between_sonar_centers + 3 * (wall_thickness + sonar_radius), 0, 0]) { circle(screw_radius); } } } /* This file is part of challenge-bot. Challenge-bot is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. GNU Affero Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with challenge-bot. If not, see . */