SpHEAR_common.scad 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. //
  2. // Spherical Harmonics Ear Project (*SpHEAR)
  3. //
  4. // Common Modules and Variables
  5. //
  6. // Copyright 2015-2019, Fernando Lopez-Lezcano, All Rights Reserved
  7. // nando@ccrma.stanford.edu
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU General Public License as published by
  11. // the Free Software Foundation, either version 3 of the License, or
  12. // (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. // GNU General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License
  20. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. //
  22. // 3d Models released under the Creative Commons license as follows:
  23. // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
  24. // http://creativecommons.org/licenses/by-nc-sa/4.0/
  25. include <CCRMA_logo.scad>;
  26. ////
  27. //// default model parameters
  28. ////
  29. // microphone capsule array
  30. //
  31. // dimensions of the electret microphone capsule
  32. // (specified in each master scad file)
  33. // capsule_radius
  34. // capsule_height
  35. // distance between the face of a capsule and the center of array
  36. // (specified in each master scad file)
  37. // mic_radius
  38. // wall thickness of the capsule holder
  39. wall = 1.0;
  40. // height and width of capsule stop ring
  41. capsule_ring_h = 0.4;
  42. capsule_ring_w = 0.5;
  43. // dimensions of the capsule holder connection legs
  44. // a width of 4mm is too thin, 5mm prints better
  45. leg_width = 5;
  46. leg_thick = 1.75;
  47. // width of the ridge that connects to the mount
  48. ridge_width = 2.0;
  49. ridge_slot_width = 2.0;
  50. // depth of the connector mount ridge
  51. ridge_depth = 3.0;
  52. // add to the thickness of ridges
  53. ridge_wfit = 0.1;
  54. ridge_hfit = 3;
  55. // microphone mount
  56. //
  57. mount_radius = 3.5;
  58. mount_wall = 0.75;
  59. // lip that mounts flares into main body box
  60. mount_lip = 10.0;
  61. // height and eccentricity of top connector
  62. mount_top_height = 10.0;
  63. mount_top_eccentricity = 1.3;
  64. // height of mount
  65. mount_height = 40;
  66. // microphone stand mount
  67. //
  68. // diameter of existing shielded wires (x 4)
  69. mic_wire_diam = 1.5;
  70. mic_wire_fit = 0.8;
  71. mic_wire_hole_radius = 3.0;
  72. mic_wire_hole_offset = 5;
  73. // standard microphone stand
  74. // measured diameter = 13.5, inside diameter of sleeve = 13.79 (
  75. mic_mount_radius = 13.50 / 2;
  76. // add this to inside diameter
  77. mic_mount_fit = 0.2;
  78. mic_mount_slot_height = 11.5;
  79. mic_mount_slot_width = 4.25;
  80. mic_mount_slot_radius = 6.25 / 2;
  81. mic_mount_wall = 1.5;
  82. mic_mount_height = 20.0 + mic_wire_hole_offset + mic_wire_hole_radius + 2 * mic_mount_wall;
  83. // dimensions of 12 pin male bottom connector
  84. //
  85. // Amphenol T 3635 002
  86. // 12 pin DIN male to cable, gold plated contacts
  87. //
  88. // inner diameter of connector core
  89. conn_core_diam = 13.00 + 0.2;
  90. // outer diameter of connector core sleeve
  91. conn_core_o_diam = 17.00;
  92. // inner diameter of connector core sleeve
  93. conn_core_s_diam = 15.00;
  94. // from top of connector to sleeve
  95. conn_core_sleeve = 13.00;
  96. // from top of connector to holes
  97. conn_core_holes_h = 6.00;
  98. // between holes
  99. conn_core_holes_w = 9.20;
  100. // hole diameter
  101. conn_core_holes_d = 1.95 + 0.2;
  102. // screw head diameter
  103. conn_core_screw_d = 2.75 + 0.5;
  104. // sleeve overlap
  105. conn_core_overlap = 3.00;
  106. // robotic arm interface
  107. // this separation between pillars comes from original arm Widow XL gripper
  108. // (it could be something else now)
  109. grip_sep = 25.4 * 1.5 / 2;
  110. grip_width = 15.0;
  111. grip_depth = 5.0;
  112. //// end of model parameters
  113. ////
  114. //// rendering control
  115. // what type of connection to use between capsule holders:
  116. // 0 -> original cylindrical angled legs
  117. // 1 -> interlocking horizontal legs with triangular top (only works with small radius)
  118. // 2 -> interlocking horizontal legs
  119. // 3 -> interlocking vertical legs
  120. connect = 1;
  121. // how many mount ridges to create
  122. // 0 -> no ridges
  123. // 1 -> 1 ridge
  124. // 2 -> 2 ridges
  125. ridges = 1;
  126. //// end of rendering control
  127. ////
  128. // adjustment for the inner radius of the capsule holder
  129. // measured inside diameter of a trial print was around 7.5 to 8.2
  130. // instead of 10, capsule diameter was 9.99)
  131. fudge = 0.12;
  132. // adjustment for fit of slots in connection legs and mount
  133. // 0.1: initial setting
  134. // 0.1 ->0.15: Ultimaker 2 + Extended plus APL (2016.06.17)
  135. // 0.15->0.10 (2017.01.21)
  136. // Octathingy_common builds -> 0.1, TinySpHEAR_common builds -> 0.15
  137. fit = 0.15;
  138. // number of facets for rendering cylinders (64 for coarse rendering)
  139. facets = 128;
  140. // render capsule holders with better resolution
  141. cfacets = 128;
  142. // "a wafer-thin mint..."
  143. // something to use when we need tiny 3d slivers
  144. thin_mint = 0.001;
  145. //////// Printed circuit board parameters
  146. // size of Zapnspark printed circuit board
  147. // kicad length = 79.375
  148. // measured length = 79.20 (2016.08.25)
  149. pcb_length = pcb_version == 2 ? 72.39 : 79.20;
  150. // kicad width = 19.050
  151. // measured width = 18.82 (2016.08.25)
  152. // v2 (kicad) 15.24 (measured) 15.34
  153. pcb_width = pcb_version == 2 ? 15.34 : 18.85;
  154. // ultimaker spec thickness = 1.61
  155. // measured thickness = 1.56 (w/ copper)
  156. pcb_thickness = pcb_version == 2 ? 1.68 + 0.02 : 1.58;
  157. // tolerance to add to length and width of pcb
  158. //
  159. // measured 3d print width = 18.70 (with pcb_fit = 0.3)
  160. // actual printed = 18.70 - 0.3 = 16.97
  161. // total correction = 18.85 - 16.97 = 1.88
  162. //
  163. pcb_fit = 0.4;
  164. // tolerance add to thickness of pcb
  165. //
  166. // printed with pcb_tfit = 0.15 -> 1.58 + 0.15 = 1.73 (ideal printed)
  167. // measured print channel = 1.63 : 0.1 thinner (ultimaker 2 plus, 2016.08.24)
  168. // measured pcb thickness = 1.58 (othermill)
  169. //
  170. pcb_tfit = 0.15;
  171. // we leave part of the pcb exposed on the bottom of the body so that we
  172. // can solder the wires that connect the microphone with the
  173. // preamplifier, same at the top of the pcb to solder the wires
  174. // to the capsules
  175. pcb_low_exp = 12.0;
  176. pcb_hi_exp = 8.0;
  177. // mount height
  178. pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
  179. // lip fit for flares
  180. lip_fit = 0.15;
  181. // clearance from the bottom and top of pcb's to the start of the flare,
  182. // this adds space for the protuding molex pins on which we solder
  183. pcb_low_clear = pcb_version == 2 ? 12.0 : 15.0;
  184. pcb_hi_clear = pcb_version == 2 ? 12.0 : 15.0;
  185. // depth of slot into which the printed circuit board fits
  186. pcb_slot_depth = 1.0;
  187. // diameter of four conductor cable
  188. cable_diam = 9.5;
  189. // XXX back and front clearance of pcb (components and leads)
  190. // XXX this is different for the Octathingy
  191. pcb_front = pcb_version == 2 ? 2.50 : 3.00;
  192. pcb_back = pcb_version == 2 ? 1.70 : 1.80;
  193. // shared windscreen parameters
  194. windscreen_height = 60;
  195. windscreen_w = 4.0;
  196. beam_radius = 1.3;
  197. windscreen_thread_height = pcb_version == 2 ? 8.0 : 10.0;
  198. windscreen_thread_pitch = 2.0;
  199. windscreen_thread_angle = 30;
  200. windscreen_thread_depth = cos(windscreen_thread_angle) * windscreen_thread_pitch * 5/8 + 0.5;
  201. windscreen_thread_fit = 3 * fit;
  202. ////////
  203. // microphone capsule holder
  204. // mounts: vectors containing the angle of the mount and the angle to the adjacent capsule
  205. // twist: rotate the whole capsule to match mounting legs
  206. // ridge: add 0, 1 or 2 ridges for attaching the structure to the mount
  207. // ridge_wfit: tune the fit, used for carving slots in mount
  208. // ridge_hfit: adjust height of ridges when carving out the capsule rests
  209. // solid: make the capsule holder solid, used in the mount code to carve the capsule rests
  210. module capsule (mounts, twist, ridge, ridge_wfit = 0.0, ridge_hfit = 0.0, solid = 0) {
  211. capsule_h = capsule_height + capsule_ring_h;
  212. difference () {
  213. union () {
  214. // main capsule holder
  215. cylinder(r = capsule_radius + wall, h = capsule_h, $fn = cfacets);
  216. // the mounting legs
  217. for (angles = mounts) {
  218. rotate([0, 0, angles[0] + twist]) {
  219. // disable rendering of the connection legs if the array radius is too
  220. // small and components of adyacent capsule holders touch each other
  221. //
  222. leg_height = leg_thick;
  223. // make sure capsule holders do not touch
  224. render_legs = ((mic_radius - capsule_height) / tan(angles[1])) - capsule_radius - wall -
  225. // and make sure connection leg does not touch adyacent capsule holder
  226. (angles[1] > 45 ? leg_height * tan(2 * angles[1] - 90) + 2 * fit : 0.0);
  227. //
  228. // connect with cylindrical beams, very pretty, not printable
  229. if (connect == 0 && render_legs >= 0) {
  230. leg_length = mic_radius * cos(angles[1]) - capsule_radius * sin(angles[1]);
  231. translate([capsule_radius - wall, 0, capsule_height - wall]) {
  232. rotate([0, 180 - angles[1], 0]) {
  233. cylinder(d = leg_width, h = leg_length - 0.3, center = false, $fn = facets);
  234. }
  235. }
  236. }
  237. // connect with horizontal legs with triangular top (the best by far)
  238. if (connect == 1 && render_legs >= 0) {
  239. leg_length = capsule_radius + wall + capsule_height * tan(angles[1]) - fit;
  240. leg_w = (solid != 0)? leg_width + fit : leg_width;
  241. slot_radius = (mic_radius - capsule_height) / tan(angles[1]);
  242. translate([0, 2 * (- leg_w / 3), 0]) {
  243. difference() {
  244. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  245. // cut slots that lock with adyacent leg
  246. if (solid == 0) {
  247. for (offset = [1, 3]) {
  248. translate([slot_radius - 1 * fit, leg_w / offset - fit / 2, 0]) {
  249. rotate([0, 90 - angles[1] * 2, 0]) translate([0, 0, - capsule_height])
  250. cube([leg_length, leg_w / 3 + fit, capsule_height * 2]);
  251. }
  252. }
  253. }
  254. // shave triangular slice of fingers, starts at edge of capsule holder
  255. translate([capsule_radius + wall, 0, leg_height]) {
  256. rotate([0, 90 - angles[1], 0]) {
  257. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  258. }
  259. }
  260. // and remove the rest when the leg height is less than the capsule height
  261. translate([0, - 2 * (- leg_w / 3), leg_height]) {
  262. difference() {
  263. cylinder(r = capsule_radius + leg_length, h = capsule_height, $fn = facets);
  264. cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);
  265. }
  266. }
  267. }
  268. }
  269. }
  270. // connect with horizontal legs with triangular top (testing for octathingy)
  271. if (connect == 4 && render_legs >= 0) {
  272. leg_h = leg_height * angles[3];
  273. // legs are not long enough for long ones in octathingy... add 1.0
  274. leg_length = capsule_radius + wall + capsule_height * tan(angles[1] + angles[2]) - fit + 1.0;
  275. leg_w = (solid != 0)? leg_width + fit : leg_width;
  276. slot_radius = (mic_radius - capsule_height) / tan(angles[1] + angles[2]);
  277. translate([0, 2 * (- leg_w / 3), 0]) {
  278. difference() {
  279. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  280. // cut slots that lock with adyacent leg
  281. if (solid == 0) {
  282. for (offset = [1, 3]) {
  283. translate([slot_radius - 1 * fit, leg_w / offset - fit / 2, 0]) {
  284. rotate([0, 90 - (angles[1] + angles[2]) * 2, 0]) translate([0, 0, - capsule_height])
  285. cube([leg_length, leg_w / 3 + fit, capsule_height * 2]);
  286. }
  287. }
  288. }
  289. // shave triangular slice of fingers, starts at edge of capsule holder
  290. translate([capsule_radius + wall, 0, leg_h]) {
  291. rotate([0, 90 - (angles[1] + angles[2]), 0]) {
  292. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  293. }
  294. }
  295. // and remove the rest when the leg height is less than the capsule height
  296. translate([0, - 2 * (- leg_w / 3), leg_h]) {
  297. difference() {
  298. cylinder(r = capsule_radius + leg_length, h = capsule_height, $fn = facets);
  299. cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);
  300. }
  301. }
  302. }
  303. }
  304. }
  305. // connect with horizontal legs
  306. if (connect == 2 && render_legs >= 0) {
  307. leg_length = (mic_radius - capsule_height + leg_thick) * tan(90 - angles[1]);
  308. slot_depth = leg_thick / cos(90 - 2 * angles[1]);
  309. slot_xtra_depth = (angles[1] < 45) ? (leg_thick * tan(90 - 2 * angles[1])) : 0.0;
  310. translate([0, - leg_width / 3, 0]) {
  311. difference() {
  312. cube([leg_length, leg_width, leg_thick]);
  313. // cut slot in connector
  314. translate([leg_length - slot_depth - slot_xtra_depth - fit, leg_width / 3 - (fit / 2), 0]) {
  315. cube([slot_depth + slot_xtra_depth + fit, leg_width / 3 + fit, leg_thick]);
  316. }
  317. }
  318. }
  319. }
  320. // connect with vertical legs
  321. if (connect == 3 && render_legs >= 0) {
  322. // fix this 0.2 == (2 * fudge?)
  323. leg_length = (mic_radius * tan(90 - angles[1]) - capsule_radius) * tan(angles[1]) - 0.2;
  324. slot_depth = leg_thick * cos (90 - (2 * angles[1]));
  325. translate([capsule_radius - leg_thick / 2 + fudge, - leg_width / 3,
  326. - leg_length + capsule_height]) {
  327. difference() {
  328. // the connection
  329. difference() {
  330. cube([leg_thick + leg_thick / 2, leg_width, leg_length]);
  331. translate([-leg_thick + wall - fudge, 0, - capsule_height + fudge]) {
  332. cube([leg_thick, leg_width, leg_length]);
  333. }
  334. }
  335. // cut slot in connector
  336. translate([0, leg_width / 3 - (fit / 2), 0]) {
  337. cube([leg_thick + leg_thick / 2, leg_width / 3 + fit, slot_depth]);
  338. }
  339. }
  340. }
  341. }
  342. }
  343. }
  344. // add ridges for microphone mount
  345. ridge_length = (mic_radius - capsule_height) / tan(elev_angle) - (capsule_radius + wall);
  346. if (ridge == 2) {
  347. rotate([0, 0, twist]) {
  348. translate([capsule_radius + wall - ridge_length / 2, (ridge_width + ridge_wfit) / 2, 0]) {
  349. cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  350. }
  351. translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) * 3 / 2, 0]) {
  352. cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  353. }
  354. }
  355. }
  356. if (ridge == 1) {
  357. rotate([0, 0, twist]) {
  358. difference() {
  359. translate([capsule_radius + wall / 2, - (ridge_width + ridge_wfit) / 2, 0]) {
  360. cube([ridge_depth + wall / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  361. }
  362. translate([capsule_radius + wall + ridge_length, - (ridge_width + ridge_wfit) / 2, 0]) {
  363. rotate([0, elev_angle, 0]) {
  364. cube([ridge_depth, ridge_width + ridge_wfit, capsule_h * 2], center = false);
  365. }
  366. }
  367. }
  368. }
  369. }
  370. }
  371. if (solid != 1) {
  372. // make the hole for the capsule
  373. translate ([0, 0, capsule_ring_h]) {
  374. cylinder(r = capsule_radius + fudge, h = capsule_h + thin_mint, $fn = cfacets);
  375. }
  376. if (connect == 3) {
  377. // cut vertical leg overhang below capsule
  378. translate ([0, 0, -capsule_h]) {
  379. cylinder(r = capsule_radius + fudge, h = capsule_h, $fn = cfacets);
  380. }
  381. }
  382. if (connect != 3) {
  383. // leave ridge at bottom for horizontal legs only
  384. cylinder(r = capsule_radius + fudge - capsule_ring_w, h = capsule_h + thin_mint, $fn = cfacets);
  385. }
  386. }
  387. // remove any extra connecting beam material from the face of the holder
  388. if (connect == 0) {
  389. translate ([0, 0, capsule_h]) {
  390. cylinder(r = capsule_radius + wall * 2, h = 2, $fn = cfacets);
  391. }
  392. }
  393. }
  394. }
  395. //// shared modules for zapnspark printed circuit board
  396. // one printed circuit board
  397. module pcb(length, width, thick) {
  398. translate([-width/2, 0, 0]) {
  399. cube([width, thick, length]);
  400. }
  401. }
  402. // one printed circuit board with space in the front and back for components
  403. module pcb_clear(length, width, thick, slot_depth, front, back) {
  404. translate([0, - (thick + front)]) {
  405. pcb(length, width, thick);
  406. // clear space in the front
  407. translate([- (width/2 - slot_depth), thick, 0]) {
  408. cube([width - 2 * slot_depth, front, length]);
  409. }
  410. // clear space in the back
  411. translate([- (width/2 - slot_depth), - back, 0]) {
  412. cube([width - 2 * slot_depth, back, length]);
  413. }
  414. }
  415. }
  416. //// shared modules for mount
  417. // rectangular block with rounded corners
  418. module rounded_block(height, width, depth, radius) {
  419. dw = width - radius;
  420. dd = depth - radius;
  421. minkowski() {
  422. translate([-dw, -dd, 0]) {
  423. cube([dw * 2, dd * 2, height / 2]);
  424. }
  425. cylinder(r = radius, h = height / 2, $fn = facets);
  426. }
  427. }
  428. // rectangular inset block with rounded corners
  429. module rounded_block_relative(height, ref_width, ref_depth, ref_corner, radius_inc) {
  430. corner = ref_corner * ((ref_width + radius_inc) / ref_width);
  431. rounded_block(height, ref_width + radius_inc, ref_depth + radius_inc, corner);
  432. }
  433. // box with rounded corners
  434. module rounded_box(height, width, depth, radius, wall) {
  435. iradius = radius * ((width - wall) / width);
  436. difference() {
  437. rounded_block(height, width, depth, radius);
  438. rounded_block(height, width - wall, depth - wall, iradius);
  439. }
  440. }
  441. //// shared modules for shock mount
  442. // eyelet for connecting the external ring to the stand mount
  443. module shock_mount_ring(outside_radius, inside_radius, thickness) {
  444. difference() {
  445. union() {
  446. cylinder(r = outside_radius, h = thickness, $fn = facets);
  447. translate([0, -outside_radius, 0]) {
  448. cube([outside_radius, outside_radius, thickness]);
  449. }
  450. }
  451. cylinder(r = inside_radius, h = thickness, $fn = facets);
  452. }
  453. }
  454. // one eyelet for connection to shock mount or permanent mount
  455. module mount_stand_eyelet(outside_radius, inside_radius, thickness) {
  456. translate([0, thickness/2, 0]) rotate([90, 0, 0])
  457. difference() {
  458. cylinder(r = outside_radius, h = thickness, $fn = facets);
  459. cylinder(r = inside_radius, h = thickness, $fn = facets);
  460. }
  461. }
  462. // connector to shock mount or permanent mount (upper part)
  463. module mount_connector_top(height, o_radius, i_radius, offset) {
  464. // eyelets
  465. o_rad = 8;
  466. i_rad = 3;
  467. thk = 4;
  468. // screw head and nut dimensions
  469. head_thick = 3.0;
  470. head_diam = 9.2;
  471. nut_radius = 12/2;
  472. // offset
  473. h_offset = offset;
  474. difference() {
  475. hull() {
  476. for (m = [0, 1]) mirror([0, m, 0]) {
  477. translate([0, thk * 3/2, height + o_rad + h_offset]) {
  478. mount_stand_eyelet(o_rad, i_rad, thk);
  479. }
  480. }
  481. translate([0, 0, height]) {
  482. difference() {
  483. cylinder(r = o_radius, h = thin_mint, $fn = facets);
  484. }
  485. }
  486. }
  487. // make hole for screw
  488. translate([0, mic_mount_radius * 2, height + h_offset + o_rad]) {
  489. rotate([90, 0, 0]) cylinder(r = i_rad, h = mic_mount_radius * 4, $fn = facets);
  490. }
  491. // clear the space between eyelets
  492. translate([-o_rad * 2, -thk/2, height + h_offset/2]) {
  493. cube([o_rad * 4, thk, o_rad * 4]);
  494. }
  495. // hollow top
  496. translate([0, 0, height]) {
  497. scale([1.0, 1.0, 1.2]) sphere(r = i_radius, $fn = facets);
  498. }
  499. // recessed hexagonal screw head on one side
  500. translate([0, -3/2*thk, height + h_offset + o_rad]) {
  501. rotate([90, 30, 0]) cylinder(h = head_thick, r = head_diam / 2, $fn = 6);
  502. }
  503. // recessed nut head on the other side
  504. translate([0, 3/2*thk + thk, height + h_offset + o_rad]) {
  505. rotate([90, 30, 0]) cylinder(h = head_thick, r = nut_radius + 0.2, $fn = facets);
  506. }
  507. }
  508. }
  509. // mount to quik release stand
  510. module quik_release_stand_adapter(height, wall, stand_wall) {
  511. difference() {
  512. union() {
  513. // main mount cylinder
  514. difference() {
  515. cylinder(r = mic_mount_radius + mic_mount_fit + stand_wall,
  516. h = height, $fn = facets);
  517. // make the hole for the mount (* 1.5 to cut the ridge as well)
  518. cylinder(r = mic_mount_radius + mic_mount_fit, h = height, $fn = facets);
  519. }
  520. }
  521. // slot for fitting into microphone stand
  522. translate([mic_mount_radius - stand_wall / 2, - mic_mount_slot_width / 2, 0]) {
  523. cube([2 * stand_wall, mic_mount_slot_width, mic_mount_slot_height]);
  524. }
  525. // eyelet for microphone stand
  526. translate([mic_mount_radius - stand_wall / 2, 0, mic_mount_slot_height]) {
  527. rotate([0, 90, 0]) {
  528. cylinder(r = mic_mount_slot_radius, h = 2 * stand_wall, $fn = facets);
  529. }
  530. }
  531. }
  532. }
  533. // connector to quik release microphone stand
  534. module shock_mount_stand(height, wall, stand_wall) {
  535. // connection to microphone
  536. mount_connector_top(height, mic_mount_radius + mount_wall + wall + mic_mount_fit, mic_mount_radius + mic_mount_fit, 20.0);
  537. // connection to stand
  538. quik_release_stand_adapter(height, wall, stand_wall);
  539. }
  540. // thread for stand mount
  541. //
  542. // 5/8-27 for US mic stands
  543. // 3/8-16 for European
  544. module stand_mount_thread(length, band, wall, diameter = 5/8, threads_per_inch = 27, wall = 2.0, fit = 0.1) {
  545. diam = diameter * 25.4;
  546. pitch = (1.0/threads_per_inch)*25.4;
  547. difference() {
  548. cylinder(r = (diam / 2) + wall, h = length + band, $fn = facets);
  549. translate([0, 0, length]) {
  550. cylinder(r = (diam / 2), h = band, $fn = facets);
  551. }
  552. metric_thread (diameter = diam + fit, pitch = pitch, length = length + thin_mint, internal = true);
  553. }
  554. }
  555. // connector to threaded microphone stand
  556. module shock_mount_threaded_stand(height, wall, stand_wall) {
  557. // connection to stand
  558. diam = 5/8 * 25.4;
  559. thread_length = 15.0;
  560. stand_mount_thread(thread_length, height - thread_length, wall);
  561. // connection to microphone
  562. mount_connector_top(height, diam/2 + wall, diam/2, 23.0);
  563. }
  564. //
  565. // new version of tetra shock mount
  566. //
  567. module tetra_shock_mount_band(band_height, radius, corner, gap) {
  568. difference() {
  569. rounded_block_relative(band_height, radius + gap, radius + gap, corner, 3 * wall);
  570. rounded_block(band_height, radius + gap, radius + gap, corner);
  571. }
  572. }
  573. // tetra shock mount internal ring
  574. module tetra_shock_mount_internal_ring(height, radius, band_height, corner, gap) {
  575. difference() {
  576. // four sided ring
  577. union() {
  578. tetra_shock_mount_band(band_height, radius, corner, gap);
  579. // ridge so that rubber bands stay in the shock mount
  580. tetra_shock_mount_band(wall, radius, corner, gap + wall);
  581. }
  582. // slots inside body so that the ring clears the lower screws
  583. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  584. translate([radius + gap + 2.5, -2.0, 0]) cube([2.0, 4.0, band_height]);
  585. }
  586. // channels in body for upper rubber band
  587. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  588. rotate([90, 0, 0]) translate([radius + 8.75, 2 * wall + 0.2, 0])
  589. cylinder(r = 1.0, h = height, center = true, $fn = facets);
  590. }
  591. }
  592. // 8 columns for mounting rubber bands
  593. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  594. for (m = [0, 1]) mirror([m, 0, 0]) {
  595. translate([radius + 4.0 + gap, radius*1/3, 0]) {
  596. rotate([0, 0, 0]) {
  597. difference() {
  598. // columns
  599. union() {
  600. translate([3, 0, 0]) rotate([0, 0, 45]) scale([1.2, 0.85, 1.0])
  601. cylinder(r = 3, h = height, $fn = facets);
  602. // connect column to body
  603. translate([-2, -2, 0])
  604. cube([4, 3, band_height]);
  605. // connect columns together so they cannot bend
  606. translate([2, -7, 0])
  607. cube([wall, 6, height]);
  608. }
  609. // lower slots for rubber bands
  610. rotate([0, 0, 45]) translate([2.5, radius/2, 2.0]) scale([1.0, 1.0, 2.2]) rotate([90, 0, 0]) {
  611. cylinder(r = 1.1, h = radius * 2, $fn = facets);
  612. }
  613. // upper slots for rubber bands
  614. rotate([0, 0, 45]) translate([2.5, radius/2, height - 2.0]) scale([1.0, 1.0, 2.2]) rotate([90, 0, 0]) {
  615. cylinder(r = 1.1, h = radius * 2, $fn = facets);
  616. }
  617. }
  618. }
  619. }
  620. }
  621. }
  622. }
  623. // tetra shock mount external ring
  624. module tetra_shock_mount_external_ring(height, radius, corner, gap) {
  625. // main ring
  626. difference() {
  627. rounded_block_relative(height, radius, radius, corner, gap);
  628. rounded_block_relative(height, radius, radius, corner, gap - ring_wall);
  629. }
  630. for (rot = [0, 90, 180, 270]) {
  631. // anchors for rubber bands
  632. rotate([0, 0, rot + 45]) {
  633. translate([radius + gap + 2.25 * ring_wall, -5, 0]) {
  634. minkowski() {
  635. cube([4 - 2, 10, ring_ext_height]);
  636. cylinder(r = 1.5, h = thin_mint, $fn = facets);
  637. }
  638. }
  639. translate([radius + gap + ring_wall - 2, -2, 0]) {
  640. cube([9, 4, ring_ext_height]);
  641. }
  642. }
  643. }
  644. // reinforcement
  645. intersection() {
  646. difference() {
  647. rounded_block_relative(height * 2, radius, radius, corner, gap);
  648. rounded_block_relative(height * 2, radius, radius, corner, gap - ring_wall);
  649. }
  650. //rotate([0, 0, 22.5]) rounded_octagon_wall(ring_ext_height * 2, 2 * radius - ring_wall, ring_wall);
  651. translate([radius + gap - ring_wall/2, 0, 0]) {
  652. rotate([0, 0, 45]) cylinder(r1 = 2 * radius, r2 = ring_wall/2 + 1, h = ring_ext_height * 2, $fn = 4);
  653. }
  654. }
  655. // connection to hub
  656. translate([radius + gap, -2, 0]) {
  657. cube([10, 4, ring_ext_height * 2]);
  658. }
  659. // rotating mount
  660. o_rad = 8;
  661. i_rad = 3;
  662. rotate([0, 90, -90]) {
  663. translate([-o_rad, radius + gap + o_rad + 8, -2]) {
  664. shock_mount_ring(o_rad, i_rad, ring_wall);
  665. }
  666. }
  667. }
  668. // shock mount to test rig
  669. // model WidowXL
  670. //
  671. // sliding block
  672. arm_l = 10.2 + 0.38;
  673. arm_w = 21.5 + 0.38;
  674. arm_d = 17.6 + 0.1;
  675. // x profile
  676. arm_profile_s = 10.25;
  677. arm_b_prof = 4.25;
  678. // connection socket
  679. arm_s_h = 20.0;
  680. module arm_gripper_block () {
  681. difference() {
  682. // body
  683. translate([-(4 * wall)/2, -2 * wall, 0]) {
  684. cube([arm_l + 4 * wall, arm_w + 4 * wall, arm_d + arm_s_h]);
  685. }
  686. // carve out corners for better fit
  687. translate([0.2, 0.2, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  688. translate([arm_l, 0.2, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  689. translate([arm_l, arm_w, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  690. translate([0.2, arm_w, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  691. // arm gripper block
  692. union() {
  693. cube([arm_l, arm_w, arm_d + arm_s_h]);
  694. translate([-arm_l/2, arm_w/2 - arm_profile_s/2, arm_d - arm_b_prof - arm_profile_s - 10]) {
  695. cube([20, arm_profile_s, arm_profile_s + 10]);
  696. }
  697. // screw holes
  698. translate([-10 + arm_l/2, 3.15, arm_d - 9.7]) rotate([0, 90, 0]) {
  699. cylinder(r = 1.94/2, h = 20.0, $fn = facets);
  700. }
  701. translate([-10 + arm_l/2, arm_w - 3.15, arm_d - 9.7]) rotate([0, 90, 0]) {
  702. cylinder(r = 1.94/2, h = 20.0, $fn = facets);
  703. }
  704. }
  705. }
  706. // add ceiling to body and screw hole
  707. difference() {
  708. translate([-(4 * wall)/2, -2 * wall, arm_d]) {
  709. cube([arm_l + 4 * wall, arm_w + 4 * wall, 3 * wall]);
  710. }
  711. translate([arm_l/2, arm_w/2, 0]) cylinder(r = 3.1/2, h = 30, $fn = facets);
  712. }
  713. }
  714. module tetra_arm_mount(pillar_h, height, radius, band_height, corner, gap) {
  715. difference() {
  716. // four sided ring
  717. union() {
  718. tetra_shock_mount_band(band_height, radius, corner, gap);
  719. // ridge so that rubber bands stay in the shock mount
  720. *tetra_shock_mount_band(wall, radius, corner, gap + wall);
  721. }
  722. // slots inside body so that the ring clears the lower screws
  723. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  724. translate([radius + gap + 2.5, -2.0, 0]) cube([2.0, 4.0, band_height]);
  725. }
  726. // channels in body for upper rubber band
  727. *for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  728. rotate([90, 0, 0]) translate([radius + 8.75, 2 * wall + 0.2, 0])
  729. cylinder(r = 1.0, h = height, center = true, $fn = facets);
  730. }
  731. }
  732. // pillars for arm grips
  733. sphear_arm_mount_pillars(radius, pillar_h, grip_sep, grip_width, grip_depth);
  734. }
  735. // mount pillars that plug into robotic arm sockets
  736. module sphear_arm_mount_pillars(radius, height, grip_sep, grip_width, grip_depth) {
  737. // pillars for arm grips
  738. m_r = 1.0;
  739. for (m = [0, 1]) mirror([m, 0, 0]) translate([radius + 3 * wall + m_r, - grip_width/2 + m_r, 0]) {
  740. minkowski() {
  741. cube([grip_depth - 2*m_r, grip_width - 2*m_r, height]);
  742. cylinder(r = m_r, h = thin_mint, $fn = 32);
  743. }
  744. }
  745. // transition
  746. tran_h = 30.0;
  747. for (m = [0, 1]) mirror([m, 0, 0]) {
  748. hull() {
  749. translate([radius + 3 * wall + m_r, -grip_width/2 + m_r, height]) {
  750. minkowski() {
  751. cube([grip_depth - 2 * m_r, grip_width - 2 * m_r, thin_mint]);
  752. cylinder(r = m_r, h = thin_mint, $fn = 32);
  753. }
  754. }
  755. translate([grip_sep - wall + m_r, -(arm_w + 2 * fit + 2 * wall)/2 + m_r, height + tran_h]) {
  756. minkowski() {
  757. cube([arm_l - 2 * fit + 2 * wall - 2 * m_r, arm_w - 2 * fit + 2 * wall - 2 * m_r, thin_mint]);
  758. cylinder(r = m_r, h = thin_mint, $fn = 32);
  759. }
  760. }
  761. }
  762. }
  763. // grip pillar, plugs into slots
  764. for (m = [0, 1]) mirror([m, 0, 0]) {
  765. translate([grip_sep + m_r, -(arm_w + 2 * fit)/2 + m_r, height + tran_h]) {
  766. minkowski() {
  767. cube([arm_l - 2 * fit - 2 * m_r, arm_w - 2 * fit - 2 * m_r, 20 - 3.0]);
  768. cylinder(r = m_r, h = thin_mint, $fn = 32);
  769. }
  770. }
  771. }
  772. }