From bea673f63b43164bb3be81644a592dddb0fdf591 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 21 Nov 2021 13:30:04 +0000 Subject: [PATCH] adafruit-powerboost: wip common Signed-off-by: Ian Jackson --- adafruit-powerboost-500.scad | 139 +------------------------------ adafruit-powerboost-common.scad | 141 ++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+), 138 deletions(-) diff --git a/adafruit-powerboost-500.scad b/adafruit-powerboost-500.scad index defda26..d946bda 100644 --- a/adafruit-powerboost-500.scad +++ b/adafruit-powerboost-500.scad @@ -4,70 +4,20 @@ psu_sz = [ 21.7, 36.0 ] + [ 0.25, 0.25 ]; include -psu_th = 1.70 + 0.25; -psu_th_for_clamp = 1.50; - psu_hole_pos = [ 2.05, // from back edge of psu_sz[0] 0.55 * 0.5 * 25.4, // from centreline ]; -psu_hole_dia = 2.5 - 0.3; + psu_baffle_gap = 1.0 + 0.5; psu_baffle_cnr_y = 7.45; // from connector end psu_baffle_th = [ 0.8, 3.5 ]; -psu_connector_z = 2.9 + 0.1; -psu_connector_z_overlap = 0.15; -psu_connector_depth = 6.25; -psu_connector_w = 8.0 + 0.5; -psu_usb_protr = 0.6; psu_usbend_led_x = 4.5; psu_innerend_led_depth = 10; -psu_clamp_th = 4.0 + 0.75; -psu_clamp_w = 8.0; -psu_clamp_gap = 0.4; - -psu_board_clamp_ovlp = 4.5; -psu_board_support_wall = 2; -psu_board_nutbox = nutbox_data_M3; - -psu_y = +psu_sz[1]/2 + psu_usb_protr; - // ----- calculated ----- psu_usbend_led_depth = psu_baffle_cnr_y*2 - psu_usbend_led_x; -psu_z = NutBox_h_base(psu_board_nutbox); -psu_z_down = psu_z + 0.1; - - -module PsuBoardRepresentation(){ - linear_extrude(height= psu_th) - square(center=true, [psu_sz[0],psu_sz[1]]); -} - -module PsuRepresentation(){ - PsuBoardRepresentation(); - translate([0, -psu_sz[1]/2, -psu_connector_z]) - linear_extrude(height= psu_connector_z + psu_connector_z_overlap) - rectfromto([ -psu_connector_w/2, -10 ], - [ +psu_connector_w/2, psu_connector_depth ]); -} - -module AtPsuMountCorner(mx,my){ - mirror([mx,0,0]) - mirror([0,my,0]) - translate(-0.5 * [psu_sz[0], psu_sz[1], 0] - -1 * [0,0, psu_z_down]) - children(); -} - -module PsuMountCornerExtrude(mx,my, plus_z=board_support_z){ - AtPsuMountCorner(mx,my){ - linear_extrude(height= psu_z_down + plus_z, convexity=10) { - children(); - } - } -} module PsuLedBafflePlan(){ baffle_tr = [0, psu_baffle_cnr_y] @@ -112,90 +62,3 @@ module PsuLedWindowsPlan(){ } } -module PsuMountPositiveMain(){ - for (mx=[0,1]) { - for (my=[0,1]) { - PsuMountCornerExtrude(mx,my){ - rectfromto(-[1,1]*psu_board_support_wall, - +[1,1]*board_support_ovlp); - } - } - // mount above at plug end - PsuMountCornerExtrude(mx,0, psu_th + psu_board_support_wall){ - rectfromto(-[1,1]*psu_board_support_wall, - [board_support_ovlp, - board_support_ovlp_ceil]); - } - } - translate([0,0, -psu_z_down]) - linear_extrude(psu_z_down - psu_baffle_gap, convexity=10) - PsuLedBafflePlan(); -} - -module PsuMountNegative(){ - axis = [0, -psu_sz[1]/2, psu_th]; - PsuRepresentation(); - translate(axis) - rotate([atan(2 * board_support_z / psu_sz[1]), - 0,0]) - translate(-axis) - PsuBoardRepresentation(); -} - -module PsuMountPositive(){ - difference(){ - intersection(){ - PsuMountPositiveMain(); - linextr_y_xz(-psu_y, psu_sz[1]*2) square(100, center=true); - } - PsuMountNegative(); - intersection(){ - hull(){ - PsuBoardRepresentation(); - translate([0,0,5]) PsuBoardRepresentation(); - } - translate([-20,0,-20]) cube(40); - } - } - for (mx=[0,1]) { - PsuMountCornerExtrude(mx,1){ - translate([psu_sz[0]/2 - psu_hole_pos[1], - psu_hole_pos[0]] - + board_gap * [1,1] ) - circle(r= psu_hole_dia/2); - } - } - translate([0, psu_sz[1]/2 + psu_board_nutbox[0]/2, 0]) - rotate([0,0,180]) - NutBox(psu_board_nutbox, psu_z_down); -} - -module PsuClamp(){ ////toplevel - rotate([180,0,0]) difference(){ - linear_extrude(height=psu_clamp_th + psu_th_for_clamp, convexity=5) { - difference(){ - hull(){ - circle(r = fix_sz/2); - translate([ -psu_board_nutbox[0]/2, 0]) - square(center=true, [ psu_board_clamp_ovlp*2, psu_clamp_w ]); - } - circle(r = psu_board_nutbox[0]/2); - } - } - translate([0,0,-1]) linear_extrude(height=psu_th_for_clamp+1) { - translate([ -psu_board_nutbox[0]/2 + psu_clamp_gap, 0 ]) - mirror([1,0]) - translate([0,-20]) square(40); - } - } -} - -module PsuMountDemo(ceil = 2.5) { ////toplevel - translate([0, psu_y, psu_z]) { - PsuMountPositive(); - %PsuMountNegative(); - color("yellow") translate([0,0, -psu_z - ceil]) - linear_extrude(height=0.4, convexity=10) - PsuLedWindowsPlan(); - } -} diff --git a/adafruit-powerboost-common.scad b/adafruit-powerboost-common.scad index d9dcd89..555768b 100644 --- a/adafruit-powerboost-common.scad +++ b/adafruit-powerboost-common.scad @@ -2,3 +2,144 @@ include +psu_th = 1.70 + 0.25; +psu_th_for_clamp = 1.50; + +psu_hole_dia = 2.5 - 0.3; +psu_connector_z = 2.9 + 0.1; +psu_connector_z_overlap = 0.15; +psu_connector_depth = 6.25; +psu_connector_w = 8.0 + 0.5; +psu_usb_protr = 0.6; + +psu_clamp_th = 4.0 + 0.75; +psu_clamp_w = 8.0; +psu_clamp_gap = 0.4; + +psu_board_clamp_ovlp = 4.5; +psu_board_support_wall = 2; +psu_board_nutbox = nutbox_data_M3; + +psu_y = +psu_sz[1]/2 + psu_usb_protr; + +// ----- calculated ----- + +psu_z = NutBox_h_base(psu_board_nutbox); +psu_z_down = psu_z + 0.1; + +module PsuBoardRepresentation(){ + linear_extrude(height= psu_th) + square(center=true, [psu_sz[0],psu_sz[1]]); +} + +module PsuRepresentation(){ + PsuBoardRepresentation(); + translate([0, -psu_sz[1]/2, -psu_connector_z]) + linear_extrude(height= psu_connector_z + psu_connector_z_overlap) + rectfromto([ -psu_connector_w/2, -10 ], + [ +psu_connector_w/2, psu_connector_depth ]); +} + +module AtPsuMountCorner(mx,my){ + mirror([mx,0,0]) + mirror([0,my,0]) + translate(-0.5 * [psu_sz[0], psu_sz[1], 0] + -1 * [0,0, psu_z_down]) + children(); +} + +module PsuMountCornerExtrude(mx,my, plus_z=board_support_z){ + AtPsuMountCorner(mx,my){ + linear_extrude(height= psu_z_down + plus_z, convexity=10) { + children(); + } + } +} + +module PsuMountPositiveMain(){ + for (mx=[0,1]) { + for (my=[0,1]) { + PsuMountCornerExtrude(mx,my){ + rectfromto(-[1,1]*psu_board_support_wall, + +[1,1]*board_support_ovlp); + } + } + // mount above at plug end + PsuMountCornerExtrude(mx,0, psu_th + psu_board_support_wall){ + rectfromto(-[1,1]*psu_board_support_wall, + [board_support_ovlp, + board_support_ovlp_ceil]); + } + } + translate([0,0, -psu_z_down]) + linear_extrude(psu_z_down - psu_baffle_gap, convexity=10) + PsuLedBafflePlan(); +} + +module PsuMountNegative(){ + axis = [0, -psu_sz[1]/2, psu_th]; + PsuRepresentation(); + translate(axis) + rotate([atan(2 * board_support_z / psu_sz[1]), + 0,0]) + translate(-axis) + PsuBoardRepresentation(); +} + +module PsuMountPositive(){ + difference(){ + intersection(){ + PsuMountPositiveMain(); + linextr_y_xz(-psu_y, psu_sz[1]*2) square(100, center=true); + } + PsuMountNegative(); + intersection(){ + hull(){ + PsuBoardRepresentation(); + translate([0,0,5]) PsuBoardRepresentation(); + } + translate([-20,0,-20]) cube(40); + } + } + for (mx=[0,1]) { + PsuMountCornerExtrude(mx,1){ + translate([psu_sz[0]/2 - psu_hole_pos[1], + psu_hole_pos[0]] + + board_gap * [1,1] ) + circle(r= psu_hole_dia/2); + } + } + translate([0, psu_sz[1]/2 + psu_board_nutbox[0]/2, 0]) + rotate([0,0,180]) + NutBox(psu_board_nutbox, psu_z_down); +} + +module PsuClamp(){ ////toplevel + rotate([180,0,0]) difference(){ + linear_extrude(height=psu_clamp_th + psu_th_for_clamp, convexity=5) { + difference(){ + hull(){ + circle(r = fix_sz/2); + translate([ -psu_board_nutbox[0]/2, 0]) + square(center=true, [ psu_board_clamp_ovlp*2, psu_clamp_w ]); + } + circle(r = psu_board_nutbox[0]/2); + } + } + translate([0,0,-1]) linear_extrude(height=psu_th_for_clamp+1) { + translate([ -psu_board_nutbox[0]/2 + psu_clamp_gap, 0 ]) + mirror([1,0]) + translate([0,-20]) square(40); + } + } +} + +module PsuMountDemo(ceil = 2.5) { ////toplevel + translate([0, psu_y, psu_z]) { + PsuMountPositive(); + %PsuMountNegative(); + color("yellow") translate([0,0, -psu_z - ceil]) + linear_extrude(height=0.4, convexity=10) + PsuLedWindowsPlan(); + } +} -- 2.30.2