1
0

TinySpHEAR_mount_pcb.scad 33 KB

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