mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2025-02-14 06:33:45 -05:00
Merge branch 'martinbudden-stepper_motor_jst_connector'
This commit is contained in:
commit
23cbadf6df
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 818 KiB After Width: | Height: | Size: 819 KiB |
@ -3422,7 +3422,7 @@ NEMA stepper motor model.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```NEMA(type, shaft_angle = 0)``` | Draw specified NEMA stepper motor |
|
||||
| ```NEMA(type, shaft_angle = 0, jst_connector = false)``` | Draw specified NEMA stepper motor |
|
||||
| ```NEMA_outline(type)``` | 2D outline |
|
||||
| ```NEMA_screw_positions(type, n = 4)``` | Positions children at the screw holes |
|
||||
| ```NEMA_screws(type, screw, n = 4, screw_length = 8, earth = undef)``` | Place screws and optional earth tag |
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 108 KiB |
@ -24,7 +24,7 @@ use <../utils/layout.scad>
|
||||
module stepper_motors()
|
||||
layout([for(s = stepper_motors) NEMA_width(s)], 5) {
|
||||
rotate(180)
|
||||
NEMA(stepper_motors[$i]);
|
||||
NEMA(stepper_motors[$i], 0, $i > 1 && $i < 5);
|
||||
|
||||
translate_z(4)
|
||||
NEMA_screws(stepper_motors[$i], M3_pan_screw, n = $i, earth = $i > 4 ? undef : $i - 1);
|
||||
|
@ -23,6 +23,7 @@
|
||||
include <../core.scad>
|
||||
include <ring_terminals.scad>
|
||||
|
||||
include <../vitamins/pin_headers.scad>
|
||||
use <../utils/tube.scad>
|
||||
use <../utils/thread.scad>
|
||||
use <washer.scad>
|
||||
@ -39,7 +40,6 @@ function NEMA_shaft_length(type)= type[8]; //! Shaft length above the face, if a
|
||||
function NEMA_hole_pitch(type) = type[9]; //! Screw hole pitch
|
||||
function NEMA_holes(type) = [-NEMA_hole_pitch(type) / 2, NEMA_hole_pitch(type) / 2]; //! Screw positions for for loop
|
||||
function NEMA_big_hole(type) = NEMA_boss_radius(type) + 0.2; //! Clearance hole for the big boss
|
||||
|
||||
stepper_body_colour = "black";
|
||||
stepper_cap_colour = grey(50);
|
||||
stepper_machined_colour = grey(90);
|
||||
@ -52,7 +52,7 @@ module NEMA_outline(type) //! 2D outline
|
||||
circle(NEMA_radius(type));
|
||||
}
|
||||
|
||||
module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
|
||||
module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified NEMA stepper motor
|
||||
side = NEMA_width(type);
|
||||
length = NEMA_length(type);
|
||||
body_rad = NEMA_body_radius(type);
|
||||
@ -92,12 +92,23 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
|
||||
cap_shape(1);
|
||||
}
|
||||
|
||||
color(stepper_cap_colour) // aluminium end caps
|
||||
tabSize = [16, 4, 2.5];
|
||||
color(stepper_cap_colour) { // aluminium end caps
|
||||
for(end = [-1, 1])
|
||||
translate_z(-length / 2 + end * (length - cap) / 2)
|
||||
linear_extrude(cap, center = true)
|
||||
cap_shape(end);
|
||||
|
||||
if(jst_connector)
|
||||
translate([-tabSize.x / 2, side / 2, -length])
|
||||
cube(tabSize);
|
||||
}
|
||||
|
||||
if(jst_connector)
|
||||
translate([0, side / 2 - 2, -length + tabSize.z + 5.75 / 2])
|
||||
rotate([-90, 0, 0])
|
||||
jst_xh_header(jst_xh_header, 6);
|
||||
|
||||
if(show_threads)
|
||||
for(x = NEMA_holes(type), y = NEMA_holes(type))
|
||||
translate([x, y, -cap / 2])
|
||||
@ -111,15 +122,16 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
|
||||
cylinder(r = shaft_rad, h = shaft + 5); // shaft
|
||||
else
|
||||
not_on_bom()
|
||||
leadscrew(shaft_rad * 2, shaft.x + 5, shaft.y, shaft.z, center = false)
|
||||
leadscrew(shaft_rad * 2, shaft.x + 5, shaft.y, shaft.z, center = false);
|
||||
|
||||
translate([0, side / 2, -length + cap / 2])
|
||||
rotate([90, 0, 0])
|
||||
for(i = [0 : 3])
|
||||
rotate(225 + i * 90)
|
||||
color(["red", "blue","green","black"][i])
|
||||
translate([1, 0, 0])
|
||||
cylinder(r = 1.5 / 2, h = 12, center = true);
|
||||
if(!jst_connector)
|
||||
translate([0, side / 2, -length + cap / 2])
|
||||
rotate([90, 0, 0])
|
||||
for(i = [0 : 3])
|
||||
rotate(225 + i * 90)
|
||||
color(["red", "blue","green","black"][i])
|
||||
translate([1, 0, 0])
|
||||
cylinder(r = 1.5 / 2, h = 12, center = true);
|
||||
}
|
||||
|
||||
module NEMA_screw_positions(type, n = 4) { //! Positions children at the screw holes
|
||||
|
@ -23,13 +23,13 @@
|
||||
|
||||
// corner body boss boss shaft
|
||||
// side, length, radius, radius, radius, depth, shaft, length, holes
|
||||
NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31 ];
|
||||
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31 ];
|
||||
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31 ];
|
||||
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31 ];
|
||||
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31 ];
|
||||
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26 ];
|
||||
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1 ];
|
||||
NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31];
|
||||
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31];
|
||||
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31];
|
||||
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31];
|
||||
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31];
|
||||
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26];
|
||||
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1];
|
||||
|
||||
stepper_motors = [NEMA14, NEMA16, NEMA17S, NEMA17M, NEMA17, NEMA23];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user