Bladeren bron

render capsules with more facets, tune some fits for new printer, add one more parameter to capsule code to better fit the mount slots to the capsule array, actually fix the sign of the previous fit parameter (was making things smaller, not bigger), modify calls to do the right thing

Fernando Pablo Lopez-Lezcano 10 jaren geleden
bovenliggende
commit
e75115f167
2 gewijzigde bestanden met toevoegingen van 52 en 54 verwijderingen
  1. 20 16
      TinySpHEAR_common.scad
  2. 32 38
      TinySpHEAR_mount_pcb.scad

+ 20 - 16
TinySpHEAR_common.scad

@@ -54,7 +54,8 @@ wall = 1;
 ridge_width = 2.0;
 ridge_slot_width = 2.0;
 // add to the thickness of ridges
-ridge_fit = 0.1;
+ridge_wfit = 0.1;
+ridge_hfit = 3;
 
 // dimensions of microphone mount
 mount_radius = 3.5;
@@ -131,15 +132,18 @@ leg_angles_bot =
 // adjustment for the inner radius of the capsule holder
 //   measured inside diameter of a trial print was around 7.5 to 8.2 
 //   instead of 10, capsule diameter was 9.99)
-fudge = 0.15;
+// 0.1 -> 0.08: Ultimaker 2 + Extended plus APL (2016.06.17)
+fudge = 0.08;
 
 // adjustment for fit of slots in connection legs and mount
 // 0.1: initial setting
-// 0.1 ->0.2: Ultimaker 2 + Extended plus APL (2016.06.10)
-fit = 0.2;
+// 0.1 ->0.15: Ultimaker 2 + Extended plus APL (2016.06.17)
+fit = 0.15;
 
 // number of facets for rendering cylinders
 facets = 64;
+// render capsule holders with better resolution
+cfacets = 128;
 
 // microphone structure geometry
 capsule_sep_min = (mic_radius - capsule_height) * cos(elev_angle) - (capsule_radius + wall) * sin(elev_angle);
@@ -155,18 +159,18 @@ mount_radius_capsule = capsule_sep_max;
 // mounts: vectors containing the angle of the mount and the angle to the adjacent capsule
 // twist: rotate the whole capsule to match mounting legs
 // ridge: add 0, 1 or 2 ridges for attaching the structure to the mount
-// ridge_fit: tune the fit, used for carving slots in mount
+// ridge_wfit: tune the fit, used for carving slots in mount
+// ridge_hfit: adjust height of ridges when carving out the capsule rests
 // solid: make the capsule holder solid, used in the mount code to carve the capsule rests
-// rfit: adjust height of ridges when carving out the capsule rests
 
