TinySpHEAR_mount_pcb.scad 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  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-2018, 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. // which version of the pcb we are building for
  36. // 1: single layer, milled in house
  37. // 2: double layer with ground plane, smaller, fabricated
  38. pcb_version = 2;
  39. // size of Zapnspark printed circuit board
  40. // kicad length = 79.375
  41. // measured length = 79.20 (2016.08.25)
  42. pcb_length = pcb_version == 2 ? 72.39 : 79.20;
  43. // kicad width = 19.050
  44. // measured width = 18.82 (2016.08.25)
  45. // v2 (kicad) 15.24 (measured) 15.34
  46. pcb_width = pcb_version == 2 ? 15.34 : 18.85;
  47. // ultimaker spec thickness = 1.61
  48. // measured thickness = 1.56 (w/ copper)
  49. pcb_thickness = pcb_version == 2 ? 1.68 + 0.02 : 1.58;
  50. // tolerance to add to length and width of pcb
  51. //
  52. // measured 3d print width = 18.70 (with pcb_fit = 0.3)
  53. // actual printed = 18.70 - 0.3 = 16.97
  54. // total correction = 18.85 - 16.97 = 1.88
  55. //
  56. pcb_fit = 0.4;
  57. // tolerance add to thickness of pcb
  58. //
  59. // printed with pcb_tfit = 0.15 -> 1.58 + 0.15 = 1.73 (ideal printed)
  60. // measured print channel = 1.63 : 0.1 thinner (ultimaker 2 plus, 2016.08.24)
  61. // measured pcb thickness = 1.58 (othermill)
  62. //
  63. pcb_tfit = 0.15;
  64. // we leave part of the pcb exposed on the bottom of the body so that we
  65. // can solder the wires that connect the microphone with the
  66. // preamplifier, same at the top of the pcb to solder the wires
  67. // to the capsules
  68. pcb_low_exp = 12.0;
  69. pcb_hi_exp = 8.0;
  70. // clearance from the bottom and top of pcb's to the start of the flare,
  71. // this adds space for the protuding molex pins on which we solder
  72. pcb_low_clear = pcb_version == 2 ? 12.0 : 15.0;
  73. pcb_hi_clear = pcb_version == 2 ? 12.0 : 15.0;
  74. // back (leads) and front (components) clearance of pcb
  75. pcb_front = pcb_version == 2 ? 10.00 : 13.25;
  76. pcb_back = pcb_version == 2 ? 2.0 : 3.0;
  77. // depth of slot into which the printed circuit board fits
  78. pcb_slot_depth = 1.0;
  79. // diameter of four conductor cable (Mogami W2931)
  80. cable_diam = 9.5;
  81. // diameter of microphone capsule cable (Mogami 2490)
  82. capsule_cable_diam = 1.7;
  83. // lip that mounts flares into main body box
  84. mount_lip = 10.0;
  85. // lip fit for flares
  86. lip_fit = 0.05;
  87. // capsule array mount, height of flare and stalk
  88. flare_height = pcb_version == 2 ? 45 : 50;
  89. stalk_height = pcb_version == 2 ? 35 : 40;
  90. // adjust mic array to mount relative height
  91. mic_to_mount_fit = 0.0;
  92. // wall thickness
  93. wall = 1.0;
  94. // calculated minimum "radius" of microphone box
  95. box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + (pcb_version == 2 ? 1 : 2) * wall;
  96. // calculated main body corner radius
  97. mount_corner = box_radius - pcb_width / 2 + pcb_slot_depth + (pcb_version == 2 ? 1 : 4);
  98. // calculated radius at the corners
  99. box_corner_radius = (box_radius + wall - mount_corner) / sin(45) + mount_corner;
  100. //// snap joints to join the body to the two flares
  101. //
  102. // render snap joints to join all three main assemblies
  103. render_snap_joints = false;
  104. // body to flares snap joint arm slot width
  105. snap_joint_slot_w = 0.75;
  106. // width and radius of snap joint hook that locks upper and lower flanges to body
  107. snap_joint_hook_w = 5.0;
  108. snap_joint_hook_r = 1.4;
  109. //// screw holes to join the body to the two flares
  110. //
  111. render_screw_holes = true;
  112. // rotation of holes to avoid pcb slots
  113. screw_rotation = -3.0;
  114. // dimensions of 12 pin male bottom connector
  115. //
  116. // Amphenol T 3635 002
  117. // 12 pin DIN male to cable, gold plated contacts
  118. //
  119. // inner diameter of connector core
  120. conn_core_diam = 13.00 + 0.2;
  121. // outer diameter of connector core sleeve
  122. conn_core_o_diam = 17.00;
  123. // inner diameter of connector core sleeve
  124. conn_core_s_diam = 15.00;
  125. // from top of connector to sleeve
  126. conn_core_sleeve = 13.00;
  127. // from top of connector to holes
  128. conn_core_holes_h = 6.00;
  129. // between holes
  130. conn_core_holes_w = 9.20;
  131. // hole diameter
  132. conn_core_holes_d = 1.95 + 0.2;
  133. // screw head diameter
  134. conn_core_screw_d = 2.75 + 0.5;
  135. // sleeve overlap
  136. conn_core_overlap = 3.00;
  137. // shock mount parameters
  138. //
  139. // angle in degrees of rubber bands
  140. rubber_band_angle = 40;
  141. // height of external ring
  142. external_ring_height = 6.0;
  143. external_ring_radius = (40.0 / 2) / tan(rubber_band_angle);
  144. // height of internal ring posts
  145. internal_ring_height = 50.0;
  146. //height of internal ring band that slips over microphone body
  147. internal_band_height = 20.0;
  148. // gap between internal ring and microphone body
  149. internal_ring_gap = 2.75;
  150. // connector that joins the two internal rings
  151. connector_w = 10.0;
  152. connector_d = 2.0;
  153. // wall thickness and height of shock mount rings
  154. ring_wall = 4 * wall;
  155. ring_ext_height = 6;
  156. // gap between external ring and support arm
  157. ring_arm_gap = 20;
  158. // windscreen parameters
  159. //
  160. windscreen_height = 60;
  161. windscreen_w = 4.0;
  162. beam_radius = 1.3;
  163. windscreen_thread_height = pcb_version == 2 ? 8.0 : 10.0;
  164. windscreen_thread_pitch = 2.0;
  165. windscreen_thread_angle = 30;
  166. windscreen_thread_depth = cos(windscreen_thread_angle) * windscreen_thread_pitch * 5/8 + 0.5;
  167. windscreen_thread_radius = box_corner_radius + windscreen_thread_depth;
  168. windscreen_thread_fit = 3 * fit;
  169. // windscreen_thread_fit = 4 * fit;
  170. // all four printed circuit boards
  171. module tetra_pcb_clear(length, width, thick, slot_depth, front, back, side, twist) {
  172. for (rot = [0, 90, 180, 270]) {
  173. rotate([0, 0, rot + twist]) translate([-side, 0, 0]) {
  174. pcb_clear(pcb_length + pcb_fit, pcb_width + pcb_fit, pcb_thickness + pcb_tfit, slot_depth, front, back);
  175. }
  176. }
  177. }
  178. // the main body of the microphone mount
  179. module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
  180. // lateral offset of pcb's
  181. side = 1.4;
  182. // twist of pcbs inside body
  183. twist = 0;
  184. // twist of each pcb
  185. pcb_twist = 0;
  186. difference() {
  187. rounded_block(height, radius, radius, corner);
  188. union() {
  189. // hollow out the inside with slots for pcbs
  190. tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, pcb_slot_depth, pcb_front, pcb_back, side, twist);
  191. // trim square angles
  192. cylinder(r = pcb_front, h = height, $fn = facets);
  193. // remove slots from inside body
  194. slot_len = 30;
  195. translate([0, 0, slot_len]) {
  196. difference() {
  197. rounded_block_relative(height, radius, radius, corner, - (2 * wall));
  198. if (render_screw_holes) {
  199. // add columns for upper screw holes
  200. col_w = 3.5;
  201. for (r = [45, 135, 225, 315]) rotate([0, 0, r])
  202. translate([radius - col_w*2/3, -col_w/2, 0]) {
  203. cube([col_w, col_w, height]);
  204. }
  205. }
  206. }
  207. }
  208. // upper lip for flare to microphone
  209. translate([0, 0, height - upper_lip]) {
  210. difference() {
  211. rounded_block(upper_lip, radius, radius, corner);
  212. rounded_block_relative(upper_lip, radius, radius, corner, -(wall + lip_fit));
  213. }
  214. }
  215. // lower lip for flare to cable
  216. translate([0, 0, 0]) {
  217. difference() {
  218. rounded_block(lower_lip, radius, radius, corner);
  219. rounded_block_relative(lower_lip, radius, radius, corner, -(wall + lip_fit));
  220. }
  221. }
  222. if (render_screw_holes) {
  223. // make eight holes in the the body for screws that hold both flares
  224. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  225. for (z = [lower_lip/2, height - upper_lip/2])
  226. for (r = [45, 135, 225, 315]) {
  227. rotate([0, 0, r + screw_rotation])
  228. translate([-(radius + 2 * wall), 0, z]) {
  229. rotate([0, 90, 0]) {
  230. cylinder(r = 0.7, h = radius + wall, $fn = facets);
  231. }
  232. }
  233. }
  234. }
  235. if (render_snap_joints) {
  236. // slots for snap joint hooks
  237. // lower
  238. for (m=[-1, 1]) rotate([0, 90, 0]) {
  239. translate([-lower_lip * 3/4, (radius - wall/2)*m, -(snap_joint_hook_w/2 + 0.25)]) {
  240. cylinder(r = snap_joint_hook_r, h = snap_joint_hook_w + 0.5, $fn = facets);
  241. }
  242. }
  243. // upper
  244. for (m=[-1, 1]) rotate([0, 90, 0]) {
  245. translate([- height + upper_lip * 3/4, (radius - wall/2)*m, -(snap_joint_hook_w/2 + 0.25)]) {
  246. cylinder(r = snap_joint_hook_r, h = snap_joint_hook_w + 0.5, $fn = facets);
  247. }
  248. }
  249. }
  250. }
  251. }
  252. if (render_snap_joints) {
  253. // upper lip is too thin, reinforce the back of the snap joint hook holes
  254. for (r = [0, 180]) rotate([0, 90, r]) {
  255. translate([- height + upper_lip * 3/4, (radius - wall), -(snap_joint_hook_w/2 + 0.25)]) {
  256. difference() {
  257. cylinder(r = snap_joint_hook_r * 1.25, h = snap_joint_hook_w + 0.5, $fn = facets);
  258. translate([- snap_joint_hook_r * 1.25, - wall, 0]) {
  259. cube([snap_joint_hook_r * 3, snap_joint_hook_r * 3, snap_joint_hook_w * 1.5]);
  260. }
  261. }
  262. }
  263. }
  264. }
  265. // add parts for clearance check
  266. if (clear == 1) {
  267. for (rot = [0, 180, 270]) {
  268. //for (rot = [0]) {
  269. rotate([0, 0, rot + twist]) {
  270. translate([-(pcb_front + pcb_thickness), -pcb_width/2 + side, -pcb_low_exp]) {
  271. // twist the assembly in place
  272. rotate([0, 0, pcb_twist]) {
  273. // PCBs
  274. cube([pcb_thickness, pcb_width, pcb_length]);
  275. // small electrolytic capacitors (pcb_version == 2)
  276. // https://www.mouser.com/datasheet/2/293/e-umw-1219455.pdf
  277. cap_diam = 8.0;
  278. // should be 5, but transistors are a bit taller;
  279. cap_len = 6.5;
  280. translate([pcb_thickness + 0.15, pcb_width/2, 6]) {
  281. rotate([0, 90, 0]) cylinder(r = (cap_diam/2), h = cap_len, $fn = facets);
  282. }
  283. // film capacitors
  284. cap_h = 12;
  285. cap_w = 9;
  286. cap_t = 5.5;
  287. translate([pcb_thickness + 0.15, pcb_width/2 - cap_w/2, 10]) {
  288. cube([cap_t, cap_w, cap_h]);
  289. }
  290. }
  291. }
  292. }
  293. }
  294. // big electrolytic capacitors (pcb_version == 1)
  295. cap_diam = 10.2;
  296. *for (rot = [0, 180, 270]) {
  297. rotate([0, 0, rot + twist]) {
  298. translate([-pcb_front + cap_diam/2, side, 0]) {
  299. cylinder(r = (cap_diam/2), h = 20, $fn = facets);
  300. }
  301. }
  302. }
  303. }
  304. }
  305. // flares from the body to the microphone stalk and cable
  306. module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_radius, windscreen) {
  307. // bottom rounded box
  308. difference() {
  309. union() {
  310. rounded_block(height, bot_radius, bot_radius, bot_corner);
  311. if (windscreen) {
  312. translate([0, 0, lip]) {
  313. metric_thread(diameter = windscreen_thread_radius * 2, pitch = windscreen_thread_pitch,
  314. length = windscreen_thread_height, angle = windscreen_thread_angle, internal = false);
  315. }
  316. cylinder(r2 = box_corner_radius + 1.5, r1 = box_radius + 0.5, h = lip , $fn = facets);
  317. // index for back of microphone
  318. translate([-bot_radius, 0, 0]) {
  319. cylinder(r = 1.0, h = height, $fn = facets);
  320. }
  321. // stops for shock mount
  322. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  323. translate([bot_radius, 0, 0]) scale([2.0, 1.0, 1.0]) cylinder(r = 2.0, h = lip, $fn = facets);
  324. }
  325. }
  326. if (render_screw_holes) {
  327. // small supports for the screws that attach the flare to the body
  328. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  329. for (r = [45, 135, 225, 315]) rotate([0, 0, r + screw_rotation]) {
  330. translate([bot_radius + wall/3, 0, lip/2]) {
  331. rotate([0, 90, 0]) {
  332. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  333. }
  334. }
  335. }
  336. }
  337. if (render_snap_joints) {
  338. // make snap joint arm thicker
  339. for (r = [0, 180]) rotate([0, 0, r]) {
  340. translate([- snap_joint_hook_w - snap_joint_slot_w / 2, bot_radius, 0]) {
  341. cube([snap_joint_hook_w * 2 + snap_joint_slot_w, wall / 2, lip * 1.25]);
  342. }
  343. }
  344. }
  345. }
  346. rounded_block_relative(height, bot_radius, bot_radius, bot_corner, -(2 * wall));
  347. // cut flange to mount on body
  348. rounded_block_relative(lip + 1.00, bot_radius, bot_radius, bot_corner, - (wall));
  349. if (render_screw_holes) {
  350. // holes for screws that attach the flare to the body
  351. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  352. for (r = [45, 135, 225, 315]) rotate([0, 0, r + screw_rotation]) {
  353. translate([bot_radius + wall, 0, lip/2]) {
  354. rotate([0, 90, 0]) {
  355. cylinder(r = (1.6 + 0.1)/2, h = bot_radius, $fn = facets);
  356. }
  357. }
  358. }
  359. }
  360. if (render_snap_joints) {
  361. // cut slots for snap joint hooks
  362. for (r = [0, 180]) rotate([0, 0, r]) {
  363. for (m = [-1, 1]) {
  364. translate([m * (snap_joint_hook_w + snap_joint_slot_w) - snap_joint_slot_w / 2, bot_radius - 1.5 * wall, 0]) {
  365. cube([snap_joint_slot_w, 2 * wall, lip - 1.0]);
  366. }
  367. }
  368. }
  369. }
  370. // and make a smooth transition to avoid overhangs
  371. translate([0, 0, lip + 1.00]) {
  372. hull() {
  373. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
  374. translate([0, 0, 1.0]) {
  375. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - 2 * wall);
  376. }
  377. }
  378. }
  379. }
  380. if (render_snap_joints) {
  381. // add snap joint hook to arm
  382. for (r = [0, 180]) rotate([0, 0, r]) {
  383. translate([- snap_joint_hook_w / 2, bot_radius - wall/2, 1/4 * lip]) {
  384. rotate([90, 0, 90]) {
  385. difference() {
  386. cylinder(r = snap_joint_hook_r - 0.2, h = snap_joint_hook_w, $fn = facets);
  387. translate([0, -snap_joint_hook_r, 0]) {
  388. cube([snap_joint_hook_r, snap_joint_hook_w, snap_joint_hook_w]);
  389. }
  390. }
  391. }
  392. }
  393. }
  394. }
  395. // flare to round section
  396. translate([0, 0, height]) {
  397. difference() {
  398. hull() {
  399. rounded_block(thin_mint, bot_radius, bot_radius, bot_corner);
  400. translate([0, 0, transition]) {
  401. cylinder(r = top_radius, h = thin_mint, $fn = facets);
  402. }
  403. }
  404. hull() {
  405. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
  406. translate([0, 0, transition]) {
  407. cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
  408. }
  409. }
  410. }
  411. }
  412. }
  413. // stalk that connects upper flare to capsule array mount
  414. module tetra_mount_array_stalk(height, radius) {
  415. difference() {
  416. cylinder(r = radius, h = height, $fn = facets);
  417. cylinder(r = radius - wall, h = height, $fn = facets);
  418. }
  419. // add marker for "back of microphone" orientation
  420. *rotate([0, 0, 90]) {
  421. translate([0, radius - wall * 2 / 3, height - radius]) {
  422. difference() {
  423. sphere(r = radius / 3, $fn = 32);
  424. translate([0, -radius + radius / 2, 0]) {
  425. cube([radius, radius, radius], center = true);
  426. }
  427. }
  428. }
  429. }
  430. }
  431. // bottom cable holder
  432. module tetra_mount_cable_holder(height, radius) {
  433. difference() {
  434. cylinder(r = radius, h = height, $fn = facets);
  435. cylinder(r = radius - wall, h = height, $fn = facets);
  436. }
  437. }
  438. // bottom connector holder
  439. module tetra_mount_connector_holder(height, radius, inside_radius, sleeve_height, sleeve_radius) {
  440. difference() {
  441. union() {
  442. cylinder(r = radius, h = height, $fn = facets);
  443. // add seats for screw heads
  444. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, radius / 2, conn_core_holes_h]) {
  445. rotate([90, 0, 0]) {
  446. scale([1, 1, 1]) cylinder(r = conn_core_screw_d / 2, h = radius * 1.43, $fn = facets);
  447. }
  448. }
  449. }
  450. cylinder(r = inside_radius, h = height, $fn = facets);
  451. // transition from thin wall to thick wall at the bottom of connector
  452. cylinder(r1 = radius - wall, r2 = inside_radius, h = 2.0, $fn = facets);
  453. // holes for connector core screws
  454. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius / 3, conn_core_holes_h]) {
  455. rotate([90, 0, 0]) {
  456. cylinder(r = conn_core_holes_d / 2, h = radius, $fn = facets);
  457. }
  458. }
  459. // substract cutout for screw heads
  460. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius + 1.5, conn_core_holes_h]) {
  461. rotate([90, 0, 0]) {
  462. cylinder(r = conn_core_screw_d / 2, h = 2.0, $fn = facets);
  463. }
  464. }
  465. }
  466. // thinner cylinder sits inside connector sleeve
  467. translate([0, 0, height]) {
  468. difference() {
  469. cylinder(r = sleeve_radius, h = sleeve_height, $fn = facets);
  470. cylinder(r = inside_radius, h = sleeve_height, $fn = facets);
  471. }
  472. }
  473. }
  474. // top conical section that plugs into capsule array
  475. module tilted_cylinder(radius, height, offset) {
  476. hull() {
  477. cylinder(r = radius, h = thin_mint, $fn = facets);
  478. translate([offset, 0, height]) {
  479. cylinder(r = radius, h = thin_mint, $fn = facets);
  480. }
  481. }
  482. }
  483. module tilted_cube(width, depth, height, offset) {
  484. hull() {
  485. cube([width, depth, thin_mint]);
  486. translate([offset, 0, height]) {
  487. cube([width, depth, thin_mint]);
  488. }
  489. }
  490. }
  491. module tetra_capsule_array_mount_old(angles, mount_radius, mount_wall) {
  492. difference() {
  493. union() {
  494. rotate([0, 0, 45]) {
  495. wire_offset = wall;
  496. wire_diam = mic_wire_diam + mic_wire_fit;
  497. // FIXME: this 1.75 is the former leg_thick value, it should be calculated
  498. // based on the capsule diameter so that the cable fits in between the capsules
  499. // sleeve_width = 1.75 + wire_offset + wire_diam * 2 + wall / 2;
  500. sleeve_width = 3.75 + wire_offset + wire_diam * 2 + wall / 2;
  501. sleeve_width_max = capsule_radius + wall;
  502. sleeve_w = (sleeve_width > sleeve_width_max) ? sleeve_width : sleeve_width_max;
  503. difference() {
  504. hull() {
  505. cylinder(r = mount_radius + mount_wall, h = thin_mint, $fn = facets);
  506. translate([0, 0, mount_top_height]) {
  507. rounded_block(thin_mint, sleeve_w, mount_radius_capsule - wall/2, mount_radius*4/5);
  508. }
  509. }
  510. // cavity for printing without support
  511. scale([1.0, 1.0, 3.0]) {
  512. sphere(r = mount_radius, $fn = facets);
  513. }
  514. // holes for cables
  515. // offset for outer hole
  516. hole_offset_l = mount_radius - wire_diam / 2;
  517. hole_offset_h = (sleeve_w - wall - wire_diam / 2) - hole_offset_l;
  518. for (m = [0, 1]) mirror([m, 0, 0]) {
  519. translate([hole_offset_l - wire_diam, 0, 0]) {
  520. tilted_cylinder(wire_diam / 2, mount_top_height, hole_offset_h);
  521. }
  522. translate([hole_offset_l, 0, 0]) {
  523. tilted_cylinder(wire_diam / 2, mount_top_height, hole_offset_h);
  524. }
  525. // shave the inside of the double tube
  526. translate([hole_offset_l - wire_diam, - wire_diam / 4, 0]) {
  527. tilted_cube(wire_diam, wire_diam/2, mount_top_height, hole_offset_h);
  528. }
  529. }
  530. }
  531. }
  532. }
  533. // indentations that match the two lower capsule holders
  534. // add ridge height adjustment
  535. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(elev_angle) - mic_to_mount_fit]) {
  536. rotate([0, (90 + elev_angle), angles[0]]) {
  537. translate([0, 0, mic_radius - capsule_height]) {
  538. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  539. }
  540. }
  541. rotate([0, (90 + elev_angle), angles[1]]) {
  542. translate([0, 0, mic_radius - capsule_height]) {
  543. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  544. }
  545. }
  546. }
  547. // slice top sides of mount
  548. for (rot = [45, 45 + 180]) {
  549. translate([0, 0, 0]) {
  550. rotate([0, 30, rot]) {
  551. translate([-mount_radius_capsule, -(mount_radius_capsule), mount_top_height])
  552. cube([mount_radius_capsule*2, mount_radius_capsule*2, 10]);
  553. }
  554. }
  555. }
  556. }
  557. }
  558. module tetra_capsule_array_mount(angles, mount_radius, mount_wall) {
  559. pedestal = 3.0;
  560. difference() {
  561. union() {
  562. rotate([0, 0, 45]) {
  563. wire_offset = wall;
  564. wire_diam = mic_wire_diam + mic_wire_fit;
  565. difference() {
  566. // outer sleeve
  567. hull() {
  568. for (r = [0, 180]) rotate([0, 0, r]) {
  569. for (t = [1, -1]) translate([mount_radius + 2 * wall, (wire_diam/2 + wall/4) * t, mount_top_height - pedestal]) {
  570. cylinder(r = wire_diam/2 + wall, h = pedestal, $fn = facets);
  571. }
  572. }
  573. cylinder(r = mount_radius + mount_wall, h = thin_mint, $fn = facets);
  574. }
  575. // holes for cables in top part of sleeve
  576. for (r = [0, 180]) rotate([0, 0, r]) {
  577. for (t = [1, -1]) translate([mount_radius + 2 * wall, (wire_diam/2 + wall/4) * t, mount_top_height - pedestal]) {
  578. cylinder(r = wire_diam/2, h = pedestal, $fn = facets);
  579. }
  580. }
  581. // holes for cables in bottom part of sleeve
  582. for (r = [0, 180]) rotate([0, 0, r]) {
  583. for (t = [1, -1]) {
  584. hull() {
  585. translate([mount_radius - wire_diam/2 - wall, wire_diam/2 * t, 0]) {
  586. cylinder(r = wire_diam/2, h = thin_mint, $fn = facets);
  587. }
  588. translate([mount_radius + 2 * wall, (wire_diam/2 + wall/4) * t, mount_top_height - pedestal]) {
  589. cylinder(r = wire_diam/2, h = thin_mint, $fn = facets);
  590. }
  591. }
  592. }
  593. }
  594. // cavity for printing without support
  595. scale([1.0, 1.0, 3.0]) {
  596. sphere(r = mount_radius, $fn = facets);
  597. }
  598. }
  599. }
  600. }
  601. // indentations that match the two lower capsule holders
  602. // add ridge height adjustment
  603. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(elev_angle) - mic_to_mount_fit]) {
  604. rotate([0, (90 + elev_angle), angles[0]]) {
  605. translate([0, 0, mic_radius - capsule_height]) {
  606. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  607. }
  608. }
  609. rotate([0, (90 + elev_angle), angles[1]]) {
  610. translate([0, 0, mic_radius - capsule_height]) {
  611. capsule(leg_angles_top, 0, 0, 0.0, 0.0, 1);
  612. }
  613. }
  614. }
  615. // slice top sides of mount
  616. for (r = [45, 45 + 180]) rotate([0, 0, r]) {
  617. translate([mount_radius_capsule, -mount_radius_capsule*1.5, mount_top_height]) {
  618. rotate([0, 30, 0]) {
  619. cube([mount_radius_capsule*3, mount_radius_capsule*3, 10]);
  620. }
  621. }
  622. }
  623. }
  624. }
  625. ////
  626. //// render all the different parts
  627. ////
  628. // microphone body: flare to capsule array (slips into PCB holder body)
  629. //
  630. module render_tetra_capsule_flare(z_offset) {
  631. translate([0, 0, z_offset]) {
  632. tetra_mount_flare(pcb_hi_clear + pcb_hi_exp,
  633. mount_lip, flare_height, box_radius + wall, mount_corner, mount_radius + wall, true);
  634. translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height]) {
  635. tetra_mount_array_stalk(stalk_height, mount_radius + wall);
  636. }
  637. translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height + stalk_height]) {
  638. tetra_capsule_array_mount([-45, 135], mount_radius, wall);
  639. }
  640. }
  641. }
  642. // microphone body: main body, holds printed circuit boards
  643. //
  644. tetra_pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
  645. module render_tetra_pcb_mount(z_offset, showint) {
  646. translate([0, 0, z_offset]) {
  647. tetra_mount_body(tetra_pcb_mount_height, box_radius + wall, mount_corner, mount_lip, mount_lip, showint);
  648. // add ccrma logo
  649. rotate([0, 0, -90]) {
  650. translate([0, -(box_radius - 0.5), tetra_pcb_mount_height / 2]) {
  651. rotate([90, 270, 0]) {
  652. logo_scale = 1 / (pcb_version == 2 ? 3 : 2.4);
  653. scale([logo_scale, logo_scale, 1.0]) {
  654. ccrma_logo(1.65);
  655. }
  656. }
  657. }
  658. }
  659. }
  660. }
  661. // microphone body: flare to microphone cable (slips into PCB holder body)
  662. //
  663. module render_tetra_cable_flare(z_offset, flip) {
  664. translate([0, 0, z_offset]) {
  665. tetra_mount_flare(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, false);
  666. translate([0, 0, pcb_low_clear + pcb_low_exp + 20]) {
  667. tetra_mount_cable_holder(10, cable_diam / 2 + wall);
  668. }
  669. }
  670. }
  671. // microphone body: flare to 12 pin connector (slips into PCB holder body)
  672. //
  673. module render_tetra_connector_flare(z_offset, flip) {
  674. translate([0, 0, z_offset]) {
  675. // make the upper sleeve shorter
  676. flare_adjust = 6.0;
  677. flare_height = 20;
  678. tetra_mount_flare(pcb_low_clear + pcb_low_exp - flare_adjust, mount_lip, flare_height, box_radius + wall, mount_corner, conn_core_o_diam / 2, false);
  679. rotate([0, 0, -90]) translate([0, 0, pcb_low_clear + pcb_low_exp + 20 - flare_adjust]) {
  680. tetra_mount_connector_holder(conn_core_sleeve, conn_core_o_diam / 2, conn_core_diam / 2, conn_core_overlap, conn_core_s_diam / 2);
  681. }
  682. }
  683. }
  684. // microphone body: render all parts with a vertical separation
  685. //
  686. module render_tetra_body(z_offset, spread, showint) {
  687. rotate([0, 180, 0]) {
  688. render_tetra_connector_flare(0);
  689. }
  690. lippy = spread - mount_lip;
  691. render_tetra_pcb_mount(lippy, showint);
  692. render_tetra_capsule_flare(tetra_pcb_mount_height + 2 * lippy);
  693. }
  694. // microphone: render the full assembly with a vertical separation
  695. //
  696. module render_tetra_microphone(z_offset, spread) {
  697. render_tetra_body(z_offset, spread);
  698. lippy = spread - mount_lip;
  699. render_tetra_capsule_array(z_offset + tetra_pcb_mount_height + mount_top_height +
  700. flare_height + stalk_height + pcb_hi_clear + pcb_hi_exp + 2 * lippy + spread + mic_radius);
  701. }
  702. // microphone: render the full assembly with a vertical separation
  703. // cut out halt of the assembly so that we can see the inside
  704. //
  705. module render_tetra_microphone_cutout(z_offset, spread) {
  706. difference() {
  707. render_tetra_microphone(z_offset, spread);
  708. // a cube that blots out 1/4 of the microphone
  709. rotate([0, 0, 90]) {
  710. translate([0, 0, -50]) {
  711. cube([50, 100, 650]);
  712. }
  713. }
  714. }
  715. }
  716. // shock mount: microphone clip on stand mount
  717. //
  718. module render_tetra_shock_mount_stand(z_offset) {
  719. translate([z_offset]) {
  720. shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
  721. }
  722. }
  723. // shock mount: external ring
  724. //
  725. module render_tetra_shock_mount_external_ring(z_offset) {
  726. translate([0, 0, z_offset]) {
  727. tetra_shock_mount_external_ring(external_ring_height, box_radius, mount_corner, external_ring_radius);
  728. }
  729. }
  730. // shock mount: bottom internal ring
  731. //
  732. module render_tetra_shock_mount_internal_ring(z_offset) {
  733. translate([0, 0, z_offset]) {
  734. tetra_shock_mount_internal_ring(internal_ring_height, box_radius, internal_band_height, mount_corner, internal_ring_gap);
  735. }
  736. }
  737. // shock mount: render all parts
  738. //
  739. module render_tetra_shock_mount(z_offset) {
  740. // internal ring
  741. translate([0, 0, z_offset + (internal_ring_height + external_ring_height) / 2 - 1]) {
  742. rotate([0, 180, 0]) {
  743. render_tetra_shock_mount_internal_ring(0);
  744. }
  745. }
  746. // external ring
  747. translate([0, 0, z_offset]) {
  748. render_tetra_shock_mount_external_ring(0);
  749. }
  750. // mount to stand
  751. translate([box_radius + mount_corner + ring_wall + ring_arm_gap, 0, -(mic_mount_height + mic_mount_radius + 13.25) + z_offset]) {
  752. render_tetra_shock_mount_stand(0);
  753. }
  754. }