diff --git a/gallery/Mains_Box.png b/gallery/Mains_Box.png index 3162199..41089f9 100644 Binary files a/gallery/Mains_Box.png and b/gallery/Mains_Box.png differ diff --git a/gallery/SunBot.png b/gallery/SunBot.png index 173d9fe..1ce05c5 100644 Binary files a/gallery/SunBot.png and b/gallery/SunBot.png differ diff --git a/gallery/Variac.png b/gallery/Variac.png index 5c05e7e..28e479f 100644 Binary files a/gallery/Variac.png and b/gallery/Variac.png differ diff --git a/lib.scad b/lib.scad index 046b386..575b358 100644 --- a/lib.scad +++ b/lib.scad @@ -44,6 +44,7 @@ include include include include +include include include include diff --git a/libtest.png b/libtest.png index 3d6c608..0a5a7d8 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/libtest.scad b/libtest.scad index ecd9e2a..80e798c 100644 --- a/libtest.scad +++ b/libtest.scad @@ -54,6 +54,7 @@ use use use use +use use use use @@ -321,7 +322,8 @@ ssrs_y = modules_y + 80; blowers_y = ssrs_y + 60; batteries_y = blowers_y + 100; steppers_y = batteries_y + 70; -extrusions_y = steppers_y + 100; +panel_meters_y = steppers_y + 70; +extrusions_y = panel_meters_y + 80; translate([x3, veroboard_y]) veroboard_test(); @@ -362,9 +364,11 @@ translate([x3, batteries_y]) translate([x2, steppers_y]) // interloper stepper_motors(); -translate([x2, extrusions_y]) { +translate([x2, panel_meters_y]) + panel_meters(); + +translate([x2, extrusions_y]) extrusions(); -} translate([x3, transformers_y]) transformers(); diff --git a/readme.md b/readme.md index aaa293f..24b5671 100644 --- a/readme.md +++ b/readme.md @@ -36,10 +36,10 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa Fans PCB Swiss_clips Ribbon_clamp Tube Fuseholder PCBs Toggles SSR_shroud Geared_steppers PSUs Transformers Screw_knob - Green_terminals Pillars Tubings Socket_box - Hot_ends Pin_headers Variacs Strap_handle - Hygrometer Pulleys Veroboard - IECs Washers + Green_terminals Panel_meters Tubings Socket_box + Hot_ends Pillars Variacs Strap_handle + Hygrometer Pin_headers Veroboard + IECs Pulleys Washers Inserts Wire Zipties @@ -1947,6 +1947,60 @@ A permanent magnet that can be magnatized and de-magnatized electronically. | 1 | ```opengrab()``` | OpenGrab V3 electro permanent magnet | +Top + +--- + +## Panel_meters +Panel mounted digital meter modules + +Notes on the DSN_VC288: + +* The tabs aren't modelled because they can be fully retracted if the PCB is removed. +* The current connector isn't moddelled as it is awkwardly tall. I remove it and solder wires instead. + + +[vitamins/panel_meters.scad](vitamins/panel_meters.scad) Object definitions. + +[vitamins/panel_meter.scad](vitamins/panel_meter.scad) Implementation. + +[tests/panel_meters.scad](tests/panel_meters.scad) Code for this example. + +### Properties +| Function | Description | +|:--- |:--- | +| ```pmeter_aperture(type)``` | Aperture length, width and bevel | +| ```pmeter_bevel(type)``` | Bezel bevel inset and start height | +| ```pmeter_bezel(type)``` | Bezel size | +| ```pmeter_bezel_r(type)``` | Bezel radius | +| ```pmeter_pcb(type)``` | Optional PCB for open types | +| ```pmeter_pcb_z(type)``` | Distance of PCB from the back | +| ```pmeter_size(type)``` | Body size including bezel height | +| ```pmeter_tab(type)``` | Tab size | +| ```pmeter_tab_z(type)``` | Tab vertical position | +| ```pmeter_thickness(type)``` | Wall thickness if not closed | + +### Functions +| Function | Description | +|:--- |:--- | +| ```pmeter_depth(type)``` | Depth below bezel | + +### Modules +| Module | Description | +|:--- |:--- | +| ```panel_meter(type)``` | Draw panel mounted LCD meter module | +| ```panel_meter_cutout(type, h = 0)``` | Make panel cutout | + +![panel_meters](tests/png/panel_meters.png) + +### Vitamins +| Qty | Module call | BOM entry | +| ---:|:--- |:---| +| 1 | ```panel_meter(DSN_VC288)``` | DSN-VC288 DC 100V 10A Voltmeter ammeter | +| 1 | ```panel_meter(PZEM001)``` | Peacefair PZEM-001 AC digital multi-function meter | +| 1 | ```panel_meter(PZEM021)``` | Peacefair PZEM-021 AC digital multi-function meter | + + Top --- diff --git a/tests/panel_meters.scad b/tests/panel_meters.scad new file mode 100644 index 0000000..ea26ee4 --- /dev/null +++ b/tests/panel_meters.scad @@ -0,0 +1,29 @@ +// +// NopSCADlib Copyright Chris Palmer 2020 +// 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/panel_meters.scad> + +module panel_meters() + layout([for(p = panel_meters) pmeter_size(p).x], 20) + panel_meter(panel_meters[$i]); + +if($preview) + panel_meters(); diff --git a/tests/png/panel_meters.png b/tests/png/panel_meters.png new file mode 100644 index 0000000..343cd95 Binary files /dev/null and b/tests/png/panel_meters.png differ diff --git a/vitamins/led_meter.scad b/vitamins/led_meter.scad index 5d2ef79..981b78c 100644 --- a/vitamins/led_meter.scad +++ b/vitamins/led_meter.scad @@ -128,6 +128,7 @@ module meter_bezel(type) { //! Generate the STL for the meter bezel square([l + 2 * clearance, w + 2 * clearance], center = true); } + translate([0, -meter_pos(type)]) meter_hole_positions(type) cylinder(r = meter_hole_radius(type), h = h + meter_pcb_size(type).z * 2); diff --git a/vitamins/panel_meter.scad b/vitamins/panel_meter.scad new file mode 100644 index 0000000..bf0ac8a --- /dev/null +++ b/vitamins/panel_meter.scad @@ -0,0 +1,110 @@ +// +// NopSCADlib Copyright Chris Palmer 2020 +// 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 . +// + +// +//! Panel mounted digital meter modules +//! +//! Notes on the DSN_VC288: +//! +//! * The tabs aren't modelled because they can be fully retracted if the PCB is removed. +//! * The current connector isn't moddelled as it is awkwardly tall. I remove it and solder wires instead. +// +include <../utils/core/core.scad> + +use <../utils/dogbones.scad> +use + +function pmeter_size(type) = type[2]; //! Body size including bezel height +function pmeter_bezel(type) = type[3]; //! Bezel size +function pmeter_bezel_r(type) = type[4]; //! Bezel radius +function pmeter_bevel(type) = type[5]; //! Bezel bevel inset and start height +function pmeter_aperture(type) = type[6]; //! Aperture length, width and bevel +function pmeter_tab(type) = type[7]; //! Tab size +function pmeter_tab_z(type) = type[8]; //! Tab vertical position +function pmeter_thickness(type) = type[9]; //! Wall thickness if not closed +function pmeter_pcb(type) = type[10]; //! Optional PCB for open types +function pmeter_pcb_z(type) = type[11]; //! Distance of PCB from the back + +function pmeter_depth(type) = pmeter_size(type).z - pmeter_bezel(type).z; //! Depth below bezel + +module panel_meter(type) { //! Draw panel mounted LCD meter module + vitamin(str("panel_meter(", type[0], "): ", type[1])); + size = pmeter_size(type); + bezel = pmeter_bezel(type); + bevel = pmeter_bevel(type); + t = pmeter_thickness(type); + r = pmeter_bezel_r(type); + h = size.z - bezel.z; + app = pmeter_aperture(type); + tab = pmeter_tab(type); + tab_z = pmeter_tab_z(type); + pcb = pmeter_pcb(type); + + color("#94A7AB") + cube([app.x, app.y, 3 * eps], center = true); + + color(grey30) union() { + difference() { + hull() { + rounded_rectangle([bezel.x - 2 * bevel.x, bezel.y - 2 * bevel.x, bezel.z], r - bevel.x, center = false); + rounded_rectangle([bezel.x, bezel.y, bevel[1]],r, center = false); + } + hull() { + translate_z(bezel.z + eps) { + cube([app.x + app.z, app.y + app.z, eps], center = true); + + cube([app.x, app.y, bezel.z * 2], center = true); + } + } + } + + translate_z(-h) + linear_extrude(h) + difference() { + square([size.x, size.y], center = true); + + if(t) + square([size.x - 2 * t, size.y - 2 * t], center = true); + } + + if(tab) + for(end = [-1, 1]) + translate([end * (size.x / 2 + tab.x / 2), 0, -size.z + tab_z]) + rotate([0, end * 10, 0]) + translate_z(tab.z / 2) + cube([tab.x, tab.y, tab.z], center = true); + + } + if(pcb) + vflip() + translate_z(h - pcb_thickness(pcb) - pmeter_pcb_z(type)) + pcb(pcb); +} + +module panel_meter_cutout(type, h = 0) { //! Make panel cutout + size = pmeter_size(type); + tab = pmeter_tab(type); + extrude_if(h) + offset(0.2) { + dogbone_square([size.x, size.y]); + + if(tab) + rounded_square([size.x + 2 * tab.x, tab.y + 2 * cnc_bit_r], r = cnc_bit_r, center = true); + } +} diff --git a/vitamins/panel_meters.scad b/vitamins/panel_meters.scad new file mode 100644 index 0000000..ec6ced4 --- /dev/null +++ b/vitamins/panel_meters.scad @@ -0,0 +1,38 @@ +// +// NopSCADlib Copyright Chris Palmer 2020 +// 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 . +// + +// +//! Panel mounted digital meter modules +// + +PZEM021 = ["PZEM021", "Peacefair PZEM-021 AC digital multi-function meter", [84.6, 44.7, 24.4], [89.6, 49.6, 2.3], 1.5, [1, 1], [51, 30, 5], [1.3, 10, 6], 15.5, 0]; +PZEM001 = ["PZEM001", "Peacefair PZEM-001 AC digital multi-function meter", [62 , 52.5, 24.4], [67, 57.5, 2.0], 1.5, [1, 1], [36, 36, 0], [1.2, 10, 6], 15.5, 0]; + +DSN_VC288PCB = ["", "", 41, 21, 1, 0, 0, 0, "green", false, [], + [ [ 5, -3, 0, "jst_xh", 3], + + ], + []]; + +DSN_VC288 = ["DSN_VC288","DSN-VC288 DC 100V 10A Voltmeter ammeter", [45.3, 26, 17.4], [47.8, 28.8, 2.5], 0, [1, 1.8], [36, 18, 2.5], [], 0, 2, + DSN_VC288PCB, 5]; + +panel_meters = [DSN_VC288, PZEM021, PZEM001]; + +use