bring in height to sonar binder clip holder
[challenge-bot] / 3d-printables / sonar-binder-clip-holder-data.scad
1 /*
2 Copyright 2016 Daniel Watson
3 See the end of the file for license conditions.
4 */
5 /* challenge-bot
6 // GNU AGPLv3 (or later at your option)
7 // project available here:
8 // https://challenge-bot.com/ */
9
10 /*
11 this holds an hc-sr04 sonar sensor to a 3/16 inch deck.
12 http://fritzing.org/projects/hc-sr04-project
13 it can hold the sonar sensor either facing down, or forwards.
14 when facing down, it can detect if it passes over the edge of a table.
15 when facing forwards, it can detect and follow something in front
16 of it.
17 */
18
19 $fn = 50;
20
21 sonar_diameter_measured = 15.82;
22 sonar_diameter_print_fudge = 0.5;
23 sonar_diameter = sonar_diameter_measured + sonar_diameter_print_fudge;
24 sonar_radius = sonar_diameter / 2;
25
26 between_sonar_cans = 10.82;
27 between_sonar_centers = sonar_diameter + between_sonar_cans;
28
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_variation = 2;
32
33 wall_thickness = 3;
34
35 screw_radius_measured = 2.8;
36 screw_radius_print_fudge = 0.3;
37 screw_radius = screw_radius_measured + screw_radius_print_fudge;
38
39 sonar_binder_clip_holder_height = 2;
40
41 module sonar_sensors_2d(sonar_radius,
42 between_sonar_centers,
43 between_sonar_centers_variation) {
44 hull(){
45 circle(sonar_radius);
46 translate([between_sonar_centers_variation, 0]){
47 circle(sonar_radius); } }
48 translate([between_sonar_centers, 0]) {
49 circle(sonar_radius); } }
50
51 module sonar_holder_outline_2d(sonar_radius,
52 between_sonar_centers,
53 wall_thickness) {
54 holder_radius = sonar_radius + wall_thickness;
55 holder_diameter = holder_radius * 2;
56 hull() {
57 circle(holder_radius);
58 translate([between_sonar_centers - sonar_radius - wall_thickness,
59 -holder_radius]) {
60 square(holder_diameter); } } }
61
62 module sonar_holder_2d(sonar_radius,
63 between_sonar_centers,
64 between_sonar_centers_variation,
65 wall_thickness) {
66 difference() {
67 sonar_holder_outline_2d(sonar_radius,
68 between_sonar_centers,
69 wall_thickness);
70 sonar_sensors_2d(sonar_radius,
71 between_sonar_centers,
72 between_sonar_centers_variation); } }
73
74 module binder_clip_holder_2d(binder_clip_holder_length,
75 screw_radius,
76 holder_radius){
77 difference() {
78 square([binder_clip_holder_length, holder_radius * 2]);
79 translate([binder_clip_holder_length - holder_radius, holder_radius]) {
80 circle(screw_radius); } } }
81
82 module sonar_binder_clip_holder_2d(sonar_radius,
83 between_sonar_centers,
84 between_sonar_centers_variation,
85 wall_thickness) {
86 sonar_holder_2d(sonar_radius,
87 between_sonar_centers,
88 between_sonar_centers_variation,
89 wall_thickness);
90 holder_radius = sonar_radius + wall_thickness;
91 binder_clip_holder_length = 2 * holder_radius;
92 translate([between_sonar_centers + holder_radius, -holder_radius]){
93 binder_clip_holder_2d(binder_clip_holder_length,
94 screw_radius,
95 holder_radius); } }
96
97 module sonar_binder_clip_holder(sonar_radius,
98 between_sonar_centers,
99 between_sonar_centers_variation,
100 wall_thickness,
101 sonar_binder_clip_holder_height) {
102 linear_extrude(height = sonar_binder_clip_holder_height) {
103 sonar_binder_clip_holder_2d(sonar_radius,
104 between_sonar_centers,
105 between_sonar_centers_variation,
106 wall_thickness); } }
107
108 module binder_clip_holder(binder_clip_holder_length,
109 screw_radius,
110 holder_radius,
111 binder_clip_holder_height) {
112 linear_extrude(height = binder_clip_holder_height) {
113 binder_clip_holder_2d(binder_clip_holder_length,
114 screw_radius,
115 holder_radius); } }
116
117 /*
118 This file is part of challenge-bot.
119
120 Challenge-bot is free software: you can redistribute it and/or modify
121 it under the terms of the GNU Affero General Public License as published by
122 the Free Software Foundation, either version 3 of the License, or
123 (at your option) any later version.
124
125 GNU Affero Emacs is distributed in the hope that it will be useful,
126 but WITHOUT ANY WARRANTY; without even the implied warranty of
127 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
128 GNU Affero General Public License for more details.
129
130 You should have received a copy of the GNU Affero General Public License
131 along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
132 */