diff --git a/lib.scad b/lib.scad index b83a24a..71e2cee 100644 --- a/lib.scad +++ b/lib.scad @@ -37,6 +37,7 @@ include include include include +include include include include diff --git a/libtest.scad b/libtest.scad index 4d16f47..a635445 100644 --- a/libtest.scad +++ b/libtest.scad @@ -63,6 +63,7 @@ use use use use +use use use use @@ -336,9 +337,10 @@ leds_y = 0; carriers_y = leds_y + 40; magnets_y = carriers_y + 40; spades_y = magnets_y + 20; -buttons_y = spades_y + 20; -jacks_y = buttons_y + 40; -microswitches_y = jacks_y + 40; +fastons_y = spades_y + 20; +buttons_y = fastons_y + 20; +jacks_y = buttons_y + 30; +microswitches_y = jacks_y + 30; rockers_y = microswitches_y + 40; toggles_y = rockers_y + 60; components_y = toggles_y + 40; @@ -364,6 +366,9 @@ translate([x2 + 70, leds_y]) translate([x2, spades_y]) spades(); +translate([x2, fastons_y]) + fastons(); + translate([x2, buttons_y]) buttons(); diff --git a/readme.md b/readme.md index acaaa18..2c9e3c1 100644 --- a/readme.md +++ b/readme.md @@ -42,12 +42,12 @@ A list of changes classified as breaking, additions or fixes is maintained in [C Extrusion_brackets PCBs Terminals PSU_shroud Sweep Extrusions PSUs Toggles Pocket_handle Thread Fans Panel_meters Transformers Press_fit Tube - Fuseholder Pillars Tubings Printed_box - Geared_steppers Pillow_blocks Variacs Printed_pulleys - Green_terminals Pin_headers Veroboard Ribbon_clamp - Hot_ends Potentiometers Washers SSR_shroud - Hygrometer Pulleys Wire Screw_knob - Zipties Socket_box + Fastons Pillars Tubings Printed_box + Fuseholder Pillow_blocks Variacs Printed_pulleys + Geared_steppers Pin_headers Veroboard Ribbon_clamp + Green_terminals Potentiometers Washers SSR_shroud + Hot_ends Pulleys Wire Screw_knob + Hygrometer Zipties Socket_box Strap_handle @@ -1195,6 +1195,56 @@ Can draw three styles: solid, open frame and open frame with screw bosses. | 32 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm | +Top + +--- + +## Fastons +Faston receptacles to mate with spade connectors + +[vitamins/fastons.scad](vitamins/fastons.scad) Object definitions. + +[vitamins/faston.scad](vitamins/faston.scad) Implementation. + +[tests/fastons.scad](tests/fastons.scad) Code for this example. + +### Properties +| Function | Description | +|:--- |:--- | +| `faston_d_bot(type)` | Radius of bottom corners | +| `faston_d_top(type)` | Radius of the clips | +| `faston_fillet_d(type)` | Fillets at the transition | +| `faston_insul_crimp_d(type)` | Outside diameter of the insulation crimp | +| `faston_insul_crimp_l(type)` | Length of the insulation crimp | +| `faston_insul_crimp_o(type)` | Offset of insulation crimp | +| `faston_insul_crimp_p(type)` | Position of the tip of the insulation crimp | +| `faston_size(type)` | Size of the receptical part | +| `faston_t(type)` | Thickness | +| `faston_wall_h(type)` | Height of transition web wall | +| `faston_width(type)` | Width of matching spade | +| `faston_wire_crimp_d(type)` | Outside diameter of the wire crimp | +| `faston_wire_crimp_l(type)` | Length of the wire crimp | +| `faston_wire_crimp_p(type)` | Position of the tip of the wire crimp | + +### Functions +| Function | Description | +|:--- |:--- | +| `faston_insul_stop(type)` | Position where insulation stops | +| `faston_length(type)` | Total length of crimp | + +### Modules +| Module | Description | +|:--- |:--- | +| `faston(type, closed = false)` | Draw specified faston | + +![fastons](tests/png/fastons.png) + +### Vitamins +| Qty | Module call | BOM entry | +| ---:|:--- |:---| +| 4 | `faston(5_160430_7)` | Faston part no 5_160430_7 to fit 4.75mm spade | + + Top --- diff --git a/tests/fastons.scad b/tests/fastons.scad new file mode 100644 index 0000000..238a22f --- /dev/null +++ b/tests/fastons.scad @@ -0,0 +1,35 @@ +// +// NopSCADlib Copyright Chris Palmer 2023 +// 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 <../utils/core/core.scad> + +include <../vitamins/fastons.scad> + +module fastons() + for(i = [0, len(fastons) - 1]) + translate([i * 20, 0]) + let(f = fastons[i]) { + rotate(180) + faston(f); + + translate([10, 0]) + rotate(180) + faston(f, true); + } + +fastons(); diff --git a/tests/png/fastons.png b/tests/png/fastons.png new file mode 100644 index 0000000..a66ab03 Binary files /dev/null and b/tests/png/fastons.png differ diff --git a/vitamins/faston.scad b/vitamins/faston.scad new file mode 100644 index 0000000..16e5001 --- /dev/null +++ b/vitamins/faston.scad @@ -0,0 +1,219 @@ +// +// NopSCADlib Copyright Chris Palmer 2023 +// 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 . +// + +// +//! Faston receptacles to mate with spade connectors +// +include <../utils/core/core.scad> +include <../utils/sector.scad> + +function faston_width(type) = type[1]; //! Width of matching spade +function faston_size(type) = type[2]; //! Size of the receptical part +function faston_d_top(type) = type[3]; //! Radius of the clips +function faston_d_bot(type) = type[4]; //! Radius of bottom corners +function faston_t(type) = type[5]; //! Thickness +function faston_wire_crimp_l(type) = type[6]; //! Length of the wire crimp +function faston_wire_crimp_d(type) = type[7]; //! Outside diameter of the wire crimp +function faston_wire_crimp_p(type) = type[8]; //! Position of the tip of the wire crimp +function faston_fillet_d(type) = type[9]; //! Fillets at the transition +function faston_wall_h(type) = type[10]; //! Height of transition web wall +function faston_insul_crimp_l(type) = type[11]; //! Length of the insulation crimp +function faston_insul_crimp_d(type) = type[12]; //! Outside diameter of the insulation crimp +function faston_insul_crimp_p(type) = type[13]; //! Position of the tip of the insulation crimp +function faston_insul_crimp_o(type) = type[14]; //! Offset of insulation crimp +function faston_length(type) = //! Total length of crimp + faston_insul_crimp_p(type).z + faston_insul_crimp_l(type); + +function faston_insul_stop(type) = //! Position where insulation stops + faston_wire_crimp_p(type).z + faston_wire_crimp_l(type); + +module faston(type, closed = false) { //! Draw specified faston + vitamin(str("faston(", type[0], "): Faston part no ", type[0], " to fit ", faston_width(type), "mm spade")); + s = faston_size(type); + r_top = faston_d_top(type) / 2; + r_bot = faston_d_bot(type) / 2; + t = faston_t(type); + wc_l = faston_wire_crimp_l(type); + wc_r = faston_wire_crimp_d(type) / 2; + wc_p = faston_wire_crimp_p(type); + fillet_r = faston_fillet_d(type) / 2; + wall_h = faston_wall_h(type); + + ic_l = faston_insul_crimp_l(type); + ic_r = faston_insul_crimp_d(type) / 2; + ic_p = faston_insul_crimp_p(type); + ic_o = faston_insul_crimp_o(type); + + $fn = 64; + // Receptical + module reciptical_shape() + for(side = [-1, 1]) mirror([side < 0 ? 1 : 0, 0]) { + translate([s.x / 2 - r_top, s.y - r_top]) + difference() { + sector(r_top, 0, 180); + sector(r_top - t, 0, 180); + } + + translate([s.x / 2 - r_bot, r_bot]) + difference() { + sector(r_bot, -90, 0); + sector(r_bot - t, -90, 0); + } + + translate([s.x / 2 - t, r_bot]) + square([t, s.y - r_top - r_bot]); + + square([s.x / 2 - r_bot, t]); + } + + + module crimp_shape(p, r, offset = 0) { + hpot = norm([p.x, p.y] - [0, r + offset]); + opp = sqrt(sqr(hpot) - sqr(r)); + angle = atan((p.y - (r + offset)) / p.x) - acos(r / hpot); + r_crimp = r / 2 - eps; + lift = -0.1; + z = (opp - r * 2 * PI / -angle / 360 - PI * r_crimp) / 2 + lift / 2; + + for(side = [-1, 1]) mirror([side < 0 ? 1 : 0, 0]) + translate([0, r + offset]) { + difference() { + sector(r, 270, 360 + (closed ? 0 : angle)); + + circle(r - t); + } + + if(!closed) + rotate(angle) + translate([r - t, -eps]) + square([t, opp]); + else { + translate([r - r_crimp, z]) + difference() { + sector(r_crimp, 0, 180); + + circle(r_crimp - t); + } + translate([r - t, 0]) + square([t, z]); + + translate([r - 2 * r_crimp, lift]) + square([t, z - lift]); + + } + } + } + + // Wire crimp + module wire_crimp_shape() crimp_shape(wc_p, wc_r); + + // Insulation crimp + module insul_crimp_shape() crimp_shape(ic_p, ic_r, ic_o); + + module crop(z = 0) + intersection() { + children(); + + square([s.x, 2 * (wall_h + fillet_r + z)], center = true); + } + + color(silver) translate([0, -t]) { + // Transition from reciptical to wire crimp + render() difference() { + hull() { + translate_z(s.z) + linear_extrude(eps) + crop() + reciptical_shape(); + + translate_z(wc_p.z - eps) + linear_extrude(eps) + crop() + wire_crimp_shape(); + } + translate([0, s.y, (s.z + wc_p.z) / 2]) + rotate([0, 90, 0]) + rounded_rectangle([wc_p.z - s.z, 2 * (s.y - wall_h), s.x + 1], fillet_r, center = true); + + hull() { + translate_z(s.z - eps) + linear_extrude(eps) + offset(-t) + crop(t) + hull() + reciptical_shape(); + + translate_z(wc_p.z + eps / 8) + linear_extrude(eps / 8) + offset(-t) + crop(t) + hull() + wire_crimp_shape(); + } + } + // Transition from wire crimp to insulation crimp + render() difference() { + hull() { + translate_z(wc_p.z + wc_l) + linear_extrude(eps) + wire_crimp_shape(); + + translate_z(ic_p.z - eps) + linear_extrude(eps) + insul_crimp_shape(); + } + + gap = ic_p.z - wc_p.z - wc_l; + d = gap * 2 / 3; + translate([0, wall_h + fillet_r - gap / 2, ic_p.z - d / 2]) + hull() { + rotate([0, 90, 0]) + cylinder(d = d, h = 10, center = true); + + translate([-5, d / 2, d / 2 - gap]) + cube([10, 10, gap]); + } + + hull() { + translate_z(wc_p.z + wc_l - eps) + linear_extrude(eps) + offset(-t) + hull() + wire_crimp_shape(); + + translate_z(ic_p.z + eps / 8) + linear_extrude(eps / 8) + offset(-t) + hull() + insul_crimp_shape(); + } + } + + linear_extrude(s.z) + reciptical_shape(); + + translate_z(wc_p.z) + linear_extrude(wc_l) + wire_crimp_shape(); + + translate_z(ic_p.z) + linear_extrude(ic_l) + insul_crimp_shape(); + } +} diff --git a/vitamins/fastons.scad b/vitamins/fastons.scad new file mode 100644 index 0000000..8dcf415 --- /dev/null +++ b/vitamins/fastons.scad @@ -0,0 +1,28 @@ +// +// NopSCADlib Copyright Chris Palmer 2023 +// 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 . +// + +// +//! Faston receptacles to mate with spade connectors +// + +5_160430_7 = ["5_160430_7", 4.75, [5.6, 2.56, 6.3], 2.25, 1.13, 0.32, 3.2, 1.64, [1.64, 3.09, 9], 0.5, 0.96, 1.7, 3.53, [2.08, 4.47, 13.3], -0.4]; + +fastons = [5_160430_7]; + +use