Quellcode durchsuchen

adding screw holes for buck converter

clementinecomputing vor 5 Jahren
Ursprung
Commit
4337dbf69c

+ 0 - 1
experiment/production/adapter-box/PopufareHousingCommon.scad

@@ -1 +0,0 @@
-../scad/PopufareHousingCommon.scad

+ 249 - 0
experiment/production/adapter-box/PopufareHousingCommon.scad

@@ -0,0 +1,249 @@
+// License: CC0
+//
+// To the extent possible under law, Clementine Computing LLC has waived
+// all copyright and related or neighboring rights to this file.
+//
+// This work is published from: United States.
+//
+
+$fs = 1.0/64.0;
+
+// ...
+//
+
+// 1/8 inch sheet thickness
+//
+//_MATERIAL_THICKNESS = 3.175
+
+// 1/4 inch sheet thickness
+//
+_MATERIAL_THICKNESS = 6.35;
+
+_M2 = 2.0;
+_M2r = 2.0/2;
+
+_M2_5 = 2.5;
+_M2_5r = 2.5/2;
+
+_M3 = 3.0;
+_M3r = 3.0/2;
+
+_M4 = 4.0;
+_M4r = 4.0/2;
+
+_M5 = 5.0;
+_M5r = 5.0/2;
+
+// in mm
+//
+POPUFARE_HOUSING_WIDTH = 263;
+POPUFARE_HOUSING_FULL_DEPTH = 215;
+POPUFARE_HOUSING_HEIGHT = 135;
+
+_LIP_SCREW_D = 6.35;
+POPUFARE_HOUSING_BACK_LIP_HEIGHT = 49;
+POPUFARE_HOUSING_FRONT_LIP_HEIGHT = 7.25;
+
+POPUFARE_HOUSING_BACK_LIP_DEPTH = 23;
+//POPUFARE_HOUSING_BACK_LIP_DEPTH = 33;
+
+//POPUFARE_HOUSING_BACK_LIP_SCREW_DX = 147.25 + _LIP_SCREW_D;
+POPUFARE_HOUSING_BACK_LIP_SCREW_DX = 145 + _LIP_SCREW_D;
+POPUFARE_HOUSING_BACK_LIP_SCREW_OFFSET_SIDE_X = 30 + _LIP_SCREW_D/2;
+POPUFARE_HOUSING_BACK_LIP_SCREW_OFFSET_BACK_Y = 13.75 + _LIP_SCREW_D/2;
+POPUFARE_HOUSING_BACK_LIP_SPACE = POPUFARE_HOUSING_BACK_LIP_DEPTH + 10;
+
+POPUFARE_HOUSING_BACK_LIP_INSET = 30;
+
+POPUFARE_HOUSING_DEPTH = POPUFARE_HOUSING_FULL_DEPTH - POPUFARE_HOUSING_BACK_LIP_SPACE;
+
+POPUFARE_SCREEN_WIDTH_CAPACITIVE = 122;
+POPUFARE_SCREEN_HEIGHT_CAPACITIVE = 78;
+
+POPUFARE_SCREEN_WIDTH_RESISTIVE = 119;
+POPUFARE_SCREEN_HEIGHT_RESISTIVE = 71;
+
+POPUFARE_SCREEN_INNER_WIDTH_RESISTIVE = 117.5;
+POPUFARE_SCREEN_INNER_HEIGHT_RESISTIVE = 70;
+
+POPUFARE_GLAND_DIAMETER = 37;
+POPUFARE_SCREEN_OUTER_WIDTH = 122;
+
+//POPUFARE_SCREEN_WIDTH = 118 + 1;
+//POPUFARE_SCREEN_HEIGHT = 70 + 1;
+
+POPUFARE_SCREEN_OUTER_HEIGHT = 78;
+
+POPUFARE_FRONT_HEIGHT = 60;
+
+POPUFARE_FIXTURE_DX = 65;
+POPUFARE_FIXTURE_DY = 65;
+POPUFARE_FIXTURE_SCREW_D = 7.5;
+
+POPUFARE_HINGE1_TOP_R = 2;
+POPUFARE_HINGE1_TOP_DE = 7.25 + POPUFARE_HINGE1_TOP_R;
+POPUFARE_HINGE1_TOP_DH = (25 - 2*POPUFARE_HINGE1_TOP_R);
+POPUFARE_HINGE1_TOP_DW = (28 + 2*POPUFARE_HINGE1_TOP_R);
+
+POPUFARE_HINGE1_BACK_R = 2;
+POPUFARE_HINGE1_BACK_DE = 8.5 + POPUFARE_HINGE1_BACK_R;
+POPUFARE_HINGE1_BACK_DH = (22 - 2*POPUFARE_HINGE1_BACK_R);
+POPUFARE_HINGE1_BACK_DW = (28 + 2*POPUFARE_HINGE1_BACK_R);
+
+// bracket
+//
+
+// center of bracket to end
+//
+POPUFARE_BRACKET_CX = 20;
+
+// screw size to fit through bracket (bracket itself is 6mm in diameter)
+//
+POPUFARE_BRACKET_D = 5;
+POPUFARE_BRACKET_WIDTH = 16;
+
+POPUFARE_BRACKET_DS = 100;
+POPUFARE_BRACKET_DE = 40;
+POPUFARE_BRACKET_DE_MEDIUM = 30;
+POPUFARE_BRACKET_DE_SHORT = 20;
+
+// buck
+//
+
+POPUFARE_BUCK_HOLE_WIDTH0 = 53.6 + (59.8-53.6)/2;
+POPUFARE_BUCK_HOLE_WIDTH1 = 39 + (45-39)/2;
+
+POPUFARE_BUCK_HOLE_LEN1 = 6.2;
+POPUFARE_BUCK_HOLE_R = 3.0/2;
+
+POPUFARE_BUCK_WIDTH = 49.8;
+POPUFARE_BUCK_HEIGHT = 52.9;
+POPUFARE_BUCK_HOLE_DH = 25 + (6.25)/2 - 3.0/2;
+
+// 117 - 111 = 6
+// 111 + 3 = 114
+//
+// 87 - 81 = 6
+// 81 + 3 = 84
+
+// inner plates
+//
+POPUFARE_INNER_PLATE_WIDTH = 90;
+POPUFARE_INNER_PLATE_HEIGHT = 70;
+
+//POPUFARE_INNER_PLATE_HOLE_WIDTH = POPUFARE_SCREEN_OUTER_WIDTH + 0;
+//POPUFARE_INNER_PLATE_HOLE_HEIGHT = POPUFARE_SCREEN_OUTER_HEIGHT + 20;
+
+POPUFARE_INNER_PLATE_HOLE_WIDTH = 114;
+POPUFARE_INNER_PLATE_HOLE_HEIGHT = 84;
+
+//POPUFARE_SPEAKER_HOLE_R = 2.5/2;
+//POPUFARE_SPEAKER_HOLE_WIDTH = 34.5 + ((39.5 - 34.5) / 2);
+
+
+// diagonal inner: 59.5
+// diagonal outer: 65.5
+// diagonal screw: 62.5
+// length/width = sqrt(2)*62.5/2
+//
+// diagonal inner: 55.0
+// diagonal outer: 65.0
+// diagonal screw: 60.0
+// length/width = sqrt(2)*60/2
+//
+POPUFARE_SPEAKER_HOLE_R = 4.5/2;
+POPUFARE_SPEAKER_HOLE_WIDTH = sqrt(2)*60.0/2;
+POPUFARE_SPEAKER_HOLE_HEIGHT = sqrt(2)*60.0/2;
+
+// hinge
+//
+POPUFARE_HINGE_TOP_HOLE_WIDTH = 32;
+POPUFARE_HINGE_TOP_HOLE_DE = 36;
+
+POPUFARE_HINGE_BACK_HOLE_WIDTH = 45;
+POPUFARE_HINGE_BACK_HOLE_DE = 28;
+
+POPUFARE_HINGE_D = _M4;
+
+// Raspberry Pi measurements
+//
+_RASPBERRY_PI_B_HOLE_DX = 58;
+_RASPBERRY_PI_B_HOLE_DY = 48;
+
+_SCREEN_HOLE_DX = 93;
+_SCREEN_HOLE_DY = 69;
+
+
+// Center for raspberry pi from screen
+// that sits on top of it.
+//
+_SCREEN_OUTER_CENTER = [ POPUFARE_SCREEN_OUTER_WIDTH/2, POPUFARE_SCREEN_OUTER_HEIGHT/2 ];
+
+// offset of left screen m2 screws
+// as seen from the back, front ribbon down
+//
+_SCREEN_LL_M2_C = [ 5,5 ];
+_SCREEN_UL_M2_C = [ 5, POPUFARE_SCREEN_OUTER_HEIGHT - 4 ];
+
+_SCREEN_CX = _SCREEN_HOLE_DX/2 + _SCREEN_LL_M2_C[0] - _SCREEN_OUTER_CENTER[0];
+_SCREEN_CY = _SCREEN_HOLE_DY/2 + _SCREEN_LL_M2_C[1] - _SCREEN_OUTER_CENTER[1];
+
+_RASPBERRY_PI_B_CX = (_SCREEN_HOLE_DX - _RASPBERRY_PI_B_HOLE_DX/2) + _SCREEN_LL_M2_C[0] - _SCREEN_OUTER_CENTER[0];
+_RASPBERRY_PI_B_CY = (_SCREEN_HOLE_DY - _RASPBERRY_PI_B_HOLE_DY/2) + _SCREEN_LL_M2_C[1] - _SCREEN_OUTER_CENTER[1];
+
+
+// Bounding box width of rouned rect is w and h,
+// so this function compensates for the rounded corner
+// radius.
+//
+// w - width or rectangle
+// h - height of rectangle
+// r - corner radius
+//
+// rounded rectangle has center of mass (center) at (0,0)
+//
+module rounded_rect(w,h,r) {
+  _w = w-2*r;
+  _h = h-2*r;
+
+  x2 = _w/2;
+  y2 = _h/2;
+
+  hull() {
+    translate([-x2, y2]) circle(r);
+    translate([ x2, y2]) circle(r);
+    translate([ x2,-y2]) circle(r);
+    translate([-x2,-y2]) circle(r);
+  }
+}
+
+
+// adapter dimensions
+//
+
+_POWER_CONNECTOR_WIDTH = 36.5;
+_POWER_CONNECTOR_HEIGHT = 10.5;
+_POWER_CONNECTOR_DEPTH = 14.5;
+
+_POWER_USB_HOLE_DW = 9.11 + (15.11-9.11)/2;
+_POWER_USB_HOLE_R = 3/2;
+
+_PIU_BUCK_DW = (61.5+58.75)/2;
+_PIU_BUCK_R = 6.75/2;
+
+_PIU_USB_HOLE_DW = 9.25 + (12.5-9.25)/2;
+_PIU_USB_HOLE_DE = 8.5;
+_PIU_USB_HOLE_R = 2/2;
+_PIU_USB_WIDTH = 12;
+
+_POWER_BOX_R = 3/2;
+_POWER_BOX_WIDTH = _POWER_CONNECTOR_WIDTH + 12*_POWER_BOX_R;
+_POWER_BOX_HEIGHT = 3*_POWER_CONNECTOR_WIDTH + 12*_POWER_BOX_R;
+
+_POWER_BOX_PIU_USB_H = -_POWER_BOX_HEIGHT/4;
+
+
+_POWER_BOX_STRAP_DW = 18;
+_POWER_BOX_STRAP_DH = 22;
+_POWER_BOX_STRAP_R = 3/2;
+

