Selaa lähdekoodia

tinysphear: first redesign with smaller pcb (version 2)

Fernando Pablo Lopez-Lezcano 8 vuotta sitten
vanhempi
sitoutus
2d09df5241
1 muutettua tiedostoa jossa 71 lisäystä ja 45 poistoa
  1. 71 45
      TinySpHEAR_mount_pcb.scad

+ 71 - 45
TinySpHEAR_mount_pcb.scad

@@ -4,7 +4,7 @@
 // TinySpHEAR, First Order (B-format) Ambisonics Microphone
 // Mount for four Zapnspark phantom power printed circuit boards
 // 
-// Copyright 2015-2017, Fernando Lopez-Lezcano, All Rights Reserved
+// Copyright 2015-2018, Fernando Lopez-Lezcano, All Rights Reserved
 // nando@ccrma.stanford.edu
 //
 //  This program is free software: you can redistribute it and/or modify
@@ -36,16 +36,22 @@ include <threads.scad>;
 //// default model parameters
 ////
 
+// which version of the pcb we are building for
+// 1: single layer, milled in house
+// 2: double layer with ground plane, smaller, fabricated
+pcb_version = 2;
+
 // size of Zapnspark printed circuit board
 // kicad length = 79.375
 // measured length = 79.20 (2016.08.25)
-pcb_length = 79.20;
+pcb_length = pcb_version == 2 ? 72.39 : 79.20;
 // kicad width = 19.050
 // measured width = 18.82 (2016.08.25)
-pcb_width = 18.85;
+// v2 (kicad) 15.24 (measured) 15.34
+pcb_width = pcb_version == 2 ? 15.34 : 18.85;
 // ultimaker spec thickness = 1.61
 // measured thickness = 1.56 (w/ copper)
-pcb_thickness = 1.58;
+pcb_thickness = pcb_version == 2 ? 1.68 + 0.02 : 1.58;
 
 // tolerance to add to length and width of pcb
 //
@@ -72,12 +78,12 @@ pcb_hi_exp = 8.0;
 
 // clearance from the bottom and top of pcb's to the start of the flare,
 // this adds space for the protuding molex pins on which we solder
-pcb_low_clear = 15.0;
-pcb_hi_clear = 15.0;
+pcb_low_clear = pcb_version == 2 ? 12.0 : 15.0;
+pcb_hi_clear = pcb_version == 2 ? 12.0 : 15.0;
 
-// back and front clearance of pcb (components and leads)
-pcb_front = 13.25;
-pcb_back = 3.0;
+// back (leads) and front (components) clearance of pcb
+pcb_front = pcb_version == 2 ? 10.00 : 13.25;
+pcb_back = pcb_version == 2 ? 2.0 : 3.0;
 
 // depth of slot into which the printed circuit board fits
 pcb_slot_depth = 1.0;
@@ -95,8 +101,8 @@ mount_lip = 10.0;
 lip_fit = 0.05;
 
 // capsule array mount, height of flare and stalk
-flare_height = 50;
-stalk_height = 40;
+flare_height = pcb_version == 2 ? 45 : 50;
+stalk_height = pcb_version == 2 ? 35 : 40;
 
 // adjust mic array to mount relative height
 mic_to_mount_fit = 0.0;
@@ -105,10 +111,10 @@ mic_to_mount_fit = 0.0;
 wall = 1.0;
 
 // calculated minimum "radius" of microphone box
-box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
+box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + (pcb_version == 2 ? 1 : 2) * wall;
 
 // calculated main body corner radius
-mount_corner = box_radius - pcb_width / 2 + pcb_slot_depth + 4.0;
+mount_corner = box_radius - pcb_width / 2 + pcb_slot_depth + (pcb_version == 2 ? 1 : 4);
 
 // calculated radius at the corners
 box_corner_radius = (box_radius + wall - mount_corner) / sin(45) + mount_corner;
@@ -128,6 +134,8 @@ snap_joint_hook_r = 1.4;
 //// screw holes to join the body to the two flares
 //
 render_screw_holes = true;
+// rotation of holes to avoid pcb slots
+screw_rotation = -3.0;
 
 // dimensions of 12 pin male bottom connector
 //
