1
0

Octathingy_mount_pcb.scad 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  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. // d-sub connector
  33. include <db25.scad>;
  34. ////
  35. //// overrides
  36. // inner radius of mount stalk
  37. mount_radius = 4.0;
  38. ////
  39. //// default model parameters
  40. ////
  41. // size of Zapnspark printed circuit board
  42. // kicad length = 79.375
  43. // measured length = 79.20 (2016.08.25)
  44. pcb_length = 79.20;
  45. // kicad width = 19.050
  46. // measured width = 18.82 (2016.08.25)
  47. pcb_width = 18.85;
  48. // ultimaker spec thickness = 1.61
  49. // measured thickness = 1.56 (w/ copper)
  50. pcb_thickness = 1.58;
  51. // tolerance to add to length and width of pcb
  52. //
  53. // measured 3d print width = 18.70 (with pcb_fit = 0.3)
  54. // actual printed = 18.70 - 0.3 = 16.97
  55. // total correction = 18.85 - 16.97 = 1.88
  56. //
  57. pcb_fit = 0.4;
  58. // tolerance add to thickness of pcb
  59. //
  60. // printed with pcb_tfit = 0.15 -> 1.58 + 0.15 = 1.73 (ideal printed)
  61. // measured print channel = 1.63 : 0.1 thinner (ultimaker 2 plus, 2016.08.24)
  62. // measured pcb thickness = 1.58 (othermill)
  63. //
  64. pcb_tfit = 0.15;
  65. // we leave part of the pcb exposed on the bottom of the body so that we
  66. // can solder the wires that connect the microphone with the
  67. // preamplifier, same at the top of the pcb to solder the wires
  68. // to the capsules
  69. pcb_low_exp = 12.0;
  70. pcb_hi_exp = 8.0;
  71. // lip fit for flares
  72. lip_fit = 0.15;
  73. // clearance from the bottom and top of pcb's to the start of the flare,
  74. // this adds space for the protuding molex pins on which we solder
  75. pcb_low_clear = 15.0;
  76. pcb_hi_clear = 15.0;
  77. // depth of slot into which the printed circuit board fits
  78. pcb_slot_depth = 1.0;
  79. // diameter of four conductor cable
  80. cable_diam = 9.5;
  81. // lip that mounts flares into main body box
  82. mount_lip = 10.0;
  83. // capsule array mount, height of flare and stalk
  84. flare_height = 50;
  85. stalk_height = 60;
  86. // wall thickness
  87. wall = 1.0;
  88. // back and front clearance of pcb (components and leads)
  89. pcb_front = 3.00;
  90. pcb_back = 1.80;
  91. // calculated minimum "radius" of microphone box
  92. box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
  93. // calculated main body corner radius
  94. mount_corner = box_radius - pcb_width / 2 + pcb_slot_depth + 4.0;
  95. // body parameters
  96. render_screw_holes = true;
  97. radial_pcb_offset = 17.0;
  98. octa_pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
  99. octa_pcb_radius = radial_pcb_offset + pcb_width/2 + 5 * wall;
  100. // body to flares snap joint arm slot width
  101. snap_joint_slot_w = 0.75;
  102. // width and radius of snap joint hook that locks upper and lower flanges to body
  103. snap_joint_hook_w = 5.0;
  104. snap_joint_hook_r = 1.4;
  105. // dimensions of 12 pin male bottom connector
  106. //
  107. // Amphenol T 3635 002
  108. // 12 pin DIN male to cable, gold plated contacts
  109. //
  110. // inner diameter of connector core
  111. conn_core_diam = 13.00 + 0.2;
  112. // outer diameter of connector core sleeve
  113. conn_core_o_diam = 17.00;
  114. // inner diameter of connector core sleeve
  115. conn_core_s_diam = 15.00;
  116. // from top of connector to sleeve
  117. conn_core_sleeve = 13.00;
  118. // from top of connector to holes
  119. conn_core_holes_h = 6.00;
  120. // between holes
  121. conn_core_holes_w = 9.20;
  122. // hole diameter
  123. conn_core_holes_d = 1.95 + 0.2;
  124. // screw head diameter
  125. conn_core_screw_d = 2.75 + 0.5;
  126. // sleeve overlap
  127. conn_core_overlap = 3.00;
  128. // shock mount parameters
  129. //
  130. ring_sep = 30.0;
  131. ring_height = 10.0;
  132. rubber_band_angle = 40;
  133. main_radius_inc = (ring_sep / 2) / tan(rubber_band_angle);
  134. // gap between internal ring and microphone body
  135. internal_ring_gap = 1.0;
  136. // connector that joins the two internal rings
  137. connector_w = 10.0;
  138. connector_d = 2.0;
  139. // wall thickness and height of shock mount rings
  140. ring_wall = 4 * wall;
  141. ring_ext_height = 6;
  142. // gap between external ring and support arm
  143. ring_arm_gap = 16;
  144. // the main body that holds the phantom power interfaces
  145. module one_pcb_slot (pcb_w, pcb_l, pcb_t, slot_d, front, back, test = false) {
  146. d = pcb_t + front + back;
  147. render() translate([-(pcb_w/2 + wall/2), -back, 0]) {
  148. // make cage with slots for pcb
  149. difference() {
  150. translate([-2 * wall, 0, 0]) {
  151. cube([pcb_w + 4 * wall, d, pcb_l]);
  152. }
  153. translate([slot_d, 0, 0]) {
  154. cube([pcb_w - 2 * slot_d, pcb_t + front + back, pcb_l]);
  155. }
  156. translate([0, back, 0]) {
  157. cube([pcb_w, pcb_t, pcb_l]);
  158. }
  159. // make top and bottom entry channels
  160. translate([slot_d, back + pcb_t/2, 0]) {
  161. rotate([0, 0, 45]) cylinder(r1 = pcb_t * 1.1, r2 = 0, h = 8.0, $fn = 4);
  162. }
  163. translate([pcb_w - slot_d, back + pcb_t/2, 0]) {
  164. rotate([0, 0, 45]) cylinder(r1 = pcb_t * 1.1, r2 = 0, h = 8.0, $fn = 4);
  165. }
  166. translate([slot_d, back + pcb_t/2, pcb_l - 8.0]) {
  167. rotate([0, 0, 45]) cylinder(r2 = pcb_t * 1.1, r1 = 0, h = 8.0, $fn = 4);
  168. }
  169. translate([pcb_w - slot_d, back + pcb_t/2, pcb_l - 8.0]) {
  170. rotate([0, 0, 45]) cylinder(r2 = pcb_t * 1.1, r1 = 0, h = 8.0, $fn = 4);
  171. }
  172. }
  173. // add spar in the back
  174. translate([-2 * wall, -back + wall, 0]) {
  175. cube([pcb_w + 4 * wall, wall, pcb_l]);
  176. }
  177. }
  178. // add capacitor if in test mode
  179. if (test) {
  180. cap_diam = 10.2;
  181. translate([0, cap_diam/2 + pcb_t, 0]) {
  182. cylinder(r = cap_diam/2, h = 20, $fn = facets);
  183. }
  184. }
  185. }
  186. module rounded_octagon(height, radius) {
  187. intersection() {
  188. cylinder(r = radius, h = height, $fn = 8);
  189. cylinder(r = radius - wall, h = height + thin_mint, $fn = facets);
  190. }
  191. }
  192. module rounded_octagon_wall(height, radius, wall) {
  193. difference() {
  194. rounded_octagon(height, radius);
  195. rounded_octagon(height + thin_mint, radius - wall);
  196. }
  197. }
  198. module octa_mount_body(height, radius, lower_lip, upper_lip, clear) {
  199. // rotate pcb assembly so it does not interfere with the screws
  200. offset_angle = -16;
  201. // rotate individual pcb's to better use the internal space of the body
  202. twist_angle = 16;
  203. difference() {
  204. union() {
  205. difference() {
  206. union() {
  207. // main body
  208. rounded_octagon_wall(height, radius, 2 * wall);
  209. // slots for printed circuit boards
  210. intersection() {
  211. for (r = [0:360/8:360]) rotate([0, 0, r + offset_angle]) {
  212. translate([radial_pcb_offset, 0, 0]) {
  213. rotate([0, 0, 180 + twist_angle]) {
  214. one_pcb_slot(pcb_width + pcb_fit, height * 2/3, pcb_thickness + pcb_tfit,
  215. pcb_slot_depth, pcb_front, pcb_back, false);
  216. }
  217. }
  218. }
  219. // clip outside
  220. rounded_octagon(height, radius);
  221. }
  222. }
  223. // upper lip for flare to microphone
  224. translate([0, 0, height - upper_lip]) {
  225. rounded_octagon_wall(upper_lip, radius, wall + lip_fit);
  226. }
  227. // lower lip for flare to cable or connector
  228. translate([0, 0, 0]) {
  229. rounded_octagon_wall(upper_lip, radius, wall + lip_fit);
  230. }
  231. }
  232. if (render_screw_holes) {
  233. // add backplates for upper lip screws
  234. for (r = [45, 135, 225, 315]) {
  235. rotate([0, 0, r]) translate([-(radius - 3 * wall), -2.5, 0]) {
  236. cube([2, 5, height]);
  237. }
  238. }
  239. }
  240. }
  241. if (render_screw_holes) {
  242. // make eight holes in the the body for screws that hold both flares
  243. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  244. difference() {
  245. for (z = [lower_lip/2, height - upper_lip/2]) {
  246. for (r = [45, 135, 225, 315]) {
  247. rotate([0, 0, r]) translate([-(radius + 2 * wall), 0, z]) {
  248. rotate([0, 90, 0]) {
  249. cylinder(r = 0.7, h = radius + wall, $fn = facets);
  250. }
  251. }
  252. }
  253. }
  254. cylinder(r = radius/2, h = height);
  255. }
  256. }
  257. }
  258. }
  259. // flare from the body to the microphone stalk
  260. module octa_mount_flare_no_ws(height, lip, transition, radius, top_radius, stalk_height, dot) {
  261. // bottom box
  262. difference() {
  263. union() {
  264. rounded_octagon_wall(height, radius, 2 * wall);
  265. if (render_screw_holes) {
  266. // small pedestals for the screws that attach the flare to the body
  267. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  268. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  269. translate([radius - wall - 1.75, 0, lip/2]) {
  270. rotate([0, 90, 0]) {
  271. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  272. }
  273. }
  274. }
  275. }
  276. }
  277. // flange to mount on body
  278. rounded_octagon_wall(lip + 1.00, radius - wall, wall);
  279. // and make a smooth transition to avoid overhangs
  280. translate([0, 0, lip + 1.00]) {
  281. hull() {
  282. rounded_octagon_wall(thin_mint, radius - wall, wall);
  283. translate([0, 0, 1.0]) {
  284. rounded_octagon_wall(thin_mint, radius - 2 * wall, wall);
  285. }
  286. }
  287. }
  288. if (render_screw_holes) {
  289. // holes for screws that attach the flare to the body
  290. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  291. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  292. translate([radius/2, 0, lip/2]) {
  293. rotate([0, 90, 0]) {
  294. cylinder(r = (1.6 + 0.1)/2, h = radius, $fn = facets);
  295. }
  296. }
  297. }
  298. }
  299. }
  300. // flare to round section
  301. translate([0, 0, height]) {
  302. difference() {
  303. hull() {
  304. rounded_octagon(thin_mint, radius);
  305. translate([0, 0, transition]) {
  306. cylinder(r = top_radius, h = thin_mint, $fn = facets);
  307. }
  308. }
  309. hull() {
  310. rounded_octagon(thin_mint, radius - wall);
  311. translate([0, 0, transition]) {
  312. cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
  313. }
  314. }
  315. }
  316. }
  317. // cylindrical stalk
  318. translate([0, 0, height + transition]) {
  319. difference() {
  320. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  321. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  322. }
  323. // add marker for "back of microphone" orientation
  324. if (dot == 1) {
  325. rotate([0, 0, 90]) {
  326. translate([0, top_radius - wall * 2 / 3, stalk_height - top_radius]) {
  327. difference() {
  328. sphere(r = top_radius / 3, $fn = 32);
  329. translate([0, -top_radius + top_radius / 2, 0]) {
  330. cube([top_radius, top_radius, top_radius], center = true);
  331. }
  332. }
  333. }
  334. }
  335. }
  336. // close stalk and add holes for cables
  337. translate([0, 0, stalk_height - top_radius - wall]) {
  338. difference() {
  339. cylinder(r = top_radius - wall, h = top_radius + wall, $fn = facets);
  340. translate([0, 0, 0]) {
  341. sphere(r = top_radius - wall, $fn = facets);
  342. }
  343. wire_diam = mic_wire_diam + mic_wire_fit;
  344. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  345. for (t = [0, 1]) {
  346. rotate([0, 0, 45 * t]) translate([top_radius - wire_diam - t * wire_diam * 2/3, 0, wall]) {
  347. cylinder(r = wire_diam / 2, h = top_radius * 2, $fn = facets);
  348. }
  349. }
  350. }
  351. translate([0, 0, wall]) cylinder(r = wire_diam, h = top_radius * 2, $fn = facets);
  352. }
  353. }
  354. }
  355. }
  356. module octa_mount_flare(height, lip, transition, radius, top_radius, stalk_height, dot) {
  357. // transition from bottom box to windscreen mounting thread
  358. transition_to_threads = 5;
  359. // bottom box
  360. difference() {
  361. union() {
  362. rounded_octagon_wall(height, radius, 2 * wall);
  363. if (render_screw_holes) {
  364. // small pedestals for the screws that attach the flare to the body
  365. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  366. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  367. translate([radius - wall - 1.75, 0, lip/2]) {
  368. rotate([0, 90, 0]) {
  369. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  370. }
  371. }
  372. }
  373. }
  374. // indicator of "front" of microphone
  375. rotate([0, 0, 180]) translate([radius - 0.75, 0, 0]) {
  376. cylinder(r = 1.0, h = lip/2, $fn = facets);
  377. }
  378. }
  379. // flange to mount on body
  380. rounded_octagon_wall(lip + 1.00, radius - wall, wall);
  381. // and make a smooth transition to avoid overhangs
  382. translate([0, 0, lip + 1.00]) {
  383. hull() {
  384. rounded_octagon_wall(thin_mint, radius - wall, wall);
  385. translate([0, 0, 1.0]) {
  386. rounded_octagon_wall(thin_mint, radius - 2 * wall, wall);
  387. }
  388. }
  389. }
  390. if (render_screw_holes) {
  391. // holes for screws that attach the flare to the body
  392. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  393. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  394. translate([radius/2, 0, lip/2]) {
  395. rotate([0, 90, 0]) {
  396. cylinder(r = (1.6 + 0.1)/2, h = radius, $fn = facets);
  397. }
  398. }
  399. }
  400. }
  401. }
  402. // flare to windscreen threads
  403. translate([0, 0, height - windscreen_thread_height - transition_to_threads]) {
  404. difference() {
  405. hull() {
  406. rounded_octagon(thin_mint, radius);
  407. translate([0, 0, transition_to_threads]) {
  408. cylinder(r = windscreen_thread_radius + 0.5, h = thin_mint, $fn = facets);
  409. }
  410. }
  411. hull() {
  412. rounded_octagon(thin_mint, radius - wall);
  413. translate([0, 0, transition_to_threads]) {
  414. cylinder(r = windscreen_thread_radius - windscreen_thread_depth - wall, h = thin_mint, $fn = facets);
  415. }
  416. }
  417. }
  418. }
  419. // windscreen mounting threads
  420. translate([0, 0, height - windscreen_thread_height]) difference() {
  421. metric_thread(diameter = windscreen_thread_radius * 2, pitch = windscreen_thread_pitch,
  422. length = windscreen_thread_height, angle = windscreen_thread_angle, internal = false);
  423. cylinder(r = windscreen_thread_radius - wall - windscreen_thread_depth, h = windscreen_thread_height + thin_mint, $fn = facets);
  424. }
  425. // flare to stalk
  426. translate([0, 0, height - 1.5]) {
  427. difference() {
  428. hull() {
  429. cylinder(r = windscreen_thread_radius - windscreen_thread_depth, h = thin_mint, $fn = facets);
  430. translate([0, 0, transition + 1.5]) {
  431. cylinder(r = top_radius, h = thin_mint, $fn = facets);
  432. }
  433. }
  434. hull() {
  435. cylinder(r = windscreen_thread_radius - windscreen_thread_depth - wall, h = thin_mint, $fn = facets);
  436. translate([0, 0, transition + 1.5]) {
  437. cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
  438. }
  439. }
  440. }
  441. }
  442. // cylindrical stalk
  443. translate([0, 0, height + transition]) {
  444. difference() {
  445. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  446. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  447. }
  448. // close stalk and add holes for cables
  449. translate([0, 0, stalk_height - top_radius - wall]) {
  450. difference() {
  451. cylinder(r = top_radius - wall, h = top_radius + wall, $fn = facets);
  452. translate([0, 0, 0]) {
  453. sphere(r = top_radius - wall, $fn = facets);
  454. }
  455. wire_diam = mic_wire_diam + mic_wire_fit;
  456. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  457. for (t = [0, 1]) {
  458. rotate([0, 0, 45 * t]) translate([top_radius - wire_diam - t * wire_diam * 2/3, 0, wall]) {
  459. cylinder(r = wire_diam / 2, h = top_radius * 2, $fn = facets);
  460. }
  461. }
  462. }
  463. translate([0, 0, wall]) cylinder(r = wire_diam, h = top_radius * 2, $fn = facets);
  464. }
  465. }
  466. }
  467. }
  468. // flares from the body to a dual cable housing
  469. module octa_mount_flare_dual(height, lip, transition, xradius, yradius, corner, top_radius, stalk_height) {
  470. // hack to get it to render, fix problem in rounded_block when radius is equal to corner...
  471. delta = 0.001;
  472. difference() {
  473. union() {
  474. // bottom rounded box
  475. difference() {
  476. rounded_block(height, xradius, yradius, corner);
  477. rounded_block_relative(height, xradius, yradius, corner, -(2 * wall));
  478. // flange to mount on body
  479. rounded_block_relative(lip + 1.00, xradius, yradius, corner, - (wall));
  480. // and make a smooth transition to avoid overhangs
  481. translate([0, 0, lip + 1.00]) {
  482. hull() {
  483. rounded_block_relative(thin_mint, xradius, yradius, corner, - wall);
  484. translate([0, 0, 1.0]) {
  485. rounded_block_relative(thin_mint, xradius, yradius, corner, - 2 * wall);
  486. }
  487. }
  488. }
  489. }
  490. // flare to rounded section
  491. translate([0, 0, height]) {
  492. difference() {
  493. hull() {
  494. rounded_block(thin_mint, xradius, yradius, corner);
  495. translate([0, 0, transition]) {
  496. rounded_block(thin_mint, top_radius + wall / 2, top_radius * 2 + wall / 2, top_radius - delta);
  497. }
  498. }
  499. hull() {
  500. rounded_block_relative(thin_mint, xradius, yradius, corner, - 2 * wall);
  501. translate([0, -top_radius, transition]) {
  502. cube([thin_mint, (top_radius) * 2, thin_mint]);
  503. }
  504. }
  505. }
  506. }
  507. // corner box cable stalk
  508. translate([0, 0, height + transition]) {
  509. rounded_block(stalk_height, top_radius + wall / 2, top_radius * 2 + wall / 2, top_radius - delta);
  510. }
  511. }
  512. // holes for the cables
  513. for (offset = [top_radius - wall/2, -(top_radius - wall/2)]) {
  514. translate([0, offset, 0]){
  515. cylinder(r = top_radius - wall, h = height + transition + stalk_height, $fn = facets);
  516. }
  517. }
  518. }
  519. }
  520. // flare from the body to a dual conector housing
  521. // bottom connector holder
  522. module tetra_mount_connector_holder(height, radius, inside_radius, sleeve_height, sleeve_radius) {
  523. difference() {
  524. union() {
  525. cylinder(r = radius, h = height, $fn = facets);
  526. // add seats for screw heads
  527. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, radius / 2, conn_core_holes_h]) {
  528. rotate([90, 0, 0]) {
  529. scale([1, 1, 1]) cylinder(r = conn_core_screw_d / 2, h = radius * 1.43, $fn = facets);
  530. }
  531. }
  532. }
  533. cylinder(r = inside_radius, h = height, $fn = facets);
  534. // transition from thin wall to thick wall at the bottom of connector
  535. *cylinder(r1 = radius - wall, r2 = inside_radius, h = 2.0, $fn = facets);
  536. // holes for connector core screws
  537. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius / 3, conn_core_holes_h]) {
  538. rotate([90, 0, 0]) {
  539. cylinder(r = conn_core_holes_d / 2, h = radius, $fn = facets);
  540. }
  541. }
  542. // substract cutout for screw heads
  543. for (m = [-1, 1]) translate([m * conn_core_holes_w / 2, - radius + 1.5, conn_core_holes_h]) {
  544. rotate([90, 0, 0]) {
  545. cylinder(r = conn_core_screw_d / 2, h = 2.0, $fn = facets);
  546. }
  547. }
  548. }
  549. // thinner cylinder sits inside connector sleeve
  550. translate([0, 0, height]) {
  551. difference() {
  552. cylinder(r = sleeve_radius, h = sleeve_height, $fn = facets);
  553. cylinder(r = inside_radius, h = sleeve_height, $fn = facets);
  554. }
  555. }
  556. }
  557. // flare to dual cable connectors
  558. module octa_mount_flare_connector(height, lip, transition, radius, top_xradius, top_yradius) {
  559. // hack to get it to render, fix problem in rounded_block when radius is equal to corner...
  560. delta = 0.001;
  561. // bottom rounded box
  562. difference() {
  563. union() {
  564. rounded_octagon_wall(height, radius, 2 * wall);
  565. if (render_screw_holes) {
  566. // small pedestals for the screws that attach the flare to the body
  567. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  568. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  569. translate([radius - wall - 1.75, 0, lip/2]) {
  570. rotate([0, 90, 0]) {
  571. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  572. }
  573. }
  574. }
  575. }
  576. }
  577. // flange to mount on body
  578. rounded_octagon_wall(lip + 1.00, radius - wall, wall);
  579. // and make a smooth transition to avoid overhangs
  580. translate([0, 0, lip + 1.00]) {
  581. hull() {
  582. rounded_octagon_wall(thin_mint, radius - wall, wall);
  583. translate([0, 0, 1.0]) {
  584. rounded_octagon_wall(thin_mint, radius - 2 * wall, wall);
  585. }
  586. }
  587. }
  588. if (render_screw_holes) {
  589. // holes for screws that attach the flare to the body
  590. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  591. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  592. translate([radius/2, 0, lip/2]) {
  593. rotate([0, 90, 0]) {
  594. cylinder(r = (1.6 + 0.1)/2, h = radius, $fn = facets);
  595. }
  596. }
  597. }
  598. }
  599. }
  600. // flare to rounded section
  601. translate([0, 0, height]) {
  602. difference() {
  603. hull() {
  604. rounded_octagon(thin_mint, radius);
  605. translate([0, 0, transition]) {
  606. rounded_block(thin_mint, top_xradius, top_yradius, top_xradius - delta);
  607. }
  608. }
  609. hull() {
  610. rounded_octagon(thin_mint, radius - 2 * wall);
  611. translate([0, -top_xradius, transition]) {
  612. cube([thin_mint, (top_xradius) * 2, thin_mint]);
  613. }
  614. }
  615. }
  616. }
  617. }
  618. // flare to d-sub 25 pin connector
  619. module octa_mount_flare_dsub(height, lip, transition, radius, top_xradius, top_yradius) {
  620. // bottom octagonal box
  621. difference() {
  622. union() {
  623. rounded_octagon_wall(height, radius, 2 * wall);
  624. if (render_screw_holes) {
  625. // small pedestals for the screws that attach the flare to the body
  626. // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
  627. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  628. translate([radius - wall - 1.75, 0, lip/2]) {
  629. rotate([0, 90, 0]) {
  630. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  631. }
  632. }
  633. }
  634. }
  635. }
  636. // flange to mount on body
  637. rounded_octagon_wall(lip + 1.00, radius - wall, wall);
  638. // and make a smooth transition to avoid overhangs
  639. translate([0, 0, lip + 1.00]) {
  640. hull() {
  641. rounded_octagon_wall(thin_mint, radius - wall, wall);
  642. translate([0, 0, 1.0]) {
  643. rounded_octagon_wall(thin_mint, radius - 2 * wall, wall);
  644. }
  645. }
  646. }
  647. if (render_screw_holes) {
  648. // holes for screws that attach the flare to the body
  649. // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
  650. for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
  651. translate([radius/2, 0, lip/2]) {
  652. rotate([0, 90, 0]) {
  653. cylinder(r = (1.6 + 0.1)/2, h = radius, $fn = facets);
  654. }
  655. }
  656. }
  657. }
  658. }
  659. // flare to db25 connector mounting plate
  660. expand = 3;
  661. // height of connector
  662. guard_height = 9.525;
  663. // thickness of db25 plate
  664. db25_t = 3 * wall;
  665. translate([0, 0, height]) {
  666. minkr = 2.0;
  667. difference() {
  668. hull() {
  669. rounded_octagon(thin_mint, radius);
  670. rotate([0, 0, -22.5]) translate([0, 0, transition]) {
  671. minkowski() {
  672. db25_plate(th = thin_mint, border = expand);
  673. cylinder(r = minkr, h = thin_mint, $fn = facets);
  674. }
  675. }
  676. }
  677. hull() {
  678. rounded_octagon(thin_mint, radius - 2 * wall);
  679. rotate([0, 0, -22.5]) translate([0, 0, transition]) {
  680. minkowski() {
  681. db25_plate(th = thin_mint);
  682. cylinder(r = minkr, h = thin_mint, $fn = facets);
  683. }
  684. }
  685. }
  686. }
  687. // db25 mounting plate
  688. rotate([0, 0, -22.5]) translate([0, 0, transition]) {
  689. difference() {
  690. db25_plate(th = db25_t, border = expand);
  691. db25_cutout(th = db25_t);
  692. }
  693. // add guard wall around connector
  694. difference() {
  695. minkowski() {
  696. db25_plate(th = guard_height + db25_t, border = expand);
  697. cylinder(r = minkr, h = thin_mint, $fn = facets);
  698. }
  699. db25_plate(th = guard_height + db25_t + thin_mint, border = expand);
  700. }
  701. }
  702. // for testing
  703. *rotate([0, 0, -22.5]) translate([0, 0, 30]) db25_plate(th = 1.0);
  704. }
  705. }
  706. module octa_mount_stand(height, lip, transition, radius, top_xradius, top_yradius) {
  707. // flare to db25 connector mounting plate
  708. expand = 3;
  709. // height of connector
  710. guard_height = 9.525;
  711. // thickness of db25 plate
  712. db25_t = 3 * wall;
  713. translate([0, 0, height]) {
  714. minkr = 2.0;
  715. // db25 mounting plate
  716. rotate([0, 0, -22.5]) translate([0, 0, transition]) {
  717. // add guard wall around connector
  718. difference() {
  719. minkowski() {
  720. db25_plate(th = guard_height + db25_t, border = 1.8 * expand);
  721. cylinder(r = minkr, h = thin_mint, $fn = facets);
  722. }
  723. db25_plate(th = guard_height + db25_t + thin_mint, border = 1.8 * expand);
  724. }
  725. }
  726. // ring and connector
  727. translate([0, 0, height]) {
  728. o_rad = 8;
  729. i_rad = 3;
  730. rotate([0, 90, -22.5]) {
  731. // connector
  732. translate([-guard_height, 13, 0]) cube([guard_height, 10, o_rad/2]);
  733. translate([-guard_height, 9, o_rad/4]) rotate([0, 90, 0]) {
  734. difference() {
  735. cylinder(r = o_rad, h = guard_height, $fn = facets);
  736. translate([-10, -16, 0]) cube([20, 20, 10]);
  737. }
  738. }
  739. // ring
  740. translate([-o_rad, 30, 0]) {
  741. shock_mount_ring(o_rad, i_rad, ring_wall);
  742. }
  743. }
  744. }
  745. }
  746. }
  747. // top conical section that plugs into capsule array
  748. module octa_capsule_array_mount(angles) {
  749. difference() {
  750. union() {
  751. difference() {
  752. cylinder(h = mount_top_height, r1 = mount_radius + wall, r2 = mount_radius_capsule, $fn = facets);
  753. cylinder(h = mount_top_height, r1 = mount_radius, r2 = mount_radius_capsule - 3 * wall * wall, $fn = facets);
  754. }
  755. // second set of optional "leaves" to get a better mount
  756. *difference() {
  757. cylinder(h = mount_top_height, r1 = mount_radius + wall, r2 = mount_radius_capsule * 0.8, $fn = facets);
  758. cylinder(h = mount_top_height, r1 = mount_radius, r2 = mount_radius_capsule * 0.8 - 1.2 * wall, $fn = facets);
  759. }
  760. }
  761. // indentations that match the four lower capsule holders
  762. // add ridge height adjustment
  763. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(90 - elev_angle) - 2]) {
  764. for (az = angles) {
  765. rotate([0, 180 - elev_angle, az + 45]) {
  766. translate([0, 0, mic_radius - capsule_height]) {
  767. capsule(leg_angles, 0, 1, ridge_wfit, ridge_hfit, 1);
  768. }
  769. }
  770. }
  771. }
  772. // indentations at the top to open up the array a bit
  773. translate([0, 0, mount_top_height + mount_radius_capsule / 8]) {
  774. for (rot = [45, 135, -135, -45]) {
  775. translate([0, 0, 0]) {
  776. rotate([0, 90, rot]) {
  777. linear_extrude(height = mount_radius_capsule) {
  778. minkowski() {
  779. polygon(points = [[0, mount_radius_capsule * 0.35], [0, - mount_radius_capsule * 0.35],
  780. [mount_radius_capsule * 2 / 3, 0]]);
  781. circle(r = 1.0, $fn = facets);
  782. }
  783. }
  784. }
  785. }
  786. }
  787. }
  788. }
  789. }
  790. //
  791. // shock mount components
  792. //
  793. // shock mount internal ring
  794. module octa_shock_mount_internal_ring(height, radius, band_height, corner, gap) {
  795. rotate([0, 0, 22.5]) {
  796. // inner octagon, hugs the body
  797. difference() {
  798. rounded_octagon_wall(band_height, radius + 3 * wall, 2 * wall);
  799. rotate([0, 0, -22.5 + 90]) translate([-40, -20, 0]) {
  800. cube([80, 40, 20 + thin_mint]);
  801. }
  802. }
  803. }
  804. // joins inner and outer octagons
  805. for (m = [0, 1]) mirror([m, 0, 0]) {
  806. translate([octa_pcb_radius, -10, 0]) {
  807. cube([2, 20, band_height]);
  808. }
  809. }
  810. // 8 columns for mounting rubber bands
  811. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  812. for (m = [0, 1]) mirror([m, 0, 0]) {
  813. translate([radius + 1.0, radius/2 - 2, 0]) {
  814. rotate([0, 0, 0]) {
  815. difference() {
  816. // columns
  817. union() {
  818. translate([3, 0, 0]) rotate([0, 0, 45]) scale([1.2, 0.85, 1.0])
  819. cylinder(r = 3, h = height, $fn = facets);
  820. }
  821. // lower slots for rubber bands
  822. rotate([0, 0, 45]) translate([2.5, radius/2, 0]) scale([1.0, 1.0, 3.0]) rotate([90, 0, 0]) {
  823. cylinder(r = 1.2, h = radius * 2, $fn = facets);
  824. }
  825. // upper slots for rubber bands
  826. rotate([0, 0, 45]) translate([2.5, radius/2, height]) scale([1.0, 1.0, 3.0]) rotate([90, 0, 0]) {
  827. cylinder(r = 1.2, h = radius * 2, $fn = facets);
  828. }
  829. }
  830. }
  831. }
  832. }
  833. // the outer octagon, holds the columns
  834. rotate([0, 0, 22.5]) rounded_octagon_wall(band_height, radius + 6, 2 * wall);
  835. }
  836. }
  837. // shock mount external ring
  838. module octa_shock_mount_external_ring(height, radius, corner, gap) {
  839. // main ring
  840. rotate([0, 0, 22.5]) rounded_octagon_wall(ring_ext_height, 2 * radius - ring_wall, ring_wall);
  841. for (rot = [0, 90, 180, 270]) {
  842. // anchors for rubber bands
  843. rotate([0, 0, rot + 45]) {
  844. translate([radius + gap + 3 * ring_wall, -7.5, 0]) {
  845. minkowski() {
  846. cube([4 - 2, 15, ring_ext_height]);
  847. cylinder(r = 1.5, h = thin_mint, $fn = facets);
  848. }
  849. }
  850. translate([radius + gap + ring_wall, -2, 0]) {
  851. cube([7, 4, ring_ext_height]);
  852. }
  853. }
  854. }
  855. // connection to hub
  856. translate([radius + corner - 0.7, -2, 0]) {
  857. cube([10, 4, ring_ext_height * 2]);
  858. }
  859. // reinforcement
  860. intersection() {
  861. rotate([0, 0, 22.5]) rounded_octagon_wall(ring_ext_height * 2, 2 * radius - ring_wall, ring_wall);
  862. translate([radius * 2 - 10.25, 0, 0]) {
  863. rotate([0, 0, 45]) cylinder(r1 = 2 * radius, r2 = ring_wall/2 + 1, h = ring_ext_height * 2, $fn = 4);
  864. }
  865. }
  866. // rotating mount
  867. o_rad = 8;
  868. i_rad = 3;
  869. rotate([0, 90, -90]) {
  870. translate([-o_rad, radius + corner + o_rad + 2 * ring_wall, -2]) {
  871. shock_mount_ring(o_rad, i_rad, ring_wall);
  872. }
  873. }
  874. }
  875. ////
  876. //// render all the different parts
  877. ////
  878. // microphone body: flare to capsule array (slips into PCB holder body)
  879. //
  880. module render_octa_capsule_flare(z_offset) {
  881. translate([0, 0, z_offset]) {
  882. octa_mount_flare(pcb_hi_clear + pcb_hi_exp, mount_lip, flare_height, octa_pcb_radius, mount_radius + wall, stalk_height, 1);
  883. translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height + stalk_height]) {
  884. octa_capsule_array_mount([45, 135, -45, -135]);
  885. }
  886. }
  887. }
  888. // microphone body: main body, holds printed circuit boards
  889. //
  890. module render_octa_pcb_mount(z_offset, showint) {
  891. translate([0, 0, z_offset]) {
  892. octa_mount_body(octa_pcb_mount_height, octa_pcb_radius, mount_lip, mount_lip, 0);
  893. // add ccrma logo
  894. rotate([0, 0, -90 + 22.5]) {
  895. translate([0, -(octa_pcb_radius - 3.75), octa_pcb_mount_height / 2]) {
  896. rotate([90, 270, 0]) {
  897. logo_scale = 1 / 2.4;
  898. scale([logo_scale, logo_scale, 1.0]) {
  899. ccrma_logo(1.65);
  900. }
  901. }
  902. }
  903. }
  904. }
  905. }
  906. // microphone body: flare to microphone cable (slips into PCB holder body)
  907. //
  908. module render_octa_cable_flare(z_offset, flip) {
  909. translate([0, 0, z_offset]) {
  910. octa_mount_flare_dual(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, box_radius * 2 - wall,
  911. mount_corner, cable_diam / 2 + wall, 10, 0);
  912. }
  913. }
  914. // microphone body: flare to dual cable connectors (slips into PCB holder body)
  915. //
  916. module render_octa_connector_flare(z_offset, flip) {
  917. conn_offset = 2.0;
  918. conn_wall = conn_core_o_diam / 2 - conn_core_diam / 2;
  919. translate([0, 0, z_offset]) {
  920. difference() {
  921. union() {
  922. octa_mount_flare_connector(pcb_low_clear + pcb_low_exp, mount_lip, 20,
  923. octa_pcb_radius,
  924. conn_core_o_diam / 2, conn_core_o_diam + conn_offset);
  925. for (m = [0, 1]) mirror([0, m, 0]) translate([0, conn_core_o_diam / 2 + conn_offset, pcb_low_clear + pcb_low_exp + 20]) {
  926. // add two connectors
  927. rotate([0, 0, -90]) {
  928. tetra_mount_connector_holder(conn_core_sleeve, conn_core_o_diam / 2, conn_core_diam / 2,
  929. conn_core_overlap, conn_core_s_diam / 2);
  930. }
  931. // add wall in between the two connectors
  932. translate([- 2 * wall, - (conn_core_o_diam / 2 + conn_offset), 0]) {
  933. cube([4 * wall, conn_offset + wall, 10]);
  934. }
  935. }
  936. }
  937. // redo the hole in the connector holder so that it drills into the top of the flare
  938. for (m = [0, 1]) mirror([0, m, 0]) translate([0, conn_core_o_diam / 2 + conn_offset, 0]) {
  939. cylinder(r = conn_core_diam / 2, h = 100, $fn = facets);
  940. }
  941. }
  942. }
  943. }
  944. // microphone body: render all parts with a vertical separation
  945. //
  946. module render_octa_body(z_offset, spread, showint) {
  947. rotate([0, 180, 0]) {
  948. render_octa_connector_flare(0);
  949. }
  950. lippy = spread - mount_lip;
  951. render_octa_pcb_mount(lippy, showint);
  952. render_octa_capsule_flare(octa_pcb_mount_height + 2 * lippy);
  953. }
  954. // microphone: render the full assembly with vertical separation between components
  955. //
  956. module render_octa_microphone(z_offset, spread) {
  957. render_octa_body(z_offset, spread);
  958. lippy = spread - mount_lip;
  959. render_octa_capsule_array(z_offset + octa_pcb_mount_height + mount_top_height +
  960. flare_height + stalk_height + pcb_hi_clear + pcb_hi_exp + 2 * lippy + spread + mic_radius);
  961. }
  962. // microphone: render the full assembly with vertical separation between components
  963. // cut out half of the assembly so that we can see the inside
  964. //
  965. module render_octa_microphone_cutout(z_offset, spread) {
  966. difference() {
  967. render_octa_microphone(z_offset, spread);
  968. // a cube that blots out 1/4 of the microphone
  969. rotate([0, 0, 90]) {
  970. translate([0, 0, -50]) {
  971. cube([50, 100, 650]);
  972. }
  973. }
  974. }
  975. }
  976. // shock mount: microphone clip on stand mount
  977. //
  978. module render_octa_shock_mount_stand(z_offset) {
  979. translate([z_offset]) {
  980. shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
  981. }
  982. }
  983. // shock mount: external ring
  984. //
  985. module render_octa_shock_mount_external_ring_old(z_offset) {
  986. translate([0, 0, z_offset]) {
  987. shock_mount_external_ring(ring_height, box_radius + wall, box_radius * 2 - wall, mount_corner, main_radius_inc, 0);
  988. }
  989. }
  990. module render_octa_shock_mount_external_ring(z_offset) {
  991. translate([0, 0, z_offset]) {
  992. octa_shock_mount_external_ring(ring_height, octa_pcb_radius, 20, main_radius_inc);
  993. }
  994. }
  995. // shock mount: bottom internal ring
  996. //
  997. module render_octa_shock_mount_internal_ring_bot(z_offset) {
  998. translate([0, 0, z_offset]) {
  999. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius * 2 - wall, mount_corner, internal_ring_gap, 1);
  1000. }
  1001. }
  1002. module render_octa_shock_mount_internal_ring_bot(z_offset) {
  1003. translate([0, 0, z_offset]) {
  1004. shock_mount_internal_ring(ring_height, A/2 + wall, A/2 + 3, octa_pcb_radius * 2/3, internal_ring_gap, 1);
  1005. }
  1006. }
  1007. // shock mount: top internal ring
  1008. //
  1009. module render_octa_shock_mount_internal_ring_top_old(z_offset) {
  1010. translate([0, 0, z_offset]) {
  1011. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius * 2 - wall, mount_corner, internal_ring_gap, 0);
  1012. }
  1013. }
  1014. module render_octa_shock_mount_internal_ring_top(z_offset) {
  1015. translate([0, 0, z_offset]) {
  1016. shock_mount_internal_ring(ring_height, A/2 + wall, A/2 + 3, octa_pcb_radius * 2/3, internal_ring_gap, 0);
  1017. }
  1018. }
  1019. // shock mount: all four internal ring connectors
  1020. //
  1021. module render_octa_shock_mount_ring_connectors(offset) {
  1022. for (o = [0, 1, 2, 3]) {
  1023. translate([-18, (10 + offset) * o, 0]) {
  1024. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  1025. }
  1026. }
  1027. }
  1028. // shock mount: render all parts
  1029. //
  1030. module render_octa_shock_mount(z_offset) {
  1031. // internal rings
  1032. translate([0, 0, z_offset + ring_sep / 2]) {
  1033. render_octa_shock_mount_internal_ring_top(0);
  1034. rotate([0, 180, 0]) {
  1035. render_octa_shock_mount_internal_ring_bot(ring_sep + 2);
  1036. }
  1037. // insert the connecting rods
  1038. for (r = [0, 90, 180, 270]) {
  1039. rotate([0, 0, r]) {
  1040. translate([((r % 180) ? box_radius * 2 : box_radius) + 3 * wall + internal_ring_gap, 0, -1]) {
  1041. rotate([0, 90, 0]) {
  1042. translate([-4, -5, 1]) {
  1043. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  1044. }
  1045. }
  1046. }
  1047. }
  1048. }
  1049. }
  1050. // external ring
  1051. translate([0, 0, z_offset - ring_height / 4]) {
  1052. render_octa_shock_mount_external_ring(0);
  1053. }
  1054. // mount to stand
  1055. 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)]) {
  1056. render_octa_shock_mount_stand(0);
  1057. }
  1058. }