1
0

TinySpHEAR_mount_pcb.scad 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  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 <TinySpHEAR_common.scad>;
  27. include <CCRMA_logo.scad>;
  28. ////
  29. //// default model parameters
  30. ////
  31. // size of Zapnspark printed circuit board
  32. // kicad length = 79.375
  33. // measured length = 79.20 (2016.08.25)
  34. pcb_length = 79.20;
  35. // kicad width = 19.050
  36. // measured width = 18.82 (2016.08.25)
  37. pcb_width = 18.85;
  38. // ultimaker spec thickness = 1.61
  39. // measured thickness = 1.56 (w/ copper)
  40. pcb_thickness = 1.58;
  41. // tolerance to add to length and width of pcb
  42. //
  43. // measured 3d print width = 18.70 (with pcb_fit = 0.3)
  44. // actual printed = 18.70 - 0.3 = 16.97
  45. // total correction = 18.85 - 16.97 = 1.88
  46. //
  47. pcb_fit = 0.4;
  48. // tolerance add to thickness of pcb
  49. //
  50. // printed with pcb_tfit = 0.15 -> 1.58 + 0.15 = 1.73 (ideal printed)
  51. // measured print channel = 1.63 : 0.1 thinner (ultimaker 2 plus, 2016.08.24)
  52. // measured pcb thickness = 1.58 (othermill)
  53. //
  54. pcb_tfit = 0.15;
  55. // we leave part of the pcb exposed on the bottom of the body so that we
  56. // can solder the wires that connect the microphone with the
  57. // preamplifier, same at the top of the pcb to solder the wires
  58. // to the capsules
  59. pcb_low_exp = 12.0;
  60. pcb_hi_exp = 8.0;
  61. // clearance from the bottom and top of pcb's to the start of the flare,
  62. // this adds space for the protuding molex pins on which we solder
  63. pcb_low_clear = 15.0;
  64. pcb_hi_clear = 15.0;
  65. // back and front clearance of pcb (components and leads)
  66. pcb_front = 13.25;
  67. pcb_back = 3.0;
  68. // depth of slot into which the printed circuit board fits
  69. pcb_slot_depth = 1.0;
  70. // diameter of four conductor cable (Mogami W2931)
  71. cable_diam = 9.5;
  72. // diameter of microphone capsule cable (Mogami 2490)
  73. capsule_cable_diam = 1.7;
  74. // lip that mounts flares into main body box
  75. mount_lip = 6.0;
  76. // lip fit for flares
  77. lip_fit = 0.05;
  78. // capsule array mount, height of flare and stalk
  79. flare_height = 50;
  80. stalk_height = 40;
  81. // adjust mic array to mount fit
  82. mic_to_mount_fit = 0.0;
  83. // wall thickness
  84. wall = 1.0;
  85. // calculated minimum "radius" of microphone box
  86. box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
  87. // calculated main body corner radius
  88. mount_corner = box_radius - pcb_width / 2 + pcb_slot_depth + 4.0;
  89. // shock mount parameters
  90. //
  91. ring_sep = 30.0;
  92. ring_height = 10.0;
  93. rubber_band_angle = 40;
  94. main_radius_inc = (ring_sep / 2) / tan(rubber_band_angle);
  95. // gap between internal ring and microphone body
  96. internal_ring_gap = 1.0;
  97. // connector that joins the two internal rings
  98. connector_w = 10.0;
  99. connector_d = 2.0;
  100. // wall thickness and height of shock mount rings
  101. ring_wall = 4 * wall;
  102. ring_ext_height = 6;
  103. // gap between external ring and support arm
  104. ring_arm_gap = 20;
  105. // all four printed circuit boards
  106. module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
  107. for (rot = [0, 90, 180, 270]) {
  108. rotate([0, 0, rot]) {
  109. pcb_clear(pcb_length + pcb_fit, pcb_width + pcb_fit, pcb_thickness + pcb_tfit, slot_depth, front, back);
  110. }
  111. }
  112. }
  113. // the main body of the microphone mount
  114. module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
  115. difference() {
  116. rounded_block(height, radius, radius, corner);
  117. union() {
  118. // hollow out the inside with slots for pcbs
  119. tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, pcb_slot_depth, pcb_front, pcb_back);
  120. // trim square angles
  121. cylinder(r = pcb_front, h = height, $fn = facets);
  122. // remove slots from inside body
  123. slot_len = 30;
  124. translate([0, 0, slot_len]) {
  125. rounded_block_relative(height, radius, radius, corner, - (2 * wall));
  126. }
  127. // upper lip for flare to microphone
  128. translate([0, 0, height - upper_lip]) {
  129. difference() {
  130. rounded_block(upper_lip, radius, radius, corner);
  131. rounded_block_relative(upper_lip, radius, radius, corner, -(wall + lip_fit));
  132. }
  133. }
  134. // lower lip for flare to cable
  135. translate([0, 0, 0]) {
  136. difference() {
  137. rounded_block(lower_lip, radius, radius, corner);
  138. rounded_block_relative(lower_lip, radius, radius, corner, -(wall + lip_fit));
  139. }
  140. }
  141. }
  142. }
  143. // add parts for clearance check
  144. if (clear == 1) {
  145. // electrolytic capacitors
  146. cap_diam = 10.2;
  147. for (rot = [0, 180, 270]) {
  148. rotate([0, 0, rot]) {
  149. translate([-pcb_front + cap_diam/2, 0, 0]) {
  150. *cylinder(r = (cap_diam/2), h = 20, $fn = facets);
  151. }
  152. }
  153. }
  154. // PCBs
  155. for (rot = [0, 180, 270]) {
  156. rotate([0, 0, rot]) {
  157. translate([-(pcb_front + pcb_thickness), -pcb_width/2, -pcb_low_exp]) {
  158. cube([pcb_thickness, pcb_width, pcb_length]);
  159. }
  160. }
  161. }
  162. // connectors
  163. cap_h = 12.3;
  164. cap_w = 10.53/2;
  165. for (rot = [0, 180, 270]) {
  166. rotate([0, 0, rot]) {
  167. translate([-pcb_front, -cap_w/2 - 2.5, 0]) {
  168. *cube([cap_h, cap_w, 20]);
  169. }
  170. }
  171. }
  172. }
  173. }
  174. // flares from the body to the microphone stalk and cable
  175. module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_radius, stalk_height, dot) {
  176. // bottom rounded box
  177. difference() {
  178. rounded_block(height, bot_radius, bot_radius, bot_corner);
  179. rounded_block_relative(height, bot_radius, bot_radius, bot_corner, -(2 * wall));
  180. // cut flange to mount on body
  181. rounded_block_relative(lip + 1.00, bot_radius, bot_radius, bot_corner, - (wall));
  182. // and make a smooth transition to avoid overhangs
  183. translate([0, 0, lip + 1.00]) {
  184. hull() {
  185. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
  186. translate([0, 0, 1.0]) {
  187. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - 2 * wall);
  188. }
  189. }
  190. }
  191. }
  192. // flare to round section
  193. translate([0, 0, height]) {
  194. difference() {
  195. hull() {
  196. rounded_block(thin_mint, bot_radius, bot_radius, bot_corner);
  197. translate([0, 0, transition]) {
  198. cylinder(r = top_radius, h = thin_mint, $fn = facets);
  199. }
  200. }
  201. hull() {
  202. rounded_block_relative(thin_mint, bot_radius, bot_radius, bot_corner, - wall);
  203. translate([0, 0, transition]) {
  204. cylinder(r = top_radius - wall, h = thin_mint, $fn = facets);
  205. }
  206. }
  207. }
  208. }
  209. // cylindrical stalk
  210. translate([0, 0, height + transition]) {
  211. difference() {
  212. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  213. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  214. }
  215. // add marker for "back of microphone" orientation
  216. if (dot == 1) {
  217. rotate([0, 0, 90]) {
  218. translate([0, top_radius - wall * 2 / 3, stalk_height - top_radius]) {
  219. difference() {
  220. sphere(r = top_radius / 3, $fn = 32);
  221. translate([0, -top_radius + top_radius / 2, 0]) {
  222. cube([top_radius, top_radius, top_radius], center = true);
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. // top conical section that plugs into capsule array
  231. module tetra_capsule_array_mount(angles) {
  232. difference() {
  233. union() {
  234. rotate([0, 0, 45]) {
  235. difference() {
  236. hull() {
  237. cylinder(r = mount_radius + wall, h = thin_mint, $fn = facets);
  238. translate([0, 0, mount_top_height]) {
  239. rounded_block(thin_mint, capsule_radius + wall, mount_radius_capsule - wall/2, mount_radius*4/5);
  240. }
  241. }
  242. hull() {
  243. cylinder(r = mount_radius, h = thin_mint, $fn = facets);
  244. translate([0, 0, mount_top_height]) {
  245. rounded_block_relative(thin_mint, capsule_radius + wall, mount_radius_capsule - wall/2, mount_radius*4/5, -wall);
  246. }
  247. }
  248. }
  249. // internal divider wall with slot for capsule ridges
  250. difference() {
  251. translate([-(leg_thick + wall*2)/2, -(mount_radius_capsule - wall/2), mount_top_height/2]) {
  252. difference() {
  253. cube([leg_thick + wall*2, (mount_radius_capsule - wall/2) * 2, mount_top_height/2]);
  254. // arch at bottom of dividing wall
  255. translate([0, mount_radius_capsule - wall/2, -wall]) {
  256. rotate([0, 90, 0]) {
  257. cylinder(r = mount_radius_capsule - wall, h = leg_thick + wall*3, $fn = facets);
  258. }
  259. }
  260. }
  261. }
  262. // shave the top of the wall
  263. translate([-(capsule_radius + wall), -(mount_radius_capsule - wall/2), mount_top_height - wall]) {
  264. cube([(capsule_radius + wall) * 2, (mount_radius_capsule - wall/2) * 2, 10]);
  265. }
  266. }
  267. }
  268. }
  269. // indentations that match the two lower capsule holders
  270. // add ridge height adjustment
  271. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(elev_angle) - mic_to_mount_fit]) {
  272. rotate([0, (90 + elev_angle), angles[0]]) {
  273. translate([0, 0, mic_radius - capsule_height]) {
  274. capsule([], 0, 1, 0.02, 1.5, 1);
  275. }
  276. }
  277. rotate([0, (90 + elev_angle), angles[1]]) {
  278. translate([0, 0, mic_radius - capsule_height]) {
  279. capsule([], 0, 1, 0.02, 1.5, 1);
  280. }
  281. }
  282. }
  283. // slice top sides of mount
  284. for (rot = [45, 45 + 180]) {
  285. translate([0, 0, 0]) {
  286. rotate([0, 30, rot]) {
  287. translate([-mount_radius_capsule, -(mount_radius_capsule), mount_top_height])
  288. cube([mount_radius_capsule*2, mount_radius_capsule*2, 10]);
  289. }
  290. }
  291. }
  292. }
  293. }
  294. ////
  295. //// render all the different parts
  296. ////
  297. // microphone body: flare to capsule array (slips into PCB holder body)
  298. //
  299. module render_tetra_capsule_flare(z_offset) {
  300. translate([0, 0, z_offset]) {
  301. tetra_mount_flare(pcb_hi_clear + pcb_hi_exp,
  302. mount_lip, flare_height, box_radius + wall, mount_corner, mount_radius + wall, stalk_height, 1);
  303. translate([0, 0, pcb_hi_clear + pcb_hi_exp + flare_height + stalk_height]) {
  304. tetra_capsule_array_mount([-45, 135]);
  305. }
  306. }
  307. }
  308. // microphone body: main body, holds printed circuit boards
  309. //
  310. tetra_pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
  311. module render_tetra_pcb_mount(z_offset, showint) {
  312. translate([0, 0, z_offset]) {
  313. tetra_mount_body(tetra_pcb_mount_height, box_radius + wall, mount_corner, mount_lip, mount_lip, showint);
  314. }
  315. // add ccrma logo
  316. rotate([0, 0, -90]) {
  317. translate([0, -(box_radius - 0.5), tetra_pcb_mount_height / 2]) {
  318. rotate([90, 270, 0]) {
  319. logo_scale = 1 / 2.2;
  320. scale([logo_scale, logo_scale, 1.0]) {
  321. ccrma_logo(1.65);
  322. }
  323. }
  324. }
  325. }
  326. }
  327. // microphone body: flare to microphone cable (slips into PCB holder body)
  328. //
  329. module render_tetra_cable_flare(z_offset, flip) {
  330. translate([0, 0, z_offset]) {
  331. tetra_mount_flare(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10, 0);
  332. }
  333. }
  334. // microphone body: render all parts with a vertical separation
  335. //
  336. module render_tetra_body(z_offset, spread, showint) {
  337. rotate([0, 180, 0]) {
  338. render_tetra_cable_flare(0);
  339. }
  340. lippy = spread - mount_lip;
  341. render_tetra_pcb_mount(lippy, showint);
  342. render_tetra_capsule_flare(tetra_pcb_mount_height + 2 * lippy);
  343. }
  344. // microphone: render the full assembly with a vertical separation
  345. //
  346. module render_tetra_microphone(z_offset, spread) {
  347. render_tetra_body(z_offset, spread);
  348. lippy = spread - mount_lip;
  349. render_tetra_capsule_array(z_offset + tetra_pcb_mount_height + mount_top_height +
  350. flare_height + stalk_height + pcb_hi_clear + pcb_hi_exp + 2 * lippy + spread + mic_radius);
  351. }
  352. // microphone: render the full assembly with a vertical separation
  353. // cut out halt of the assembly so that we can see the inside
  354. //
  355. module render_tetra_microphone_cutout(z_offset, spread) {
  356. difference() {
  357. render_tetra_microphone(z_offset, spread);
  358. // a cube that blots out 1/4 of the microphone
  359. rotate([0, 0, 45]) {
  360. translate([0, 0, -50]) {
  361. cube([50, 100, 650]);
  362. }
  363. }
  364. }
  365. }
  366. // shock mount: microphone clip on stand mount
  367. //
  368. module render_tetra_shock_mount_stand(z_offset) {
  369. translate([z_offset]) {
  370. shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
  371. }
  372. }
  373. // shock mount: external ring
  374. //
  375. module render_tetra_shock_mount_external_ring(z_offset) {
  376. translate([0, 0, z_offset]) {
  377. shock_mount_external_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, main_radius_inc, 0);
  378. }
  379. }
  380. // shock mount: bottom internal ring
  381. //
  382. module render_tetra_shock_mount_internal_ring_bot(z_offset) {
  383. translate([0, 0, z_offset]) {
  384. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, internal_ring_gap, 1);
  385. }
  386. }
  387. // shock mount: all four internal ring connectors
  388. //
  389. module render_tetra_shock_mount_ring_connectors(offset) {
  390. for (o = [0, 1, 2, 3]) {
  391. translate([-18, (10 + offset) * o, 0]) {
  392. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  393. }
  394. }
  395. }
  396. // shock mount: top internal ring
  397. //
  398. module render_tetra_shock_mount_internal_ring_top(z_offset) {
  399. translate([0, 0, z_offset]) {
  400. shock_mount_internal_ring(ring_height, box_radius + wall, box_radius + wall, mount_corner, internal_ring_gap, 0);
  401. }
  402. }
  403. // shock mount: render all parts
  404. //
  405. module render_tetra_shock_mount(z_offset) {
  406. // internal rings
  407. translate([0, 0, z_offset + ring_sep / 2]) {
  408. render_tetra_shock_mount_internal_ring_top(0);
  409. rotate([0, 180, 0]) {
  410. render_tetra_shock_mount_internal_ring_bot(ring_sep + 2);
  411. }
  412. // insert the connecting rods
  413. for (r = [0, 90, 180, 270]) {
  414. rotate([0, 0, r]) {
  415. translate([box_radius + 3 * wall + internal_ring_gap, 0, -1]) {
  416. rotate([0, 90, 0]) {
  417. translate([-4, -5, 1]) {
  418. shock_mount_connector(ring_sep, 4, connector_w, connector_d, 0.1);
  419. }
  420. }
  421. }
  422. }
  423. }
  424. }
  425. // external ring
  426. translate([0, 0, z_offset - ring_height / 4]) {
  427. render_tetra_shock_mount_external_ring(0);
  428. }
  429. // mount to stand
  430. 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)]) {
  431. render_tetra_shock_mount_stand(0);
  432. }
  433. }