SpHEAR_common.scad 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  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. // lip fit for flares
  178. lip_fit = 0.15;
  179. // clearance from the bottom and top of pcb's to the start of the flare,
  180. // this adds space for the protuding molex pins on which we solder
  181. pcb_low_clear = pcb_version == 2 ? 12.0 : 15.0;
  182. pcb_hi_clear = pcb_version == 2 ? 12.0 : 15.0;
  183. // depth of slot into which the printed circuit board fits
  184. pcb_slot_depth = 1.0;
  185. // diameter of four conductor cable
  186. cable_diam = 9.5;
  187. // XXX back and front clearance of pcb (components and leads)
  188. // XXX this is different for the Octathingy
  189. pcb_front = pcb_version == 2 ? 2.50 : 3.00;
  190. pcb_back = pcb_version == 2 ? 1.70 : 1.80;
  191. // shared windscreen parameters
  192. windscreen_height = 60;
  193. windscreen_w = 4.0;
  194. beam_radius = 1.3;
  195. windscreen_thread_height = pcb_version == 2 ? 8.0 : 10.0;
  196. windscreen_thread_pitch = 2.0;
  197. windscreen_thread_angle = 30;
  198. windscreen_thread_depth = cos(windscreen_thread_angle) * windscreen_thread_pitch * 5/8 + 0.5;
  199. windscreen_thread_fit = 3 * fit;
  200. ////////
  201. // microphone capsule holder
  202. // mounts: vectors containing the angle of the mount and the angle to the adjacent capsule
  203. // twist: rotate the whole capsule to match mounting legs
  204. // ridge: add 0, 1 or 2 ridges for attaching the structure to the mount
  205. // ridge_wfit: tune the fit, used for carving slots in mount
  206. // ridge_hfit: adjust height of ridges when carving out the capsule rests
  207. // solid: make the capsule holder solid, used in the mount code to carve the capsule rests
  208. module capsule (mounts, twist, ridge, ridge_wfit = 0.0, ridge_hfit = 0.0, solid = 0) {
  209. capsule_h = capsule_height + capsule_ring_h;
  210. difference () {
  211. union () {
  212. // main capsule holder
  213. cylinder(r = capsule_radius + wall, h = capsule_h, $fn = cfacets);
  214. // the mounting legs
  215. for (angles = mounts) {
  216. rotate([0, 0, angles[0] + twist]) {
  217. // disable rendering of the connection legs if the array radius is too
  218. // small and components of adyacent capsule holders touch each other
  219. //
  220. leg_height = leg_thick;
  221. // make sure capsule holders do not touch
  222. render_legs = ((mic_radius - capsule_height) / tan(angles[1])) - capsule_radius - wall -
  223. // and make sure connection leg does not touch adyacent capsule holder
  224. (angles[1] > 45 ? leg_height * tan(2 * angles[1] - 90) + 2 * fit : 0.0);
  225. //
  226. // connect with cylindrical beams, very pretty, not printable
  227. if (connect == 0 && render_legs >= 0) {
  228. leg_length = mic_radius * cos(angles[1]) - capsule_radius * sin(angles[1]);
  229. translate([capsule_radius - wall, 0, capsule_height - wall]) {
  230. rotate([0, 180 - angles[1], 0]) {
  231. cylinder(d = leg_width, h = leg_length - 0.3, center = false, $fn = facets);
  232. }
  233. }
  234. }
  235. // connect with horizontal legs with triangular top (the best by far)
  236. if (connect == 1 && render_legs >= 0) {
  237. leg_length = capsule_radius + wall + capsule_height * tan(angles[1]) - fit;
  238. leg_w = (solid != 0)? leg_width + fit : leg_width;
  239. slot_radius = (mic_radius - capsule_height) / tan(angles[1]);
  240. translate([0, 2 * (- leg_w / 3), 0]) {
  241. difference() {
  242. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  243. // cut slots that lock with adyacent leg
  244. if (solid == 0) {
  245. for (offset = [1, 3]) {
  246. translate([slot_radius - 1 * fit, leg_w / offset - fit / 2, 0]) {
  247. rotate([0, 90 - angles[1] * 2, 0]) translate([0, 0, - capsule_height])
  248. cube([leg_length, leg_w / 3 + fit, capsule_height * 2]);
  249. }
  250. }
  251. }
  252. // shave triangular slice of fingers, starts at edge of capsule holder
  253. translate([capsule_radius + wall, 0, leg_height]) {
  254. rotate([0, 90 - angles[1], 0]) {
  255. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  256. }
  257. }
  258. // and remove the rest when the leg height is less than the capsule height
  259. translate([0, - 2 * (- leg_w / 3), leg_height]) {
  260. difference() {
  261. cylinder(r = capsule_radius + leg_length, h = capsule_height, $fn = facets);
  262. cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);
  263. }
  264. }
  265. }
  266. }
  267. }
  268. // connect with horizontal legs with triangular top (testing for octathingy)
  269. if (connect == 4 && render_legs >= 0) {
  270. leg_h = leg_height * angles[3];
  271. // legs are not long enough for long ones in octathingy... add 1.0
  272. leg_length = capsule_radius + wall + capsule_height * tan(angles[1] + angles[2]) - fit + 1.0;
  273. leg_w = (solid != 0)? leg_width + fit : leg_width;
  274. slot_radius = (mic_radius - capsule_height) / tan(angles[1] + angles[2]);
  275. translate([0, 2 * (- leg_w / 3), 0]) {
  276. difference() {
  277. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  278. // cut slots that lock with adyacent leg
  279. if (solid == 0) {
  280. for (offset = [1, 3]) {
  281. translate([slot_radius - 1 * fit, leg_w / offset - fit / 2, 0]) {
  282. rotate([0, 90 - (angles[1] + angles[2]) * 2, 0]) translate([0, 0, - capsule_height])
  283. cube([leg_length, leg_w / 3 + fit, capsule_height * 2]);
  284. }
  285. }
  286. }
  287. // shave triangular slice of fingers, starts at edge of capsule holder
  288. translate([capsule_radius + wall, 0, leg_h]) {
  289. rotate([0, 90 - (angles[1] + angles[2]), 0]) {
  290. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  291. }
  292. }
  293. // and remove the rest when the leg height is less than the capsule height
  294. translate([0, - 2 * (- leg_w / 3), leg_h]) {
  295. difference() {
  296. cylinder(r = capsule_radius + leg_length, h = capsule_height, $fn = facets);
  297. cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);
  298. }
  299. }
  300. }
  301. }
  302. }
  303. // connect with horizontal legs
  304. if (connect == 2 && render_legs >= 0) {
  305. leg_length = (mic_radius - capsule_height + leg_thick) * tan(90 - angles[1]);
  306. slot_depth = leg_thick / cos(90 - 2 * angles[1]);
  307. slot_xtra_depth = (angles[1] < 45) ? (leg_thick * tan(90 - 2 * angles[1])) : 0.0;
  308. translate([0, - leg_width / 3, 0]) {
  309. difference() {
  310. cube([leg_length, leg_width, leg_thick]);
  311. // cut slot in connector
  312. translate([leg_length - slot_depth - slot_xtra_depth - fit, leg_width / 3 - (fit / 2), 0]) {
  313. cube([slot_depth + slot_xtra_depth + fit, leg_width / 3 + fit, leg_thick]);
  314. }
  315. }
  316. }
  317. }
  318. // connect with vertical legs
  319. if (connect == 3 && render_legs >= 0) {
  320. // fix this 0.2 == (2 * fudge?)
  321. leg_length = (mic_radius * tan(90 - angles[1]) - capsule_radius) * tan(angles[1]) - 0.2;
  322. slot_depth = leg_thick * cos (90 - (2 * angles[1]));
  323. translate([capsule_radius - leg_thick / 2 + fudge, - leg_width / 3,
  324. - leg_length + capsule_height]) {
  325. difference() {
  326. // the connection
  327. difference() {
  328. cube([leg_thick + leg_thick / 2, leg_width, leg_length]);
  329. translate([-leg_thick + wall - fudge, 0, - capsule_height + fudge]) {
  330. cube([leg_thick, leg_width, leg_length]);
  331. }
  332. }
  333. // cut slot in connector
  334. translate([0, leg_width / 3 - (fit / 2), 0]) {
  335. cube([leg_thick + leg_thick / 2, leg_width / 3 + fit, slot_depth]);
  336. }
  337. }
  338. }
  339. }
  340. }
  341. }
  342. // add ridges for microphone mount
  343. ridge_length = (mic_radius - capsule_height) / tan(elev_angle) - (capsule_radius + wall);
  344. if (ridge == 2) {
  345. rotate([0, 0, twist]) {
  346. translate([capsule_radius + wall - ridge_length / 2, (ridge_width + ridge_wfit) / 2, 0]) {
  347. cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  348. }
  349. translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) * 3 / 2, 0]) {
  350. cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  351. }
  352. }
  353. }
  354. if (ridge == 1) {
  355. rotate([0, 0, twist]) {
  356. difference() {
  357. translate([capsule_radius + wall / 2, - (ridge_width + ridge_wfit) / 2, 0]) {
  358. cube([ridge_depth + wall / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  359. }
  360. translate([capsule_radius + wall + ridge_length, - (ridge_width + ridge_wfit) / 2, 0]) {
  361. rotate([0, elev_angle, 0]) {
  362. cube([ridge_depth, ridge_width + ridge_wfit, capsule_h * 2], center = false);
  363. }
  364. }
  365. }
  366. }
  367. }
  368. }
  369. if (solid != 1) {
  370. // make the hole for the capsule
  371. translate ([0, 0, capsule_ring_h]) {
  372. cylinder(r = capsule_radius + fudge, h = capsule_h + thin_mint, $fn = cfacets);
  373. }
  374. if (connect == 3) {
  375. // cut vertical leg overhang below capsule
  376. translate ([0, 0, -capsule_h]) {
  377. cylinder(r = capsule_radius + fudge, h = capsule_h, $fn = cfacets);
  378. }
  379. }
  380. if (connect != 3) {
  381. // leave ridge at bottom for horizontal legs only
  382. cylinder(r = capsule_radius + fudge - capsule_ring_w, h = capsule_h + thin_mint, $fn = cfacets);
  383. }
  384. }
  385. // remove any extra connecting beam material from the face of the holder
  386. if (connect == 0) {
  387. translate ([0, 0, capsule_h]) {
  388. cylinder(r = capsule_radius + wall * 2, h = 2, $fn = cfacets);
  389. }
  390. }
  391. }
  392. }
  393. //// shared modules for zapnspark printed circuit board
  394. // one printed circuit board
  395. module pcb(length, width, thick) {
  396. translate([-width/2, 0, 0]) {
  397. cube([width, thick, length]);
  398. }
  399. }
  400. // one printed circuit board with space in the front and back for components
  401. module pcb_clear(length, width, thick, slot_depth, front, back) {
  402. translate([0, - (thick + front)]) {
  403. pcb(length, width, thick);
  404. // clear space in the front
  405. translate([- (width/2 - slot_depth), thick, 0]) {
  406. cube([width - 2 * slot_depth, front, length]);
  407. }
  408. // clear space in the back
  409. translate([- (width/2 - slot_depth), - back, 0]) {
  410. cube([width - 2 * slot_depth, back, length]);
  411. }
  412. }
  413. }
  414. //// shared modules for mount
  415. // rectangular block with rounded corners
  416. module rounded_block(height, width, depth, radius) {
  417. dw = width - radius;
  418. dd = depth - radius;
  419. minkowski() {
  420. translate([-dw, -dd, 0]) {
  421. cube([dw * 2, dd * 2, height / 2]);
  422. }
  423. cylinder(r = radius, h = height / 2, $fn = facets);
  424. }
  425. }
  426. // rectangular inset block with rounded corners
  427. module rounded_block_relative(height, ref_width, ref_depth, ref_corner, radius_inc) {
  428. corner = ref_corner * ((ref_width + radius_inc) / ref_width);
  429. rounded_block(height, ref_width + radius_inc, ref_depth + radius_inc, corner);
  430. }
  431. // box with rounded corners
  432. module rounded_box(height, width, depth, radius, wall) {
  433. iradius = radius * ((width - wall) / width);
  434. difference() {
  435. rounded_block(height, width, depth, radius);
  436. rounded_block(height, width - wall, depth - wall, iradius);
  437. }
  438. }
  439. //// shared modules for shock mount
  440. // eyelet for connecting the external ring to the stand mount
  441. module shock_mount_ring(outside_radius, inside_radius, thickness) {
  442. difference() {
  443. union() {
  444. cylinder(r = outside_radius, h = thickness, $fn = facets);
  445. translate([0, -outside_radius, 0]) {
  446. cube([outside_radius, outside_radius, thickness]);
  447. }
  448. }
  449. cylinder(r = inside_radius, h = thickness, $fn = facets);
  450. }
  451. }
  452. // one eyelet for connection to shock mount or permanent mount
  453. module mount_stand_eyelet(outside_radius, inside_radius, thickness) {
  454. translate([0, thickness/2, 0]) rotate([90, 0, 0])
  455. difference() {
  456. cylinder(r = outside_radius, h = thickness, $fn = facets);
  457. cylinder(r = inside_radius, h = thickness, $fn = facets);
  458. }
  459. }
  460. // connector to shock mount or permanent mount (upper part)
  461. module mount_connector_top(height, o_radius, i_radius, offset) {
  462. // eyelets
  463. o_rad = 8;
  464. i_rad = 3;
  465. thk = 4;
  466. // screw head and nut dimensions
  467. head_thick = 3.0;
  468. head_diam = 9.2;
  469. nut_radius = 12/2;
  470. // offset
  471. h_offset = offset;
  472. difference() {
  473. hull() {
  474. for (m = [0, 1]) mirror([0, m, 0]) {
  475. translate([0, thk * 3/2, height + o_rad + h_offset]) {
  476. mount_stand_eyelet(o_rad, i_rad, thk);
  477. }
  478. }
  479. translate([0, 0, height]) {
  480. difference() {
  481. cylinder(r = o_radius, h = thin_mint, $fn = facets);
  482. }
  483. }
  484. }
  485. // make hole for screw
  486. translate([0, mic_mount_radius * 2, height + h_offset + o_rad]) {
  487. rotate([90, 0, 0]) cylinder(r = i_rad, h = mic_mount_radius * 4, $fn = facets);
  488. }
  489. // clear the space between eyelets
  490. translate([-o_rad * 2, -thk/2, height + h_offset/2]) {
  491. cube([o_rad * 4, thk, o_rad * 4]);
  492. }
  493. // hollow top
  494. translate([0, 0, height]) {
  495. scale([1.0, 1.0, 1.2]) sphere(r = i_radius, $fn = facets);
  496. }
  497. // recessed hexagonal screw head on one side
  498. translate([0, -3/2*thk, height + h_offset + o_rad]) {
  499. rotate([90, 30, 0]) cylinder(h = head_thick, r = head_diam / 2, $fn = 6);
  500. }
  501. // recessed nut head on the other side
  502. translate([0, 3/2*thk + thk, height + h_offset + o_rad]) {
  503. rotate([90, 30, 0]) cylinder(h = head_thick, r = nut_radius + 0.2, $fn = facets);
  504. }
  505. }
  506. }
  507. // mount to quik release stand
  508. module quik_release_stand_adapter(height, wall, stand_wall) {
  509. difference() {
  510. union() {
  511. // main mount cylinder
  512. difference() {
  513. cylinder(r = mic_mount_radius + mic_mount_fit + stand_wall,
  514. h = height, $fn = facets);
  515. // make the hole for the mount (* 1.5 to cut the ridge as well)
  516. cylinder(r = mic_mount_radius + mic_mount_fit, h = height, $fn = facets);
  517. }
  518. }
  519. // slot for fitting into microphone stand
  520. translate([mic_mount_radius - stand_wall / 2, - mic_mount_slot_width / 2, 0]) {
  521. cube([2 * stand_wall, mic_mount_slot_width, mic_mount_slot_height]);
  522. }
  523. // eyelet for microphone stand
  524. translate([mic_mount_radius - stand_wall / 2, 0, mic_mount_slot_height]) {
  525. rotate([0, 90, 0]) {
  526. cylinder(r = mic_mount_slot_radius, h = 2 * stand_wall, $fn = facets);
  527. }
  528. }
  529. }
  530. }
  531. // connector to quik release microphone stand
  532. module shock_mount_stand(height, wall, stand_wall) {
  533. // connection to microphone
  534. mount_connector_top(height, mic_mount_radius + mount_wall + wall + mic_mount_fit, mic_mount_radius + mic_mount_fit, 20.0);
  535. // connection to stand
  536. quik_release_stand_adapter(height, wall, stand_wall);
  537. }
  538. // thread for stand mount
  539. //
  540. // 5/8-27 for US mic stands
  541. // 3/8-16 for European
  542. module stand_mount_thread(length, band, wall, diameter = 5/8, threads_per_inch = 27, wall = 2.0, fit = 0.1) {
  543. diam = diameter * 25.4;
  544. pitch = (1.0/threads_per_inch)*25.4;
  545. difference() {
  546. cylinder(r = (diam / 2) + wall, h = length + band, $fn = facets);
  547. translate([0, 0, length]) {
  548. cylinder(r = (diam / 2), h = band, $fn = facets);
  549. }
  550. metric_thread (diameter = diam + fit, pitch = pitch, length = length + thin_mint, internal = true);
  551. }
  552. }
  553. // connector to threaded microphone stand
  554. module shock_mount_threaded_stand(height, wall, stand_wall) {
  555. // connection to stand
  556. diam = 5/8 * 25.4;
  557. thread_length = 15.0;
  558. stand_mount_thread(thread_length, height - thread_length, wall);
  559. // connection to microphone
  560. mount_connector_top(height, diam/2 + wall, diam/2, 23.0);
  561. }
  562. //
  563. // new version of tetra shock mount
  564. //
  565. module tetra_shock_mount_band(band_height, radius, corner, gap) {
  566. difference() {
  567. rounded_block_relative(band_height, radius + gap, radius + gap, corner, 3 * wall);
  568. rounded_block(band_height, radius + gap, radius + gap, corner);
  569. }
  570. }
  571. // tetra shock mount internal ring
  572. module tetra_shock_mount_internal_ring(height, radius, band_height, corner, gap) {
  573. difference() {
  574. // four sided ring
  575. union() {
  576. tetra_shock_mount_band(band_height, radius, corner, gap);
  577. // ridge so that rubber bands stay in the shock mount
  578. tetra_shock_mount_band(wall, radius, corner, gap + wall);
  579. }
  580. // slots inside body so that the ring clears the lower screws
  581. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  582. translate([radius + gap + 2.5, -2.0, 0]) cube([2.0, 4.0, band_height]);
  583. }
  584. // channels in body for upper rubber band
  585. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  586. rotate([90, 0, 0]) translate([radius + 8.75, 2 * wall + 0.2, 0])
  587. cylinder(r = 1.0, h = height, center = true, $fn = facets);
  588. }
  589. }
  590. // 8 columns for mounting rubber bands
  591. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  592. for (m = [0, 1]) mirror([m, 0, 0]) {
  593. translate([radius + 4.0 + gap, radius*1/3, 0]) {
  594. rotate([0, 0, 0]) {
  595. difference() {
  596. // columns
  597. union() {
  598. translate([3, 0, 0]) rotate([0, 0, 45]) scale([1.2, 0.85, 1.0])
  599. cylinder(r = 3, h = height, $fn = facets);
  600. // connect column to body
  601. translate([-2, -2, 0])
  602. cube([4, 3, band_height]);
  603. // connect columns together so they cannot bend
  604. translate([2, -7, 0])
  605. cube([wall, 6, height]);
  606. }
  607. // lower slots for rubber bands
  608. rotate([0, 0, 45]) translate([2.5, radius/2, 2.0]) scale([1.0, 1.0, 2.2]) rotate([90, 0, 0]) {
  609. cylinder(r = 1.1, h = radius * 2, $fn = facets);
  610. }
  611. // upper slots for rubber bands
  612. rotate([0, 0, 45]) translate([2.5, radius/2, height - 2.0]) scale([1.0, 1.0, 2.2]) rotate([90, 0, 0]) {
  613. cylinder(r = 1.1, h = radius * 2, $fn = facets);
  614. }
  615. }
  616. }
  617. }
  618. }
  619. }
  620. }
  621. // tetra shock mount external ring
  622. module tetra_shock_mount_external_ring(height, radius, corner, gap) {
  623. // main ring
  624. difference() {
  625. rounded_block_relative(height, radius, radius, corner, gap);
  626. rounded_block_relative(height, radius, radius, corner, gap - ring_wall);
  627. }
  628. for (rot = [0, 90, 180, 270]) {
  629. // anchors for rubber bands
  630. rotate([0, 0, rot + 45]) {
  631. translate([radius + gap + 2.25 * ring_wall, -5, 0]) {
  632. minkowski() {
  633. cube([4 - 2, 10, ring_ext_height]);
  634. cylinder(r = 1.5, h = thin_mint, $fn = facets);
  635. }
  636. }
  637. translate([radius + gap + ring_wall - 2, -2, 0]) {
  638. cube([9, 4, ring_ext_height]);
  639. }
  640. }
  641. }
  642. // reinforcement
  643. intersection() {
  644. difference() {
  645. rounded_block_relative(height * 2, radius, radius, corner, gap);
  646. rounded_block_relative(height * 2, radius, radius, corner, gap - ring_wall);
  647. }
  648. //rotate([0, 0, 22.5]) rounded_octagon_wall(ring_ext_height * 2, 2 * radius - ring_wall, ring_wall);
  649. translate([radius + gap - ring_wall/2, 0, 0]) {
  650. rotate([0, 0, 45]) cylinder(r1 = 2 * radius, r2 = ring_wall/2 + 1, h = ring_ext_height * 2, $fn = 4);
  651. }
  652. }
  653. // connection to hub
  654. translate([radius + gap, -2, 0]) {
  655. cube([10, 4, ring_ext_height * 2]);
  656. }
  657. // rotating mount
  658. o_rad = 8;
  659. i_rad = 3;
  660. rotate([0, 90, -90]) {
  661. translate([-o_rad, radius + gap + o_rad + 8, -2]) {
  662. shock_mount_ring(o_rad, i_rad, ring_wall);
  663. }
  664. }
  665. }
  666. // shock mount to test rig
  667. // model WidowXL
  668. //
  669. // sliding block
  670. arm_l = 10.2 + 0.38;
  671. arm_w = 21.5 + 0.38;
  672. arm_d = 17.6 + 0.1;
  673. // x profile
  674. arm_profile_s = 10.25;
  675. arm_b_prof = 4.25;
  676. // connection socket
  677. arm_s_h = 20.0;
  678. module arm_gripper_block () {
  679. difference() {
  680. // body
  681. translate([-(4 * wall)/2, -2 * wall, 0]) {
  682. cube([arm_l + 4 * wall, arm_w + 4 * wall, arm_d + arm_s_h]);
  683. }
  684. // carve out corners for better fit
  685. translate([0.2, 0.2, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  686. translate([arm_l, 0.2, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  687. translate([arm_l, arm_w, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  688. translate([0.2, arm_w, 0]) cylinder(r = 0.4, h = arm_d + arm_s_h, $fn = facets);
  689. // arm gripper block
  690. union() {
  691. cube([arm_l, arm_w, arm_d + arm_s_h]);
  692. translate([-arm_l/2, arm_w/2 - arm_profile_s/2, arm_d - arm_b_prof - arm_profile_s - 10]) {
  693. cube([20, arm_profile_s, arm_profile_s + 10]);
  694. }
  695. // screw holes
  696. translate([-10 + arm_l/2, 3.15, arm_d - 9.7]) rotate([0, 90, 0]) {
  697. cylinder(r = 1.94/2, h = 20.0, $fn = facets);
  698. }
  699. translate([-10 + arm_l/2, arm_w - 3.15, arm_d - 9.7]) rotate([0, 90, 0]) {
  700. cylinder(r = 1.94/2, h = 20.0, $fn = facets);
  701. }
  702. }
  703. }
  704. // add ceiling to body and screw hole
  705. difference() {
  706. translate([-(4 * wall)/2, -2 * wall, arm_d]) {
  707. cube([arm_l + 4 * wall, arm_w + 4 * wall, 3 * wall]);
  708. }
  709. translate([arm_l/2, arm_w/2, 0]) cylinder(r = 3.1/2, h = 30, $fn = facets);
  710. }
  711. }
  712. module tetra_arm_mount(pillar_h, height, radius, band_height, corner, gap) {
  713. difference() {
  714. // four sided ring
  715. union() {
  716. tetra_shock_mount_band(band_height, radius, corner, gap);
  717. // ridge so that rubber bands stay in the shock mount
  718. *tetra_shock_mount_band(wall, radius, corner, gap + wall);
  719. }
  720. // slots inside body so that the ring clears the lower screws
  721. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  722. translate([radius + gap + 2.5, -2.0, 0]) cube([2.0, 4.0, band_height]);
  723. }
  724. // channels in body for upper rubber band
  725. *for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  726. rotate([90, 0, 0]) translate([radius + 8.75, 2 * wall + 0.2, 0])
  727. cylinder(r = 1.0, h = height, center = true, $fn = facets);
  728. }
  729. }
  730. // pillars for arm grips
  731. sphear_arm_mount_pillars(radius, pillar_h, grip_sep, grip_width, grip_depth);
  732. }
  733. // mount pillars that plug into robotic arm sockets
  734. module sphear_arm_mount_pillars(radius, height, grip_sep, grip_width, grip_depth) {
  735. // pillars for arm grips
  736. m_r = 1.0;
  737. for (m = [0, 1]) mirror([m, 0, 0]) translate([radius + 3 * wall + m_r, - grip_width/2 + m_r, 0]) {
  738. minkowski() {
  739. cube([grip_depth - 2*m_r, grip_width - 2*m_r, height]);
  740. cylinder(r = m_r, h = thin_mint, $fn = 32);
  741. }
  742. }
  743. // transition
  744. tran_h = 30.0;
  745. for (m = [0, 1]) mirror([m, 0, 0]) {
  746. hull() {
  747. translate([radius + 3 * wall + m_r, -grip_width/2 + m_r, height]) {
  748. minkowski() {
  749. cube([grip_depth - 2 * m_r, grip_width - 2 * m_r, thin_mint]);
  750. cylinder(r = m_r, h = thin_mint, $fn = 32);
  751. }
  752. }
  753. translate([grip_sep - wall + m_r, -(arm_w + 2 * fit + 2 * wall)/2 + m_r, height + tran_h]) {
  754. minkowski() {
  755. cube([arm_l - 2 * fit + 2 * wall - 2 * m_r, arm_w - 2 * fit + 2 * wall - 2 * m_r, thin_mint]);
  756. cylinder(r = m_r, h = thin_mint, $fn = 32);
  757. }
  758. }
  759. }
  760. }
  761. // grip pillar, plugs into slots
  762. for (m = [0, 1]) mirror([m, 0, 0]) {
  763. translate([grip_sep + m_r, -(arm_w + 2 * fit)/2 + m_r, height + tran_h]) {
  764. minkowski() {
  765. cube([arm_l - 2 * fit - 2 * m_r, arm_w - 2 * fit - 2 * m_r, 20 - 3.0]);
  766. cylinder(r = m_r, h = thin_mint, $fn = 32);
  767. }
  768. }
  769. }
  770. }