X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=3d-printables%2Fsonar-table-top-holder.scad;h=8f0d1539d9a9aa6f39172a40759669127db5723f;hb=201687b69cac35080b52a0c1ebe01419e995cff1;hp=42578116602547606d7927d23504471146d9f736;hpb=34e9f480eba5336401589033ce04112919c6407e;p=challenge-bot diff --git a/3d-printables/sonar-table-top-holder.scad b/3d-printables/sonar-table-top-holder.scad index 4257811..8f0d153 100644 --- a/3d-printables/sonar-table-top-holder.scad +++ b/3d-printables/sonar-table-top-holder.scad @@ -4,8 +4,20 @@ // https://gitorious.org/ozzloy/challenge-bot // https://github.com/waynegramlich/challenge-bot +/* + 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 = 60; +use +oshw_dy = 120.366; +oshw_dx = 133.888; + // 3/16 inch in mm deck_depth = 4.7625; // 1/4 inch in mm = 6.35 // subtract a little to be a squeeze fit @@ -44,10 +56,15 @@ module sonars(){ module sonar_holder(){ elbow_length = deck_depth - 0.5; + rounded_corner_radius = buffer; difference(){ cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]); translate([sonar_holder_length / 2, sonar_holder_width / 2, -0.05]){ - sonars();}} + sonars();} + translate([sonar_holder_length - rounded_corner_radius, + sonar_holder_width - rounded_corner_radius, + 0]){ + corner_rounder(rounded_corner_radius, sonar_holder_depth);}} translate([sonar_holder_length, 0, 0]){ cube([elbow_length, deck_depth, sonar_holder_depth]); translate([elbow_length, 0, 0]){ @@ -69,15 +86,39 @@ module sonar_holder(){ module deck_holder(){ deck_holder_width = sonar_holder_width - deck_depth; + deck_holder_height = sonar_holder_depth * 2 + deck_depth; linear_extrude(height = deck_holder_width){ difference(){ - square([deck_holder_length, sonar_holder_depth * 2 + deck_depth]); + square([deck_holder_length, deck_holder_height]); translate([sonar_holder_depth, sonar_holder_depth]){ square(deck_depth);} - translate([sonar_holder_depth * 2 + deck_depth, sonar_holder_depth]){ - square([deck_holder_length - (sonar_holder_depth * 2 + deck_depth), - deck_depth]);}}}} + translate([deck_holder_height, sonar_holder_depth]){ + square([deck_holder_length - (deck_holder_height), deck_depth]);}}} + translate([deck_holder_length - oshw_dy * 0.05, 0, deck_holder_width / 2]) + scale([0.1, 1, 0.1]) + rotate(v = [1, 0, 0], a = 90) + rotate(90) + linear_extrude(height = 0.5) + oshw(); + translate([deck_holder_length - oshw_dy * 0.05, + deck_holder_height + 0.5, + deck_holder_width / 2]) + rotate(v = [1, 0, 0], a = 90) + rotate(90) + scale([0.1, 0.1, 1]) + linear_extrude(height = 0.5) + oshw();} + +module corner_rounder_2d(radius){ + difference (){ + square (radius); + circle (radius);}} + +module corner_rounder(radius, height){ + linear_extrude(height = height){ + corner_rounder_2d(radius);}} deck_holder(); + translate([0, sonar_holder_depth * 2 + deck_depth + 2, 0]){ sonar_holder();}