Added PSU shrouds.

This commit is contained in:
Chris Palmer 2019-06-27 13:20:50 +01:00
parent 8ea7d92997
commit a3e51d2607
8 changed files with 320 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 KiB

After

Width:  |  Height:  |  Size: 658 KiB

View File

@ -87,6 +87,7 @@ use <tests/screw_knob.scad>
use <tests/socket_box.scad>
use <tests/strap_handle.scad>
use <tests/ssr_shroud.scad>
use <tests/psu_shroud.scad>
x5 = 800;
@ -217,9 +218,11 @@ translate([x0, fans_y]) {
translate([x0, transformers_y])
variacs();
translate([x0, psus_y])
translate([x0, psus_y]) {
psus();
psu_shrouds();
}
x1 = x0 + 100;
zipties_y = 0;

210
printed/psu_shroud.scad Normal file
View File

@ -0,0 +1,210 @@
//
// NopSCADlib Copyright Chris Palmer 2018
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
//! A cover to go over the mains end of a PSU terminal strip to make it safe.
//! The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/wire.scad>
use <../vitamins/psu.scad>
use <../utils/round.scad>
wall = 1.8;
top = 1.5;
screw = M3_cap_screw;
insert = screw_insert(screw);
boss_r = wall + corrected_radius(insert_hole_radius(insert));
boss_h = insert_hole_length(insert);
counter_bore = 2;
boss_h2 = boss_h + counter_bore;
rad = 2;
clearance = layer_height;
overlap = 6;
cable_tie_inset = wall + 4;
function psu_shroud_extent(type) = 15 + wall; //! How far it extends beyond the PSU to clear the connections
function psu_shroud_depth(type) = //! Outside depth of the shroud
psu_left_bay(type) + overlap + psu_shroud_extent(type);
function psu_shroud_width(type) = //! Outside width of the shroud
let(terminals = psu_terminals(type))
terminals ?
let(y = terminals.y, tb = terminals.z)
wall + clearance / 2 + y + 3 * terminal_block_pitch(tb) + terminal_block_divider(tb) / 2 + wall / 2
: psu_width(type) + 2 * wall + clearance;
function psu_shroud_height(type) = psu_height(type) + top + clearance; //! Outside height
function psu_shroud_centre_y(type) = //! Shroud centre relative to PSU centre
psu_width(type) / 2 + clearance / 2 + wall - psu_shroud_width(type) / 2;
function psu_shroud_pitch(type) = psu_shroud_width(type) - 2 * boss_r - eps;
function psu_shroud_screw(type) = screw; //! Screw used to fasten
function psu_shroud_cable_pitch(cable_d) = cable_d + 5; //! Pitch between cable entries
module psu_shroud_hole_positions(type) //! Place children at the screw hole positions
for($side = [-1, 1])
translate([-psu_length(type) / 2 - boss_r - 1, psu_shroud_centre_y(type) + $side * psu_shroud_pitch(type) / 2])
children();
module psu_shroud_cable_positions(type, cable_d, cables = 1) //! Place children at the cable tie positions
for(i = [0 : 1 : cables - 1])
translate([-psu_length(type) / 2 - psu_shroud_extent(type) + cable_tie_inset,
psu_shroud_centre_y(type) + (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d)])
children();
module psu_shroud_holes(type, cable_d, cables = 1) { //! Drill the screw and ziptie holes
psu_shroud_hole_positions(type)
drill(screw_clearance_radius(screw), 0);
psu_shroud_cable_positions(type, cable_d, cables)
cable_tie_holes(cable_d / 2, h = 0);
}
module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file for a specified ssr and cable
stl(str("psu_shroud_", name));
extent = psu_shroud_extent(type);
depth = psu_shroud_depth(type);
width = psu_shroud_width(type);
height = psu_shroud_height(type);
centre_x = -psu_length(type) / 2 - psu_shroud_extent(type) + psu_shroud_depth(type) / 2;
centre_y = psu_shroud_centre_y(type);
terminal_clearance = 0.5;
tb = psu_terminals(type).z;
module shape() {
difference() {
round(or = wall / 2 - eps, ir = 0) difference() {
rounded_square([depth, width], rad);
rounded_square([depth - 2 * wall, width - 2 * wall], rad - wall);
translate([depth / 2, 0])
square([2 * rad, width], center = true);
translate([depth / 2, width / 2 - 5])
square([2 * (overlap + terminal_clearance), 10], center = true);
}
for(i = [0 : 1 : cables - 1])
translate([0, (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d)])
square([depth + 1, cable_d], center = true);
}
}
// base and sides
translate([centre_x, -centre_y]) {
rounded_rectangle([depth - eps, width - eps, top], rad, center = false);
linear_extrude(height = height)
difference() {
shape();
translate([depth / 2, width / 2 - 5])
square([2 * (depth - extent + terminal_clearance), 10], center = true);
}
linear_extrude(height = height - terminal_block_height(tb) - psu_terminal_block_z(type) - terminal_clearance)
shape();
}
// cable slots
for(i = [0 : 1 : cables - 1])
translate([centre_x - depth / 2 + wall / 2, -centre_y + (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d), height / 2])
rotate([90, 0, 90])
linear_extrude(height = wall, center = true)
difference() {
square([cable_d + eps, height], center = true);
translate([0, height / 2])
vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d);
}
mirror([0, 1, 0]) {
// insert boss
translate_z(height - boss_h)
linear_extrude(height = boss_h)
psu_shroud_hole_positions(type)
difference() {
hull() {
circle(boss_r);
translate([0, $side * (boss_r - 1)])
square([2 * boss_r, eps], center = true);
}
poly_circle(insert_hole_radius(insert));
}
// insert boss counter_bore
translate_z(height - boss_h2)
linear_extrude(height = counter_bore + eps)
psu_shroud_hole_positions(type)
difference() {
hull() {
circle(boss_r);
translate([0, $side * (boss_r - 1)])
square([2 * boss_r, eps], center = true);
}
poly_circle(insert_screw_diameter(insert) / 2 + 0.1);
}
// support cones
translate_z(height - boss_h2)
psu_shroud_hole_positions(type)
hull() {
cylinder(h = eps, r = boss_r - eps);
translate([0, $side * (boss_r - 1)])
cube([2 * boss_r, eps, eps], center = true);
translate([0, $side * (boss_r - wall), - (2 * boss_r - wall)])
cube(eps);
}
}
}
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted
assembly(str("psu_shroud_", name)) {
translate_z(psu_shroud_height(type))
vflip()
color(pp1_colour) psu_shroud(type, cable_d, name, cables);
psu_shroud_hole_positions(type)
vflip()
insert(insert);
}
module psu_shroud_fastened_assembly(type, cable_d, thickness, name, cables = 1) //! Assembly with screws in place
{
washer = screw_washer(screw);
screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + insert_length(insert) + counter_bore);
psu_shroud_assembly(type, cable_d, name, cables);
translate_z(-thickness)
psu_shroud_hole_positions(type)
vflip()
screw_and_washer(screw, screw_length, true);
psu_shroud_cable_positions(type, cable_d, cables)
cable_tie(cable_d / 2, thickness);
}

