diff --git a/libtest.png b/libtest.png index 9a4d2d1..7e0063a 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/libtest.scad b/libtest.scad index 436e15b..04ef3a1 100644 --- a/libtest.scad +++ b/libtest.scad @@ -86,6 +86,7 @@ use use use use +use x5 = 800; @@ -300,9 +301,12 @@ translate([x3 + 15, modules_y]) translate([x3 + 40, modules_y]) modules(); -translate([x3, ssrs_y]) +translate([x3, ssrs_y]) { ssrs(); + ssr_shrouds(); +} + translate([x3, blowers_y]) blowers(); diff --git a/printed/ssr_shroud.scad b/printed/ssr_shroud.scad new file mode 100644 index 0000000..10d7658 --- /dev/null +++ b/printed/ssr_shroud.scad @@ -0,0 +1,154 @@ +// +// 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 . +// + +// +//! A cover to go over the mains end of an SSR to make it safe to be touched. +//! 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/ssr.scad> +use <../utils/round.scad> + +wall = 1.8; +top = 1.5; +screw = M3_cap_screw; +screw_length = 10; +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 = 3; +clearance = layer_height; + +function ssr_shroud_pitch(type) = ssr_width(type) + 2 * wall - 2 * boss_r - eps; +function ssr_shroud_screw(type) = screw; //! Screw used to fasten +function ssr_shroud_extent(type, cable_d) = 2 * boss_r + 1 + cable_d + rad; //! How far it extends beyond the SSR +function ssr_shroud_width(type) = ssr_width(type) + 2 * wall + clearance; //! Outside width of shroud +function ssr_shroud_height(type) = ssr_height(type) + top + clearance; //! Outside height + +module ssr_shroud_hole_positions(type) //! Place children at the screw hole positions + for($side = [-1, 1]) + translate([-ssr_length(type) / 2 -boss_r, $side * ssr_shroud_pitch(type) / 2]) + vflip() + children(); + +module ssr_shroud_holes(type) //: Drill the screw holes + ssr_shroud_hole_positions(type) + drill(screw_clearance_radius(screw), 0); + +module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a specified ssr and cable + stl(str("ssr_shroud_", name)); + + width = ssr_shroud_width(type); + depth = ssr_length(type) / 3 + ssr_shroud_extent(type, cable_d); + height = ssr_shroud_height(type); + cable_x = -ssr_length(type) / 2 - 2 * boss_r - 1 - cable_d / 2; + center_x = -ssr_length(type) / 6 - depth / 2; + + translate([center_x, 0]) { + rounded_rectangle([depth - eps, width - eps, top], rad, center = false); + + linear_extrude(height = height) 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([cable_x - center_x, 0]) + square([cable_d, width + 1], center = true); + } + } + for(side = [-1, 1]) + translate([cable_x, side * (width / 2 - wall / 2), height / 2]) + rotate([90, 0, 0]) + 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); + } + + translate_z(height - boss_h) + linear_extrude(height = boss_h) + ssr_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)); + } + + translate_z(height - boss_h2) + linear_extrude(height = counter_bore + eps) + ssr_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); + } + + ssr_shroud_hole_positions(type) + hull() { + translate_z(-height + boss_h2) { + cylinder(h = eps, r = boss_r); + + translate([0, -$side * (boss_r - 1)]) + cube([2 * boss_r, eps, eps], center = true); + } + translate([0, -$side * (boss_r - wall), -height + boss_h2 + (2 * boss_r - wall)]) + cube(eps); + } + +} + +module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted +assembly(str("ssr_shroud_", name)) { + + translate_z(ssr_height(type) + top) + vflip() + color(pp1_colour) ssr_shroud(type, cable_d, name); + + ssr_shroud_hole_positions(type) + insert(insert); + +} + +module ssr_shroud_fastened_assembly(type, cable_d, thickness, name) //! Assembly with screws in place +{ + ssr_shroud_assembly(type, cable_d, name); + + translate_z(-thickness) + ssr_shroud_hole_positions(type) + screw_and_washer(screw, screw_length, true); +} diff --git a/readme.md b/readme.md index dc3a2b1..4c0d9d9 100644 --- a/readme.md +++ b/readme.md @@ -32,8 +32,8 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa Fuseholder Sealing_strip Ribbon_clamp Rounded_polygon Hot_ends Sheets Screw_knob Sector Iecs Spades Socket_box Sweep - Inserts Spools Strap_handle Tube - Jack Springs + Inserts Spools Ssr_shroud Tube + Jack Springs Strap_handle Leadnuts Ssrs Leds Stepper_motors Light_strips Toggles @@ -3587,6 +3587,58 @@ UK 13A socket and printed backbox with earth terminal for the panel it is mounte | 1 | socket_box_MKLOGIC_assembly | +Top + +--- + +## Ssr_shroud +A cover to go over the mains end of an SSR to make it safe to be touched. +The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project. + + +[printed/ssr_shroud.scad](printed/ssr_shroud.scad) Implementation. + +[tests/ssr_shroud.scad](tests/ssr_shroud.scad) Code for this example. + +### Functions +| Function | Description | +|:--- |:--- | +| ```ssr_shroud_extent(type, cable_d)``` | How far it extends beyond the SSR | +| ```ssr_shroud_height(type)``` | Outside height | +| ```ssr_shroud_screw(type)``` | Screw used to fasten | +| ```ssr_shroud_width(type)``` | Outside width of shroud | + +### Modules +| Module | Description | +|:--- |:--- | +| ```ssr_shroud(type, cable_d, name)``` | Generate the STL file for a specified ssr and cable | +| ```ssr_shroud_assembly(type, cable_d, name)``` | The printed parts with inserts fitted | +| ```ssr_shroud_fastened_assembly(type, cable_d, thickness, name)``` | Assembly with screws in place | +| ```ssr_shroud_hole_positions(type)``` | Place children at the screw hole positions | + +![ssr_shroud](tests/png/ssr_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 | + +### Printed +| Qty | Filename | +| ---:|:--- | +| 1 | ssr_shroud_SSR10DA.stl | +| 1 | ssr_shroud_SSR25DA.stl | + +### Assemblies +| Qty | Name | +| ---:|:--- | +| 1 | ssr_shroud_SSR10DA_assembly | +| 1 | ssr_shroud_SSR25DA_assembly | + + Top --- diff --git a/tests/png/ssr_shroud.png b/tests/png/ssr_shroud.png new file mode 100644 index 0000000..f6349da Binary files /dev/null and b/tests/png/ssr_shroud.png differ diff --git a/tests/png/ssrs.png b/tests/png/ssrs.png index c230b17..13cc01c 100644 Binary files a/tests/png/ssrs.png and b/tests/png/ssrs.png differ diff --git a/tests/ssr_shroud.scad b/tests/ssr_shroud.scad new file mode 100644 index 0000000..17d220a --- /dev/null +++ b/tests/ssr_shroud.scad @@ -0,0 +1,37 @@ +// +// 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 . +// +include <../core.scad> +use <../utils/layout.scad> + +include <../vitamins/screws.scad> +include <../vitamins/ssrs.scad> +use <../printed/ssr_shroud.scad> + +thickness = 3; + +module ssr_shrouds() + layout([for(s = ssrs) ssr_width(s)], 15) let(ssr = ssrs[$i]) + rotate(90) { + if($preview) + ssr_shroud_fastened_assembly(ssr, 6, thickness, ssr[0]); + else + ssr_shroud(ssrs[$i], 6, ssr[0]); + } + +ssr_shrouds(); diff --git a/tests/ssrs.scad b/tests/ssrs.scad index 8636cce..95d90bb 100644 --- a/tests/ssrs.scad +++ b/tests/ssrs.scad @@ -23,8 +23,9 @@ include <../vitamins/screws.scad> include <../vitamins/ssrs.scad> module ssrs() - layout([for(s = ssrs) ssr_length(s)], 15) - ssr_assembly(ssrs[$i], M4_cap_screw, 3); + layout([for(s = ssrs) ssr_width(s)], 15) + rotate(90) + ssr_assembly(ssrs[$i], M4_cap_screw, 3); if($preview) ssrs();