-module capsule (azimuth, elevation, mounts, twist, ridge, ridge_fit = 0.0, solid = 0, rfit = 0) {
+module capsule (azimuth, elevation, mounts, twist, ridge, ridge_wfit = 0.0, ridge_hfit = 0.0, solid = 0) {
     rotate([0, 0, azimuth]) {
         rotate([0, (90 - elevation), 0]) {
             translate([0, 0, (rendermic == 0 && solid == 0) ? 0 : mic_radius - capsule_height]) {
                 difference () {
                     union () {
                         // main capsule holder
-                        cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);    
+                        cylinder(r = capsule_radius + wall, h = capsule_height, $fn = cfacets);    
                         // the mounting legs
                         for (angles = mounts) {
                             rotate([0, 0, angles[0] + twist]) {
@@ -224,18 +228,18 @@ module capsule (azimuth, elevation, mounts, twist, ridge, ridge_fit = 0.0, solid
                         ridge_length = (mic_radius - capsule_height) / tan(elev_angle) - (capsule_radius + wall);
                         if (ridge == 2) {
                             rotate([0, 0, twist]) {
-                                translate([capsule_radius + wall - ridge_length / 2, (ridge_width - ridge_fit) / 2, 0]) {
-                                    cube([ridge_length * 3 / 2, ridge_width - ridge_fit, capsule_height + rfit], center = false);
+                                translate([capsule_radius + wall - ridge_length / 2, (ridge_width + ridge_wfit) / 2, 0]) {
+                                    cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
                                 }
-                                translate([capsule_radius + wall - ridge_length / 2, - (ridge_width - ridge_fit) * 3 / 2, 0]) {
-                                    cube([ridge_length * 3 / 2, ridge_width - ridge_fit, capsule_height + rfit], center = false);
+                                translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) * 3 / 2, 0]) {
+                                    cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
                                 }
                             }
                         }
                         if (ridge == 1) {
                             rotate([0, 0, twist]) {
-                                translate([capsule_radius + wall - ridge_length / 2, - (ridge_width - ridge_fit) / 2, 0]) {
-                                    cube([ridge_length * 3 / 2, ridge_width - ridge_fit, capsule_height + rfit], center = false);
+                                translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) / 2, 0]) {
+                                    cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
                                 }
                             }
                         }
@@ -243,13 +247,13 @@ module capsule (azimuth, elevation, mounts, twist, ridge, ridge_fit = 0.0, solid
                     // make the hole for the capsule (also cuts leg overhang for vertical connectors)
                     if (solid != 1) {
                         translate ([0, 0, -capsule_height]) {
-                            cylinder(r = capsule_radius + fudge, h = capsule_height * 2, $fn = facets);
+                            cylinder(r = capsule_radius + fudge, h = capsule_height * 2, $fn = cfacets);
                         }
                     }
                     // remove any extra connecting beam material from the face of the holder
                     if (connect == 0) {
                         translate ([0, 0, capsule_height]) {
-                            cylinder(r = capsule_radius + wall * 2, h = 2, $fn = facets);
+                            cylinder(r = capsule_radius + wall * 2, h = 2, $fn = cfacets);
                         }
                     }
                 }

+ 32 - 38
TinySpHEAR_mount_pcb.scad

@@ -34,8 +34,25 @@ pcb_width = 16.51;
 // measured = 1.33 (fit = 0.28)
 pcb_thickness = 1.61;
 
+// we leave 12mm of the pcb exposed on the bottom of the body so that we
+// can solder the wires that connect the microphone with the
+// preamplifier, same at the top of the pcb to solder the wires
+// to the capsules
+pcb_low_exp = 12.0;
+pcb_hi_exp = 8.0;
+
 // diameter of four conductor cable
-cable_diam = 8.75;
+cable_diam = 9.5;
+
+// lip that mounts flares into main body box
+mount_lip = 6.0;
+
+// main body corner radius
+mount_corner = 10.0;
+
+// capsule array mount, height of flare and stalk
+flare_height = 50;
+stalk_height = 40;
 
 // add to length and width of pcb
 pcb_fit = 0.25 / 2;
@@ -58,9 +75,6 @@ pcb_back = 2.0;
 // calculated minimum "radius" of microphone box
 box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
 
-// number of facets for rendering cylinders
-facets = 64;
-
 // the printed circuit board
 
 module pcb(length, width, thick) {
@@ -230,41 +244,22 @@ module tetra_capsule_array_mount(angles) {
         // indentations that match the two lower capsule holders
         // add ridge height adjustment
         translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
-            capsule(angles[0], -elev_angle, [], 0, 1, 0.1, 1, 3);
-            capsule(angles[1], -elev_angle, [], 0, 1, 0.1, 1, 3);
+            capsule(angles[0], -elev_angle, [], 0, 1, 0.1, 3, 1);
+            capsule(angles[1], -elev_angle, [], 0, 1, 0.1, 3, 1);
         }
     }
 }
 
-echo("box radius is ", box_radius);
-
-// lip that mounts flares into main body box
-mount_lip = 6.0;
-
-// main body corner radius
-mount_corner = 10.0;
-
 // main body of microphone mount
 //
-// we leave 12mm of the pcb exposed on the bottom of the body so that we
-// can solder the wires that connect the microphone with the
-// preamplifier, same at the top of the pcb to solder the wires
-// to the capsules
-pcb_low_exp = 12.0;
-pcb_hi_exp = 8.0;
-
 translate([0, 0, -(pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
     tetra_mount_body(pcb_length - pcb_low_exp - pcb_hi_exp, box_radius + wall, mount_corner, mount_lip, mount_lip, 0);
 }
 
 // flare to microphone stalk
 //
-// add 12mm of exposed pcb coverage
 
 //translate([0, 0, pcb_length - pcb_low_exp - pcb_hi_exp + 10]) {
-flare_height = 50;
-stalk_height = 40;
-
 translate([0, 0, 0]) {
     tetra_mount_flare(10 + pcb_hi_exp, mount_lip, flare_height, box_radius + wall,  mount_corner, 
                     mount_radius + wall, stalk_height);
@@ -275,18 +270,17 @@ translate([0, 0, 0]) {
 
 // flare to microphone cable
 //
-// add 8mm of exposed pcb coverage
 
 translate([0, 0, -(10 + pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
+//translate([0, 0, 0]) {
     rotate([0, 180, 0]) {
-        tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2, 10);
+        tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10);
     }
 }
 
-// the microphone itself
-rendermic = 1;
-
-rotate([90, 0, 0]) {
+// first try at a ccrma logo
+//
+*rotate([90, 0, 0]) {
     translate([0, 10, box_radius + 1.5]) {
         scale([0.03, 0.03, 0.02]) {
             surface(file = "ccrma-black.png", center = true, invert = true);
@@ -294,15 +288,15 @@ rotate([90, 0, 0]) {
     }
 }
 
-//capsule_radius = 7;
-//mic_radius = 11;
+// the microphone itself
+rendermic = 1;
 
-translate([0, 0, 3 + pcb_hi_exp + flare_height + stalk_height + 30]) {
+translate([0, 0, 2.8 + pcb_hi_exp + flare_height + stalk_height + 30]) {
     // all four capsules
-    capsule(45, elev_angle, leg_angles_top, 60, 0, 0.0, 0, 0);
-    capsule(-135, elev_angle, leg_angles_top, 60, 0, 0.0, 0, 0);
-    capsule(-45, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0, 0);
-    capsule(135, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0, 0);
+    capsule(45, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
+    capsule(-135, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
+    capsule(-45, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
+    capsule(135, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
     // the mount
     *mount([-45, 135], mount_wall, mic_mount_wall, mic_mount_height + mount_top_height + mount_height + capsule_bottom);
 }