TinySpHEAR_mount_pcb.scad 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. //
  2. // *SpHEAR Project (Spherical Harmonics Ears),
  3. //
  4. // Mount for four interface printed circuit boards
  5. //
  6. // Copyright 2015-2016, Fernando Lopez-Lezcano, All Rights Reserved
  7. // nando@ccrma.stanford.edu
  8. //
  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. //
  24. // 3d Models released under the Creative Commons license as follows:
  25. // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
  26. // http://creativecommons.org/licenses/by-nc-sa/4.0/
  27. include <TinySpHEAR_common.scad>;
  28. // size of printed circuit board
  29. pcb_length = 85.090;
  30. // measured = 16.26 (fit = 0.25)
  31. pcb_width = 16.51;
  32. // measured = 1.33 (fit = 0.28)
  33. pcb_thickness = 1.61;
  34. // we leave 12mm of the pcb exposed on the bottom of the body so that we
  35. // can solder the wires that connect the microphone with the
  36. // preamplifier, same at the top of the pcb to solder the wires
  37. // to the capsules
  38. pcb_low_exp = 12.0;
  39. pcb_hi_exp = 8.0;
  40. // diameter of four conductor cable
  41. cable_diam = 9.5;
  42. // lip that mounts flares into main body box
  43. mount_lip = 6.0;
  44. // main body corner radius
  45. mount_corner = 10.0;
  46. // capsule array mount, height of flare and stalk
  47. flare_height = 50;
  48. stalk_height = 40;
  49. // add to length and width of pcb
  50. pcb_fit = 0.25 / 2;
  51. // add to thickness of pcb
  52. pcb_tfit = 0.3;
  53. // lip fit for flares
  54. // 0.20 seems to be fine (0.3 was too lose)
  55. lip_fit = 0.20 / 2;
  56. // wall thickness
  57. wall = 1.0;
  58. // back and front clearance of pcb (components and leads)
  59. // pcb_front = 10.2;
  60. pcb_front = 12.5;
  61. pcb_back = 2.0;
  62. // calculated minimum "radius" of microphone box
  63. box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
  64. // the printed circuit board
  65. module pcb(length, width, thick) {
  66. translate([-width/2, 0, 0]) {
  67. cube([width, thick, length]);
  68. }
  69. }
  70. // the printed circuit board plus space in the front and back for components
  71. module pcb_clear(length, width, thick, slot_depth, front, back) {
  72. translate([0, - (thick + front)]) {
  73. pcb(length, width, thick);
  74. // clear space in the front
  75. translate([- (width/2 - slot_depth), thick, 0]) {
  76. cube([width - 2 * slot_depth, front, length]);
  77. }
  78. // clear space in the back
  79. translate([- (width/2 - slot_depth), - back, 0]) {
  80. cube([width - 2 * slot_depth, back, length]);
  81. }
  82. }
  83. }
  84. // all four printed circuit boards
  85. module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
  86. for (rot = [0, 90, 180, 270]) {
  87. rotate([0, 0, rot]) {
  88. pcb_clear(pcb_length + 2*pcb_fit, pcb_width + 2*pcb_fit, pcb_thickness + pcb_tfit, slot_depth, front, back);
  89. }
  90. }
  91. }
  92. // create a box with rounded corners
  93. module tetra_mount_box(height, radius, corner) {
  94. rd = radius - corner;
  95. minkowski() {
  96. translate([-rd, -rd, 0]) {
  97. cube([rd * 2, rd * 2, height / 2]);
  98. }
  99. cylinder(r = corner, h = height / 2, $fn = facets);
  100. }
  101. }
  102. module tetra_mount_box_relative(height, ref_radius, ref_corner, radius_inc) {
  103. corner = (ref_radius + radius_inc) * (ref_radius - ref_corner) / ref_radius;
  104. tetra_mount_box(height, ref_radius + radius_inc, corner);
  105. }
  106. // the main body of the microphone mount
  107. module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
  108. difference() {
  109. tetra_mount_box(height, radius, corner);
  110. union() {
  111. // hollow out the inside with slots for pcbs
  112. tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, 1.0, pcb_front, pcb_back);
  113. // trim square angles
  114. cylinder(r = pcb_front, h = height, $fn = facets);
  115. // remove slots from inside body
  116. slot_len = 15;
  117. translate([0, 0, slot_len]) {
  118. hull() {
  119. tetra_mount_box_relative(height - (3 * slot_len), radius, corner, - (2 * wall));
  120. translate([0, 0, height - (2 * slot_len) + height / 3]) {
  121. cylinder(r = radius / 3, h = 1, $fn = facets);
  122. }
  123. }
  124. }
  125. // upper lip for flare to microphone
  126. translate([0, 0, height - upper_lip]) {
  127. difference() {
  128. tetra_mount_box(upper_lip, radius, corner);
  129. tetra_mount_box_relative(upper_lip, radius, corner, -(wall + lip_fit));
  130. }
  131. }
  132. // lower lip for flare to cable
  133. translate([0, 0, 0]) {
  134. difference() {
  135. tetra_mount_box(lower_lip, radius, corner);
  136. tetra_mount_box_relative(lower_lip, radius, corner, -(wall + lip_fit));
  137. }
  138. }
  139. }
  140. }
  141. // external slot for microphone holder
  142. if (0) {
  143. mount_slot_len = 30;
  144. mount_slot_stem = 4;
  145. mount_slot_width = 2;
  146. mount_slot_radius = 2;
  147. translate([-(radius + mount_slot_stem), -(mount_slot_width/2), 0]) {
  148. cube([mount_slot_stem, mount_slot_width, mount_slot_len]);
  149. }
  150. translate([-(radius + mount_slot_stem), 0, 0]) {
  151. cylinder(r = mount_slot_radius, h = mount_slot_len, $fn = facets);
  152. }
  153. }
  154. // add parts for clearance check
  155. if (clear == 1) {
  156. // electrolytic capacitors
  157. cap_diam = 10.2;
  158. for (rot = [0, 180, 270]) {
  159. rotate([0, 0, rot]) {
  160. translate([-pcb_front + cap_diam/2, 0, 0]) {
  161. cylinder(r = (cap_diam/2), h = 20, $fn = facets);
  162. }
  163. }
  164. }
  165. // 12.3 x 10.53 caps
  166. cap_h = 12.3;
  167. cap_w = 10.53/2;
  168. for (rot = [0, 180, 270]) {
  169. rotate([0, 0, rot]) {
  170. translate([-pcb_front + cap_h, -cap_w/2 - 2.5, 0]) {
  171. cube([cap_h, cap_w, 20]);
  172. }
  173. }
  174. }
  175. }
  176. }
  177. module tetra_mount_body_new(height, radius, corner, lower_lip, upper_lip, clear) {
  178. difference() {
  179. tetra_mount_box(height, radius, corner);
  180. union() {
  181. // hollow out the inside with slots for pcbs
  182. tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, 1.0, pcb_front, pcb_back);
  183. // trim square angles
  184. cylinder(r = pcb_front, h = height, $fn = facets);
  185. // remove slots from inside body
  186. slot_len = 30;
  187. translate([0, 0, slot_len]) {
  188. tetra_mount_box_relative(height, radius, corner, - (2 * wall));
  189. }
  190. // upper lip for flare to microphone
  191. translate([0, 0, height - upper_lip]) {
  192. difference() {
  193. tetra_mount_box(upper_lip, radius, corner);
  194. tetra_mount_box_relative(upper_lip, radius, corner, -(wall + lip_fit));
  195. }
  196. }
  197. // lower lip for flare to cable
  198. translate([0, 0, 0]) {
  199. difference() {
  200. tetra_mount_box(lower_lip, radius, corner);
  201. tetra_mount_box_relative(lower_lip, radius, corner, -(wall + lip_fit));
  202. }
  203. }
  204. }
  205. }
  206. // external slot for microphone holder
  207. if (0) {
  208. mount_slot_len = 30;
  209. mount_slot_stem = 4;
  210. mount_slot_width = 2;
  211. mount_slot_radius = 2;
  212. translate([-(radius + mount_slot_stem), -(mount_slot_width/2), 0]) {
  213. cube([mount_slot_stem, mount_slot_width, mount_slot_len]);
  214. }
  215. translate([-(radius + mount_slot_stem), 0, 0]) {
  216. cylinder(r = mount_slot_radius, h = mount_slot_len, $fn = facets);
  217. }
  218. }
  219. // add parts for clearance check
  220. if (clear == 1) {
  221. // electrolytic capacitors
  222. cap_diam = 10.2;
  223. for (rot = [0, 180, 270]) {
  224. rotate([0, 0, rot]) {
  225. translate([-pcb_front + cap_diam/2, 0, 0]) {
  226. cylinder(r = (cap_diam/2), h = 20, $fn = facets);
  227. }
  228. }
  229. }
  230. // 12.3 x 10.53 caps
  231. cap_h = 12.3;
  232. cap_w = 10.53/2;
  233. for (rot = [0, 180, 270]) {
  234. rotate([0, 0, rot]) {
  235. translate([-pcb_front + cap_h, -cap_w/2 - 2.5, 0]) {
  236. cube([cap_h, cap_w, 20]);
  237. }
  238. }
  239. }
  240. }
  241. }
  242. // flares from the body to the microphone stalk and cable
  243. module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_radius, stalk_height) {
  244. // bottom rounded box
  245. difference() {
  246. tetra_mount_box(height, bot_radius, bot_corner);
  247. tetra_mount_box_relative(height, bot_radius, bot_corner, -(2 * wall));
  248. // flange to mount on body
  249. // temporarily add 0.05 for best fit on already printed body (FIXME)
  250. tetra_mount_box_relative(lip + 1.0, bot_radius, bot_corner, - (wall + 0.05));
  251. }
  252. // flare to round section
  253. translate([0, 0, height]) {
  254. difference() {
  255. hull() {
  256. tetra_mount_box(1, bot_radius, bot_corner);
  257. translate([0, 0, transition]) {
  258. cylinder(r = top_radius, h = 1, $fn = facets);
  259. }
  260. }
  261. hull() {
  262. tetra_mount_box_relative(1, bot_radius, bot_corner, - 2 * wall);
  263. translate([0, 0, transition]) {
  264. cylinder(r = top_radius - wall, h = 1, $fn = facets);
  265. }
  266. }
  267. }
  268. }
  269. // cylindrical stalk
  270. translate([0, 0, height + transition]) {
  271. difference() {
  272. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  273. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  274. }
  275. }
  276. }
  277. // top conical section that plugs into capsule array
  278. module tetra_capsule_array_mount(angles) {
  279. difference() {
  280. translate([0, 0, 0]) {
  281. rotate([0, 0, 45]) {
  282. difference() {
  283. ellipsoid(mount_top_height, mount_radius + wall, mount_radius_capsule, mount_top_eccentricity);
  284. ellipsoid(mount_top_height, mount_radius, mount_radius_capsule * 0.5, mount_top_eccentricity * 1.05);
  285. }
  286. }
  287. }
  288. // indentations that match the two lower capsule holders
  289. // add ridge height adjustment
  290. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
  291. capsule(angles[0], -elev_angle, [], 0, 1, 0.1, 3, 1);
  292. capsule(angles[1], -elev_angle, [], 0, 1, 0.1, 3, 1);
  293. }
  294. }
  295. }
  296. // internal ring of shock mount
  297. module tetra_shock_mount_body_ring(height, radius, corner, gap, lip) {
  298. slot_sep = radius * 2 / 2.7;
  299. slot_w = 6;
  300. slot_o = height / 3;
  301. // connecting bar dimensions
  302. bar_w = 10;
  303. bar_d = 2;
  304. difference() {
  305. union() {
  306. // base ring
  307. difference() {
  308. tetra_mount_box_relative(slot_o, radius + gap, corner, 3 * wall);
  309. tetra_mount_box(slot_o, radius + gap, corner);
  310. }
  311. // upper ring with slots for rubber bands
  312. difference() {
  313. tetra_mount_box_relative(height, radius + gap + 2 * wall, corner, 2 * wall);
  314. tetra_mount_box_relative(height, radius + gap + wall, corner, 1 * wall);
  315. for (rot = [0, 90, 180, 270]) {
  316. rotate([0, 0, rot]) {
  317. // slots for rubber bands
  318. for (m = [0, 1]) mirror([0, m, 0]) {
  319. translate([-slot_w / 2 + slot_sep, radius + gap, slot_o]) {
  320. cube([slot_w, 10, slot_o]);
  321. translate([slot_w / 3, 0, 0]) {
  322. cube([slot_w /3, 10, 10]);
  323. }
  324. }
  325. }
  326. }
  327. }
  328. }
  329. // body for bars that connect both rings together
  330. for (rot = [0, 90, 180, 270]) {
  331. rotate([0, 0, rot]) {
  332. translate([radius + gap + 3 * wall, -(bar_w/2 + wall), 0]) {
  333. cube([bar_d + wall, bar_w + 2 * wall, height]);
  334. }
  335. }
  336. }
  337. }
  338. // carve holes for bars that connect both rings
  339. for (rot = [0, 90, 180, 270]) {
  340. rotate([0, 0, rot]) {
  341. translate([radius + gap + 3 * wall, -bar_w/2, 0]) {
  342. cube([bar_d, bar_w, height - 2.75 * wall]);
  343. translate([bar_d / 2, 0, height - 3 * wall]) {
  344. rotate([-90, 0, 0]) {
  345. cylinder(r = bar_d / 2, h = bar_w, $fn = facets);
  346. }
  347. }
  348. }
  349. }
  350. }
  351. }
  352. for (rot = [0, 90, 180, 270]) {
  353. rotate([0, 0, rot]) {
  354. // lip to support microphone on lower ring only
  355. if (lip == 1) {
  356. lip_w = 10;
  357. translate([radius + gap + 2.5 * wall, -lip_w/2, height]) {
  358. rotate([90, 90, 180]) {
  359. linear_extrude(height = lip_w) {
  360. polygon([[0, 0], [0, 4], [1, 4], [height * 2/3, 0]]);
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. module tetra_shock_mount_main_ring(height, radius, corner, gap, lip) {
  369. difference() {
  370. tetra_mount_box_relative(6, radius, mount_corner, gap);
  371. tetra_mount_box_relative(6, radius, mount_corner, gap - 4 * wall);
  372. }
  373. for (rot = [0, 90, 180, 270]) {
  374. rotate([0, 0, rot]) {
  375. translate([radius + gap + 4 * wall, -7.5, 0]) {
  376. cube([4, 15, 6]);
  377. }
  378. translate([radius + gap, -2, 0]) {
  379. cube([7, 4, 6]);
  380. }
  381. }
  382. }
  383. // connection to stand mount
  384. for (m = [0, 1]) mirror([m, 0, 0]) {
  385. rotate([0, 0, 20]) {
  386. translate([25, radius * 1.36, 0]) cube([4, 50, 6]);
  387. }
  388. }
  389. }
  390. module tetra_shock_mount_connector(length, width, thickness, fit) {
  391. cube([length, width - 2 * fit, thickness - 2 * fit]);
  392. }
  393. *tetra_shock_mount_connector(ring_sep, 9, 3.3, 0.1);
  394. *translate([0, 15, 0])
  395. tetra_shock_mount_connector(ring_sep, 9, 3.3, 0.1);
  396. // main body of microphone mount
  397. //
  398. //translate([0, 0, -(pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
  399. *tetra_mount_body_new(pcb_length - pcb_low_exp - pcb_hi_exp, box_radius + wall, mount_corner, mount_lip, mount_lip, 0);
  400. //}
  401. // flare to microphone stalk
  402. //
  403. //translate([0, 0, pcb_length - pcb_low_exp - pcb_hi_exp + 10]) {
  404. translate([0, 0, 0]) {
  405. tetra_mount_flare(10 + pcb_hi_exp, mount_lip, flare_height, box_radius + wall, mount_corner,
  406. mount_radius + wall, stalk_height);
  407. translate([0, 0, 10 + pcb_hi_exp + flare_height + stalk_height]) {
  408. tetra_capsule_array_mount([-45, 135]);
  409. }
  410. }
  411. // flare to microphone cable
  412. //
  413. //translate([0, 0, -(10 + pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
  414. *translate([0, 0, -5]) {
  415. rotate([0, 180, 0]) {
  416. tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10);
  417. }
  418. }
  419. // shock mount
  420. //
  421. ring_sep = 30;
  422. ring_height = 6;
  423. band_angle = 40;
  424. main_radius_inc = (ring_sep / 2) / tan(band_angle);
  425. body_ring_gap = 0.5;
  426. translate([0, 0, 0]) {
  427. //rotate([0, 180, 0]) {
  428. *tetra_shock_mount_body_ring(10, box_radius + wall, mount_corner, body_ring_gap, 0);
  429. *rotate([0, 180, 0]) {
  430. translate([0, 0, ring_sep]) {
  431. tetra_shock_mount_body_ring(10, box_radius + wall, mount_corner, body_ring_gap, 1);
  432. }
  433. }
  434. //}
  435. }
  436. //translate([0, 0, - ring_sep / 2 - 5]) {
  437. *translate([0, 0, 0]) {
  438. tetra_shock_mount_main_ring(10, box_radius + wall, mount_corner, main_radius_inc, 0);
  439. }
  440. // first try at a ccrma logo
  441. //
  442. *rotate([90, 0, 0]) {
  443. translate([0, 10, box_radius + 1.5]) {
  444. scale([0.03, 0.03, 0.02]) {
  445. surface(file = "ccrma-black.png", center = true, invert = true);
  446. }
  447. }
  448. }
  449. // the microphone itself
  450. rendermic = 1;
  451. *translate([0, 0, 2.8 + pcb_hi_exp + flare_height + stalk_height + 30]) {
  452. // all four capsules
  453. capsule(45, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
  454. capsule(-135, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
  455. capsule(-45, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
  456. capsule(135, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
  457. // the mount
  458. *mount([-45, 135], mount_wall, mic_mount_wall, mic_mount_height + mount_top_height + mount_height + capsule_bottom);
  459. }