Jelajahi Sumber

h2n: rename mini-xrl related parameters, some code and comments cleanup

Fernando Pablo Lopez-Lezcano 9 tahun lalu
induk
melakukan
bee8221200
1 mengubah file dengan 63 tambahan dan 40 penghapusan
  1. 63 40
      TinySpHEAR_H2N_common.scad

+ 63 - 40
TinySpHEAR_H2N_common.scad

@@ -106,6 +106,14 @@ h2n_bridge_band_h = 3.30; // 26.5 - h2n_column_height;
 h2n_bridge_circle_max = 26.5;
 h2n_bridge_circle_ratio = h2n_bridge_circle_max / h2n_bridge_circle;
 
+// mini-xlr connector parameters
+h2n_xlr_thread_diam = 10.0;
+h2n_xlr_thread_pitch = 0.75;
+h2n_xlr_thread_height = 6.0;
+h2n_xlr_thread_depth = 0.614 * h2n_xlr_thread_pitch;
+h2n_xlr_conn_height = 30;
+h2n_xlr_conn_shoulder = 1.25;
+
 
 module tube(or, ir, h) {
     difference() {
@@ -493,7 +501,7 @@ module h2n_bridge_old(width, base_height, stalk_height, radius, col_wall, wall)
 
 // base plate for upper band cover
 
-module h2n_center_cover(width, base_height, stalk_height, radius, col_wall, wall, offset) {
+module h2n_center_cover(width, base_height, radius, wall, offset) {
     bot_step = h2n_bridge_band_h;
     difference() {
         union() {
@@ -529,7 +537,7 @@ module h2n_center_dial_cover(radius, wall, offset) {
 
 // the core of the bridge, a solid offset-able version
 
-module h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, offset) {
+module h2n_bridge_core(width, base_height, radius, col_wall, wall, offset) {
     hull() {
         // top of bridge
         translate([width / 2, 0, base_height]) {
@@ -545,7 +553,7 @@ module h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall,
             }
         }
         // bottom plate
-        h2n_center_cover(width, base_height, stalk_height, radius, col_wall, wall, offset);
+        h2n_center_cover(width, base_height, radius, wall, offset);
     }
     // add cover for center dial
     hull() {
@@ -563,7 +571,7 @@ module h2n_bridge(width, base_height, stalk_height, radius, col_wall, stalk_wall
     }
     difference() {
         union() {
-            h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, 0);
+            h2n_bridge_core(width, base_height, radius, col_wall, wall, 0);
             // stalk
             translate([0, 0, base_height]) {
                 difference() {
@@ -596,7 +604,7 @@ module h2n_bridge(width, base_height, stalk_height, radius, col_wall, stalk_wall
                 }
             }
         }
-        h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, -wall);
+        h2n_bridge_core(width, base_height, radius, col_wall, wall, -wall);
         // make a hole in the bridge for the cables
         cylinder(r = radius, h = base_height + radius + 2 * wall, $fn = facets);
         // cut a window for the XY and MS leds
@@ -613,43 +621,39 @@ module h2n_bridge(width, base_height, stalk_height, radius, col_wall, stalk_wall
 }
 
 
-// a bridge that includes an 8 pin mini-xlr connector
-
-thread_diam = 10.0;
-thread_pitch = 0.75;
-thread_height = 6.0;
-thread_depth = 0.614 * thread_pitch;
-conn_height = 25;
-conn_shoulder = 1.25;
+// a bridge with detachable stalk and capsule array (attaches with an 8 pin mini-xlr connector)
 
 module h2n_mini_xlr_thread(diam, pitch, height) {
-    metric_thread (diameter=diam, pitch=pitch, length=height, internal=true);
+    metric_thread(diameter = diam, pitch = pitch, length = height, internal = true);
 }
 
+// bridge and threaded housing for female mini-xlr connector
+
 module h2n_bridge_connector(width, base_height, stalk_height, radius, col_wall, stalk_wall, wall) {
     difference() {
         union() {
-            h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, 0);
+            h2n_bridge_core(width, base_height, radius, col_wall, wall, 0);
             // connector
             translate([0, 0, base_height]) {
                 difference() {
-                    cylinder(r = thread_diam/2 + stalk_wall, h = conn_height, $fn = facets);
+                    cylinder(r = h2n_xlr_thread_diam/2 + stalk_wall, h = h2n_xlr_conn_height, $fn = facets);
                     // remove the thread
-                    translate([0, 0, conn_height - thread_height - conn_shoulder]) {
+                    translate([0, 0, h2n_xlr_conn_height - h2n_xlr_thread_height - h2n_xlr_conn_shoulder]) {
                         rotate([0, 0, 90]) {
-                            h2n_mini_xlr_thread(thread_diam, thread_pitch, thread_height);
+                            h2n_mini_xlr_thread(h2n_xlr_thread_diam, h2n_xlr_thread_pitch, h2n_xlr_thread_height);
                         }
                     }
                     // remove excess above the thread
-                    translate([0, 0, conn_height - conn_shoulder]) {
-                        cylinder(r = thread_diam/2 + thread_depth, h = conn_shoulder, $fn = facets);
+                    translate([0, 0, h2n_xlr_conn_height - h2n_xlr_conn_shoulder]) {
+                        cylinder(r = h2n_xlr_thread_diam/2 + h2n_xlr_thread_depth, h = h2n_xlr_conn_shoulder, $fn = facets);
                     }
                     // make hole below the thread
-                    cylinder(r = thread_diam/2, h = conn_height - thread_height - conn_shoulder, $fn = facets);
+                    cylinder(r = h2n_xlr_thread_diam/2, h = h2n_xlr_conn_height - h2n_xlr_thread_height - h2n_xlr_conn_shoulder,
+                             $fn = facets);
                     // remove stalk segment that is inside the bridge
                     translate([width / 2, 0, -1.0]) {
                         rotate([0, -90, 0]) {
-                            semi_cylinder(r = thread_diam/2 + stalk_wall, h = width);
+                            semi_cylinder(r = h2n_xlr_thread_diam/2 + stalk_wall, h = width);
                         }
                     }
                 }
@@ -663,9 +667,9 @@ module h2n_bridge_connector(width, base_height, stalk_height, radius, col_wall,
                 }
             }
         }
-        h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, -wall);
+        h2n_bridge_core(width, base_height, radius, col_wall, wall, -wall);
         // make a hole in the bridge for the cables
-        cylinder(r = thread_diam/2, h = base_height + radius + 2 * wall, $fn = facets);
+        cylinder(r = h2n_xlr_thread_diam/2, h = base_height + radius + 2 * wall, $fn = facets);
         // cut a window for the XY and MS leds
         translate([0, h2n_bridge_circle_max, 0]) {
             rotate([90, 0, 0]) cylinder(r = 2.0, h = h2n_bridge_circle_max * 2, $fn = facets);
@@ -679,33 +683,47 @@ module h2n_bridge_connector(width, base_height, stalk_height, radius, col_wall,
     }
 }
 
-module h2n_connector_to_array_mount(width, stalk_wall) {
-    stalk_height = 40;
-    // the threaded bottom
+// threaded housing for male mini-xlr connector
+
+module h2n_connector_to_stalk(width, stalk_wall) {
     difference() {
-        cylinder(r = thread_diam/2 + stalk_wall, h = conn_height, $fn = facets);
+        cylinder(r = h2n_xlr_thread_diam/2 + stalk_wall, h = h2n_xlr_conn_height, $fn = facets);
         // remove the thread
-        translate([0, 0, conn_shoulder]) {
+        translate([0, 0, h2n_xlr_conn_shoulder]) {
             rotate([0, 0, 90]) {
-                h2n_mini_xlr_thread(thread_diam, thread_pitch, thread_height);
+                h2n_mini_xlr_thread(h2n_xlr_thread_diam, h2n_xlr_thread_pitch, h2n_xlr_thread_height);
             }
         }
         // remove excess above the thread
-        translate([0, 0, conn_shoulder + thread_height]) {
-            cylinder(r = thread_diam/2, h = conn_height, $fn = facets);
+        translate([0, 0, h2n_xlr_conn_shoulder + h2n_xlr_thread_height]) {
+            cylinder(r = h2n_xlr_thread_diam/2, h = h2n_xlr_conn_height, $fn = facets);
         }
         // make hole below the thread
-        cylinder(r = thread_diam/2, h = conn_shoulder, $fn = facets);
+        cylinder(r = h2n_xlr_thread_diam/2, h = h2n_xlr_conn_shoulder, $fn = facets);
     }
+}
+
+// stalk and capsule array mount (clips on mini-xlr housing, rotates to orient capsule array)
+
+module h2n_stalk_to_array_mount(width, stalk_wall) {
+    stalk_height = 40;
     // conical stalk to the capsule array mount
-    translate([0, 0, conn_height]) {
+    difference() {
+        cylinder(r1 = h2n_xlr_thread_diam/2 + stalk_wall, r2 = mount_radius + stalk_wall, h = stalk_height, $fn = facets);
+        cylinder(r1 = h2n_xlr_thread_diam/2 - fit, r2 = mount_radius, h = stalk_height, $fn = facets);
+        // avoid overhang for printing
+        trans = 1.0;
         difference() {
-            cylinder(r1 = thread_diam/2 + stalk_wall, r2 = mount_radius + stalk_wall, h = stalk_height, $fn = facets);
-            cylinder(r1 = thread_diam/2, r2 = mount_radius, h = stalk_height, $fn = facets);
+            cylinder(r2 = h2n_xlr_thread_diam/2 + stalk_wall * 2, r1 = h2n_xlr_thread_diam/2 + stalk_wall * 4, h = trans, $fn = facets);
+            cylinder(r2 = h2n_xlr_thread_diam/2 + stalk_wall, r1 = h2n_xlr_thread_diam/2 - fit, h = trans, $fn = facets);
         }
     }
+    // press fit connector to stalk mini-xlr connector
+    translate([0, 0, -3]) {
+        tube(h2n_xlr_thread_diam/2 - fit, h2n_xlr_thread_diam/2 - wall, 6.0);
+    }
     // capsule array mount with the right orientation (left front top = #1)0
-    rotate([0, 0, -90]) translate([0, 0, conn_height + stalk_height]) {
+    rotate([0, 0, -90]) translate([0, 0, stalk_height]) {
         tetra_capsule_array_mount([-45, 135], mount_radius, stalk_wall);
     }
 }
@@ -875,13 +893,18 @@ union() {
                h2n_bridge_base_height, h2n_bridge_stalk_height, mount_radius, h2n_col_wall, h2n_stalk_wall, wall);
 }
 
-*translate([0, 0, h2n_column_height]) {
+translate([0, 0, h2n_column_height]) {
     h2n_bridge_connector((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
                h2n_bridge_base_height, h2n_bridge_stalk_height, mount_radius, h2n_col_wall, h2n_stalk_wall, wall);
 }
 
 translate([0, 0, h2n_column_height + 40]) {
-    h2n_connector_to_array_mount((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
+    h2n_connector_to_stalk((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
+            h2n_stalk_wall);
+}
+
+translate([0, 0, h2n_column_height + h2n_xlr_conn_height + 5 + 40]) {
+    h2n_stalk_to_array_mount((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
             h2n_stalk_wall);
 }
 
@@ -908,7 +931,7 @@ translate([0, 0, 100]) {
 
 }
 translate([-40, -50, 0]) {
-    cube([80, 50, 150]);
+    cube([80, 50, 170]);
 }
 }