//
// Spherical Harmonics Ear Project (*SpHEAR)
//
// TinySpHEAR, First Order (B-format) Ambisonics Microphone
// Mount for four Zapnspark phantom power printed circuit boards
//
// Copyright 2015-2016, 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 .
//
// 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/
include ;
include ;
////
//// default model parameters
////
// size of Zapnspark printed circuit board
// kicad length = 79.375
// measured length = 79.20 (2016.08.25)
pcb_length = 79.20;
// kicad width = 19.050
// measured width = 18.82 (2016.08.25)
pcb_width = 18.85;
// ultimaker spec thickness = 1.61
// measured thickness = 1.56 (w/ copper)
pcb_thickness = 1.58;
// tolerance to add to length and width of pcb
//
// measured 3d print width = 18.70 (with pcb_fit = 0.3)
// actual printed = 18.70 - 0.3 = 16.97
// total correction = 18.85 - 16.97 = 1.88
//
pcb_fit = 0.4;
// tolerance add to thickness of pcb
//
// printed with pcb_tfit = 0.15 -> 1.58 + 0.15 = 1.73 (ideal printed)
// measured print channel = 1.63 : 0.1 thinner (ultimaker 2 plus, 2016.08.24)
// measured pcb thickness = 1.58 (othermill)
//
pcb_tfit = 0.15;
// we leave part of the pcb exposed on the bottom of the body so that we
// can solder the wires that connect the microphone with the
// preamplifier, same at the top of the pcb to solder the wires
// to the capsules
pcb_low_exp = 12.0;
pcb_hi_exp = 8.0;
// clearance from the bottom and top of pcb's to the start of the flare,
// this adds space for the protuding molex pins on which we solder
pcb_low_clear = 15.0;
pcb_hi_clear = 15.0;
// back and front clearance of pcb (components and leads)
pcb_front = 13.25;
pcb_back = 3.0;
// depth of slot into which the printed circuit board fits
pcb_slot_depth = 1.0;
// diameter of four conductor cable
cable_diam = 9.5;
// lip that mounts flares into main body box
mount_lip = 6.0;
// lip fit for flares
lip_fit = 0.15;
// capsule array mount, height of flare and stalk
flare_height = 50;
stalk_height = 40;
// wall thickness
wall = 1.0;
// calculated minimum "radius" of microphone box
box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
// calculated main body corner radius
mount_corner = box_radius - pcb_width / 2 + pcb_slot_depth + 1.0;
// shock mount parameters
//
ring_sep = 30.0;
ring_height = 10.0;
rubber_band_angle = 40;
main_radius_inc = (ring_sep / 2) / tan(rubber_band_angle);
// gap between internal ring and microphone body
internal_ring_gap = 1.0;
// connector that joins the two internal rings
connector_w = 10.0;
connector_d = 2.0;
// wall thickness and height of shock mount rings
ring_wall = 4 * wall;
ring_ext_height = 6;
// gap between external ring and support arm
ring_arm_gap = 20;
// all four printed circuit boards
module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
for (rot = [0, 90, 180, 270]) {
rotate([0, 0, rot]) {
pcb_clear(pcb_length + pcb_fit, pcb_width + pcb_fit, pcb_thickness + pcb_tfit, slot_depth, front, back);
}
}
}
// the main body of the microphone mount
module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
difference() {
rounded_block(height, radius, radius, corner);
union() {
// hollow out the inside with slots for pcbs
tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, pcb_slot_depth, pcb_front, pcb_back);
// trim square angles
cylinder(r = pcb_front, h = height, $fn = facets);
// remove slots from inside body
slot_len = 30;
translate([0, 0, slot_len]) {
rounded_block_relative(height, radius, radius, corner, - (2 * wall));
}
// upper lip for flare to microphone
translate([0, 0, height - upper_lip]) {
difference() {
rounded_block(upper_lip, radius, radius, corner);
rounded_block_relative(upper_lip, radius, radius, corner, -(wall + lip_fit));
}
}
// lower lip for flare to cable
translate([0, 0, 0]) {
difference() {
rounded_block(lower_lip, radius, radius, corner);
rounded_block_relative(lower_lip, radius, radius, corner, -(wall + lip_fit));
}
}
}
}
// add parts for clearance check
if (clear == 1) {
// electrolytic capacitors
cap_diam = 10.2;
for (rot = [0, 180, 270]) {
rotate([0, 0, rot]) {
translate([-pcb_front + cap_diam/2, 0, 0]) {
*cylinder(r = (cap_diam/2), h = 20, $fn = facets);
}
}
}
// PCBs
for (rot = [0, 180, 270]) {
rotate([0, 0, rot]) {
translate([-(pcb_front + pcb_thickness), -pcb_width/2, -pcb_low_exp]) {
cube([pcb_thickness, pcb_width, pcb_length]);
}
}
}
// connectors
cap_h = 12.3;
cap_w = 10.53/2;
for (rot = [0, 180, 270]) {
rotate([0, 0, rot]) {
translate([-pcb_front, -cap_w/2 - 2.5, 0]) {
*cube([cap_h, cap_w, 20]);
}
}
}
}
}
// flares from the body to the microphone stalk and cable
module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_radius, stalk_height, dot) {
// bottom rounded box
difference() {
rounded_block(height, bot_radius, bot_radius, bot_corner);
rounded_block_relative(height, bot_radius, bot_radius, bot_corner, -(2 * wall));
// cut flange to mount on body
rounded_block_relative(lip + 1.00, bot_radius, bot_radius, bot_corner, - (wall));
// and make a smooth transition to avoid overhangs
translate([0, 0, lip + 1.00]) {
hull() {
rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
translate([0, 0, 1.0]) {
rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - 2 * wall);
}
}
}
}
// flare to round section
translate([0, 0, height]) {
difference() {
hull() {
rounded_block(thin_mint, bot_radius, bot_radius, bot_corner);
translate([0, 0, transition]) {
cylinder(r = top_radius, h = thin_mint, $fn = facets);
}
}
hull() {
rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
translate([0, 0, transition]) {
cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
}
}
}
}
// cylindrical stalk
translate([0, 0, height + transition]) {
difference() {
cylinder(r = top_radius, h = stalk_height, $fn = facets);
cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
}
// add marker for "back of microphone" orientation
if (dot == 1) {
rotate([0, 0, 90]) {
translate([0, top_radius - wall * 2 / 3, stalk_height - top_radius]) {
difference() {
sphere(r = top_radius / 3, $fn = 32);
translate([0, -top_radius + top_radius / 2, 0]) {
cube([top_radius, top_radius, top_radius], center = true);
}
}
}
}
}
}
}
// top conical section that plugs into capsule array
module tetra_capsule_array_mount(angles) {
difference() {
translate([0, 0, 0]) {
rotate([0, 0, 45]) {
difference() {
hull() {
cylinder(r = mount_radius + wall, h = thin_mint, $fn = facets);
translate([0, 0, mount_top_height]) {
rounded_block(thin_mint, capsule_radius + wall, mount_radius_capsule, mount_radius);
}
}
hull() {
cylinder(r = mount_radius, h = thin_mint, $fn = facets);
translate([0, 0, mount_top_height]) {
rounded_block_relative(thin_mint, capsule_radius + wall, mount_radius_capsule, mount_radius, -wall);
}
}
}
}
}
// indentations that match the two lower capsule holders
// add ridge height adjustment
translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(elev_angle)]) {
rotate([0, (90 + elev_angle), angles[0]]) {
translate([0, 0, mic_radius - capsule_height]) {
capsule([], 0, 1, 0.1, 3, 1);
}
}
rotate([0, (90 + elev_angle), angles[1]]) {
translate([0, 0, mic_radius - capsule_height]) {
capsule([], 0, 1, 0.1, 3, 1);
}
}
}
}
}
////
//// render all the different parts
////
// microphone body: flare to capsule array (slips into PCB holder body)
//
module render_tetra_capsule_flare(z_offset) {
translate([0, 0, z_offset]) {
tetra_mount_flare(pcb_hi_clear + pcb_hi_exp,
mount_lip, flare_height, box_radius + wall, mount_corner, mount_radius + wall, stalk_height, 1);
translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height + stalk_height]) {
tetra_capsule_array_mount([-45, 135]);
}
}
}
// microphone body: main body, holds printed circuit boards
//
tetra_pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
module render_tetra_pcb_mount(z_offset, showint) {
translate([0, 0, z_offset]) {
tetra_mount_body(tetra_pcb_mount_height, box_radius + wall, mount_corner, mount_lip, mount_lip, showint);
}
// add ccrma logo
rotate([0, 0, -90]) {
translate([0, -(box_radius - 0.5), tetra_pcb_mount_height / 2]) {
rotate([90, 270, 0]) {
logo_scale = 1 / 2.2;
scale([logo_scale, logo_scale, 1.0]) {
ccrma_logo(1.65);
}
}
}
}
}
// microphone body: flare to microphone cable (slips into PCB holder body)
//
module render_tetra_cable_flare(z_offset, flip) {
translate([0, 0, z_offset]) {
tetra_mount_flare(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10, 0);
}
}
// microphone body: render all parts with a vertical separation
//
module render_tetra_body(z_offset, spread, showint) {
rotate([0, 180, 0]) {
render_tetra_cable_flare(0);
}
lippy = spread - mount_lip;
render_tetra_pcb_mount(lippy, showint);
render_tetra_capsule_flare(tetra_pcb_mount_height + 2 * lippy);
}
// microphone: render the full assembly with a vertical separation
//
module render_tetra_microphone(z_offset, spread) {
render_tetra_body(z_offset, spread);
lippy = spread - mount_lip;
render_tetra_capsule_array(z_offset + tetra_pcb_mount_height + mount_top_height +
flare_height + stalk_height + pcb_hi_clear + pcb_hi_exp + 2 * lippy + spread + mic_radius);
}
// microphone: render the full assembly with a vertical separation
// cut out halt of the assembly so that we can see the inside
//
module render_tetra_microphone_cutout(z_offset, spread) {
difference() {
render_tetra_microphone(z_offset, spread);
// a cube that blots out 1/4 of the microphone
rotate([0, 0, 45]) {
translate([0, 0, -50]) {
cube([50, 100, 650]);
}
}
}
}
// shock mount: microphone clip on stand mount
//
module render_tetra_shock_mount_stand(z_offset) {
translate([z_offset]) {
shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
}
}
// shock mount: external ring
//
module render_tetra_shock_mount_external_ring(z_offset) {
translate([0, 0, z_offset]) {
shock_mount_external_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, main_radius_inc, 0);
}
}
// shock mount: bottom internal ring
//
module render_tetra_shock_mount_internal_ring_bot(z_offset) {
translate([0, 0, z_offset]) {
shock_mount_internal_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, internal_ring_gap, 1);
}
}
// shock mount: all four internal ring connectors
//
module render_tetra_shock_mount_ring_connectors(offset) {
for (o = [0, 1, 2, 3]) {
translate([-18, (10 + offset) * o, 0]) {
shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
}
}
}
// shock mount: top internal ring
//
module render_tetra_shock_mount_internal_ring_top(z_offset) {
translate([0, 0, z_offset]) {
shock_mount_internal_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, internal_ring_gap, 0);
}
}
// shock mount: render all parts
//
module render_tetra_shock_mount(z_offset) {
// internal rings
translate([0, 0, z_offset + ring_sep / 2]) {
render_tetra_shock_mount_internal_ring_top(0);
rotate([0, 180, 0]) {
render_tetra_shock_mount_internal_ring_bot(ring_sep + 2);
}
// insert the connecting rods
for (r = [0, 90, 180, 270]) {
rotate([0, 0, r]) {
translate([box_radius + 3 * wall + internal_ring_gap, 0, -1]) {
rotate([0, 90, 0]) {
translate([-4, -5, 1]) {
shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
}
}
}
}
}
}
// external ring
translate([0, 0, z_offset - ring_height / 4]) {
render_tetra_shock_mount_external_ring(0);
}
// mount to stand
translate([box_radius + mount_corner + ring_wall + ring_arm_gap + 8 + ring_wall / 2 + 4, 0, -(mic_mount_height + mic_mount_radius + ring_height / 4)]) {
render_tetra_shock_mount_stand(0);
}
}