TinySpHEAR_mount_pcb.scad 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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 (fit = 0.25)
  54. // tried with 0.30 and seems to be fine
  55. lip_fit = 0.30 / 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. module tetra_mount_box(height, radius, corner) {
  93. rd = radius - corner;
  94. minkowski() {
  95. translate([-rd, -rd, 0]) {
  96. cube([rd * 2, rd * 2, height / 2]);
  97. }
  98. cylinder(r = corner, h = height / 2, $fn = facets);
  99. }
  100. }
  101. // the main body of the microphone mount
  102. module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
  103. rd = radius - corner;
  104. difference() {
  105. tetra_mount_box(height, radius, corner);
  106. union() {
  107. // hollow out the inside with slots for pcbs
  108. tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, 1.0, pcb_front, pcb_back);
  109. // trim square angles
  110. cylinder(r = pcb_front, h = height, $fn = facets);
  111. // remove slots from inside body
  112. slot_len = 15;
  113. translate([0, 0, slot_len]) {
  114. hull() {
  115. tetra_mount_box(height - (3 * slot_len), radius - 2 * wall, corner);
  116. translate([0, 0, height - (2 * slot_len) + height / 3]) {
  117. cylinder(r = radius / 3, h = 1, $fn = facets);
  118. }
  119. }
  120. }
  121. // upper lip for flare to microphone
  122. translate([0, 0, height - upper_lip]) {
  123. difference() {
  124. tetra_mount_box(upper_lip, radius, corner);
  125. tetra_mount_box(upper_lip, radius - (wall + lip_fit), corner);
  126. }
  127. }
  128. // lower lip for flare to cable
  129. translate([0, 0, 0]) {
  130. difference() {
  131. tetra_mount_box(lower_lip, radius, corner);
  132. tetra_mount_box(lower_lip, radius - (wall + lip_fit), corner);
  133. }
  134. }
  135. }
  136. }
  137. // external slot for microphone holder
  138. if (0) {
  139. mount_slot_len = 30;
  140. mount_slot_stem = 4;
  141. mount_slot_width = 2;
  142. mount_slot_radius = 2;
  143. translate([-(radius + mount_slot_stem), -(mount_slot_width/2), 0]) {
  144. cube([mount_slot_stem, mount_slot_width, mount_slot_len]);
  145. }
  146. translate([-(radius + mount_slot_stem), 0, 0]) {
  147. cylinder(r = mount_slot_radius, h = mount_slot_len, $fn = facets);
  148. }
  149. }
  150. // add parts for clearance check
  151. if (clear == 1) {
  152. // electrolytic capacitors
  153. cap_diam = 10.2;
  154. for (rot = [0, 180, 270]) {
  155. rotate([0, 0, rot]) {
  156. translate([-pcb_front + cap_diam/2, 0, 0]) {
  157. cylinder(r = (cap_diam/2), h = 20, $fn = facets);
  158. }
  159. }
  160. }
  161. // 12.3 x 10.53 caps
  162. cap_h = 12.3;
  163. cap_w = 10.53/2;
  164. for (rot = [0, 180, 270]) {
  165. rotate([0, 0, rot]) {
  166. translate([-pcb_front + cap_h, -cap_w/2 - 2.5, 0]) {
  167. cube([cap_h, cap_w, 20]);
  168. }
  169. }
  170. }
  171. }
  172. }
  173. // flares from the body to the microphone stalk and cable
  174. module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_radius, stalk_height) {
  175. // bottom rounded box
  176. difference() {
  177. tetra_mount_box(height, bot_radius, bot_corner);
  178. tetra_mount_box(height, bot_radius - 2 * wall, bot_corner);
  179. // flange to mount on body
  180. tetra_mount_box(lip + 1.0, bot_radius - wall, bot_corner);
  181. }
  182. // flare to round section
  183. translate([0, 0, height]) {
  184. difference() {
  185. hull() {
  186. tetra_mount_box(1, bot_radius, bot_corner);
  187. translate([0, 0, transition]) {
  188. cylinder(r = top_radius, h = 1, $fn = facets);
  189. }
  190. }
  191. hull() {
  192. tetra_mount_box(1, bot_radius - 2 * wall, bot_corner);
  193. translate([0, 0, transition]) {
  194. cylinder(r = top_radius - wall, h = 1, $fn = facets);
  195. }
  196. }
  197. }
  198. }
  199. // cylindrical stalk
  200. translate([0, 0, height + transition]) {
  201. difference() {
  202. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  203. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  204. }
  205. }
  206. }
  207. // top conical section that plugs into capsule array
  208. module tetra_capsule_array_mount(angles) {
  209. difference() {
  210. translate([0, 0, 0]) {
  211. rotate([0, 0, 45]) {
  212. difference() {
  213. ellipsoid(mount_top_height, mount_radius + wall, mount_radius_capsule, mount_top_eccentricity);
  214. ellipsoid(mount_top_height, mount_radius, mount_radius_capsule * 0.5, mount_top_eccentricity * 1.05);
  215. }
  216. }
  217. }
  218. // indentations that match the two lower capsule holders
  219. // add ridge height adjustment
  220. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
  221. capsule(angles[0], -elev_angle, [], 0, 1, 0.1, 3, 1);
  222. capsule(angles[1], -elev_angle, [], 0, 1, 0.1, 3, 1);
  223. }
  224. }
  225. }
  226. // internal ring of shock mount
  227. module tetra_shock_mount_int_ring(height, radius, corner, lip) {
  228. slot_sep = radius * 2 / 2.7;
  229. slot_w = 6;
  230. slot_o = height / 3;
  231. difference() {
  232. tetra_mount_box(slot_o, radius + wall, corner);
  233. tetra_mount_box(slot_o, radius - 2 * wall, corner - 2.0);
  234. }
  235. difference() {
  236. tetra_mount_box(height, radius + 2 * wall, corner);
  237. tetra_mount_box(height, radius, corner - 2.0);
  238. for (rot = [0, 90, 180, 270]) {
  239. rotate([0, 0, rot]) {
  240. for (xo = [1, -1] * slot_sep) {
  241. translate([-slot_w / 2 + xo, radius - 2 * wall, slot_o]) {
  242. // slots for rubber bands
  243. cube([slot_w, 10, slot_o]);
  244. translate([slot_w / 3, 0, 0]) {
  245. cube([slot_w / 3, 10, 10]);
  246. }
  247. }
  248. }
  249. }
  250. }
  251. }
  252. for (rot = [0, 90, 180, 270]) {
  253. rotate([0, 0, rot]) {
  254. // slots for connecting the upper and lower rings
  255. translate([radius + wall, -(slot_sep + slot_w/3)/2, 0]) {
  256. difference() {
  257. cube([5, slot_sep + slot_w/3, height]);
  258. translate([0, wall, 0]) {
  259. cube([4, slot_sep + slot_w/3 - 2 * wall, 4]);
  260. }
  261. }
  262. }
  263. // lip to support microphone on lower ring only
  264. if (lip == 1) {
  265. lip_w = 10;
  266. translate([radius, -lip_w/2, height]) {
  267. rotate([90, 90, 180]) {
  268. linear_extrude(height = lip_w) {
  269. polygon([[0, 0], [0, 4], [1, 4], [height * 2/3, 0]]);
  270. }
  271. }
  272. }
  273. }
  274. }
  275. }
  276. }
  277. // main body of microphone mount
  278. //
  279. *translate([0, 0, -(pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
  280. tetra_mount_body(pcb_length - pcb_low_exp - pcb_hi_exp, box_radius + wall, mount_corner, mount_lip, mount_lip, 0);
  281. }
  282. // flare to microphone stalk
  283. //
  284. //translate([0, 0, pcb_length - pcb_low_exp - pcb_hi_exp + 10]) {
  285. *translate([0, 0, 0]) {
  286. tetra_mount_flare(10 + pcb_hi_exp, mount_lip, flare_height, box_radius + wall, mount_corner,
  287. mount_radius + wall, stalk_height);
  288. translate([0, 0, 10 + pcb_hi_exp + flare_height + stalk_height]) {
  289. tetra_capsule_array_mount([-45, 135]);
  290. }
  291. }
  292. // flare to microphone cable
  293. //
  294. //translate([0, 0, -(10 + pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
  295. translate([0, 0, -15]) {
  296. rotate([0, 180, 0]) {
  297. tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10);
  298. }
  299. }
  300. // shock mount
  301. //
  302. ring_sep = 30;
  303. translate([0, 0, -3]) {
  304. //rotate([0, 180, 0]) {
  305. tetra_shock_mount_int_ring(10, box_radius + 3.5 * wall, 12, 0);
  306. rotate([0, 180, 0]) {
  307. translate([0, 0, ring_sep]) {
  308. tetra_shock_mount_int_ring(10, box_radius + 3.5 * wall, 12, 1);
  309. }
  310. }
  311. //}
  312. }
  313. translate([0, 0, - ring_sep / 2 - 5]) {
  314. difference() {
  315. tetra_mount_box(6, box_radius + 25, 25);
  316. tetra_mount_box(6, box_radius + 25 - 4 * wall, 25 - 2.0);
  317. // cylinder(r = box_radius + 25, h = 6, $fn = facets);
  318. // cylinder(r = box_radius + 25 - 3 * wall, h = 6, $fn = facets);
  319. }
  320. for (rot = [0, 90, 180, 270]) {
  321. rotate([0, 0, rot]) {
  322. translate([box_radius + 25 + 4 * wall, -7.5, 0]) {
  323. cube([4, 15, 6]);
  324. }
  325. translate([box_radius + 25, -2, 0]) {
  326. cube([7, 4, 6]);
  327. }
  328. }
  329. }
  330. }
  331. // first try at a ccrma logo
  332. //
  333. *rotate([90, 0, 0]) {
  334. translate([0, 10, box_radius + 1.5]) {
  335. scale([0.03, 0.03, 0.02]) {
  336. surface(file = "ccrma-black.png", center = true, invert = true);
  337. }
  338. }
  339. }
  340. // the microphone itself
  341. rendermic = 1;
  342. *translate([0, 0, 2.8 + pcb_hi_exp + flare_height + stalk_height + 30]) {
  343. // all four capsules
  344. capsule(45, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
  345. capsule(-135, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
  346. capsule(-45, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
  347. capsule(135, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
  348. // the mount
  349. *mount([-45, 135], mount_wall, mic_mount_wall, mic_mount_height + mount_top_height + mount_height + capsule_bottom);
  350. }