| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- //
- // TinySphEAR, Tiny Spherical Ear, First Order (B-format) Ambisonics Microphone
- //
- // Copyright 2015, Fernando Lopez-Lezcano, All Rights Reserved
- // nando@ccrma.stanford.edu
- //
- //
- // This program is free software: you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation, either version 3 of the License, or
- // (at your option) any later version.
- //
- // This program 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 General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
- //
- //
- // 3d Models released under the Creative Commons license as follows:
- // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
- // http://creativecommons.org/licenses/by-nc-sa/4.0/
- // https://en.wikipedia.org/wiki/Tetrahedron
- // angle of capsule to vertical axis = atan(sqrt(2)) = 54.7356103172
- ////
- //// model parameters
- // dimensions of the EM182 electret microphone
- capsule_radius = 5;
- capsule_height = 4.5;
- // distance between face of capsule and center of array
- mic_radius = 10;
- // dimensions of capsule holder connection legs
- // 4mm is too thin for the width, 5mm works better
- leg_width = 5;
- leg_thick = 2.5;
- // width of the ridge that connects to the mount
- ridge_width = 2.0;
- ridge_slot_width = 2;
- // wall thickness of capsule holder
- wall = 1;
- // dimensions of microphone holder
- mount_radius = 2.75;
- mount_wall = 1.0;
- // height of mount
- mount_height = 30;
- // height of sleeve
- sleeve_height = 23;
- sleeve_wall = 0.75;
- // microphone stand mount
- //
- // diameter of existing shielded wires (x 4)
- mic_wire_diam = 1.5;
- mic_wire_hole_radius = 2.5;
- mic_wire_hole_offset = 5;
- // measured diameter = 13.5, inside diameter of sleeve = 13.79 (
- mic_mount_radius = 13.50 / 2;
- // add this to inside diameter
- mic_mount_fit = 0.1;
- mic_mount_slot_height = 11.5;
- mic_mount_slot_width = 4.25;
- mic_mount_slot_radius = 6.25 / 2;
- mic_mount_wall = 1.5;
- mic_mount_height = 35.0 + mic_wire_hole_offset + mic_wire_hole_radius + 2 * mic_mount_wall;
- //// end of model parameters
- ////
- //// rendering control
- // what to render:
- // 0 -> ready to print
- // set = 0 -> one capsule, set = 1 -> four capsules
- // 1 -> the whole microhone with four capsules
- rendermic = 1;
- renderset = 0;
- // what type of connection to use between capsule holders:
- // 0 -> original cylinder beams
- // 1 -> interlocking beams (out)
- // 2 -> interlocking beams (in)
- connect = 2;
- // what type of mount ridges to use
- // 0 -> nothing
- // 1 -> 1 ridge
- // 2 -> 2 ridges
- ridges = 1;
- //// end of rendering control
- ////
- // elevation angle for the capsule holders (fixed for this microphone)
- elev_angle = atan(sqrt(1/2));
- // angles of the connection legs and adjacent capsule holders
- leg_angles_top =
- [
- [-120, elev_angle],
- [0, elev_angle],
- [120, elev_angle]
- ];
- leg_angles_bot =
- [
- [-120, elev_angle],
- [120, elev_angle]
- ];
- // adjustment for the inner radius of the capsule holder
- // measured inside diameter of a trial print was around 7.5 to 8.2
- // instead of 10, capsule diameter was 9.99)
- fudge = 0.15;
- // adjustment for fit of slots in connection legs and mount
- fit = 0.2;
- // number of facets for rendering cylinders
- facets = 64;
- // microphone holder geometry
- capsule_sep_min = (mic_radius - capsule_height) * cos(elev_angle) - (capsule_radius + wall) * sin(elev_angle);
- capsule_sep_max = mic_radius * cos(elev_angle) - (capsule_radius + wall) * sin(elev_angle);
- capsule_bottom = mic_radius * sin(elev_angle) + (capsule_radius + wall) * cos(elev_angle);
- mount_radius_capsule = capsule_sep_max;
- ////////
- // microphone capsule holder
- // azimuth: horizontal orientation of the capsule
- // elevation: vertical orientation of the capsure
- // mounts: vectors containing the angle of the mount and the angle to the adjacent capsule
- // twist: rotate the whole capsule to match mounting legs
- // ridge: 1 -> print ridge for mount
- // solid: make the capsule holder solid, used in the mount to carve the capsule rests
- module capsule (azimuth, elevation, mounts, twist, ridge, solid = 0) {
- rotate([0, 0, azimuth]) {
- rotate([0, (90 - elevation), 0]) {
- translate([0, 0, (rendermic == 0 && solid == 0) ? 0 : mic_radius - capsule_height]) {
- difference () {
- union () {
- // main capsule holder
- cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);
- // the mounting legs
- for (angles = mounts) {
- rotate([0, 0, angles[0] + twist]) {
- // connect with cylindrical beams, very pretty
- if (connect == 0) {
- leg_length = mic_radius * cos(angles[1]) - capsule_radius * sin(angles[1]);
- translate([capsule_radius - wall, 0, capsule_height - wall]) {
- rotate([0, 180 - angles[1], 0]) {
- cylinder(d = leg_width, h = leg_length - 0.3, center = false, $fn = facets);
- }
- }
- }
- // connect with horizontal legs
- if (connect == 1) {
- leg_length = (mic_radius - capsule_height + leg_thick) * tan(90 - angles[1]) - capsule_radius;
- slot_depth = leg_thick * cos(90 - 2 * angles[1]) + wall + fit;
- translate([capsule_radius + leg_length + fudge, - leg_width / 3, 0]) {
- rotate([0, -90, 0]) {
- difference() {
- // thickness, width
- cube([leg_thick, leg_width, leg_length]);
- // cut slot in connector
- translate([0, leg_width / 3 - (fit / 2), 0]) {
- cube([leg_thick, leg_width / 3 + fit, slot_depth]);
- }
- }
- }
- }
- }
- // connect with vertical legs
- if (connect == 2) {
- // fix this 0.2 == (2 * fudge?)
- leg_length = (mic_radius * tan(90 - angles[1]) - capsule_radius) * tan(angles[1]) - 0.2;
- slot_depth = leg_thick * cos (90 - (2 * angles[1]));
- translate([capsule_radius - leg_thick / 2 + fudge, - leg_width / 3,
- - leg_length + capsule_height]) {
- difference() {
- // thickness, width
- difference() {
- cube([leg_thick + leg_thick / 2, leg_width, leg_length]);
- translate([-leg_thick / 2 + wall - fudge, 0, - capsule_height + fudge]) {
- cube([leg_thick, leg_width, leg_length]);
- }
- }
- // cut slot in connector
- translate([0, leg_width / 3 - (fit / 2), 0]) {
- cube([leg_thick + leg_thick / 2, leg_width / 3 + fit, slot_depth]);
- }
- }
- }
- }
- }
- }
- // add ridges for microphone mount
- ridge_length = (mic_radius - capsule_height) / tan(elev_angle) - (capsule_radius + wall);
- if (ridge == 2) {
- rotate([0, 0, twist]) {
- translate([capsule_radius + wall - ridge_length / 2, ridge_slot_width / 2, 0]) {
- cube([ridge_length * 3 / 2, ridge_width, capsule_height], center = false);
- }
- translate([capsule_radius + wall - ridge_length / 2, -ridge_width - ridge_slot_width / 2, 0]) {
- cube([ridge_length * 3 / 2, ridge_width, capsule_height], center = false);
- }
- }
- }
- if (ridge == 1) {
- rotate([0, 0, twist]) {
- translate([capsule_radius + wall - ridge_length / 2, -ridge_width / 2, 0]) {
- cube([ridge_length * 3 / 2, ridge_width, capsule_height], center = false);
- }
- }
- }
- }
- // make the hole for the capsule
- if (solid != 1) {
- translate ([0, 0, 0]) {
- cylinder(r = capsule_radius + fudge, h = capsule_height, $fn = facets);
- }
- }
- // remove any extra connecting beam material from the face of the holder
- if (connect == 0) {
- translate ([0, 0, capsule_height]) {
- cylinder(r = capsule_radius + wall * 2, h = 2, $fn = facets);
- }
- }
- }
- }
- }
- }
- }
- // microphone mount
- //
- // angles: angles for mount slots
- // wall: thickness of cylinder wall
- // separation: height of mount with respect of the microphone assembly
- module mount (angles, wall, separation) {
- cone_height = 5;
- translate([0, 0, -(separation - 0)]) {
- difference() {
- union() {
- // conic section
- translate([0, 0, -cone_height]) {
- difference() {
- cylinder(r2 = mount_radius_capsule, r1 = mount_radius + wall, h = cone_height, $fn = facets);
- // make the hole for the mount (* 1.5 to cut the ridge as well)
- cylinder(r2 = mount_radius_capsule - wall, r1 = mount_radius, h = cone_height * 1.5, $fn = facets);
- }
- }
- translate([0, 0, -mount_height]) {
- difference() {
- cylinder(r = mount_radius + wall, h = mount_height - cone_height, $fn = facets);
- // make the hole for the mount (* 1.5 to cut the ridge as well)
- cylinder(r = mount_radius, h = (mount_height - cone_height) * 1.5, $fn = facets);
- }
- }
- }
- // indentations that match the lower capsule holders
- translate([0, 0, (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
- capsule(angles[0], -elev_angle, [], 0, 1, 1);
- capsule(angles[1], -elev_angle, [], 0, 1, 1);
- }
- // slice it open so we can pop in cables
- rotate([0, 0, 45]) {
- translate([mount_radius - fudge, - mic_wire_diam / 2, -mount_height]) {
- cube([mount_radius_capsule - mount_radius + fudge, mic_wire_diam, mount_height]);
- }
- }
- }
- }
- }
- module mount_sleeve (wall, separation) {
- translate([0, 0, -(separation + 0.0)]) {
- difference() {
- union() {
- // main mount cylinder
- translate([0, 0, -mount_height]) {
- difference() {
- cylinder(r = mount_radius + mount_wall + wall, h = sleeve_height, $fn = facets);
- // make the hole for the mount (* 1.5 to cut the ridge as well)
- cylinder(r = mount_radius + mount_wall, h = sleeve_height * 1.5, $fn = facets);
- }
- }
- // spine that fits into slice of mount body
- rotate([0, 0, 45]) {
- translate([mount_radius - mount_wall, - mic_wire_diam / 2, -mount_height]) {
- cube([2 * mount_wall, mic_wire_diam, sleeve_height]);
- }
- }
- }
- // cut a bit less that one half of the sleeve so it fits around the body
- rotate([0, 0, 45]) {
- translate([-mount_radius - 4 * wall, - (mount_radius + wall) /2, -mount_height]) {
- cube([mount_radius + wall, (mount_radius + wall), sleeve_height]);
- }
- }
- }
- }
- }
- // mount for microphone stand
- //
- module stand_mount (wall, separation) {
- translate([0, 0, -separation]) {
- difference() {
- union() {
- // main mount cylinder
- translate([0, 0, - mic_mount_height]) {
- difference() {
- cylinder(r = mic_mount_radius + mic_mount_fit + wall, h = mic_mount_height, $fn = facets);
- // make the hole for the mount (* 1.5 to cut the ridge as well)
- cylinder(r = mic_mount_radius + mic_mount_fit, h = mic_mount_height, $fn = facets);
- }
- }
- }
- // slot for fitting into microphone stand
- translate([mic_mount_radius - wall / 2, - mic_mount_slot_width / 2, - mic_mount_height]) {
- cube([2 * wall, mic_mount_slot_width, mic_mount_slot_height]);
- }
- // eyelet for microphone stand
- translate([mic_mount_radius - wall / 2, 0, - mic_mount_height + mic_mount_slot_height]) {
- rotate([0, 90, 0]) {
- cylinder(r = mic_mount_slot_radius, h = 2 * wall, $fn = facets);
- }
- }
- // slot and hole for microphone wiring
- translate([mic_mount_radius - wall / 2, - mic_wire_diam / 2, - mic_wire_hole_offset]) {
- cube([2 * wall, mic_wire_diam, mic_wire_hole_offset]);
- }
- translate([mic_mount_radius - wall / 2, 0, - mic_wire_hole_offset]) {
- rotate([0, 90, 0]) {
- cylinder(r = mic_wire_hole_radius, h = 2 * wall, $fn = facets);
- }
- }
- }
- }
- }
- // the cap that connects the microphone stand mount with the microphone mount
- module stand_mount_cap (wall, separation) {
- translate([0, 0, -(separation)]) {
- difference() {
- union() {
- // cap
- cylinder(r = mic_mount_radius + mic_mount_fit + wall, h = wall, $fn = facets);
- translate([0, 0, -wall]) {
- cylinder(r = mic_mount_radius + mic_mount_fit, h = 2 * wall, $fn = facets);
- }
- }
- // hole for mount
- translate([0, 0, - 2 * wall]) {
- cylinder(r = mount_radius + mount_wall + sleeve_wall, h = 3 * wall, $fn = facets);
- }
- // slot for microphone wiring
- translate([0, - mic_wire_diam / 2, - wall]) {
- cube([mic_mount_radius + mic_mount_fit + wall, mic_wire_diam, 2 * wall]);
- }
- }
- }
- }
- // render a complete microphone
- if (rendermic == 1) {
- capsule(45, elev_angle, leg_angles_top, 60, 0);
- capsule(-135, elev_angle, leg_angles_top, 60, 0);
- capsule(-45, -elev_angle, leg_angles_bot, 0, 1);
- capsule(135, -elev_angle, leg_angles_bot, 0, 1);
- // the mount
- mount([-45, 135], mount_wall, capsule_bottom);
- // the sleeve closing it
- mount_sleeve(sleeve_wall, capsule_bottom);
- // the microphone stand mount
- stand_mount_cap(mic_mount_wall, capsule_bottom + mount_height + 3);
- stand_mount(mic_mount_wall, capsule_bottom + mount_height + 5);
- }
- // print all the parts separately
- if (rendermic == 0) {
- if (connect == 1) {
- part_rot = 90;
- part_height = 0;
- part_sep = capsule_radius * 2.5;
- // #3
- translate([part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 60, 0); }
- if (renderset != 0) {
- // #4
- translate([part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 60, 0); }
- // #2
- translate([-part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, -90, 1); }
- // #1
- translate([-part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, 90, 1); }
- // mount body
- translate([0, 0, mount_height]) { mount([-45, 135], 1, 0); }
- // mount sleeve
- translate([mount_radius * 8, 0, mount_height]) { mount_sleeve(1, 0); }
- // add connecting ridges to make it all one part
- difference() {
- for (rot_a = [-45, 45]) {
- rotate([0, 0, rot_a]) {
- translate([-wall / 2, -part_sep, 0]) {
- cube([wall, part_sep * 2, wall / 2]);
- }
- }
- }
- // remove them in the inside of the mount
- cylinder(r = mount_radius + wall / 2, h = wall / 2);
- }
- }
- } else {
- // connect == 2
- part_rot = -90;
- part_height = capsule_height;
- part_sep = capsule_radius * 2;
- // #3
- *translate([part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 0, 0); }
- if (renderset != 0) {
- // #4
- *translate([part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 0, 0); }
- // #2
- translate([-part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, -90, 1); }
- // #1
- translate([-part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, 90, 1); }
- // mount
- *rotate([0, 0, 45]) {
- translate([0, 0, mount_height]) { mount([-45, 135], mount_wall, 0); }
- }
- // mount sleeve
- *translate([10, 0, mount_height]) {
- rotate([0, 0, 45]) {
- mount_sleeve(sleeve_wall, 0); }
- }
- // stand mount
- *translate([0, 0, mic_mount_height + mic_mount_height]) {
- stand_mount(mic_mount_wall, mic_mount_height);
- }
- // stand mount cap
- *rotate([0, 180, 0]) {
- translate([2 * mic_mount_radius + 8, 0, - mic_mount_wall]) {
- stand_mount_cap(mic_mount_wall, 0);
- }
- }
- // add connecting ridges to make it all one part
- *difference() {
- for (rot_a = [-45, 45]) {
- rotate([0, 0, rot_a]) {
- translate([-wall / 2, -part_sep * 0.85, 0]) {
- cube([wall, part_sep * 1.75, wall / 2]);
- }
- }
- }
- // remove them in the inside of the mount
- cylinder(r = mount_radius + wall / 2, h = wall / 2);
- }
- }
- }
- }
|