TinySpHEAR_mount_pcb.scad 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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. // diameter of four conductor cable
  35. cable_diam = 8.75;
  36. // add to length and width of pcb
  37. pcb_fit = 0.25 / 2;
  38. // add to thickness of pcb
  39. pcb_tfit = 0.3;
  40. // lip fit for flares (fit = 0.25)
  41. // tried with 0.30 and seems to be fine
  42. lip_fit = 0.30 / 2;
  43. // wall thickness
  44. wall = 1.0;
  45. // back and front clearance of pcb (components and leads)
  46. // pcb_front = 10.2;
  47. pcb_front = 12.5;
  48. pcb_back = 2.0;
  49. // calculated minimum "radius" of microphone box
  50. box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
  51. // number of facets for rendering cylinders
  52. facets = 64;
  53. // the printed circuit board
  54. module pcb(length, width, thick) {
  55. translate([-width/2, 0, 0]) {
  56. cube([width, thick, length]);
  57. }
  58. }
  59. // the printed circuit board plus space in the front and back for components
  60. module pcb_clear(length, width, thick, slot_depth, front, back) {
  61. translate([0, - (thick + front)]) {
  62. pcb(length, width, thick);
  63. // clear space in the front
  64. translate([- (width/2 - slot_depth), thick, 0]) {
  65. cube([width - 2 * slot_depth, front, length]);
  66. }
  67. // clear space in the back
  68. translate([- (width/2 - slot_depth), - back, 0]) {
  69. cube([width - 2 * slot_depth, back, length]);
  70. }
  71. }
  72. }
  73. // all four printed circuit boards
  74. module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
  75. for (rot = [0, 90, 180, 270]) {
  76. rotate([0, 0, rot]) {
  77. pcb_clear(pcb_length + 2*pcb_fit, pcb_width + 2*pcb_fit, pcb_thickness + pcb_tfit, slot_depth, front, back);
  78. }
  79. }
  80. }
  81. module tetra_mount_box(height, radius, corner) {
  82. rd = radius - corner;
  83. minkowski() {
  84. translate([-rd, -rd, 0]) {
  85. cube([rd * 2, rd * 2, height / 2]);
  86. }
  87. cylinder(r = corner, h = height / 2, $fn = facets);
  88. }
  89. }
  90. // the main body of the microphone mount
  91. module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
  92. rd = radius - corner;
  93. difference() {
  94. tetra_mount_box(height, radius, corner);
  95. union() {
  96. // hollow out the inside with slots for pcbs
  97. tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, 1.0, pcb_front, pcb_back);
  98. // trim square angles
  99. cylinder(r = pcb_front, h = height, $fn = facets);
  100. // remove slots from inside body
  101. slot_len = 15;
  102. translate([0, 0, slot_len]) {
  103. hull() {
  104. tetra_mount_box(height - (3 * slot_len), radius - 2 * wall, corner);
  105. translate([0, 0, height - (2 * slot_len) + height / 3]) {
  106. cylinder(r = radius / 3, h = 1, $fn = facets);
  107. }
  108. }
  109. }
  110. // upper lip for flare to microphone
  111. translate([0, 0, height - upper_lip]) {
  112. difference() {
  113. tetra_mount_box(upper_lip, radius, corner);
  114. tetra_mount_box(upper_lip, radius - (wall + lip_fit), corner);
  115. }
  116. }
  117. // lower lip for flare to cable
  118. translate([0, 0, 0]) {
  119. difference() {
  120. tetra_mount_box(lower_lip, radius, corner);
  121. tetra_mount_box(lower_lip, radius - (wall + lip_fit), corner);
  122. }
  123. }
  124. }
  125. }
  126. // external slot for microphone holder
  127. if (0) {
  128. mount_slot_len = 30;
  129. mount_slot_stem = 4;
  130. mount_slot_width = 2;
  131. mount_slot_radius = 2;
  132. translate([-(radius + mount_slot_stem), -(mount_slot_width/2), 0]) {
  133. cube([mount_slot_stem, mount_slot_width, mount_slot_len]);
  134. }
  135. translate([-(radius + mount_slot_stem), 0, 0]) {
  136. cylinder(r = mount_slot_radius, h = mount_slot_len, $fn = facets);
  137. }
  138. }
  139. // add parts for clearance check
  140. if (clear == 1) {
  141. // electrolytic capacitors
  142. cap_diam = 10.2;
  143. for (rot = [0, 180, 270]) {
  144. rotate([0, 0, rot]) {
  145. translate([-pcb_front + cap_diam/2, 0, 0]) {
  146. cylinder(r = (cap_diam/2), h = 20, $fn = facets);
  147. }
  148. }
  149. }
  150. // 12.3 x 10.53 caps
  151. cap_h = 12.3;
  152. cap_w = 10.53/2;
  153. for (rot = [0, 180, 270]) {
  154. rotate([0, 0, rot]) {
  155. translate([-pcb_front + cap_h, -cap_w/2 - 2.5, 0]) {
  156. cube([cap_h, cap_w, 20]);
  157. }
  158. }
  159. }
  160. }
  161. }
  162. // flares from the body to the microphone stalk and cable
  163. module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_radius, stalk_height) {
  164. // bottom rounded box
  165. difference() {
  166. tetra_mount_box(height, bot_radius, bot_corner);
  167. tetra_mount_box(height, bot_radius - 2 * wall, bot_corner);
  168. // flange to mount on body
  169. tetra_mount_box(lip + 1.0, bot_radius - wall, bot_corner);
  170. }
  171. // flare to round section
  172. translate([0, 0, height]) {
  173. difference() {
  174. hull() {
  175. tetra_mount_box(1, bot_radius, bot_corner);
  176. translate([0, 0, transition]) {
  177. cylinder(r = top_radius, h = 1, $fn = facets);
  178. }
  179. }
  180. hull() {
  181. tetra_mount_box(1, bot_radius - 2 * wall, bot_corner);
  182. translate([0, 0, transition]) {
  183. cylinder(r = top_radius - wall, h = 1, $fn = facets);
  184. }
  185. }
  186. }
  187. }
  188. // cylindrical stalk
  189. translate([0, 0, height + transition]) {
  190. difference() {
  191. cylinder(r = top_radius, h = stalk_height, $fn = facets);
  192. cylinder(r = top_radius - wall, h = stalk_height, $fn = facets);
  193. }
  194. }
  195. }
  196. // top conical section that plugs into capsule array
  197. module tetra_capsule_array_mount(angles) {
  198. difference() {
  199. translate([0, 0, 0]) {
  200. rotate([0, 0, 45]) {
  201. difference() {
  202. ellipsoid(mount_top_height, mount_radius + wall, mount_radius_capsule, mount_top_eccentricity);
  203. ellipsoid(mount_top_height, mount_radius, mount_radius_capsule * 0.5, mount_top_eccentricity * 1.05);
  204. }
  205. }
  206. }
  207. // indentations that match the two lower capsule holders
  208. // add ridge height adjustment
  209. translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
  210. capsule(angles[0], -elev_angle, [], 0, 1, 0.1, 1, 3);
  211. capsule(angles[1], -elev_angle, [], 0, 1, 0.1, 1, 3);
  212. }
  213. }
  214. }
  215. echo("box radius is ", box_radius);
  216. // lip that mounts flares into main body box
  217. mount_lip = 6.0;
  218. // main body corner radius
  219. mount_corner = 10.0;
  220. // main body of microphone mount
  221. //
  222. // we leave 12mm of the pcb exposed on the bottom of the body so that we
  223. // can solder the wires that connect the microphone with the
  224. // preamplifier, same at the top of the pcb to solder the wires
  225. // to the capsules
  226. pcb_low_exp = 12.0;
  227. pcb_hi_exp = 8.0;
  228. translate([0, 0, -(pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
  229. tetra_mount_body(pcb_length - pcb_low_exp - pcb_hi_exp, box_radius + wall, mount_corner, mount_lip, mount_lip, 0);
  230. }
  231. // flare to microphone stalk
  232. //
  233. // add 12mm of exposed pcb coverage
  234. //translate([0, 0, pcb_length - pcb_low_exp - pcb_hi_exp + 10]) {
  235. flare_height = 50;
  236. stalk_height = 40;
  237. translate([0, 0, 0]) {
  238. tetra_mount_flare(10 + pcb_hi_exp, mount_lip, flare_height, box_radius + wall, mount_corner,
  239. mount_radius + wall, stalk_height);
  240. translate([0, 0, 10 + pcb_hi_exp + flare_height + stalk_height]) {
  241. tetra_capsule_array_mount([-45, 135]);
  242. }
  243. }
  244. // flare to microphone cable
  245. //
  246. // add 8mm of exposed pcb coverage
  247. translate([0, 0, -(10 + pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
  248. rotate([0, 180, 0]) {
  249. tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2, 10);
  250. }
  251. }
  252. // the microphone itself
  253. rendermic = 1;
  254. rotate([90, 0, 0]) {
  255. translate([0, 10, box_radius + 1.5]) {
  256. scale([0.03, 0.03, 0.02]) {
  257. surface(file = "ccrma-black.png", center = true, invert = true);
  258. }
  259. }
  260. }
  261. //capsule_radius = 7;
  262. //mic_radius = 11;
  263. translate([0, 0, 3 + pcb_hi_exp + flare_height + stalk_height + 30]) {
  264. // all four capsules
  265. capsule(45, elev_angle, leg_angles_top, 60, 0, 0.0, 0, 0);
  266. capsule(-135, elev_angle, leg_angles_top, 60, 0, 0.0, 0, 0);
  267. capsule(-45, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0, 0);
  268. capsule(135, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0, 0);
  269. // the mount
  270. *mount([-45, 135], mount_wall, mic_mount_wall, mic_mount_height + mount_top_height + mount_height + capsule_bottom);
  271. }