View File

@ -29,12 +29,12 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr>
@ -3496,6 +3496,64 @@ Printed handle that can be printed without needing support material due to its t
| 1 | handle_assembly |
<a href="#top">Top</a>
---
<a name="Psu_shroud"></a>
## Psu_shroud
A cover to go over the mains end of a PSU terminal strip to make it safe.
The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
[printed/psu_shroud.scad](printed/psu_shroud.scad) Implementation.
[tests/psu_shroud.scad](tests/psu_shroud.scad) Code for this example.
### Functions
| Function | Description |
|:--- |:--- |
| ```psu_shroud_cable_pitch(cable_d)``` | Pitch between cable entries |
| ```psu_shroud_centre_y(type)``` | Shroud centre relative to PSU centre |
| ```psu_shroud_depth(type)``` | Outside depth of the shroud |
| ```psu_shroud_extent(type)``` | How far it extends beyond the PSU to clear the connections |
| ```psu_shroud_height(type)``` | Outside height |
| ```psu_shroud_screw(type)``` | Screw used to fasten |
| ```psu_shroud_width(type)``` | Outside width of the shroud |
### Modules
| Module | Description |
|:--- |:--- |
| ```psu_shroud(type, cable_d, name, cables = 1)``` | Generate the STL file for a specified ssr and cable |
| ```psu_shroud_assembly(type, cable_d, name, cables = 1)``` | The printed parts with inserts fitted |
| ```psu_shroud_cable_positions(type, cable_d, cables = 1)``` | Place children at the cable tie positions |
| ```psu_shroud_fastened_assembly(type, cable_d, thickness, name, cables = 1)``` | Assembly with screws in place |
| ```psu_shroud_hole_positions(type)``` | Place children at the screw hole positions |
| ```psu_shroud_holes(type, cable_d, cables = 1)``` | Drill the screw and ziptie holes |
![psu_shroud](tests/png/psu_shroud.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 4 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 4 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 4 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
| 2 | ```ziptie(small_ziptie, 3)``` | Ziptie 100mm min length |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | psu_shroud_PD_150_12.stl |
| 1 | psu_shroud_S_250_48.stl |
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | psu_shroud_PD_150_12_assembly |
| 1 | psu_shroud_S_250_48_assembly |
<a href="#top">Top</a>
---

BIN
tests/png/psu_shroud.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

38
tests/psu_shroud.scad Normal file
View File

@ -0,0 +1,38 @@
//
// NopSCADlib Copyright Chris Palmer 2018
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../utils/layout.scad>
include <../vitamins/screws.scad>
include <../vitamins/psus.scad>
use <../printed/psu_shroud.scad>
thickness = 3;
module psu_shrouds()
layout([for(p = psus) psu_width(p)], 10) let(psu = psus[$i])
if(psu_terminals(psu))
rotate(90) {
if($preview)
psu_shroud_fastened_assembly(psu, 6, thickness, psu[0]);
else
psu_shroud(psu, 6, psu[0]);
}
psu_shrouds();

View File

@ -31,7 +31,7 @@ module ssr_shrouds()
if($preview)
ssr_shroud_fastened_assembly(ssr, 6, thickness, ssr[0]);
else
ssr_shroud(ssrs[$i], 6, ssr[0]);
ssr_shroud(ssr, 6, ssr[0]);
}
ssr_shrouds();

View File

@ -139,6 +139,8 @@ module psu_grill(width, height) {
}
}
function psu_terminal_block_z(type) = psu_face_cutouts(psu_faces(type)[f_left])[0][2].y + psu_height(type) / 2;
module psu(type) { //! Draw a power supply
vitamin(str("psu(", type[0], "): PSU ", psu_name(type)));
@ -242,7 +244,7 @@ module psu(type) { //! Draw a power supply
rt = psu_face_thickness(faces[f_right]);
lt = psu_face_thickness(faces[f_left]);
cutout = psu_face_cutouts(faces[f_left])[0];
z = cutout[2].y + h / 2;
z = psu_terminal_block_z(type);
pw = w -ft - bt;
pl = l - right - rt;
pcb_thickness = 1.6;