diff --git a/lib.scad b/lib.scad index 50f8c39..80ff86a 100644 --- a/lib.scad +++ b/lib.scad @@ -61,6 +61,7 @@ include include include include +include use use diff --git a/libtest.png b/libtest.png index ddbeec6..c21be3d 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/libtest.scad b/libtest.scad index 5605e20..7de27e2 100644 --- a/libtest.scad +++ b/libtest.scad @@ -34,6 +34,7 @@ use use use use +use use use use @@ -300,6 +301,9 @@ steppers_y = batteries_y + 70; translate([x3, veroboard_y]) veroboard_test(); +translate([x3 + 70, veroboard_y + 30]) + geared_steppers(); + translate([x3, d_connectors_y]) d_connectors(); diff --git a/readme.md b/readme.md index 126d663..0d1b151 100644 --- a/readme.md +++ b/readme.md @@ -30,21 +30,22 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa D_connectors Rockers Flat_hinge Round Fans Rod Foot Rounded_cylinder Fuseholder Screws Handle Rounded_polygon - Green_terminals Sealing_strip Psu_shroud Sector - Hot_ends Sheets Ribbon_clamp Sweep - Iecs Spades Screw_knob Tube - Inserts Spools Socket_box - Jack Springs Ssr_shroud - Ldrs Ssrs Strap_handle - Leadnuts Stepper_motors - Leds Toggles - Light_strips Transformers - Linear_bearings Tubings - Mains_sockets Variacs - Meter Veroboard - Microswitches Washers - Microview Wire - Modules Zipties + Geared_steppers Sealing_strip Psu_shroud Sector + Green_terminals Sheets Ribbon_clamp Sweep + Hot_ends Spades Screw_knob Tube + Iecs Spools Socket_box + Inserts Springs Ssr_shroud + Jack Ssrs Strap_handle + Ldrs Stepper_motors + Leadnuts Toggles + Leds Transformers + Light_strips Tubings + Linear_bearings Variacs + Mains_sockets Veroboard + Meter Washers + Microswitches Wire + Microview Zipties + Modules Nuts @@ -684,6 +685,57 @@ Can draw three styles: solid, open frame and open frame with screw bosses. | 1 | ```fuseholder(6)``` | Fuse holder 20mm | +Top + +--- + +## Geared_steppers +Geared tin can steppers + + +[vitamins/geared_steppers.scad](vitamins/geared_steppers.scad) Object definitions. + +[vitamins/geared_stepper.scad](vitamins/geared_stepper.scad) Implementation. + +[tests/geared_steppers.scad](tests/geared_steppers.scad) Code for this example. + +### Properties +| Function | Description | +|:--- |:--- | +| ```gs_boss_d(type)``` | Boss around the shaft diameter | +| ```gs_boss_h(type)``` | Boss around the shaft height | +| ```gs_bulge2_d(type)``` | Plastic rear bulge depth from centre | +| ```gs_bulge2_h(type)``` | Plastic rear bulge height | +| ```gs_bulge2_w(type)``` | Plastic rear bulge width | +| ```gs_bulge_d(type)``` | Plastic bulge depth from centre | +| ```gs_bulge_h(type)``` | Plastic bulge height | +| ```gs_bulge_w(type)``` | Plastic bulge width | +| ```gs_diameter(type)``` | Can diameter | +| ```gs_flat_length(type)``` | Shaft flat length | +| ```gs_height(type)``` | Can height | +| ```gs_hole_d(type)``` | Screw hole diameter | +| ```gs_lug_t(type)``` | Screw lug thickness | +| ```gs_lug_w(type)``` | Screw lug width | +| ```gs_offset(type)``` | Offset of the shaft from the centre of the can | +| ```gs_pitch(type)``` | Screw pitch | +| ```gs_shaft_d(type)``` | Shaft diameter | +| ```gs_shaft_flat(type)``` | Shaft width across the flats | +| ```gs_shaft_length(type)``` | Shaft length | + +### Modules +| Module | Description | +|:--- |:--- | +| ```geared_stepper(type)``` | Draw the specified geared stepper | +| ```geared_stepper_screw_positions(type)``` | Place children at the screw positions | + +![geared_steppers](tests/png/geared_steppers.png) + +### Vitamins +| Qty | Module call | BOM entry | +| ---:|:--- |:---| +| 1 | ```geared_stepper(28BYJ_48)``` | Geared stepper - 28BYJ-48 5V | + + Top --- diff --git a/tests/geared_steppers.scad b/tests/geared_steppers.scad new file mode 100644 index 0000000..ba9ef57 --- /dev/null +++ b/tests/geared_steppers.scad @@ -0,0 +1,27 @@ +// +// NopSCADlib Copyright Chris Palmer 2019 +// 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 <../vitamins/geared_steppers.scad> + +use <../utils/layout.scad> + +module geared_steppers() + layout([for(g = geared_steppers) gs_diameter(g)], 5) + geared_stepper(geared_steppers[$i]); + +geared_steppers(); diff --git a/tests/png/geared_steppers.png b/tests/png/geared_steppers.png new file mode 100644 index 0000000..8f76076 Binary files /dev/null and b/tests/png/geared_steppers.png differ diff --git a/tests/png/pcbs.png b/tests/png/pcbs.png index d106cde..77f5476 100644 Binary files a/tests/png/pcbs.png and b/tests/png/pcbs.png differ diff --git a/vitamins/geared_stepper.scad b/vitamins/geared_stepper.scad new file mode 100644 index 0000000..30d2c4e --- /dev/null +++ b/vitamins/geared_stepper.scad @@ -0,0 +1,114 @@ +// +// NopSCADlib Copyright Chris Palmer 2019 +// 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 . +// + +// +//! Geared tin can steppers +// +include <../core.scad> +use <../utils/rounded_cylinder.scad> +use <../utils/round.scad> + +function gs_diameter(type) = type[2]; //! Can diameter +function gs_height(type) = type[3]; //! Can height +function gs_pitch(type) = type[4]; //! Screw pitch +function gs_lug_w(type) = type[5]; //! Screw lug width +function gs_lug_t(type) = type[6]; //! Screw lug thickness +function gs_hole_d(type) = type[7]; //! Screw hole diameter +function gs_offset(type) = type[8]; //! Offset of the shaft from the centre of the can +function gs_boss_d(type) = type[9]; //! Boss around the shaft diameter +function gs_boss_h(type) = type[10]; //! Boss around the shaft height +function gs_shaft_d(type) = type[11]; //! Shaft diameter +function gs_shaft_flat(type) = type[12]; //! Shaft width across the flats +function gs_shaft_length(type) = type[13]; //! Shaft length +function gs_flat_length(type) = type[14]; //! Shaft flat length +function gs_bulge_w(type) = type[15]; //! Plastic bulge width +function gs_bulge_d(type) = type[16]; //! Plastic bulge depth from centre +function gs_bulge_h(type) = type[17]; //! Plastic bulge height +function gs_bulge2_w(type) = type[18]; //! Plastic rear bulge width +function gs_bulge2_d(type) = type[19]; //! Plastic rear bulge depth from centre +function gs_bulge2_h(type) = type[20]; //! Plastic rear bulge height + +module geared_stepper_screw_positions(type) //! Place children at the screw positions + for(side = [-1, 1]) + translate([side * gs_pitch(type) / 2, -gs_offset(type)]) + children(); + +module geared_stepper(type) { //! Draw the specified geared stepper + vitamin(str("geared_stepper(", type[0], "): Geared stepper - ", type[1])); + + radius = gs_diameter(type) / 2; + height = gs_height(type); + offset = gs_offset(type); + color("silver") { + translate([0, -offset]) + rounded_cylinder(r = radius, h = height, r2 = 1); + + cylinder(d = gs_boss_d(type), h = 2 * gs_boss_h(type), center = true); + + linear_extrude(height = gs_lug_t(type)) + difference() { + hull() + geared_stepper_screw_positions(type) + circle(d = gs_lug_w(type)); + + geared_stepper_screw_positions(type) + circle(d = gs_hole_d(type)); + } + + translate([0, -offset - radius, eps]) + cube([gs_bulge_w(type) - 2, 2 * (gs_bulge_d(type) - radius) - 2, 2 * eps], center = true); + } + vflip() + color(brass) { + d = gs_shaft_d(type); + h = gs_shaft_length(type); + linear_extrude(height = h) + intersection() { + circle(d = d); + + square([d + 1, gs_shaft_flat(type)], center = true); + } + + cylinder(d = d, h = h - gs_flat_length(type)); + } + + color("skyblue") { + h1 = gs_bulge_h(type); + translate([0, - offset - radius, eps]) + rounded_rectangle([gs_bulge_w(type), 2 * (gs_bulge_d(type) - radius), h1], 0.5, center = false); + + h2 = gs_bulge2_h(type); + translate([0, - offset, h1 + 1 - h2]) + linear_extrude(height = h2) + round(0.5) + intersection() { + circle(gs_bulge2_d(type)); + + translate([0, -50]) + square([gs_bulge2_w(type), 100], center = true); + } + } + + translate_z(2.5) + for(i = [0 : 4]) + translate([i - 2.5, 0]) + rotate([90, 0, 0]) + color(["yellow", "orange", "red", "pink", "blue"][i]) + cylinder(d = 1, h = radius + offset + 10); +} diff --git a/vitamins/geared_steppers.scad b/vitamins/geared_steppers.scad new file mode 100644 index 0000000..917e89c --- /dev/null +++ b/vitamins/geared_steppers.scad @@ -0,0 +1,27 @@ +// +// NopSCADlib Copyright Chris Palmer 2019 +// 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 . +// + +// +//! Geared tin can steppers +// +28BYJ_48 = ["28BYJ_48", "28BYJ-48 5V", 28, 19, 35, 7, 0.85, 4.2, 8, 9, 1.5, 5, 3, 10, 6, 14.7, 17, 16.5, 17.7, 15.5, 13.8 ]; + +geared_steppers = [28BYJ_48]; + +use diff --git a/vitamins/pcbs.scad b/vitamins/pcbs.scad index a48a560..deb0a82 100644 --- a/vitamins/pcbs.scad +++ b/vitamins/pcbs.scad @@ -275,6 +275,10 @@ PI_IO = ["PI_IO", "PI_IO V2", 35.56, 25.4, 1.6, 0, 0, 0, "green", tru [(3.4 - 2.7) * 25.4, (4.5 - 4.15) * 25.4, 0, "2p54socket", 13, 2, true], ], []]; +ZC_A0591 = ["ZC_A0591", "ZC-A0591 ULN2003 driver PCB", 35, 32, 1.6, 0, 2.5, 0, "green", false, [[2.25, 3.25], [-2.25, 3.25], [2.25, -3.25], [-2.25, -3.25] ], + [], [], [], [], M2p5_pan_screw]; + + PERF80x20 = ["PERF80x20", "Perfboard 80 x 20mm", 80, 20, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]]; PERF70x50 = ["PERF70x50", "Perfboard 70 x 50mm", 70, 50, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]]; @@ -287,6 +291,6 @@ PERF74x51 = ["PERF74x51", "Perfboard 74 x 51mm", 74, 51, 1.0, 0, 3.0, 0, "sienna PSU12V1A = ["PSU12V1A", "PSU 12V 1A", 67, 31, 1.7, 0, 3.9, 0, "green", true, [[3.5, 3.5], [-3.5, 3.5], [-3.5, -3.5], [3.5, -3.5]], [], []]; -pcbs = [ExtruderPCB, PI_IO, RPI3, ArduinoUno3, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi]; +pcbs = [ExtruderPCB, PI_IO, RPI3, ArduinoUno3, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi, ZC_A0591]; use