diff --git a/libtest.png b/libtest.png index 47ade9f..9c48402 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/libtest.scad b/libtest.scad index 95b8068..04b934c 100644 --- a/libtest.scad +++ b/libtest.scad @@ -198,8 +198,9 @@ translate([900, 750]) translate([900, 850]) printed_boxes(); -translate([850, 1330 + 85]) - bbox_test(); +translate([950, 1400]) + rotate(-90) + bbox_test(); inserts_y = 0; nuts_y = inserts_y + 20; diff --git a/readme.md b/readme.md index 0de8711..ce70223 100644 --- a/readme.md +++ b/readme.md @@ -2885,6 +2885,7 @@ Face order is bottom, top, left, right, front, back. | `psu_left_bay(type)` | Bay for terminals | | `psu_length(type)` | Length | | `psu_name(type)` | The part name | +| `psu_pcb(type)` | The PCB | | `psu_right_bay(type)` | Bay for heatsink | | `psu_screw(type)` | Screw type | | `psu_screw_hole_radius(type)` | Clearance hole for screw, bigger than normal on ATX | @@ -2913,6 +2914,8 @@ Face order is bottom, top, left, right, front, back. | 1 | `psu(ATX500)` | PSU ATX500 | | 1 | `psu(ATX300)` | PSU FSP300-60GHX | | 1 | `psu(KY240W)` | PSU KY-240W-12-L - not shown | +| 1 | `psu(NG_CB_200W_24V)` | PSU NIUGUY CB-200W-24V | +| 1 | `psu(NG_CB_500W_24V)` | PSU NIUGUY CB-500W-24V | | 1 | `psu(PD_150_12)` | PSU PD-150-12 | | 1 | `psu(S_250_48)` | PSU S-250-48 | | 1 | `psu(S_300_12)` | PSU S-300-12 | @@ -4610,23 +4613,23 @@ Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block). ### Vitamins | Qty | Module call | BOM entry | | ---:|:--- |:---| -| 48 | `insert(F1BM3)` | Heatfit insert M3 | -| 36 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm | +| 60 | `insert(F1BM3)` | Heatfit insert M3 | +| 44 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm | | 4 | `screw(M3_dome_screw, 12)` | Screw M3 dome x 12mm | -| 8 | `screw(M3_dome_screw, 16)` | Screw M3 dome x 16mm | -| 2 | `sheet(DiBond, 303, 126)` | Sheet DiBond 303mm x 126mm x 3mm | -| 1 | `sheet(DiBond, 400, 126)` | Sheet DiBond 400mm x 126mm x 3mm | -| 1 | `sheet(DiBond6, 400, 300, 1)` | Sheet DiBond 400mm x 300mm x 6mm | -| 1 | `sheet(DiBond, 406, 129)` | Sheet DiBond 406mm x 129mm x 3mm | -| 1 | `sheet(PMMA3, 406, 303)` | Sheet acrylic 406mm x 303mm x 3mm | -| 48 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm | -| 48 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm | +| 12 | `screw(M3_dome_screw, 16)` | Screw M3 dome x 16mm | +| 2 | `sheet(DiBond, 203, 126)` | Sheet DiBond 203mm x 126mm x 3mm | +| 1 | `sheet(DiBond, 300, 126)` | Sheet DiBond 300mm x 126mm x 3mm | +| 1 | `sheet(DiBond6, 300, 200, 1)` | Sheet DiBond 300mm x 200mm x 6mm | +| 1 | `sheet(DiBond, 306, 129)` | Sheet DiBond 306mm x 129mm x 3mm | +| 1 | `sheet(PMMA3, 306, 203)` | Sheet acrylic 306mm x 203mm x 3mm | +| 60 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm | +| 60 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm | ### Printed | Qty | Filename | | ---:|:--- | | 8 | corner_block_M30.stl | -| 8 | fixing_block_M30.stl | +| 12 | fixing_block_M30.stl | ### Routed | Qty | Filename | @@ -4643,7 +4646,7 @@ Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block). | ---:|:--- | | 1 | bbox_assembly | | 8 | corner_block_M30_assembly | -| 8 | fixing_block_M30_assembly | +| 12 | fixing_block_M30_assembly | Top diff --git a/tests/PSUs.scad b/tests/PSUs.scad index ec24c55..211ee37 100644 --- a/tests/PSUs.scad +++ b/tests/PSUs.scad @@ -30,9 +30,10 @@ module psus() rotate(atx_psu(p) ? 0 : 90) { psu(p); - psu_screw_positions(p) - translate_z(3) - screw_and_washer(psu_screw(p), 8); + if (psu_screw(p)) + psu_screw_positions(p) + translate_z(3) + screw_and_washer(psu_screw(p), 8); if(show_cutout && atx_psu(p)) #atx_psu_cutout(p); diff --git a/tests/butt_box.scad b/tests/butt_box.scad index d0d4754..3bdd43c 100644 --- a/tests/butt_box.scad +++ b/tests/butt_box.scad @@ -25,7 +25,7 @@ include <../printed/butt_box.scad> $explode = 0; -box = bbox(screw = M3_dome_screw, sheets = DiBond, base_sheet = DiBond6, top_sheet = PMMA3, span = 250, size = [400, 300, 120]); +box = bbox(screw = M3_dome_screw, sheets = DiBond, base_sheet = DiBond6, top_sheet = PMMA3, span = 150, size = [300, 200, 120]); module bbox_assembly() _bbox_assembly(box); diff --git a/tests/png/butt_box.png b/tests/png/butt_box.png index cff20d1..2436553 100644 Binary files a/tests/png/butt_box.png and b/tests/png/butt_box.png differ diff --git a/tests/png/psus.png b/tests/png/psus.png index aa5293a..bf3d405 100644 Binary files a/tests/png/psus.png and b/tests/png/psus.png differ diff --git a/vitamins/psu.scad b/vitamins/psu.scad index c70bec1..b022d62 100644 --- a/vitamins/psu.scad +++ b/vitamins/psu.scad @@ -29,6 +29,7 @@ use <../utils/sector.scad> use <../utils/round.scad> use use +use use use @@ -53,8 +54,9 @@ function atx_psu(type) = type[7]; //! True if an ATX style PSU function psu_left_bay(type) = type[8]; //! Bay for terminals function psu_right_bay(type) = type[9]; //! Bay for heatsink function psu_terminals(type) = type[10]; //! How many terminals and the y offset from the back -function psu_faces(type) = type[11]; //! List of face descriptions -function psu_accessories(type) = type[12]; //! Accessories to add to BOM, e.g. mains lead +function psu_pcb(type) = type[11]; //! The PCB +function psu_faces(type) = type[12]; //! List of face descriptions +function psu_accessories(type) = type[13]; //! Accessories to add to BOM, e.g. mains lead function psu_face_transform(type, face) = //! Returns a transformation matrix to get to the specified face let(l = psu_length(type), @@ -129,8 +131,13 @@ module psu(type) { //! Draw a power supply polygon([for(p = cutout) p]); for(h = psu_face_holes(f)) - translate(h) - drill(screw_pilot_hole(psu_screw(type)), 0); + translate([h.x, h.y]) + hull() { + drill(psu_screw(type) == false ? psu_screw_hole_radius(type) : screw_pilot_hole(psu_screw(type)), 0); + if (is_list(h[2])) + translate([h[2].x, h[2].y]) + drill(psu_screw(type) == false ? psu_screw_hole_radius(type) : screw_pilot_hole(psu_screw(type)), 0); + } g = psu_face_grill(f); if(g) { @@ -210,17 +217,15 @@ module psu(type) { //! Draw a power supply lt = psu_face_thickness(faces[f_left]); cutout = psu_face_cutouts(faces[f_left])[0]; z = psu_terminal_block_z(type); - pw = w -ft - bt; - pl = l - right - rt; - pcb_thickness = 1.6; + pcb = [l - right - rt, w - ft - bt, 1.6]; heatsink_offset = 13.5; color("#FCD67E") - translate([(-right - rt) / 2, (ft - bt) / 2, z - pcb_thickness]) - linear_extrude(pcb_thickness) + translate([(-right - rt) / 2, (ft - bt) / 2, z - pcb.z]) + linear_extrude(pcb.z) difference() { - square([pl, pw], center = true); + square([pcb.x, pcb.y], center = true); - translate([-pl / 2, -pw / 2]) + translate([-pcb.x / 2, -pcb.y / 2]) square(16, center = true); } @@ -237,7 +242,7 @@ module psu(type) { //! Draw a power supply earth_d = 5; translate([-l / 2 + earth_inset, w / 2 - tab_w / 2]) { color("silver") - cylinder(d = earth_d, h = z - pcb_thickness); + cylinder(d = earth_d, h = z - pcb.z); translate_z(z + lt) not_on_bom() no_explode() @@ -274,6 +279,13 @@ module psu(type) { //! Draw a power supply } } } + // PCB + pcb = psu_pcb(type); + if (pcb) { + translate(pcb[0]) + pcb(pcb[1]); + } + } module psu_screw_positions(type, face = undef) { //! Position children at the screw positions on the preferred mounting face, which can be overridden. @@ -284,7 +296,7 @@ module psu_screw_positions(type, face = undef) { //! Position children at the sc if(len(psu_faces(type)) > f) multmatrix(psu_face_transform(type, f)) for(point = psu_face_holes(psu_faces(type)[f])) - translate(point) + translate([point.x, point.y]) children(); } diff --git a/vitamins/psus.scad b/vitamins/psus.scad index c991c1d..6203721 100644 --- a/vitamins/psus.scad +++ b/vitamins/psus.scad @@ -28,7 +28,7 @@ include mw_terminals = [9.525, 1.5, 15, 17.8, 7, 15]; PD_150_12 = - ["PD_150_12", "PD-150-12", 199, 98, 38, M3_pan_screw, M3_clearance_radius, false, 11, 4.5, [7, 11, mw_terminals], + ["PD_150_12", "PD-150-12", 199, 98, 38, M3_pan_screw, M3_clearance_radius, false, 11, 4.5, [7, 11, mw_terminals], false, [ [[[82.5, -40], [82.5, 40], [-37.5, -40], [-37.5, 40]], 1.5, []], [[], 0.5, [], true], @@ -42,7 +42,7 @@ PD_150_12 = st_terminals = [9.666, 2, 13, 15, 8, 13.5]; S_250_48 = - ["S_250_48", "S-250-48", 200, 110, 50, M3_pan_screw, M3_clearance_radius, false, 13, 5, [9, 11, st_terminals], + ["S_250_48", "S-250-48", 200, 110, 50, M3_pan_screw, M3_clearance_radius, false, 13, 5, [9, 11, st_terminals], false, [ [[[-39, -45.5], [-39, 39.5], [86, -45.5], [86, 39.5]], 1.5, []], [[], 0.5, [], true], @@ -56,7 +56,7 @@ S_250_48 = // Single fan at back, wires exit opposite side from mains in ATX500 = - ["ATX500", "ATX500", 150, 140, 86, No632_pan_screw, 5/2, true, 0, 0, [], + ["ATX500", "ATX500", 150, 140, 86, No632_pan_screw, 5/2, true, 0, 0, [], false, [ [[], 0.8, []], [[], 0.8, []], @@ -83,7 +83,7 @@ ATX500 = // Single fan in the top, wires exit opposite side from mains in ATX300 = let(p = [113 / 2, 51.5 / 2], s = [125, 100, 64], iec = [35.5, 6], sw = [6.5, 7]) - ["ATX300", "FSP300-60GHX", s.x, s.y, s.z, No632_pan_screw, No6_clearance_radius, true, 0, 0, [], + ["ATX300", "FSP300-60GHX", s.x, s.y, s.z, No632_pan_screw, No6_clearance_radius, true, 0, 0, [], false, [ [[], 0.5, []], [[], 0.5, [], false, [0, 8, fan80x25]], @@ -121,7 +121,7 @@ ATX300 = let(p = [113 / 2, 51.5 / 2], s = [125, 100, 64], iec = [35.5, 6], sw = KY240W = - ["KY240W", "KY-240W-12-L", 199, 110, 50, M3_cap_screw, M3_clearance_radius, false, 0, 0, [], + ["KY240W", "KY-240W-12-L", 199, 110, 50, M3_cap_screw, M3_clearance_radius, false, 0, 0, [], false, [ [[[ 199 / 2 - 12, 110 / 2 - 93], [ 199 / 2 - 12, 110 / 2 - 9 ], @@ -147,6 +147,7 @@ S_300_12 = [ 18,// y offset st_terminals ], + false, // pcb // faces [ [// f_bottom, bottom @@ -224,13 +225,87 @@ S_300_12 = [ [] ]; +// NIUGUY PSUs + +function NIUGUY_CB_PCB(size, left=0, right=0, front=0, back=0) = +let(s = [size.x - left - right, size.y - front - back], c=9.5) +[ + [left/2 - right/2, front/2 - back/2, 3], // offset + [ // pcb + "", "", + s.x, s.y, size.z, // size + //size.x, size.y, size.z, + 1, // corner radius + 0, // mounting hole diameter + 0, // pad around mounting hole + "DarkBlue", // color + false, // true if parts should be separate BOM items + [], // hole positions + [ // components + // terminal parameters are: pitch, divider width, divider height, total depth, height under contacts, depth of contact well + [ -0.25, 12, 180, "terminal", 3, [8.333, 1.5, 12, 15.5, 5, 13.5] ], + [ 0.25, 35.5, 0, "terminal", 4, [8.333, 1.5, 12, 15.5, 5, 13.5] ], + ], + [], // accessories + [], // grid + [ // pcb polygon + [-s.x/2, -s.y/2], + [-s.x/2, s.y/2 - c], [-s.x/2 + c, s.y/2 - c], [-s.x/2 + c, s.y/2], + [s.x/2, s.y/2], + [s.x/2, -s.y/2 + c], [s.x/2 - c, -s.y/2 + c], [s.x/2 - c, -s.y/2] + ] + ], +]; + +function NIUGUY_CB_PSU(id, name, s /*size*/, c=10/*corner*/) = + [id, name, // ID and Name + s.x, s.y, s.z, // Size + false, 2.5, // Screw type and hole radius + false, // true if ATX + 0, 0, // left and right bays + false, // terminals + NIUGUY_CB_PCB([s.x, s.y, 1.6], 0.5, 0.5, 2, 2), // pcb + [ // parameters are: holes, thickness, cutouts, grill, fans, iec, switch, vents, panel cutout + // bottom + [ [[s.x/2 - 4, s.y/2 - 7.5, [5, 0]], [-s.x/2 + 4, -s.y/2 + 7.5, [-5, 0] ], ], 1.5, [] ], // two slots cutout for screws + // top + [ [], 0.5, [ + [ [-s.x/2 + 20, -s.y/2], [-s.x/2 + 20, s.y/2], [-s.x/2, s.y/2], [-s.x/2, -s.y/2] ], + [ [ s.x/2 - 20, -s.y/2], [ s.x/2 - 20, s.y/2], [ s.x/2, s.y/2], [ s.x/2, -s.y/2] ] + ], [5.5, 1, 6, [50, 30, 6, 6], []] ], // grill + // left + [ [], 0.5, [ + [ [s.y/2, s.z/2], [s.y/2, -s.z/2 + 3], [-s.y/2, -s.z/2 + 3], [-s.y/2, s.z/2] ], // +3 is for placement of pcb + [ [s.y/2, s.z/2], [s.y/2, -s.z/2], [-s.y/2, -s.z/2], [-s.y/2, s.z/2] ], + ] ], + // right + [ [], 0.5, [ + [ [-s.y/2, -s.z/2], [s.y/2, -s.z/2], [s.y/2, s.z/2], [-s.y/2, s.z/2] ], + ] ], + // front + [ [], 2.0, [ + [ [-s.x/2, s.z/2 - c], [-s.x/2, s.z/2], [-s.x/2 + c, s.z/2] ], + [ [ s.x/2, s.z/2 - c], [ s.x/2, s.z/2], [ s.x/2 - c, s.z/2] ] + ], [4.5, 1.5, 6, [15, 15, 4, 8], []] ], // grill + // back + [ [], 2.0, [ + [ [-s.x/2, -s.z/2 + c], [-s.x/2, -s.z/2], [-s.x/2 + c, -s.z/2] ], + [ [ s.x/2, -s.z/2 + c], [ s.x/2, -s.z/2], [ s.x/2 - c, -s.z/2] ] + ] ], + ], + [] // accessories for BOM +]; + +NG_CB_200W_24V = NIUGUY_CB_PSU("NG_CB_200W_24V", "NIUGUY CB-200W-24V", [178, 50, 22]); +NG_CB_500W_24V = NIUGUY_CB_PSU("NG_CB_500W_24V", "NIUGUY CB-500W-24V", [238, 50, 22]); + External = - ["External", "X Box", 0, 0, 0, false, false, false, 0, 0, [], + ["External", "X Box", 0, 0, 0, false, false, false, 0, 0, [], false, [], [": IEC mains lead"] ]; -psus = [PD_150_12, S_250_48, S_300_12, ATX300, ATX500]; +psus = [NG_CB_200W_24V, NG_CB_500W_24V, PD_150_12, S_250_48, S_300_12, ATX300, ATX500]; psus_not_shown = [KY240W];