1
0

Octathingy_mount_pcb.scad 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  1. //
  2. // Spherical Harmonics Ear Project (*SpHEAR)
  3. //
  4. // Octathingy, Second Order Ambisonics Microphone
  5. //
  6. // based on:
  7. // "A second-order soundfield microphone with improved polar pattern shape"
  8. // by Eric Benjamin, Audio Engineering Society Convention Paper 8728,
  9. // October 2012, San Francisco
  10. //
  11. // Copyright 2015-2016, Fernando Lopez-Lezcano, All Rights Reserved
  12. // nando@ccrma.stanford.edu
  13. //
  14. // This program is free software: you can redistribute it and/or modify
  15. // it under the terms of the GNU General Public License as published by
  16. // the Free Software Foundation, either version 3 of the License, or
  17. // (at your option) any later version.
  18. //
  19. // This program is distributed in the hope that it will be useful,
  20. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. // GNU General Public License for more details.
  23. //
  24. // You should have received a copy of the GNU General Public License
  25. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. //
  27. // 3d Models released under the Creative Commons license as follows:
  28. // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
  29. // http://creativecommons.org/licenses/by-nc-sa/4.0/
  30. include <Octathingy_common.scad>;
  31. include <CCRMA_logo.scad>;
  32. ////
  33. //// overrides
  34. // inner radius of mount stalk
  35. mount_radius = 4.0;
  36. ////
  37. //// default model parameters
  38. ////
  39. // size of Zapnspark printed circuit board
  40. // kicad length = 79.375
  41. // measured length = 79.20 (2016.08.25)
  42. pcb_length = 79.20;
  43. // kicad width = 19.050
  44. // measured width = 18.82 (2016.08.25)
  45. pcb_width = 18.85;
  46. // ultimaker spec thickness = 1.61
  47. // measured thickness = 1.56 (w/ copper)
  48. pcb_thickness = 1.58;
  49. // tolerance to add to length and width of pcb
  50. //
  51. // measured 3d print width = 18.70 (with pcb_fit = 0.3)
  52. // actual printed = 18.70 - 0.3 = 16.97
  53. // total correction = 18.85 - 16.97 = 1.88
  54. //
  55. pcb_fit = 0.4;
  56. // tolerance add to thickness of pcb
  57. //
  58. // printed with pcb_tfit = 0.15 -> 1.58 + 0.15 = 1.73 (ideal printed)
  59. // measured print channel = 1.63 : 0.1 thinner (ultimaker 2 plus, 2016.08.24)
  60. // measured pcb thickness = 1.58 (othermill)
  61. //
  62. pcb_tfit = 0.15;
  63. // we leave part of the pcb exposed on the bottom of the body so that we
  64. // can solder the wires that connect the microphone with the
  65. // preamplifier, same at the top of the pcb to solder the wires
  66. // to the capsules
  67. pcb_low_exp = 12.0;
  68. pcb_hi_exp = 8.0;
  69. // lip fit for flares
  70. lip_fit = 0.15;
  71. // clearance from the bottom and top of pcb's to the start of the flare,
  72. // this adds space for the protuding molex pins on which we solder
  73. pcb_low_clear = 15.0;
  74. pcb_hi_clear = 15.0;
  75. // depth of slot into which the printed circuit board fits
  76. pcb_slot_depth = 1.0;
  77. // diameter of four conductor cable
  78. cable_diam = 9.5;
  79. // lip that mounts flares into main body box
  80. mount_lip = 10.0;
  81. // capsule array mount, height of flare and stalk
  82. flare_height = 50;
  83. stalk_height = 60;
  84. // wall thickness
  85. wall = 1.0;
  86. // back and front clearance of pcb (components and leads)
  87. pcb_front = 3.00;
  88. pcb_back = 1.80;
  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. // body parameters
  94. render_screw_holes = true;
  95. radial_pcb_offset = 17.0;
  96. octa_pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
  97. octa_pcb_radius = radial_pcb_offset + pcb_width/2 + 5 * wall;
  98. // body to flares snap joint arm slot width
  99. snap_joint_slot_w = 0.75;
  100. // width and radius of snap joint hook that locks upper and lower flanges to body
  101. snap_joint_hook_w = 5.0;
  102. snap_joint_hook_r = 1.4;
  103. // dimensions of 12 pin male bottom connector
  104. //
  105. // Amphenol T 3635 002
  106. // 12 pin DIN male to cable, gold plated contacts
  107. //
  108. // inner diameter of connector core
  109. conn_core_diam = 13.00 + 0.2;
  110. // outer diameter of connector core sleeve
  111. conn_core_o_diam = 17.00;
  112. // inner diameter of connector core sleeve
  113. conn_core_s_diam = 15.00;
  114. // from top of connector to sleeve
  115. conn_core_sleeve = 13.00;
  116. // from top of connector to holes
  117. conn_core_holes_h = 6.00;
  118. // between holes
  119. conn_core_holes_w = 9.20;
  120. // hole diameter
  121. conn_core_holes_d = 1.95 + 0.2;
  122. // screw head diameter
  123. conn_core_screw_d = 2.75 + 0.5;
  124. // sleeve overlap
  125. conn_core_overlap = 3.00;
  126. // shock mount parameters
  127. //
  128. ring_sep = 30.0;
  129. ring_height = 10.0;
  130. rubber_band_angle = 40;
  131. main_radius_inc = (ring_sep / 2) / tan(rubber_band_angle);
  132. // gap between internal ring and microphone body
  133. internal_ring_gap = 1.0;
  134. // connector that joins the two internal rings
  135. connector_w = 10.0;
  136. connector_d = 2.0;
  137. // wall thickness and height of shock mount rings
  138. ring_wall = 4 * wall;
  139. ring_ext_height = 6;
  140. // gap between external ring and support arm
  141. ring_arm_gap = 20;
  142. // the main body that holds the phantom power interfaces
  143. module one_pcb_slot (pcb_w, pcb_l, pcb_t, slot_d, front, back, test = false) {
  144. d = pcb_t + front + back;
  145. render() translate([-(pcb_w/2 + wall/2), -back, 0]) {
  146. // make cage with slots for pcb
  147. difference() {
  148. translate([-2 * wall, 0, 0]) {
  149. cube([pcb_w + 4 * wall, d, pcb_l]);
  150. }
  151. translate([slot_d, 0, 0]) {
  152. cube([pcb_w - 2 * slot_d, pcb_t + front + back, pcb_l]);
  153. }
  154. translate([0, back, 0]) {
  155. cube([pcb_w, pcb_t, pcb_l]);
  156. }
  157. // make top and bottom entry channels
  158. translate([slot_d, back + pcb_t/2, 0]) {
  159. rotate([0, 0, 45]) cylinder(r1 = pcb_t * 1.1, r2 = 0, h = 8.0, $fn = 4);
  160. }
  161. translate([pcb_w - slot_d, back + pcb_t/2, 0]) {
  162. rotate([0, 0, 45]) cylinder(r1 = pcb_t * 1.1, r2 = 0, h = 8.0, $fn = 4);
  163. }
  164. translate([slot_d, back + pcb_t/2, pcb_l - 8.0]) {
  165. rotate([0, 0, 45]) cylinder(r2 = pcb_t * 1.1, r1 = 0, h = 8.0, $fn = 4);
  166. }
  167. translate([pcb_w - slot_d, back + pcb_t/2, pcb_l - 8.0]) {
  168. rotate([0, 0, 45]) cylinder(r2 = pcb_t * 1.1, r1 = 0, h = 8.0, $fn = 4);
  169. }
  170. }
  171. // add spar in the back
  172. translate([-2 * wall, -back + wall, 0]) {
  173. cube([pcb_w + 4 * wall, wall, pcb_l]);
  174. }
  175. }
  176. // add capacitor if in test mode
  177. if (test) {
  178. cap_diam = 10.2;
  179. translate([0, cap_diam/2 + pcb_t, 0]) {
  180. cylinder(r = cap_diam/2, h = 20, $fn = facets);
  181. }
  182. }
  183. }
  184. module rounded_octagon(height, radius) {
  185. intersection() {
  186. cylinder(r = radius, h = height, $fn = 8);
  187. cylinder(r = radius - wall, h = height, $fn = facets);
  188. }
  189. }
  190. module rounded_octagon_wall(height, radius, wall) {
  191. difference() {
  192. rounded_octagon(height, radius);
  193. rounded_octagon(height, radius - wall);
  194. }
  195. }
  196. module octa_mount_body(height, radius, lower_lip, upper_lip, clear) {
  197. // rotate pcb assembly so it does not interfere with the screws
  198. offset_angle = -16;
  199. // rotate individual pcb's to better use the internal space of the body
  200. twist_angle = 16;
  201. difference() {
  202. union() {
  203. difference() {
  204. union() {
  205. // main body
  206. rounded_octagon_wall(height, radius, 2 * wall);
  207. // slots for printed circuit boards
  208. intersection() {
  209. for (r = [0:360/8:360]) rotate([0, 0, r + offset_angle]) {
  210. translate([radial_pcb_offset, 0, 0]) {
  211. rotate([0, 0, 180 + twist_angle]) {
  212. one_pcb_slot(pcb_width + pcb_fit, height * 2/3, pcb_thickness + pcb_tfit,
  213. pcb_slot_depth, pcb_front, pcb_back, false);
  214. }
  215. }
  216. }
  217. // clip outside
  218. rounded_octagon(height, radius);
  219. }
  220. }
  221. // upper lip for flare to microphone
  222. translate([0, 0, height - upper_lip]) {
  223. rounded_octagon_wall(upper_lip, radius, wall + lip_fit);
  224. }
  225. // lower lip for flare to cable or connector
  226. translate([0, 0, 0]) {
  227. rounded_octagon_wall(upper_lip, radius, wall + lip_fit);
  228. }
  229. }
  230. if (render_screw_holes) {
  231. // add backplates for upper lip screws
  232. for (r = [45, 135, 225, 315]) {
  233. rotate([0, 0, r]) translate([-(radius - 3 * wall), -2.5, 0]) {
  234. cube([2, 5, height]);
  235. }
  236. }
  237. }
  238. }
  239. if (render_screw_holes) {
  240. // make eight holes in the the body for screws that hold both flares
  241. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  242. difference() {
  243. for (z = [lower_lip/2, height - upper_lip/2]) {
  244. for (r = [45, 135, 225, 315]) {
  245. rotate([0, 0, r]) translate([-(radius + 2 * wall), 0, z]) {
  246. rotate([0, 90, 0]) {
  247. cylinder(r = 0.7, h = radius + wall, $fn = facets);
  248. }
  249. }
  250. }
  251. }
  252. cylinder(r = radius/2, h = height);
  253. }
  254. }
  255. }
  256. }
  257. // flare from the body to the microphone stalk
  258. module octa_mount_flare_no_ws(height, lip, transition, radius, top_radius, stalk_height, dot) {
  259. // bottom box
  260. difference() {
  261. union() {
  262. rounded_octagon_wall(height, radius, 2 * wall);
  263. if (render_screw_holes) {
  264. // small pedestals for the screws that attach the flare to the body
  265. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  266. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  267. translate([radius - wall - 1.75, 0, lip/2]) {
  268. rotate([0, 90, 0]) {
  269. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  270. }
  271. }
  272. }
  273. }
  274. }
  275. // flange to mount on body
  276. rounded_octagon_wall(lip + 1.00, radius - wall, wall);
  277. // and make a smooth transition to avoid overhangs
  278. translate([0, 0, lip + 1.00]) {
  279. hull() {
  280. rounded_octagon_wall(thin_mint, radius - wall, wall);
  281. translate([0, 0, 1.0]) {
  282. rounded_octagon_wall(thin_mint, radius - 2 * wall, wall);
  283. }
  284. }
  285. }
  286. if (render_screw_holes) {
  287. // holes for screws that attach the flare to the body
  288. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  289. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  290. translate([radius/2, 0, lip/2]) {
  291. rotate([0, 90, 0]) {
  292. cylinder(r = (1.6 + 0.1)/2, h = radius, $fn = facets);
  293. }
  294. }
  295. }
  296. }
  297. }
  298. // flare to round section
  299. translate([0, 0, height]) {
  300. difference() {
  301. hull() {
  302. rounded_octagon(thin_mint, radius);
  303. translate([0, 0, transition]) {
  304. cylinder(r = top_radius, h = thin_mint, $fn = facets);
  305. }
  306. }
  307. hull() {
  308. rounded_octagon(thin_mint, radius - wall);
  309. translate([0, 0, transition]) {
  310. cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
  311. }
  312. }
  313. }
  314. }
  315. // cylindrical stalk
  316. translate([0, 0, height + transition]) {
  317. difference() {
  318. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  319. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  320. }
  321. // add marker for "back of microphone" orientation
  322. if (dot == 1) {
  323. rotate([0, 0, 90]) {
  324. translate([0, top_radius - wall * 2 / 3, stalk_height - top_radius]) {
  325. difference() {
  326. sphere(r = top_radius / 3, $fn = 32);
  327. translate([0, -top_radius + top_radius / 2, 0]) {
  328. cube([top_radius, top_radius, top_radius], center = true);
  329. }
  330. }
  331. }
  332. }
  333. }
  334. // close stalk and add holes for cables
  335. translate([0, 0, stalk_height - top_radius - wall]) {
  336. difference() {
  337. cylinder(r = top_radius - wall, h = top_radius + wall, $fn = facets);
  338. translate([0, 0, 0]) {
  339. sphere(r = top_radius - wall, $fn = facets);
  340. }
  341. wire_diam = mic_wire_diam + mic_wire_fit;
  342. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  343. for (t = [0, 1]) {
  344. rotate([0, 0, 45 * t]) translate([top_radius - wire_diam - t * wire_diam * 2/3, 0, wall]) {
  345. cylinder(r = wire_diam / 2, h = top_radius * 2, $fn = facets);
  346. }
  347. }
  348. }
  349. translate([0, 0, wall]) cylinder(r = wire_diam, h = top_radius * 2, $fn = facets);
  350. }
  351. }
  352. }
  353. }
  354. module octa_mount_flare(height, lip, transition, radius, top_radius, stalk_height, dot) {
  355. // transition from bottom box to windscreen mounting thread
  356. transition_to_threads = 5;
  357. // bottom box
  358. difference() {
  359. union() {
  360. rounded_octagon_wall(height, radius, 2 * wall);
  361. if (render_screw_holes) {
  362. // small pedestals for the screws that attach the flare to the body
  363. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  364. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  365. translate([radius - wall - 1.75, 0, lip/2]) {
  366. rotate([0, 90, 0]) {
  367. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  368. }
  369. }
  370. }
  371. }
  372. // indicator of "front" of microphone
  373. rotate([0, 0, 180]) translate([radius - 0.75, 0, 0]) {
  374. cylinder(r = 1.0, h = lip/2, $fn = facets);
  375. }
  376. }
  377. // flange to mount on body
  378. rounded_octagon_wall(lip + 1.00, radius - wall, wall);
  379. // and make a smooth transition to avoid overhangs
  380. translate([0, 0, lip + 1.00]) {
  381. hull() {
  382. rounded_octagon_wall(thin_mint, radius - wall, wall);
  383. translate([0, 0, 1.0]) {
  384. rounded_octagon_wall(thin_mint, radius - 2 * wall, wall);
  385. }
  386. }
  387. }
  388. if (render_screw_holes) {
  389. // holes for screws that attach the flare to the body
  390. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  391. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  392. translate([radius/2, 0, lip/2]) {
  393. rotate([0, 90, 0]) {
  394. cylinder(r = (1.6 + 0.1)/2, h = radius, $fn = facets);
  395. }
  396. }
  397. }
  398. }
  399. }
  400. // flare to windscreen threads
  401. translate([0, 0, height - windscreen_thread_height - transition_to_threads]) {
  402. difference() {
  403. hull() {
  404. rounded_octagon(thin_mint, radius);
  405. translate([0, 0, transition_to_threads]) {
  406. cylinder(r = windscreen_thread_radius + 0.5, h = thin_mint, $fn = facets);
  407. }
  408. }
  409. hull() {
  410. rounded_octagon(thin_mint, radius - wall);
  411. translate([0, 0, transition_to_threads]) {
  412. cylinder(r = windscreen_thread_radius - windscreen_thread_depth - wall, h = thin_mint, $fn = facets);
  413. }
  414. }
  415. }
  416. }
  417. // windscreen mounting threads
  418. translate([0, 0, height - windscreen_thread_height]) difference() {
  419. metric_thread(diameter = windscreen_thread_radius * 2, pitch = windscreen_thread_pitch,
  420. length = windscreen_thread_height, angle = windscreen_thread_angle, internal = false);
  421. cylinder(r = windscreen_thread_radius - wall - windscreen_thread_depth, h = windscreen_thread_height + thin_mint, $fn = facets);
  422. }
  423. // flare to stalk
  424. translate([0, 0, height - 1.5]) {
  425. difference() {
  426. hull() {
  427. cylinder(r = windscreen_thread_radius - windscreen_thread_depth, h = thin_mint, $fn = facets);
  428. translate([0, 0, transition + 1.5]) {
  429. cylinder(r = top_radius, h = thin_mint, $fn = facets);
  430. }
  431. }
  432. hull() {
  433. cylinder(r = windscreen_thread_radius - windscreen_thread_depth - wall, h = thin_mint, $fn = facets);
  434. translate([0, 0, transition + 1.5]) {
  435. cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
  436. }
  437. }
  438. }
  439. }
  440. // cylindrical stalk
  441. translate([0, 0, height + transition]) {
  442. difference() {
  443. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  444. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  445. }
  446. // close stalk and add holes for cables
  447. translate([0, 0, stalk_height - top_radius - wall]) {
  448. difference() {
  449. cylinder(r = top_radius - wall, h = top_radius + wall, $fn = facets);
  450. translate([0, 0, 0]) {
  451. sphere(r = top_radius - wall, $fn = facets);
  452. }
  453. wire_diam = mic_wire_diam + mic_wire_fit;
  454. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  455. for (t = [0, 1]) {
  456. rotate([0, 0, 45 * t]) translate([top_radius - wire_diam - t * wire_diam * 2/3, 0, wall]) {
  457. cylinder(r = wire_diam / 2, h = top_radius * 2, $fn = facets);
  458. }
  459. }
  460. }
  461. translate([0, 0, wall]) cylinder(r = wire_diam, h = top_radius * 2, $fn = facets);
  462. }
  463. }
  464. }
  465. }
  466. // flares from the body to a dual cable housing
  467. module octa_mount_flare_dual(height, lip, transition, xradius, yradius, corner, top_radius, stalk_height) {
  468. // hack to get it to render, fix problem in rounded_block when radius is equal to corner...
  469. delta = 0.001;
  470. difference() {
  471. union() {
  472. // bottom rounded box
  473. difference() {
  474. rounded_block(height, xradius, yradius, corner);
  475. rounded_block_relative(height, xradius, yradius, corner, -(2 * wall));
  476. // flange to mount on body
  477. rounded_block_relative(lip + 1.00, xradius, yradius, corner, - (wall));
  478. // and make a smooth transition to avoid overhangs
  479. translate([0, 0, lip + 1.00]) {
  480. hull() {
  481. rounded_block_relative(thin_mint, xradius, yradius, corner, - wall);
  482. translate([0, 0, 1.0]) {
  483. rounded_block_relative(thin_mint, xradius, yradius, corner, - 2 * wall);
  484. }
  485. }
  486. }
  487. }
  488. // flare to rounded section
  489. translate([0, 0, height]) {
  490. difference() {
  491. hull() {
  492. rounded_block(thin_mint, xradius, yradius, corner);
  493. translate([0, 0, transition]) {
  494. rounded_block(thin_mint, top_radius + wall / 2, top_radius * 2 + wall / 2, top_radius - delta);
  495. }
  496. }
  497. hull() {
  498. rounded_block_relative(thin_mint, xradius, yradius, corner, - 2 * wall);
  499. translate([0, -top_radius, transition]) {
  500. cube([thin_mint, (top_radius) * 2, thin_mint]);
  501. }
  502. }
  503. }
  504. }
  505. // corner box cable stalk
  506. translate([0, 0, height + transition]) {
  507. rounded_block(stalk_height, top_radius + wall / 2, top_radius * 2 + wall / 2, top_radius - delta);
  508. }
  509. }
  510. // holes for the cables
  511. for (offset = [top_radius - wall/2, -(top_radius - wall/2)]) {
  512. translate([0, offset, 0]){
  513. cylinder(r = top_radius - wall, h = height + transition + stalk_height, $fn = facets);
  514. }
  515. }
  516. }
  517. }
  518. // flare from the body to a dual conector housing
  519. // bottom connector holder
  520. module tetra_mount_connector_holder(height, radius, inside_radius, sleeve_height, sleeve_radius) {
  521. difference() {
  522. union() {
  523. cylinder(r = radius, h = height, $fn = facets);
  524. // add seats for screw heads
  525. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, radius / 2, conn_core_holes_h]) {
  526. rotate([90, 0, 0]) {
  527. scale([1, 1, 1]) cylinder(r = conn_core_screw_d / 2, h = radius * 1.43, $fn = facets);
  528. }
  529. }
  530. }
  531. cylinder(r = inside_radius, h = height, $fn = facets);
  532. // transition from thin wall to thick wall at the bottom of connector
  533. *cylinder(r1 = radius - wall, r2 = inside_radius, h = 2.0, $fn = facets);
  534. // holes for connector core screws
  535. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius / 3, conn_core_holes_h]) {
  536. rotate([90, 0, 0]) {
  537. cylinder(r = conn_core_holes_d / 2, h = radius, $fn = facets);
  538. }
  539. }
  540. // substract cutout for screw heads
  541. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius + 1.5, conn_core_holes_h]) {
  542. rotate([90, 0, 0]) {
  543. cylinder(r = conn_core_screw_d / 2, h = 2.0, $fn = facets);
  544. }
  545. }
  546. }
  547. // thinner cylinder sits inside connector sleeve
  548. translate([0, 0, height]) {
  549. difference() {
  550. cylinder(r = sleeve_radius, h = sleeve_height, $fn = facets);
  551. cylinder(r = inside_radius, h = sleeve_height, $fn = facets);
  552. }
  553. }
  554. }
  555. // flare to dual cable connectors
  556. module octa_mount_flare_connector(height, lip, transition, radius, top_xradius, top_yradius) {
  557. // hack to get it to render, fix problem in rounded_block when radius is equal to corner...
  558. delta = 0.001;
  559. // bottom rounded box
  560. difference() {
  561. union() {
  562. rounded_octagon_wall(height, radius, 2 * wall);
  563. if (render_screw_holes) {
  564. // small pedestals for the screws that attach the flare to the body
  565. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  566. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  567. translate([radius - wall - 1.75, 0, lip/2]) {
  568. rotate([0, 90, 0]) {
  569. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  570. }
  571. }
  572. }
  573. }
  574. }
  575. // flange to mount on body
  576. rounded_octagon_wall(lip + 1.00, radius - wall, wall);
  577. // and make a smooth transition to avoid overhangs
  578. translate([0, 0, lip + 1.00]) {
  579. hull() {
  580. rounded_octagon_wall(thin_mint, radius - wall, wall);
  581. translate([0, 0, 1.0]) {
  582. rounded_octagon_wall(thin_mint, radius - 2 * wall, wall);
  583. }
  584. }
  585. }
  586. if (render_screw_holes) {
  587. // holes for screws that attach the flare to the body
  588. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  589. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  590. translate([radius/2, 0, lip/2]) {
  591. rotate([0, 90, 0]) {
  592. cylinder(r = (1.6 + 0.1)/2, h = radius, $fn = facets);
  593. }
  594. }
  595. }
  596. }
  597. }
  598. // flare to rounded section
  599. translate([0, 0, height]) {
  600. difference() {
  601. hull() {
  602. rounded_octagon(thin_mint, radius);
  603. translate([0, 0, transition]) {
  604. rounded_block(thin_mint, top_xradius, top_yradius, top_xradius - delta);
  605. }
  606. }
  607. hull() {
  608. rounded_octagon(thin_mint, radius - 2 * wall);
  609. translate([0, -top_xradius, transition]) {
  610. cube([thin_mint, (top_xradius) * 2, thin_mint]);
  611. }
  612. }
  613. }
  614. }
  615. }
  616. // top conical section that plugs into capsule array
  617. module octa_capsule_array_mount(angles) {
  618. difference() {
  619. union() {
  620. difference() {
  621. cylinder(h = mount_top_height, r1 = mount_radius + wall, r2 = mount_radius_capsule, $fn = facets);
  622. cylinder(h = mount_top_height, r1 = mount_radius, r2 = mount_radius_capsule - 3 * wall * wall, $fn = facets);
  623. }
  624. // second set of optional "leaves" to get a better mount
  625. *difference() {
  626. cylinder(h = mount_top_height, r1 = mount_radius + wall, r2 = mount_radius_capsule * 0.8, $fn = facets);
  627. cylinder(h = mount_top_height, r1 = mount_radius, r2 = mount_radius_capsule * 0.8 - 1.2 * wall, $fn = facets);
  628. }
  629. }
  630. // indentations that match the four lower capsule holders
  631. // add ridge height adjustment
  632. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(90 - elev_angle) - 2]) {
  633. for (az = angles) {
  634. rotate([0, 180 - elev_angle, az + 45]) {
  635. translate([0, 0, mic_radius - capsule_height]) {
  636. capsule(leg_angles, 0, 1, ridge_wfit, ridge_hfit, 1);
  637. }
  638. }
  639. }
  640. }
  641. // indentations at the top to open up the array a bit
  642. translate([0, 0, mount_top_height + mount_radius_capsule / 8]) {
  643. for (rot = [45, 135, -135, -45]) {
  644. translate([0, 0, 0]) {
  645. rotate([0, 90, rot]) {
  646. linear_extrude(height = mount_radius_capsule) {
  647. minkowski() {
  648. polygon(points = [[0, mount_radius_capsule * 0.35], [0, - mount_radius_capsule * 0.35],
  649. [mount_radius_capsule * 2 / 3, 0]]);
  650. circle(r = 1.0, $fn = facets);
  651. }
  652. }
  653. }
  654. }
  655. }
  656. }
  657. }
  658. }
  659. ////
  660. //// render all the different parts
  661. ////
  662. // microphone body: flare to capsule array (slips into PCB holder body)
  663. //
  664. module render_octa_capsule_flare(z_offset) {
  665. translate([0, 0, z_offset]) {
  666. octa_mount_flare(pcb_hi_clear + pcb_hi_exp, mount_lip, flare_height, octa_pcb_radius, mount_radius + wall, stalk_height, 1);
  667. translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height + stalk_height]) {
  668. octa_capsule_array_mount([45, 135, -45, -135]);
  669. }
  670. }
  671. }
  672. // microphone body: main body, holds printed circuit boards
  673. //
  674. module render_octa_pcb_mount(z_offset, showint) {
  675. translate([0, 0, z_offset]) {
  676. octa_mount_body(octa_pcb_mount_height, octa_pcb_radius, mount_lip, mount_lip, 0);
  677. // add ccrma logo
  678. rotate([0, 0, -90 + 22.5]) {
  679. translate([0, -(octa_pcb_radius - 3.75), octa_pcb_mount_height / 2]) {
  680. rotate([90, 270, 0]) {
  681. logo_scale = 1 / 2.4;
  682. scale([logo_scale, logo_scale, 1.0]) {
  683. ccrma_logo(1.65);
  684. }
  685. }
  686. }
  687. }
  688. }
  689. }
  690. // microphone body: flare to microphone cable (slips into PCB holder body)
  691. //
  692. module render_octa_cable_flare(z_offset, flip) {
  693. translate([0, 0, z_offset]) {
  694. octa_mount_flare_dual(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, box_radius * 2 - wall,
  695. mount_corner, cable_diam / 2 + wall, 10, 0);
  696. }
  697. }
  698. // microphone body: flare to dual cable connectors (slips into PCB holder body)
  699. //
  700. module render_octa_connector_flare(z_offset, flip) {
  701. conn_offset = 2.0;
  702. conn_wall = conn_core_o_diam / 2 - conn_core_diam / 2;
  703. translate([0, 0, z_offset]) {
  704. difference() {
  705. union() {
  706. octa_mount_flare_connector(pcb_low_clear + pcb_low_exp, mount_lip, 20,
  707. octa_pcb_radius,
  708. conn_core_o_diam / 2, conn_core_o_diam + conn_offset);
  709. for (m = [0, 1]) mirror([0, m, 0]) translate([0, conn_core_o_diam / 2 + conn_offset, pcb_low_clear + pcb_low_exp + 20]) {
  710. // add two connectors
  711. rotate([0, 0, -90]) {
  712. tetra_mount_connector_holder(conn_core_sleeve, conn_core_o_diam / 2, conn_core_diam / 2,
  713. conn_core_overlap, conn_core_s_diam / 2);
  714. }
  715. // add wall in between the two connectors
  716. translate([- 2 * wall, - (conn_core_o_diam / 2 + conn_offset), 0]) {
  717. cube([4 * wall, conn_offset + wall, 10]);
  718. }
  719. }
  720. }
  721. // redo the hole in the connector holder so that it drills into the top of the flare
  722. for (m = [0, 1]) mirror([0, m, 0]) translate([0, conn_core_o_diam / 2 + conn_offset, 0]) {
  723. cylinder(r = conn_core_diam / 2, h = 100, $fn = facets);
  724. }
  725. }
  726. }
  727. }
  728. // microphone body: render all parts with a vertical separation
  729. //
  730. module render_octa_body(z_offset, spread, showint) {
  731. rotate([0, 180, 0]) {
  732. render_octa_connector_flare(0);
  733. }
  734. lippy = spread - mount_lip;
  735. render_octa_pcb_mount(lippy, showint);
  736. render_octa_capsule_flare(octa_pcb_mount_height + 2 * lippy);
  737. }
  738. // microphone: render the full assembly with vertical separation between components
  739. //
  740. module render_octa_microphone(z_offset, spread) {
  741. render_octa_body(z_offset, spread);
  742. lippy = spread - mount_lip;
  743. render_octa_capsule_array(z_offset + octa_pcb_mount_height + mount_top_height +
  744. flare_height + stalk_height + pcb_hi_clear + pcb_hi_exp + 2 * lippy + spread + mic_radius);
  745. }
  746. // microphone: render the full assembly with vertical separation between components
  747. // cut out half of the assembly so that we can see the inside
  748. //
  749. module render_octa_microphone_cutout(z_offset, spread) {
  750. difference() {
  751. render_octa_microphone(z_offset, spread);
  752. // a cube that blots out 1/4 of the microphone
  753. rotate([0, 0, 90]) {
  754. translate([0, 0, -50]) {
  755. cube([50, 100, 650]);
  756. }
  757. }
  758. }
  759. }
  760. // shock mount: microphone clip on stand mount
  761. //
  762. module render_octa_shock_mount_stand(z_offset) {
  763. translate([z_offset]) {
  764. shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
  765. }
  766. }
  767. // shock mount: external ring
  768. //
  769. module render_octa_shock_mount_external_ring(z_offset) {
  770. translate([0, 0, z_offset]) {
  771. shock_mount_external_ring(ring_height, box_radius + wall, box_radius * 2 - wall, mount_corner, main_radius_inc, 0);
  772. }
  773. }
  774. // shock mount: bottom internal ring
  775. //
  776. module render_octa_shock_mount_internal_ring_bot(z_offset) {
  777. translate([0, 0, z_offset]) {
  778. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius * 2 - wall, mount_corner, internal_ring_gap, 1);
  779. }
  780. }
  781. // shock mount: top internal ring
  782. //
  783. module render_octa_shock_mount_internal_ring_top(z_offset) {
  784. translate([0, 0, z_offset]) {
  785. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius * 2 - wall, mount_corner, internal_ring_gap, 0);
  786. }
  787. }
  788. // shock mount: all four internal ring connectors
  789. //
  790. module render_octa_shock_mount_ring_connectors(offset) {
  791. for (o = [0, 1, 2, 3]) {
  792. translate([-18, (10 + offset) * o, 0]) {
  793. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  794. }
  795. }
  796. }
  797. // shock mount: render all parts
  798. //
  799. module render_octa_shock_mount(z_offset) {
  800. // internal rings
  801. translate([0, 0, z_offset + ring_sep / 2]) {
  802. render_octa_shock_mount_internal_ring_top(0);
  803. rotate([0, 180, 0]) {
  804. render_octa_shock_mount_internal_ring_bot(ring_sep + 2);
  805. }
  806. // insert the connecting rods
  807. for (r = [0, 90, 180, 270]) {
  808. rotate([0, 0, r]) {
  809. translate([((r % 180) ? box_radius * 2 : box_radius) + 3 * wall + internal_ring_gap, 0, -1]) {
  810. rotate([0, 90, 0]) {
  811. translate([-4, -5, 1]) {
  812. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  813. }
  814. }
  815. }
  816. }
  817. }
  818. }
  819. // external ring
  820. translate([0, 0, z_offset - ring_height / 4]) {
  821. render_octa_shock_mount_external_ring(0);
  822. }
  823. // mount to stand
  824. 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)]) {
  825. render_octa_shock_mount_stand(0);
  826. }
  827. }