+ 31 - 5
experiment/production/adapter-box/PopufarePowerAdapterBottom.scad

@@ -12,19 +12,29 @@ module PopufarePowerAdapterBottomPlate() {
   _w = _POWER_BOX_WIDTH;
   _h = _POWER_BOX_HEIGHT;
   _r = _POWER_BOX_R;
-  
+
   piu_usb_h = _POWER_BOX_PIU_USB_H;
-  
+
+  buck_dw = _PIU_BUCK_DW;
+  buck_r = _PIU_BUCK_R;
+  buck_cx = 0;
+  buck_cy = -_h/12;
+
   difference() {
     rounded_rect(_w, _h, _r);
-    
+
+    // PIU buck converter screw holes
+    //
+    translate([buck_cx-buck_dw/2, buck_cy]) circle(2*buck_r);
+    translate([buck_cx+buck_dw/2, buck_cy]) circle(2*buck_r);
+
     // housing holes
     //
     translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
     translate([-(_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
     translate([-(_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
     translate([ (_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
-    
+
     // max232 converter. It has no holes so we'll be using cable ties
     //
     translate([5,5])
@@ -34,12 +44,28 @@ module PopufarePowerAdapterBottomPlate() {
       translate([ _POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
       translate([-_POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
     }
-    
+
     // PIU rs232 ttl USB out
     //
     translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h + _PIU_USB_HOLE_DW/2])
       circle(_PIU_USB_HOLE_R);
     translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h - _PIU_USB_HOLE_DW/2])
       circle(_PIU_USB_HOLE_R);
+
+    // various holes for connections
+    //
+    translate([-_w/2+_PIU_USB_HOLE_DE*2, piu_usb_h + _PIU_USB_HOLE_DW/2+2*_r])
+      circle(_r);
+    translate([-_w/2+_PIU_USB_HOLE_DE*2, piu_usb_h - _PIU_USB_HOLE_DW/2-2*_r])
+      circle(_r);
+
+    translate([0,-_h/4+10]) circle(_r);
+    translate([10,-_h/4 + 10]) circle(_r);
+    translate([0,-_h/4]) circle(_r);
+    translate([0,-_h/4 - 10]) circle(_r);
+    translate([10,-_h/4]) circle(_r);
+    translate([10,-_h/4 - 10]) circle(_r);
+
+
   }
 }

+ 14 - 4
experiment/production/adapter-box/PopufarePowerAdapterMiddle.scad

@@ -12,19 +12,29 @@ module PopufarePowerAdapterMiddlePlate() {
   _w = _POWER_BOX_WIDTH;
   _h = _POWER_BOX_HEIGHT;
   _r = _POWER_BOX_R;
-  
+
   piu_usb_h = _POWER_BOX_PIU_USB_H;
-  
+
+  buck_dw = _PIU_BUCK_DW;
+  buck_r = _PIU_BUCK_R;
+  buck_cx = 0;
+  buck_cy = -_h/12;
+
   difference() {
     rounded_rect(_w, _h, _r);
-    
+
+    // PIU buck converter screw holes
+    //
+    translate([buck_cx-buck_dw/2, buck_cy]) circle(2*buck_r);
+    translate([buck_cx+buck_dw/2, buck_cy]) circle(2*buck_r);
+
     // housing holes
     //
     translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
     translate([-(_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
     translate([-(_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
     translate([ (_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
-    
+
     rounded_rect(_w - 12*_r, _h - 12*_r, _r);
 
     // PIU rs232 ttl USB out

+ 12 - 0
experiment/production/adapter-box/PopufarePowerAdapterMiddleSupport.scad

@@ -15,12 +15,24 @@ module PopufarePowerAdapterMiddleSupportPlate() {
   
   piu_usb_h = _POWER_BOX_PIU_USB_H;
   
+  buck_dw = _PIU_BUCK_DW;
+  buck_r = _PIU_BUCK_R;
+  buck_cx = 0;
+  buck_cy = -_h/12;
+
   difference() {
     rounded_rect(_w, _h, _r);
 
+    // Support for the power connector
+    //
     translate([0,-_POWER_CONNECTOR_HEIGHT/2])
       rounded_rect(_w - 12*_r, _h - 12*_r - _POWER_CONNECTOR_HEIGHT, _r);
   
+    // PIU buck converter screw holes
+    //
+    translate([buck_cx-buck_dw/2, buck_cy]) circle(2*buck_r);
+    translate([buck_cx+buck_dw/2, buck_cy]) circle(2*buck_r);
+
     // housing holes
     //
     translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);

+ 25 - 9
experiment/production/adapter-box/PopufarePowerAdapterTop.scad

@@ -12,23 +12,39 @@ module PopufarePowerAdapterTopPlate() {
   _w = _POWER_BOX_WIDTH;
   _h = _POWER_BOX_HEIGHT;
   _r = _POWER_BOX_R;
-  
+
   conw = _POWER_CONNECTOR_WIDTH;
   conh = _POWER_CONNECTOR_HEIGHT;
-  
+
   piu_usb_h = _POWER_BOX_PIU_USB_H;
-  
+
+  buck_dw = _PIU_BUCK_DW;
+  buck_r = _PIU_BUCK_R;
+  buck_cx = 0;
+  buck_cy = -_h/12;
+
   difference() {
-    rounded_rect(_w, _h, _r);
+    union() {
+      rounded_rect(_w, _h, _r);
+      translate([buck_cx,buck_cy]) rounded_rect(buck_dw + 5*buck_r, 5*buck_r, 2*buck_r);
+    }
+
+    // power connector access
+    //
     translate([0, _h/2 - conh/2 -  6*_r]) square([conw, conh], center=true);
-    
+
+    // buck converter screw holes
+    //
+    translate([buck_cx-buck_dw/2, buck_cy]) circle(buck_r);
+    translate([buck_cx+buck_dw/2, buck_cy]) circle(buck_r);
+
     // housing holes
     //
     translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
     translate([-(_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
     translate([-(_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
     translate([ (_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
-    
+
     // max232 converter. It has no holes so we'll be using cable ties
     //
     translate([5,5])
@@ -38,14 +54,14 @@ module PopufarePowerAdapterTopPlate() {
       translate([ _POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
       translate([-_POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
     }
-    
+
     // PIU rs232 ttl USB out
     //
     translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h + _PIU_USB_HOLE_DW/2])
       circle(_PIU_USB_HOLE_R);
     translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h - _PIU_USB_HOLE_DW/2])
       circle(_PIU_USB_HOLE_R);
-    
+
     // various holes for connections
     //
     translate([-_w/2+_PIU_USB_HOLE_DE*2, piu_usb_h + _PIU_USB_HOLE_DW/2+2*_r])
@@ -62,4 +78,4 @@ module PopufarePowerAdapterTopPlate() {
   }
 }
 
-PopufarePowerAdapterTopPlate();
+//PopufarePowerAdapterTopPlate();

+ 9 - 1
experiment/production/adapter-box/export/export-all

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-VERSION=0.1.0
+VERSION=0.1.1
 
 function ngc_position {
   ifn="$1"
@@ -37,6 +37,7 @@ tmpfn=`mktemp`
 for fn in `ls ../Popufare*.scad  | grep -v PopufareHousingCommon.scad ` ; do
   bfn=`basename $fn .scad`
   svg="$bfn.$VERSION.svg"
+  svg_z="$bfn.z.$VERSION.svg"
   ngc="$bfn.$VERSION.ngc"
 
   echo "## $bfn"
@@ -53,6 +54,13 @@ for fn in `ls ../Popufare*.scad  | grep -v PopufareHousingCommon.scad ` ; do
   sed -i 's/F800/F150/g' "$ngc"
   sed -i 's/G0\(.*\)S\(.*\)/G0\1 F5000 S\2/g' "$ngc"
 
+  cp "$svg" "$svg_z"
+
+  sed -i 's/<svg\(.*\) width="\([0-9]*\)"/<svg\1 width="\2mm"/' "$svg_z"
+  sed -i 's/<svg\(.*\) height="\([0-9]*\)"/<svg\1 height="\2mm"/' "$svg_z"
+  sed -i 's/ stroke-width="[^"]*"/ stroke-width=".0254"/' "$svg_z"
+
+
 done
 
 rm $tmpfn