TinySpHEAR_mount_pcb.scad 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. //
  2. // Spherical Harmonics Ear Project (*SpHEAR)
  3. //
  4. // TinySpHEAR, First Order (B-format) Ambisonics Microphone
  5. // Mount for four Zapnspark phantom power printed circuit boards
  6. //
  7. // Copyright 2015-2016, Fernando Lopez-Lezcano, All Rights Reserved
  8. // nando@ccrma.stanford.edu
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. // 3d Models released under the Creative Commons license as follows:
  24. // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
  25. // http://creativecommons.org/licenses/by-nc-sa/4.0/
  26. include <SpHEAR_common.scad>;
  27. include <TinySpHEAR_common.scad>;
  28. include <CCRMA_logo.scad>;
  29. // http://dkprojects.net/openscad-threads/
  30. // used for the windscreeen mount threads
  31. include <threads.scad>;
  32. ////
  33. //// default model parameters
  34. ////
  35. // size of Zapnspark printed circuit board
  36. // kicad length = 79.375
  37. // measured length = 79.20 (2016.08.25)
  38. pcb_length = 79.20;
  39. // kicad width = 19.050
  40. // measured width = 18.82 (2016.08.25)
  41. pcb_width = 18.85;
  42. // ultimaker spec thickness = 1.61
  43. // measured thickness = 1.56 (w/ copper)
  44. pcb_thickness = 1.58;
  45. // tolerance to add to length and width of pcb
  46. //
  47. // measured 3d print width = 18.70 (with pcb_fit = 0.3)
  48. // actual printed = 18.70 - 0.3 = 16.97
  49. // total correction = 18.85 - 16.97 = 1.88
  50. //
  51. pcb_fit = 0.4;
  52. // tolerance add to thickness of pcb
  53. //
  54. // printed with pcb_tfit = 0.15 -> 1.58 + 0.15 = 1.73 (ideal printed)
  55. // measured print channel = 1.63 : 0.1 thinner (ultimaker 2 plus, 2016.08.24)
  56. // measured pcb thickness = 1.58 (othermill)
  57. //
  58. pcb_tfit = 0.15;
  59. // we leave part of the pcb exposed on the bottom of the body so that we
  60. // can solder the wires that connect the microphone with the
  61. // preamplifier, same at the top of the pcb to solder the wires
  62. // to the capsules
  63. pcb_low_exp = 12.0;
  64. pcb_hi_exp = 8.0;
  65. // clearance from the bottom and top of pcb's to the start of the flare,
  66. // this adds space for the protuding molex pins on which we solder
  67. pcb_low_clear = 15.0;
  68. pcb_hi_clear = 15.0;
  69. // back and front clearance of pcb (components and leads)
  70. pcb_front = 13.25;
  71. pcb_back = 3.0;
  72. // depth of slot into which the printed circuit board fits
  73. pcb_slot_depth = 1.0;
  74. // diameter of four conductor cable (Mogami W2931)
  75. cable_diam = 9.5;
  76. // diameter of microphone capsule cable (Mogami 2490)
  77. capsule_cable_diam = 1.7;
  78. // lip that mounts flares into main body box
  79. mount_lip = 10.0;
  80. // lip fit for flares
  81. lip_fit = 0.05;
  82. // capsule array mount, height of flare and stalk
  83. flare_height = 50;
  84. stalk_height = 40;
  85. // adjust mic array to mount relative height
  86. mic_to_mount_fit = 0.0;
  87. // wall thickness
  88. wall = 1.0;
  89. // calculated minimum "radius" of microphone box
  90. box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
  91. // calculated main body corner radius
  92. mount_corner = box_radius - pcb_width / 2 + pcb_slot_depth + 4.0;
  93. // calculated radius at the corners
  94. box_corner_radius = (box_radius + wall - mount_corner) / sin(45) + mount_corner;
  95. //// snap joints to join the body to the two flares
  96. //
  97. // render snap joints to join all three main assemblies
  98. render_snap_joints = false;
  99. // body to flares snap joint arm slot width
  100. snap_joint_slot_w = 0.75;
  101. // width and radius of snap joint hook that locks upper and lower flanges to body
  102. snap_joint_hook_w = 5.0;
  103. snap_joint_hook_r = 1.4;
  104. //// screw holes to join the body to the two flares
  105. //
  106. render_screw_holes = true;
  107. // dimensions of 12 pin male bottom connector
  108. //
  109. // Amphenol T 3635 002
  110. // 12 pin DIN male to cable, gold plated contacts
  111. //
  112. // inner diameter of connector core
  113. conn_core_diam = 13.00 + 0.2;
  114. // outer diameter of connector core sleeve
  115. conn_core_o_diam = 17.00;
  116. // inner diameter of connector core sleeve
  117. conn_core_s_diam = 15.00;
  118. // from top of connector to sleeve
  119. conn_core_sleeve = 13.00;
  120. // from top of connector to holes
  121. conn_core_holes_h = 6.00;
  122. // between holes
  123. conn_core_holes_w = 9.20;
  124. // hole diameter
  125. conn_core_holes_d = 1.95 + 0.2;
  126. // screw head diameter
  127. conn_core_screw_d = 2.75 + 0.5;
  128. // sleeve overlap
  129. conn_core_overlap = 3.00;
  130. // shock mount parameters
  131. //
  132. ring_sep = 30.0;
  133. ring_height = 10.0;
  134. rubber_band_angle = 40;
  135. main_radius_inc = (ring_sep / 2) / tan(rubber_band_angle);
  136. // gap between internal ring and microphone body
  137. internal_ring_gap = 1.0;
  138. // connector that joins the two internal rings
  139. connector_w = 10.0;
  140. connector_d = 2.0;
  141. // wall thickness and height of shock mount rings
  142. ring_wall = 4 * wall;
  143. ring_ext_height = 6;
  144. // gap between external ring and support arm
  145. ring_arm_gap = 20;
  146. // windscreen parameters
  147. //
  148. windscreen_height = 60;
  149. windscreen_w = 4.0;
  150. beam_radius = 1.3;
  151. windscreen_thread_height = 10.0;
  152. windscreen_thread_pitch = 2.0;
  153. windscreen_thread_angle = 30;
  154. windscreen_thread_depth = cos(windscreen_thread_angle) * windscreen_thread_pitch * 5/8 + 0.5;
  155. windscreen_thread_radius = box_corner_radius + windscreen_thread_depth;
  156. windscreen_thread_fit = 3 * fit;
  157. // windscreen_thread_fit = 4 * fit;
  158. // all four printed circuit boards
  159. module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
  160. for (rot = [0, 90, 180, 270]) {
  161. rotate([0, 0, rot]) {
  162. pcb_clear(pcb_length + pcb_fit, pcb_width + pcb_fit, pcb_thickness + pcb_tfit, slot_depth, front, back);
  163. }
  164. }
  165. }
  166. // the main body of the microphone mount
  167. module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
  168. difference() {
  169. rounded_block(height, radius, radius, corner);
  170. union() {
  171. // hollow out the inside with slots for pcbs
  172. tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, pcb_slot_depth, pcb_front, pcb_back);
  173. // trim square angles
  174. cylinder(r = pcb_front, h = height, $fn = facets);
  175. // remove slots from inside body
  176. slot_len = 30;
  177. translate([0, 0, slot_len]) {
  178. difference() {
  179. rounded_block_relative(height, radius, radius, corner, - (2 * wall));
  180. if (render_screw_holes) {
  181. // add columns for upper screw holes
  182. col_w = 3.5;
  183. for (r = [45, 135, 225, 315]) rotate([0, 0, r])
  184. translate([radius - col_w*2/3, -col_w/2, 0]) {
  185. cube([col_w, col_w, height]);
  186. }
  187. }
  188. }
  189. }
  190. // upper lip for flare to microphone
  191. translate([0, 0, height - upper_lip]) {
  192. difference() {
  193. rounded_block(upper_lip, radius, radius, corner);
  194. rounded_block_relative(upper_lip, radius, radius, corner, -(wall + lip_fit));
  195. }
  196. }
  197. // lower lip for flare to cable
  198. translate([0, 0, 0]) {
  199. difference() {
  200. rounded_block(lower_lip, radius, radius, corner);
  201. rounded_block_relative(lower_lip, radius, radius, corner, -(wall + lip_fit));
  202. }
  203. }
  204. if (render_screw_holes) {
  205. // make eight holes in the the body for screws that hold both flares
  206. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  207. for (z = [lower_lip/2, height - upper_lip/2])
  208. for (r = [45, 135, 225, 315]) {
  209. rotate([0, 0, r])
  210. translate([-(radius + 2 * wall), 0, z]) {
  211. rotate([0, 90, 0]) {
  212. cylinder(r = 0.7, h = radius + wall, $fn = facets);
  213. }
  214. }
  215. }
  216. }
  217. if (render_snap_joints) {
  218. // slots for snap joint hooks
  219. // lower
  220. for (m=[-1, 1]) rotate([0, 90, 0]) {
  221. translate([-lower_lip * 3/4, (radius - wall/2)*m, -(snap_joint_hook_w/2 + 0.25)]) {
  222. cylinder(r = snap_joint_hook_r, h = snap_joint_hook_w + 0.5, $fn = facets);
  223. }
  224. }
  225. // upper
  226. for (m=[-1, 1]) rotate([0, 90, 0]) {
  227. translate([- height + upper_lip * 3/4, (radius - wall/2)*m, -(snap_joint_hook_w/2 + 0.25)]) {
  228. cylinder(r = snap_joint_hook_r, h = snap_joint_hook_w + 0.5, $fn = facets);
  229. }
  230. }
  231. }
  232. }
  233. }
  234. if (render_snap_joints) {
  235. // upper lip is too thin, reinforce the back of the snap joint hook holes
  236. for (r = [0, 180]) rotate([0, 90, r]) {
  237. translate([- height + upper_lip * 3/4, (radius - wall), -(snap_joint_hook_w/2 + 0.25)]) {
  238. difference() {
  239. cylinder(r = snap_joint_hook_r * 1.25, h = snap_joint_hook_w + 0.5, $fn = facets);
  240. translate([- snap_joint_hook_r * 1.25, - wall, 0]) {
  241. cube([snap_joint_hook_r * 3, snap_joint_hook_r * 3, snap_joint_hook_w * 1.5]);
  242. }
  243. }
  244. }
  245. }
  246. }
  247. // add parts for clearance check
  248. if (clear == 1) {
  249. // electrolytic capacitors
  250. cap_diam = 10.2;
  251. for (rot = [0, 180, 270]) {
  252. rotate([0, 0, rot]) {
  253. translate([-pcb_front + cap_diam/2, 0, 0]) {
  254. *cylinder(r = (cap_diam/2), h = 20, $fn = facets);
  255. }
  256. }
  257. }
  258. // PCBs
  259. for (rot = [0, 180, 270]) {
  260. rotate([0, 0, rot]) {
  261. translate([-(pcb_front + pcb_thickness), -pcb_width/2, -pcb_low_exp]) {
  262. cube([pcb_thickness, pcb_width, pcb_length]);
  263. }
  264. }
  265. }
  266. // connectors
  267. cap_h = 12.3;
  268. cap_w = 10.53/2;
  269. for (rot = [0, 180, 270]) {
  270. rotate([0, 0, rot]) {
  271. translate([-pcb_front, -cap_w/2 - 2.5, 0]) {
  272. *cube([cap_h, cap_w, 20]);
  273. }
  274. }
  275. }
  276. }
  277. }
  278. // flares from the body to the microphone stalk and cable
  279. module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_radius, windscreen) {
  280. // bottom rounded box
  281. difference() {
  282. union() {
  283. rounded_block(height, bot_radius, bot_radius, bot_corner);
  284. if (windscreen) {
  285. translate([0, 0, lip]) {
  286. metric_thread(diameter = windscreen_thread_radius * 2, pitch = windscreen_thread_pitch,
  287. length = lip, angle = windscreen_thread_angle, internal = false);
  288. }
  289. cylinder(r2 = box_corner_radius + 1.5, r1 = box_radius + 0.5, h = windscreen_thread_height, $fn = facets);
  290. // index for back of microphone
  291. translate([-bot_radius, 0, 0]) {
  292. cylinder(r = 1.0, h = height, $fn = facets);
  293. }
  294. }
  295. if (render_screw_holes) {
  296. // small supports for the screws that attach the flare to the body
  297. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  298. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  299. translate([bot_radius + wall/3, 0, lip/2]) {
  300. rotate([0, 90, 0]) {
  301. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  302. }
  303. }
  304. }
  305. }
  306. if (render_snap_joints) {
  307. // make snap joint arm thicker
  308. for (r = [0, 180]) rotate([0, 0, r]) {
  309. translate([- snap_joint_hook_w - snap_joint_slot_w / 2, bot_radius, 0]) {
  310. cube([snap_joint_hook_w * 2 + snap_joint_slot_w, wall / 2, lip * 1.25]);
  311. }
  312. }
  313. }
  314. }
  315. rounded_block_relative(height, bot_radius, bot_radius, bot_corner, -(2 * wall));
  316. // cut flange to mount on body
  317. rounded_block_relative(lip + 1.00, bot_radius, bot_radius, bot_corner, - (wall));
  318. if (render_screw_holes) {
  319. // holes for screws that attach the flare to the body
  320. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  321. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  322. translate([bot_radius + wall, 0, lip/2]) {
  323. rotate([0, 90, 0]) {
  324. cylinder(r = (1.6 + 0.1)/2, h = bot_radius, $fn = facets);
  325. }
  326. }
  327. }
  328. }
  329. if (render_snap_joints) {
  330. // cut slots for snap joint hooks
  331. for (r = [0, 180]) rotate([0, 0, r]) {
  332. for (m = [-1, 1]) {
  333. translate([m * (snap_joint_hook_w + snap_joint_slot_w) - snap_joint_slot_w / 2, bot_radius - 1.5 * wall, 0]) {
  334. cube([snap_joint_slot_w, 2 * wall, lip - 1.0]);
  335. }
  336. }
  337. }
  338. }
  339. // and make a smooth transition to avoid overhangs
  340. translate([0, 0, lip + 1.00]) {
  341. hull() {
  342. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
  343. translate([0, 0, 1.0]) {
  344. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - 2 * wall);
  345. }
  346. }
  347. }
  348. }
  349. if (render_snap_joints) {
  350. // add snap joint hook to arm
  351. for (r = [0, 180]) rotate([0, 0, r]) {
  352. translate([- snap_joint_hook_w / 2, bot_radius - wall/2, 1/4 * lip]) {
  353. rotate([90, 0, 90]) {
  354. difference() {
  355. cylinder(r = snap_joint_hook_r - 0.2, h = snap_joint_hook_w, $fn = facets);
  356. translate([0, -snap_joint_hook_r, 0]) {
  357. cube([snap_joint_hook_r, snap_joint_hook_w, snap_joint_hook_w]);
  358. }
  359. }
  360. }
  361. }
  362. }
  363. }
  364. // flare to round section
  365. translate([0, 0, height]) {
  366. difference() {
  367. hull() {
  368. rounded_block(thin_mint, bot_radius, bot_radius, bot_corner);
  369. translate([0, 0, transition]) {
  370. cylinder(r = top_radius, h = thin_mint, $fn = facets);
  371. }
  372. }
  373. hull() {
  374. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
  375. translate([0, 0, transition]) {
  376. cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
  377. }
  378. }
  379. }
  380. }
  381. }
  382. // stalk that connects upper flare to capsule array mount
  383. module tetra_mount_array_stalk(height, radius) {
  384. difference() {
  385. cylinder(r = radius, h = height, $fn = facets);
  386. cylinder(r = radius - wall, h = height, $fn = facets);
  387. }
  388. // add marker for "back of microphone" orientation
  389. *rotate([0, 0, 90]) {
  390. translate([0, radius - wall * 2 / 3, height - radius]) {
  391. difference() {
  392. sphere(r = radius / 3, $fn = 32);
  393. translate([0, -radius + radius / 2, 0]) {
  394. cube([radius, radius, radius], center = true);
  395. }
  396. }
  397. }
  398. }
  399. }
  400. // bottom cable holder
  401. module tetra_mount_cable_holder(height, radius) {
  402. difference() {
  403. cylinder(r = radius, h = height, $fn = facets);
  404. cylinder(r = radius - wall, h = height, $fn = facets);
  405. }
  406. }
  407. // bottom connector holder
  408. module tetra_mount_connector_holder(height, radius, inside_radius, sleeve_height, sleeve_radius) {
  409. difference() {
  410. union() {
  411. cylinder(r = radius, h = height, $fn = facets);
  412. // add seats for screw heads
  413. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, radius / 2, conn_core_holes_h]) {
  414. rotate([90, 0, 0]) {
  415. scale([1, 1, 1]) cylinder(r = conn_core_screw_d / 2, h = radius * 1.43, $fn = facets);
  416. }
  417. }
  418. }
  419. cylinder(r = inside_radius, h = height, $fn = facets);
  420. // transition from thin wall to thick wall at the bottom of connector
  421. cylinder(r1 = radius - wall, r2 = inside_radius, h = 2.0, $fn = facets);
  422. // holes for connector core screws
  423. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius / 3, conn_core_holes_h]) {
  424. rotate([90, 0, 0]) {
  425. cylinder(r = conn_core_holes_d / 2, h = radius, $fn = facets);
  426. }
  427. }
  428. // substract cutout for screw heads
  429. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius + 1.5, conn_core_holes_h]) {
  430. rotate([90, 0, 0]) {
  431. cylinder(r = conn_core_screw_d / 2, h = 2.0, $fn = facets);
  432. }
  433. }
  434. }
  435. // thinner cylinder sits inside connector sleeve
  436. translate([0, 0, height]) {
  437. difference() {
  438. cylinder(r = sleeve_radius, h = sleeve_height, $fn = facets);
  439. cylinder(r = inside_radius, h = sleeve_height, $fn = facets);
  440. }
  441. }
  442. }
  443. // top conical section that plugs into capsule array
  444. module tilted_cylinder(radius, height, offset) {
  445. hull() {
  446. cylinder(r = radius, h = thin_mint, $fn = facets);
  447. translate([offset, 0, height]) {
  448. cylinder(r = radius, h = thin_mint, $fn = facets);
  449. }
  450. }
  451. }
  452. module tilted_cube(width, depth, height, offset) {
  453. hull() {
  454. cube([width, depth, thin_mint]);
  455. translate([offset, 0, height]) {
  456. cube([width, depth, thin_mint]);
  457. }
  458. }
  459. }
  460. module tetra_capsule_array_mount_old(angles, mount_radius, mount_wall) {
  461. difference() {
  462. union() {
  463. rotate([0, 0, 45]) {
  464. wire_offset = wall;
  465. wire_diam = mic_wire_diam + mic_wire_fit;
  466. // FIXME: this 1.75 is the former leg_thick value, it should be calculated
  467. // based on the capsule diameter so that the cable fits in between the capsules
  468. // sleeve_width = 1.75 + wire_offset + wire_diam * 2 + wall / 2;
  469. sleeve_width = 3.75 + wire_offset + wire_diam * 2 + wall / 2;
  470. sleeve_width_max = capsule_radius + wall;
  471. sleeve_w = (sleeve_width > sleeve_width_max) ? sleeve_width : sleeve_width_max;
  472. difference() {
  473. hull() {
  474. cylinder(r = mount_radius + mount_wall, h = thin_mint, $fn = facets);
  475. translate([0, 0, mount_top_height]) {
  476. rounded_block(thin_mint, sleeve_w, mount_radius_capsule - wall/2, mount_radius*4/5);
  477. }
  478. }
  479. // cavity for printing without support
  480. scale([1.0, 1.0, 3.0]) {
  481. sphere(r = mount_radius, $fn = facets);
  482. }
  483. // holes for cables
  484. // offset for outer hole
  485. hole_offset_l = mount_radius - wire_diam / 2;
  486. hole_offset_h = (sleeve_w - wall - wire_diam / 2) - hole_offset_l;
  487. for (m = [0, 1]) mirror([m, 0, 0]) {
  488. translate([hole_offset_l - wire_diam, 0, 0]) {
  489. tilted_cylinder(wire_diam / 2, mount_top_height, hole_offset_h);
  490. }
  491. translate([hole_offset_l, 0, 0]) {
  492. tilted_cylinder(wire_diam / 2, mount_top_height, hole_offset_h);
  493. }
  494. // shave the inside of the double tube
  495. translate([hole_offset_l - wire_diam, - wire_diam / 4, 0]) {
  496. tilted_cube(wire_diam, wire_diam/2, mount_top_height, hole_offset_h);
  497. }
  498. }
  499. }
  500. }
  501. }
  502. // indentations that match the two lower capsule holders
  503. // add ridge height adjustment
  504. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(elev_angle) - mic_to_mount_fit]) {
  505. rotate([0, (90 + elev_angle), angles[0]]) {
  506. translate([0, 0, mic_radius - capsule_height]) {
  507. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  508. }
  509. }
  510. rotate([0, (90 + elev_angle), angles[1]]) {
  511. translate([0, 0, mic_radius - capsule_height]) {
  512. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  513. }
  514. }
  515. }
  516. // slice top sides of mount
  517. for (rot = [45, 45 + 180]) {
  518. translate([0, 0, 0]) {
  519. rotate([0, 30, rot]) {
  520. translate([-mount_radius_capsule, -(mount_radius_capsule), mount_top_height])
  521. cube([mount_radius_capsule*2, mount_radius_capsule*2, 10]);
  522. }
  523. }
  524. }
  525. }
  526. }
  527. module tetra_capsule_array_mount(angles, mount_radius, mount_wall) {
  528. pedestal = 3.0;
  529. difference() {
  530. union() {
  531. rotate([0, 0, 45]) {
  532. wire_offset = wall;
  533. wire_diam = mic_wire_diam + mic_wire_fit;
  534. difference() {
  535. // outer sleeve
  536. hull() {
  537. for (r = [0, 180]) rotate([0, 0, r]) {
  538. for (t = [1, -1]) translate([mount_radius + 2 * wall, (wire_diam/2 + wall/4) * t, mount_top_height - pedestal]) {
  539. cylinder(r = wire_diam/2 + wall, h = pedestal, $fn = facets);
  540. }
  541. }
  542. cylinder(r = mount_radius + mount_wall, h = thin_mint, $fn = facets);
  543. }
  544. // holes for cables in top part of sleeve
  545. for (r = [0, 180]) rotate([0, 0, r]) {
  546. for (t = [1, -1]) translate([mount_radius + 2 * wall, (wire_diam/2 + wall/4) * t, mount_top_height - pedestal]) {
  547. cylinder(r = wire_diam/2, h = pedestal, $fn = facets);
  548. }
  549. }
  550. // holes for cables in bottom part of sleeve
  551. for (r = [0, 180]) rotate([0, 0, r]) {
  552. for (t = [1, -1]) {
  553. hull() {
  554. translate([mount_radius - wire_diam/2 - wall, wire_diam/2 * t, 0]) {
  555. cylinder(r = wire_diam/2, h = thin_mint, $fn = facets);
  556. }
  557. translate([mount_radius + 2 * wall, (wire_diam/2 + wall/4) * t, mount_top_height - pedestal]) {
  558. cylinder(r = wire_diam/2, h = thin_mint, $fn = facets);
  559. }
  560. }
  561. }
  562. }
  563. // cavity for printing without support
  564. scale([1.0, 1.0, 3.0]) {
  565. sphere(r = mount_radius, $fn = facets);
  566. }
  567. }
  568. }
  569. }
  570. // indentations that match the two lower capsule holders
  571. // add ridge height adjustment
  572. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(elev_angle) - mic_to_mount_fit]) {
  573. rotate([0, (90 + elev_angle), angles[0]]) {
  574. translate([0, 0, mic_radius - capsule_height]) {
  575. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  576. }
  577. }
  578. rotate([0, (90 + elev_angle), angles[1]]) {
  579. translate([0, 0, mic_radius - capsule_height]) {
  580. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  581. }
  582. }
  583. }
  584. // slice top sides of mount
  585. for (r = [45, 45 + 180]) rotate([0, 0, r]) {
  586. translate([mount_radius_capsule, -mount_radius_capsule*1.5, mount_top_height]) {
  587. rotate([0, 30, 0]) {
  588. cube([mount_radius_capsule*3, mount_radius_capsule*3, 10]);
  589. }
  590. }
  591. }
  592. }
  593. }
  594. // windscreen frame
  595. module tetra_windscreen(radius, corner, height, beam_radius, twist, support) {
  596. // octagonal helix windscreen frame
  597. for (r = [0, 45, 90, 135, 180, -135, -90, -45]) for (t = [1, -1]) rotate([0, 0, r]) {
  598. linear_extrude(height = height, center = false, convexity = 0, twist = twist * t, $fn = facets) {
  599. translate([radius + beam_radius + windscreen_thread_depth, 0, 0]) {
  600. // square(size = beam_radius * 1.5, center = true);
  601. circle(r = beam_radius, $fn = facets);
  602. }
  603. }
  604. }
  605. // connectors to top
  606. translate([0, 0, height]) {
  607. for (r = [0, 45, 90, 135, 180, -135, -90, -45]) rotate([0, 0, r + twist]) {
  608. translate([radius + beam_radius + windscreen_thread_depth, 0, 0]) {
  609. // cylinder(r = beam_radius * 2/3, h = 2.0, $fn = facets);
  610. cylinder(r = beam_radius * 1, h = 2.0, $fn = facets);
  611. //
  612. // suppport structure for standalone beams
  613. // these are removed after printing
  614. if (support) {
  615. for (s = [0, -129, 120]) rotate([0, 0, s]) {
  616. translate([0, -0.3, 0]) {
  617. cube([6, 0.6, 2]);
  618. }
  619. }
  620. }
  621. }
  622. }
  623. }
  624. }
  625. // windscreen frame
  626. module tetra_windscreen_frame(sides, radius, height, beam_radius, twist) {
  627. inc = 360/sides;
  628. for (r = [0:inc:360]) for (t = [1, -1]) rotate([0, 0, r]) {
  629. render() linear_extrude(height = height, center = false, convexity = 0, twist = twist * t, $fn = facets) {
  630. translate([radius, 0, 0]) {
  631. circle(r = beam_radius, $fn = facets);
  632. }
  633. }
  634. }
  635. }
  636. // windscreen inset frame
  637. module tetra_windscreen_inset_frame(sides, radius, iradius, height, beam_radius, xscale = 1.0, yscale = 1.0) {
  638. inc = 360/sides;
  639. difference() {
  640. for (r = [0:inc:360]) for (t = [1, -1]) rotate([0, 0, r]) {
  641. render() {
  642. hull() {
  643. translate([iradius, 0, 0]) {
  644. scale([xscale, yscale, 1.0]) cylinder(r = beam_radius, h = thin_mint, $fn = facets);
  645. }
  646. rotate([0, 0, inc/2 * t]) translate([radius, 0, height]) {
  647. cylinder(r = beam_radius, h = thin_mint, $fn = facets);
  648. }
  649. }
  650. }
  651. }
  652. cylinder(r = iradius, h = height, $fn = facets);
  653. }
  654. }
  655. // windscreen frame reinforcements
  656. module tetra_windscreen_frame_reinforcements(sides, radius, beam_radius, zrotation, yrotation) {
  657. for (r = [0:360/sides:360]) rotate([0, 0, r + zrotation]) {
  658. translate([radius, 0, 0]) {
  659. render() rotate([0, yrotation, 0]) intersection() {
  660. scale([1.0, 1.55, 1.0]) {
  661. translate([0, 0, -beam_radius * 2]) {
  662. cylinder(r = beam_radius, h = beam_radius * 4, $fn = facets);
  663. }
  664. }
  665. scale([1, 2, 2.5]) sphere(r = beam_radius, $fn = facets);
  666. }
  667. }
  668. }
  669. }
  670. // windscreen frame dome (two plus two)
  671. module tetra_windscreen_dome_two(radius, beam_radius) {
  672. rad = radius * cos(180/8);
  673. difference() {
  674. for (r = [0, 90]) rotate([0, 0, r]) {
  675. for (t = [1, -1]) {
  676. translate([(rad/2 - 1.73 * beam_radius) * t, rad, 0]) rotate([0, 90, 0]) {
  677. translate([0, -rad, 0]) {
  678. rotate_extrude(convexity = 10, $fn = facets) {
  679. translate([rad, 0, 0]) {
  680. circle(r = beam_radius, $fn = facets);
  681. }
  682. }
  683. }
  684. }
  685. }
  686. }
  687. brad = rad + beam_radius + thin_mint;
  688. translate([-brad, -brad, - 2 * brad]) {
  689. cube([2 * brad, 2 * brad, 2 * brad]);
  690. }
  691. }
  692. }
  693. // windscreen frame dome (three plus three)
  694. module tetra_windscreen_dome_three(radius, beam_radius) {
  695. difference() {
  696. for (r = [0, 90]) rotate([0, 0, r + 22.5]) {
  697. translate([0, 0, 0]) rotate([0, 90, 0]) {
  698. rotate_extrude(convexity = 10, $fn = facets) {
  699. translate([radius, 0, 0]) {
  700. circle(r = beam_radius, $fn = facets);
  701. }
  702. }
  703. }
  704. for (t = [1, -1]) {
  705. translate([radius * cos(45) * t, 0, 0]) rotate([0, 90, 0]) {
  706. rotate_extrude(convexity = 10, $fn = facets) {
  707. translate([radius * cos(45), 0, 0]) {
  708. circle(r = beam_radius, $fn = facets);
  709. }
  710. }
  711. }
  712. }
  713. }
  714. brad = radius + 2 * beam_radius + thin_mint;
  715. translate([-brad, -brad, - 2 * brad]) {
  716. cube([2 * brad, 2 * brad, 2 * brad]);
  717. }
  718. }
  719. }
  720. module tetra_windscreen_dome_three_n(radius, beam_radius) {
  721. difference() {
  722. for (r = [0, 90]) rotate([0, 0, r + 22.5]) {
  723. for (t = [1, -1]) {
  724. translate([radius * cos(45) * t, 0, 0]) rotate([0, 90, 0]) {
  725. rotate_extrude(convexity = 10, $fn = facets) {
  726. translate([radius * cos(45), 0, 0]) {
  727. circle(r = beam_radius, $fn = facets);
  728. }
  729. }
  730. }
  731. }
  732. }
  733. brad = radius + 2 * beam_radius + thin_mint;
  734. translate([-brad, -brad, - 2 * brad]) {
  735. cube([2 * brad, 2 * brad, 2 * brad]);
  736. }
  737. }
  738. }
  739. module tetra_windscreen_dome(sides, radius, beam_radius) {
  740. arcs = sides/2 - 1;
  741. ang = 360 / sides;
  742. difference() {
  743. for (r = [0, 90]) rotate([0, 0, r]) {
  744. for (t = [1, -1]) {
  745. translate([radius * sin(ang/2) * t, 0, 0]) rotate([0, 90, 0]) {
  746. render() rotate_extrude(convexity = 10, $fn = facets) {
  747. translate([radius * cos(ang/2), 0, 0]) {
  748. circle(r = beam_radius, $fn = facets);
  749. }
  750. }
  751. }
  752. translate([radius * sin(ang/(2/3)) * t, 0, 0]) rotate([0, 90, 0]) {
  753. render() rotate_extrude(convexity = 10, $fn = facets) {
  754. translate([radius * cos(ang/(2/3)), 0, 0]) {
  755. circle(r = beam_radius, $fn = facets);
  756. }
  757. }
  758. }
  759. }
  760. }
  761. brad = radius + 2 * beam_radius + thin_mint;
  762. translate([-brad, -brad, - 2 * brad]) {
  763. cube([2 * brad, 2 * brad, 2 * brad]);
  764. }
  765. }
  766. }
  767. // windscreen mount to body with thread
  768. module tetra_windscreen_mount(height, radius, beam_radius) {
  769. octagon_radius = (radius + 2 * beam_radius + wall) * cos(PI/8);
  770. difference() {
  771. cylinder(r = radius + 2 * beam_radius + windscreen_thread_depth, h = height, $fn = facets);
  772. metric_thread(diameter = radius * 2 + windscreen_thread_fit, pitch = windscreen_thread_pitch,
  773. length = height, angle = windscreen_thread_angle, internal = true);
  774. // make outside be a octagon instead of a circle
  775. rotate([0, 0, 22.5]) translate([0, 0, -thin_mint]) {
  776. difference() {
  777. cylinder(r = 1.5 * radius, h = height + 2 * thin_mint);
  778. cylinder(r = octagon_radius, h = height + 2 * thin_mint, $fn = 8);
  779. }
  780. }
  781. }
  782. // marker for center of screen
  783. translate([-(radius + wall), 0, 0]) {
  784. cylinder(r = 1.0, h = height, $fn = facets);
  785. }
  786. }
  787. module tetra_windscreen_round_mount(height, radius, wall) {
  788. difference() {
  789. cylinder(r = radius + wall, h = height, $fn = facets);
  790. metric_thread(diameter = radius * 2 + windscreen_thread_fit, pitch = windscreen_thread_pitch,
  791. length = height, angle = windscreen_thread_angle, internal = true);
  792. }
  793. // add better attachment points for windscreen
  794. difference() {
  795. union() {
  796. cylinder(r = radius + 2 * wall, h = height/2, $fn = facets);
  797. translate([0, 0, height/2]) {
  798. cylinder(r1 = radius + 2 * wall, r2 = radius + wall, h = height/2, $fn = facets);
  799. }
  800. }
  801. cylinder(r = radius + wall, h = height, $fn = facets);
  802. }
  803. // marker for center of microphone
  804. translate([-(radius + 2 * wall), 0, 0]) {
  805. cylinder(r = 1.0, h = height/2, $fn = facets);
  806. }
  807. }
  808. // small tube to connect both helical windscreen mounts
  809. module tetra_windscreen_connector(beam_radius) {
  810. difference() {
  811. cylinder(r = beam_radius + 0.8, h = 5, $fn = facets);
  812. cylinder(r = beam_radius + 2 * fit, h = 5, $fn = facets);
  813. }
  814. }
  815. ////
  816. //// render all the different parts
  817. ////
  818. // microphone body: flare to capsule array (slips into PCB holder body)
  819. //
  820. module render_tetra_capsule_flare(z_offset) {
  821. translate([0, 0, z_offset]) {
  822. tetra_mount_flare(pcb_hi_clear + pcb_hi_exp,
  823. mount_lip, flare_height, box_radius + wall, mount_corner, mount_radius + wall, true);
  824. translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height]) {
  825. tetra_mount_array_stalk(stalk_height, mount_radius + wall);
  826. }
  827. translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height + stalk_height]) {
  828. tetra_capsule_array_mount([-45, 135], mount_radius, wall);
  829. }
  830. }
  831. }
  832. // microphone body: main body, holds printed circuit boards
  833. //
  834. tetra_pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
  835. module render_tetra_pcb_mount(z_offset, showint) {
  836. translate([0, 0, z_offset]) {
  837. tetra_mount_body(tetra_pcb_mount_height, box_radius + wall, mount_corner, mount_lip, mount_lip, showint);
  838. // add ccrma logo
  839. rotate([0, 0, -90]) {
  840. translate([0, -(box_radius - 0.5), tetra_pcb_mount_height / 2]) {
  841. rotate([90, 270, 0]) {
  842. logo_scale = 1 / 2.4;
  843. scale([logo_scale, logo_scale, 1.0]) {
  844. ccrma_logo(1.65);
  845. }
  846. }
  847. }
  848. }
  849. }
  850. }
  851. // microphone body: flare to microphone cable (slips into PCB holder body)
  852. //
  853. module render_tetra_cable_flare(z_offset, flip) {
  854. translate([0, 0, z_offset]) {
  855. tetra_mount_flare(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, false);
  856. translate([0, 0, pcb_low_clear + pcb_low_exp + 20]) {
  857. tetra_mount_cable_holder(10, cable_diam / 2 + wall);
  858. }
  859. }
  860. }
  861. // microphone body: flare to 12 pin connector (slips into PCB holder body)
  862. //
  863. module render_tetra_connector_flare(z_offset, flip) {
  864. translate([0, 0, z_offset]) {
  865. tetra_mount_flare(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, conn_core_o_diam / 2, false);
  866. rotate([0, 0, -90]) translate([0, 0, pcb_low_clear + pcb_low_exp + 20]) {
  867. tetra_mount_connector_holder(conn_core_sleeve, conn_core_o_diam / 2, conn_core_diam / 2, conn_core_overlap, conn_core_s_diam / 2);
  868. }
  869. }
  870. }
  871. // microphone body: render all parts with a vertical separation
  872. //
  873. module render_tetra_body(z_offset, spread, showint) {
  874. rotate([0, 180, 0]) {
  875. render_tetra_connector_flare(0);
  876. }
  877. lippy = spread - mount_lip;
  878. render_tetra_pcb_mount(lippy, showint);
  879. render_tetra_capsule_flare(tetra_pcb_mount_height + 2 * lippy);
  880. }
  881. // microphone: render the full assembly with a vertical separation
  882. //
  883. module render_tetra_microphone(z_offset, spread) {
  884. render_tetra_body(z_offset, spread);
  885. lippy = spread - mount_lip;
  886. render_tetra_capsule_array(z_offset + tetra_pcb_mount_height + mount_top_height +
  887. flare_height + stalk_height + pcb_hi_clear + pcb_hi_exp + 2 * lippy + spread + mic_radius);
  888. }
  889. // microphone: render the full assembly with a vertical separation
  890. // cut out halt of the assembly so that we can see the inside
  891. //
  892. module render_tetra_microphone_cutout(z_offset, spread) {
  893. difference() {
  894. render_tetra_microphone(z_offset, spread);
  895. // a cube that blots out 1/4 of the microphone
  896. rotate([0, 0, 90]) {
  897. translate([0, 0, -50]) {
  898. cube([50, 100, 650]);
  899. }
  900. }
  901. }
  902. }
  903. // windscreen components
  904. module render_tetra_windscreen_top(z_offset) {
  905. translate([0, 0, z_offset]) {
  906. rotate([0, 0, 22.5]) scale([1, 1, 6/7]) {
  907. tetra_windscreen_dome(box_corner_radius + beam_radius/2, beam_radius);
  908. }
  909. rotate([0, 180, 22.5]) {
  910. tetra_windscreen(box_corner_radius + beam_radius/2, mount_corner, windscreen_height, beam_radius, 45);
  911. }
  912. }
  913. }
  914. module render_tetra_windscreen_bottom(z_offset) {
  915. translate([0, 0, z_offset]) rotate([0, 0, 22.5]) {
  916. tetra_windscreen(box_corner_radius + beam_radius/2, mount_corner, windscreen_height, beam_radius, 45);
  917. }
  918. }
  919. module render_tetra_windscreen_mount(z_offset) {
  920. translate([0, 0, z_offset]) {
  921. tetra_windscreen_mount(windscreen_thread_height, windscreen_thread_radius, beam_radius);
  922. }
  923. }
  924. module render_tetra_windscreen_connectors(z_offset) {
  925. translate([0, 0, z_offset]) {
  926. for (r = [0, 45, 90, 135, 180, -135, -90, -45]) rotate([0, 0, r + 22.5]) {
  927. translate([box_corner_radius + beam_radius * 2 + 0.5, 0, 0]) {
  928. tetra_windscreen_connector(beam_radius);
  929. }
  930. }
  931. }
  932. }
  933. // shock mount: microphone clip on stand mount
  934. //
  935. module render_tetra_shock_mount_stand(z_offset) {
  936. translate([z_offset]) {
  937. shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
  938. }
  939. }
  940. // shock mount: external ring
  941. //
  942. module render_tetra_shock_mount_external_ring(z_offset) {
  943. translate([0, 0, z_offset]) {
  944. shock_mount_external_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, main_radius_inc, 0);
  945. }
  946. }
  947. // shock mount: bottom internal ring
  948. //
  949. module render_tetra_shock_mount_internal_ring_bot(z_offset) {
  950. translate([0, 0, z_offset]) {
  951. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, internal_ring_gap, 1);
  952. }
  953. }
  954. // shock mount: all four internal ring connectors
  955. //
  956. module render_tetra_shock_mount_ring_connectors(offset) {
  957. for (o = [0, 1, 2, 3]) {
  958. translate([-18, (10 + offset) * o, 0]) {
  959. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  960. }
  961. }
  962. }
  963. // shock mount: top internal ring
  964. //
  965. module render_tetra_shock_mount_internal_ring_top(z_offset) {
  966. translate([0, 0, z_offset]) {
  967. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, internal_ring_gap, 0);
  968. }
  969. }
  970. // shock mount: render all parts
  971. //
  972. module render_tetra_shock_mount(z_offset) {
  973. // internal rings
  974. translate([0, 0, z_offset + ring_sep / 2]) {
  975. render_tetra_shock_mount_internal_ring_top(0);
  976. rotate([0, 180, 0]) {
  977. render_tetra_shock_mount_internal_ring_bot(ring_sep + 2);
  978. }
  979. // insert the connecting rods
  980. for (r = [0, 90, 180, 270]) {
  981. rotate([0, 0, r]) {
  982. translate([box_radius + 3 * wall + internal_ring_gap, 0, -1]) {
  983. rotate([0, 90, 0]) {
  984. translate([-4, -5, 1]) {
  985. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  986. }
  987. }
  988. }
  989. }
  990. }
  991. }
  992. // external ring
  993. translate([0, 0, z_offset - ring_height / 4]) {
  994. render_tetra_shock_mount_external_ring(0);
  995. }
  996. // mount to stand
  997. translate([box_radius + mount_corner + ring_wall + ring_arm_gap + 8 + ring_wall / 2 + 1, 0, -(mic_mount_height + mic_mount_radius + ring_height / 4 + 2.2)]) {
  998. render_tetra_shock_mount_stand(0);
  999. }
  1000. }