@@ -186,7 +194,7 @@ ring_arm_gap = 20;
 windscreen_height = 60;
 windscreen_w = 4.0;
 beam_radius = 1.3;
-windscreen_thread_height = 10.0;
+windscreen_thread_height = pcb_version == 2 ? 8.0 : 10.0;
 windscreen_thread_pitch = 2.0;
 windscreen_thread_angle = 30;
 windscreen_thread_depth = cos(windscreen_thread_angle) * windscreen_thread_pitch * 5/8 + 0.5;
@@ -196,9 +204,9 @@ windscreen_thread_fit = 3 * fit;
 
 // all four printed circuit boards
 
-module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
+module tetra_pcb_clear(length, width, thick, slot_depth, front, back, side, twist) {
     for (rot = [0, 90, 180, 270]) {
-        rotate([0, 0, rot]) {
+        rotate([0, 0, rot + twist]) translate([-side, 0, 0]) {
             pcb_clear(pcb_length + pcb_fit, pcb_width + pcb_fit, pcb_thickness + pcb_tfit, slot_depth, front, back);
         }
     }
@@ -207,11 +215,17 @@ module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
 // the main body of the microphone mount
 
 module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
+    // lateral offset of pcb's
+    side = 1.4;
+    // twist of pcbs inside body
+    twist = 0;
+    // twist of each pcb
+    pcb_twist = 0;
     difference() {
         rounded_block(height, radius, radius, corner);
         union() {
             // hollow out the inside with slots for pcbs
-            tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, pcb_slot_depth, pcb_front, pcb_back);
+            tetra_pcb_clear(pcb_length, pcb_width, pcb_thickness, pcb_slot_depth, pcb_front, pcb_back, side, twist);
             // trim square angles
             cylinder(r = pcb_front, h = height, $fn = facets);
             // remove slots from inside body
@@ -248,7 +262,7 @@ module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
             // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
                 for (z = [lower_lip/2, height - upper_lip/2])
                 for (r = [45, 135, 225, 315]) {
-                    rotate([0, 0, r])
+                    rotate([0, 0, r + screw_rotation])
                     translate([-(radius + 2 * wall), 0, z]) {
                         rotate([0, 90, 0]) {
                             cylinder(r = 0.7, h = radius + wall, $fn = facets);
@@ -288,30 +302,39 @@ module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
     }
     // add parts for clearance check
     if (clear == 1) {
-        // electrolytic capacitors
-        cap_diam = 10.2;
-        for (rot = [0, 180, 270]) {
-            rotate([0, 0, rot]) {
-                translate([-pcb_front + cap_diam/2, 0, 0]) {
-                    *cylinder(r = (cap_diam/2), h = 20, $fn = facets);
-                }
-            }
-        }
-        // PCBs
         for (rot = [0, 180, 270]) {
-            rotate([0, 0, rot]) {
-                translate([-(pcb_front + pcb_thickness), -pcb_width/2, -pcb_low_exp]) {
-                    cube([pcb_thickness, pcb_width, pcb_length]);
+        //for (rot = [0]) {
+            rotate([0, 0, rot + twist]) {
+                translate([-(pcb_front + pcb_thickness), -pcb_width/2 + side, -pcb_low_exp]) {
+                    // twist the assembly in place
+                    rotate([0, 0, pcb_twist]) {
+                        // PCBs
+                        cube([pcb_thickness, pcb_width, pcb_length]);
+                        // small electrolytic capacitors (pcb_version == 2)
+                        // https://www.mouser.com/datasheet/2/293/e-umw-1219455.pdf
+                        cap_diam = 8.0;
+                        // should be 5, but transistors are a bit taller;
+                        cap_len = 6.5;
+                        translate([pcb_thickness + 0.15, pcb_width/2, 6]) {
+                            rotate([0, 90, 0]) cylinder(r = (cap_diam/2), h = cap_len, $fn = facets);
+                        }
+                        // film capacitors
+                        cap_h = 12;
+                        cap_w = 9;
+                        cap_t = 5.5;
+                        translate([pcb_thickness + 0.15, pcb_width/2 - cap_w/2, 10]) {
+                            cube([cap_t, cap_w, cap_h]);
+                        }
+                    }
                 }
             }
         }
-        // connectors
-        cap_h = 12.3;
-        cap_w = 10.53/2;
-        for (rot = [0, 180, 270]) {
-            rotate([0, 0, rot]) {
-                translate([-pcb_front, -cap_w/2 - 2.5, 0]) {
-                    *cube([cap_h, cap_w, 20]);
+        // big electrolytic capacitors (pcb_version == 1)
+        cap_diam = 10.2;
+        *for (rot = [0, 180, 270]) {
+            rotate([0, 0, rot + twist]) {
+                translate([-pcb_front + cap_diam/2, side, 0]) {
+                    cylinder(r = (cap_diam/2), h = 20, $fn = facets);
                 }
             }
         }
@@ -328,9 +351,9 @@ module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_ra
             if (windscreen) {
                 translate([0, 0, lip]) {
                     metric_thread(diameter = windscreen_thread_radius * 2, pitch = windscreen_thread_pitch,
-                        length = lip, angle = windscreen_thread_angle, internal = false);
+                        length = windscreen_thread_height, angle = windscreen_thread_angle, internal = false);
                 }
-                cylinder(r2 = box_corner_radius + 1.5, r1 = box_radius + 0.5, h = windscreen_thread_height, $fn = facets);
+                cylinder(r2 = box_corner_radius + 1.5, r1 = box_radius + 0.5, h = lip , $fn = facets);
                 // index for back of microphone
                 translate([-bot_radius, 0, 0]) {
                     cylinder(r = 1.0, h = height, $fn = facets);
@@ -343,7 +366,7 @@ module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_ra
             if (render_screw_holes) {
                 // small supports for the screws that attach the flare to the body
                 // (number 0 size, 1/4" long = thread diameter: 1.6mm, head diameter: 2.75)
-                for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
+                for (r = [45, 135, 225, 315]) rotate([0, 0, r + screw_rotation]) {
                     translate([bot_radius + wall/3, 0, lip/2]) {
                         rotate([0, 90, 0]) {
                             cylinder(r = 1.5, h = 2 * wall, $fn = facets);
@@ -366,7 +389,7 @@ module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_ra
         if (render_screw_holes) {
             // holes for screws that attach the flare to the body
             // Number 0 Size, 1/4" Long = thread diameter: 1.6mm, head diameter: 2.75
-            for (r = [45, 135, 225, 315]) rotate([0, 0, r]) {
+            for (r = [45, 135, 225, 315]) rotate([0, 0, r + screw_rotation]) {
                 translate([bot_radius + wall, 0, lip/2]) {
                     rotate([0, 90, 0]) {
                         cylinder(r = (1.6 + 0.1)/2, h = bot_radius, $fn = facets);
@@ -683,7 +706,7 @@ module render_tetra_pcb_mount(z_offset, showint) {
         rotate([0, 0, -90]) {
             translate([0, -(box_radius - 0.5), tetra_pcb_mount_height / 2]) {
                 rotate([90, 270, 0]) {
-                    logo_scale = 1 / 2.4;
+                    logo_scale = 1 / (pcb_version == 2 ? 3 : 2.4);
                     scale([logo_scale, logo_scale, 1.0]) {
                         ccrma_logo(1.65);
                     }
@@ -710,8 +733,11 @@ module render_tetra_cable_flare(z_offset, flip) {
 
 module render_tetra_connector_flare(z_offset, flip) {
     translate([0, 0, z_offset]) {
-        tetra_mount_flare(pcb_low_clear + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, conn_core_o_diam / 2, false);
-        rotate([0, 0, -90]) translate([0, 0, pcb_low_clear + pcb_low_exp + 20]) {
+        // make the upper sleeve shorter
+        flare_adjust = 6.0;
+        flare_height = 20;
+        tetra_mount_flare(pcb_low_clear + pcb_low_exp - flare_adjust, mount_lip, flare_height, box_radius + wall, mount_corner, conn_core_o_diam / 2, false);
+        rotate([0, 0, -90]) translate([0, 0, pcb_low_clear + pcb_low_exp + 20 - flare_adjust]) {
             tetra_mount_connector_holder(conn_core_sleeve, conn_core_o_diam / 2, conn_core_diam / 2, conn_core_overlap, conn_core_s_diam / 2);
         }
     }