Fixed orientation of inverted pulley.

Added stl and assembly calls.
Same render handling as pulleys.
Updated pics and readme.
This commit is contained in:
Chris Palmer 2021-01-10 12:11:03 +00:00
parent a8b634de39
commit c3fc352288
4 changed files with 160 additions and 66 deletions

View File

@ -1,5 +1,5 @@
//
// NopSCADlib Copyright Chris Palmer 2018
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
@ -16,11 +16,9 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
// Printed pulleys are a remix of droftarts's (see <https://www.thingiverse.com/droftarts/designs>) Parametric Pulleys
// on Thingiverse (see <https://www.thingiverse.com/thing:16627>) and are licensed under the
// Creative Commons - Attribution - Share Alike license (see <https://creativecommons.org/licenses/by-sa/3.0/>)
//
//! Printed pulleys are a remix of droftarts's (see <https://www.thingiverse.com/droftarts/designs>) Parametric Pulleys
//! on Thingiverse (see <https://www.thingiverse.com/thing:16627>) and are licensed under the
//! Creative Commons - Attribution - Share Alike license (see <https://creativecommons.org/licenses/by-sa/3.0/>)
//
include <NopSCADlib/core.scad>
@ -28,6 +26,8 @@ include <NopSCADlib/vitamins/pulleys.scad>
printed_pulley_GT2_profile = [[0.747183,-0.5],[0.747183,0],[0.647876,0.037218],[0.598311,0.130528],[0.578556,0.238423],[0.547158,0.343077],[0.504649,0.443762],[0.451556,0.53975],[0.358229,0.636924],[0.2484,0.707276],[0.127259,0.750044],[0,0.76447],[-0.127259,0.750044],[-0.2484,0.707276],[-0.358229,0.636924],[-0.451556,0.53975],[-0.504797,0.443762],[-0.547291,0.343077],[-0.578605,0.238423],[-0.598311,0.130528],[-0.648009,0.037218],[-0.747183,0],[-0.747183,-0.5]];
function printed_pulley_inverted(type) = pulley_hub_dia(type) < pulley_flange_dia(type); //! Need to print upside down to prevent overhang
function printed_pulley_od(tooth_count, tooth_pitch, pitch_line_offset)
= tooth_count * tooth_pitch / PI - 2 * pitch_line_offset;
@ -93,79 +93,98 @@ module printed_pulley(type) { //! Draw a printable pulley
or = pulley_od(type) / 2;
screw_z = pulley_screw_z(type);
stl(str("printed_pulley_", type[0]));
module core() {
translate_z(pulley_hub_length(type) + ft)
linear_extrude(w + 1) let($fa = 1, $fs = 0.1)
if ("GT2" == str(pulley_type(type)[0], pulley_type(type)[1], pulley_type(type)[2]))
difference() {
printed_pulley_GT2_teeth(type);
circle(r = pulley_bore(type) / 2);
circle(d = pulley_bore(type));
}
else
difference() {
circle(or);
printed_pulley_teeth(type);
circle(r = pulley_bore(type) / 2);
circle(d = pulley_bore(type));
}
}
module screw_holes() {
if (pulley_screws(type))
if(pulley_screws(type))
translate_z(screw_z)
for(i = [0 : pulley_screws(type) - 1])
rotate([-90, 180, i * -90])
teardrop(r = screw_pilot_hole(pulley_screw(type)), h = pulley_flange_dia(type)/2 + 1, center=false);
teardrop(r = screw_pilot_hole(pulley_screw(type)), h = pulley_flange_dia(type) / 2 + 1, center = false);
}
// hub
if (hl)
translate_z(pulley_hub_dia(type) >= pulley_flange_dia(type) ? 0 : hl + w + 2 * ft)
render_if(screw_z && screw_z < hl)
difference() {
linear_extrude(hl)
difference() {
circle(r = pulley_hub_dia(type) / 2);
circle(r = pulley_bore(type) / 2);
}
if (screw_z < hl)
module hub()
linear_extrude(hl)
difference() {
circle(d= pulley_hub_dia(type));
circle(d = pulley_bore(type));
}
translate_z(printed_pulley_inverted(type) ? - hl : 0) {
// hub
if(hl)
translate_z(printed_pulley_inverted(type) ? hl + w + 2 * ft : 0)
if(screw_z && screw_z < hl)
render() difference() {
hub();
screw_holes();
}
else
hub();
// bottom flange
translate_z(hl)
linear_extrude(ft)
difference() {
circle(d = pulley_flange_dia(type));
circle(d = pulley_bore(type));
}
// bottom flange
translate_z(hl)
linear_extrude(ft)
difference() {
circle(d = pulley_flange_dia(type));
circle(r = pulley_bore(type) / 2);
}
// top flange
translate_z(hl + ft + w) {
// inner part, supported by core
linear_extrude(ft)
difference() {
circle(r = or);
circle(r = pulley_bore(type) / 2);
}
// outer part at 45 degrees for printing
rotate_extrude()
translate([or -eps , ft])
vflip()
right_triangle(ft, ft);
}
// top flange
translate_z(hl + ft + w) {
// inner part, supported by core
linear_extrude(ft)
difference() {
circle(r = or);
circle(d = pulley_bore(type));
}
// outer part at 45 degrees for printing
rotate_extrude()
translate([or -eps , ft])
vflip()
right_triangle(ft, ft);
}
difference() { // T5 pulleys have screws through the teeth
render_if(screw_z && screw_z > hl)
core();
if (pulley_screw_z(type) > hl)
translate_z(pulley_hub_dia(type) >= pulley_flange_dia(type) ? 0 : hl)
screw_holes();
if(screw_z && screw_z > hl)
render()
difference() { // T5 pulleys have screws through the teeth
core();
translate_z(printed_pulley_inverted(type) ? hl : 0)
screw_holes();
}
else
core();
}
}
module printed_pulley_assembly(type, colour) { //! Draw a printed pulley with its grub screws in place
module printed_pulley_assembly(type, colour = pp1_colour) //! Draw a printed pulley with its grub screws in place
assembly(str("printed_pulley_", type[0])) {
translate_z(pulley_offset(type)) {
color(colour)
printed_pulley(type);
stl_colour(colour)
if(printed_pulley_inverted(type))
translate_z(pulley_height(type))
hflip()
printed_pulley(type);
else
printed_pulley(type);
if (pulley_screws(type))
translate_z(pulley_screw_z(type))

View File

@ -37,12 +37,12 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Rounded_right_triangle">Rounded_right_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Tubings">Tubings</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 = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#IECs">IECs</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td></td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#IECs">IECs</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td></td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td></td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
</table>
@ -5041,6 +5041,73 @@ It can also have printed feet on the base with the screws doubling up to hold th
| 1 | box2_assembly |
<a href="#top">Top</a>
---
<a name="Printed_pulleys"></a>
## Printed_pulleys
Printed pulleys are a remix of droftarts's (see <https://www.thingiverse.com/droftarts/designs>) Parametric Pulleys
on Thingiverse (see <https://www.thingiverse.com/thing:16627>) and are licensed under the
Creative Commons - Attribution - Share Alike license (see <https://creativecommons.org/licenses/by-sa/3.0/>)
[printed/printed_pulleys.scad](printed/printed_pulleys.scad) Implementation.
[tests/printed_pulleys.scad](tests/printed_pulleys.scad) Code for this example.
### Functions
| Function | Description |
|:--- |:--- |
| `printed_pulley_inverted(type)` | Need to print upside down to prevent overhang |
### Modules
| Module | Description |
|:--- |:--- |
| `printed_pulley(type)` | Draw a printable pulley |
| `printed_pulley_assembly(type, colour = pp1_colour)` | Draw a printed pulley with its grub screws in place |
| `printed_pulley_teeth(type)` | Draw the pulley's teeth |
![printed_pulleys](tests/png/printed_pulleys.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `screw(M3_grub_screw, 3)` | Screw M3 grub x 3mm |
| 2 | `screw(M3_grub_screw, 4.5)` | Screw M3 grub x 4.5mm |
| 2 | `screw(M3_grub_screw, 4)` | Screw M3 grub x 4mm |
| 4 | `screw(M3_grub_screw, 6)` | Screw M3 grub x 6mm |
| 1 | `screw(M4_grub_screw, 6)` | Screw M4 grub x 6mm |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | printed_pulley_GT2x12_pulley.stl |
| 1 | printed_pulley_GT2x16_plain_idler.stl |
| 1 | printed_pulley_GT2x16_pulley.stl |
| 1 | printed_pulley_GT2x16_toothed_idler.stl |
| 1 | printed_pulley_GT2x16x7_plain_idler.stl |
| 1 | printed_pulley_GT2x20_plain_idler.stl |
| 1 | printed_pulley_GT2x20_toothed_idler.stl |
| 1 | printed_pulley_GT2x20ob_pulley.stl |
| 1 | printed_pulley_GT2x20um_pulley.stl |
| 1 | printed_pulley_T2p5x16_pulley.stl |
| 1 | printed_pulley_T5x10_pulley.stl |
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | printed_pulley_GT2x12_pulley_assembly |
| 1 | printed_pulley_GT2x16_plain_idler_assembly |
| 1 | printed_pulley_GT2x16_pulley_assembly |
| 1 | printed_pulley_GT2x16_toothed_idler_assembly |
| 1 | printed_pulley_GT2x16x7_plain_idler_assembly |
| 1 | printed_pulley_GT2x20_plain_idler_assembly |
| 1 | printed_pulley_GT2x20_toothed_idler_assembly |
| 1 | printed_pulley_GT2x20ob_pulley_assembly |
| 1 | printed_pulley_GT2x20um_pulley_assembly |
| 1 | printed_pulley_T2p5x16_pulley_assembly |
| 1 | printed_pulley_T5x10_pulley_assembly |
<a href="#top">Top</a>
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -23,15 +23,23 @@ include <../printed/printed_pulleys.scad>
use <../utils/layout.scad>
module PrintedPulley_test() {
layout([for (p = pulleys) pulley_flange_dia(p)]) {
rotate(-135)
printed_pulley_assembly(pulleys[$i]);
translate([0, 20, 0])
rotate(45)
pulley_assembly(pulleys[$i]);
module printed_pulley_test(show_metal = false) {
layout([for (p = pulleys) pulley_flange_dia(p)]) let(p = pulleys[$i]) {
rotate(-145)
if($preview)
printed_pulley_assembly(p);
else
printed_pulley(p);
if(show_metal)
not_on_bom()
translate([0, 20])
rotate(-145)
pulley_assembly(p);
}
}
if ($preview)
PrintedPulley_test();
if($preview)
printed_pulley_test(true);
else
printed_pulley_test();