1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-04-20 22:51:57 +02:00

Added NEMA8 and NEMA8BH stepper motors.

Steppers can now have dual shafts, hollow shafts and black end caps.
This commit is contained in:
Chris Palmer 2021-08-31 22:43:37 +01:00
parent 540f841163
commit ef2102420b
8 changed files with 103 additions and 51 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 KiB

After

Width:  |  Height:  |  Size: 907 KiB

View File

@ -3635,15 +3635,20 @@ NEMA stepper motor model.
### Properties
| Function | Description |
|:--- |:--- |
| `NEMA_black_caps(type)` | End caps are black |
| `NEMA_body_radius(type)` | Body radius |
| `NEMA_boss_height(type)` | Boss height |
| `NEMA_boss_radius(type)` | Boss around the spindle radius |
| `NEMA_cap_heights(type)` | Height of the end cap at the corner and the side |
| `NEMA_end_connector(type)` | If has a connector then plug goes in the end rather than the side |
| `NEMA_hole_pitch(type)` | Screw hole pitch |
| `NEMA_length(type)` | Body length |
| `NEMA_radius(type)` | End cap radius |
| `NEMA_shaft_bore(type)` | Hollow shaft in non-zero |
| `NEMA_shaft_dia(type)` | Shaft diameter |
| `NEMA_shaft_length(type)` | Shaft length above the face, if a list then a leadscrew: length, lead, starts |
| `NEMA_shaft_length2(type)` | Rear shaft length if non-zero |
| `NEMA_thread_d(type)` | Screw hole diameter |
| `NEMA_width(type)` | Width of the square face |
### Functions
@ -3674,6 +3679,8 @@ NEMA stepper motor model.
| 1 | `NEMA(NEMA17M)` | Stepper motor NEMA17 x 40mm |
| 1 | `NEMA(NEMA17)` | Stepper motor NEMA17 x 47mm |
| 1 | `NEMA(NEMA23)` | Stepper motor NEMA22 x 51.2mm |
| 1 | `NEMA(NEMA8)` | Stepper motor NEMA8 x 30mm |
| 1 | `NEMA(NEMA8BH)` | Stepper motor NEMA8 x 30mm |
| 16 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 20 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

@ -22,12 +22,12 @@ include <../vitamins/stepper_motors.scad>
use <../utils/layout.scad>
module stepper_motors()
layout([for(s = stepper_motors) NEMA_width(s)], 5, no_offset = true) let(m = stepper_motors[$i]) {
layout([for(s = stepper_motors) NEMA_width(s)], 5, no_offset = false) let(m = stepper_motors[$i]) {
rotate(180)
NEMA(m, 0, m == NEMA17P || m == NEMA17M || m == NEMA17M8);
NEMA(m, 0, in([NEMA17P, NEMA17M, NEMA17M8, NEMA8, NEMA8BH], m));
translate_z(4)
NEMA_screws(m, M3_pan_screw, n = $i, earth = $i > 4 ? undef : $i - 1);
NEMA_screws(m, M3_pan_screw, n = $i - 2, earth = $i > 6 ? undef : $i - 3);
}
if($preview)

View File

@ -25,7 +25,9 @@ include <../utils/core/core.scad>
module ring(or, ir) //! Create a ring with specified external and internal radii
difference() {
circle4n(or);
circle4n(ir);
if(ir > 0)
circle4n(ir);
}
module tube(or, ir, h, center = true) //! Create a tube with specified external and internal radii and height `h`

View File

@ -30,20 +30,25 @@ use <../utils/round.scad>
use <washer.scad>
use <rod.scad>
function NEMA_width(type) = type[1]; //! Width of the square face
function NEMA_length(type) = type[2]; //! Body length
function NEMA_radius(type) = type[3]; //! End cap radius
function NEMA_body_radius(type) = type[4]; //! Body radius
function NEMA_boss_radius(type) = type[5]; //! Boss around the spindle radius
function NEMA_boss_height(type) = type[6]; //! Boss height
function NEMA_shaft_dia(type) = type[7]; //! Shaft diameter
function NEMA_shaft_length(type)= type[8]; //! Shaft length above the face, if a list then a leadscrew: length, lead, starts
function NEMA_hole_pitch(type) = type[9]; //! Screw hole pitch
function NEMA_cap_heights(type) = type[10]; //! Height of the end cap at the corner and the side
function NEMA_width(type) = type[1]; //! Width of the square face
function NEMA_length(type) = type[2]; //! Body length
function NEMA_radius(type) = type[3]; //! End cap radius
function NEMA_body_radius(type) = type[4]; //! Body radius
function NEMA_boss_radius(type) = type[5]; //! Boss around the spindle radius
function NEMA_boss_height(type) = type[6]; //! Boss height
function NEMA_shaft_dia(type) = type[7]; //! Shaft diameter
function NEMA_shaft_length(type) = type[8]; //! Shaft length above the face, if a list then a leadscrew: length, lead, starts
function NEMA_hole_pitch(type) = type[9]; //! Screw hole pitch
function NEMA_cap_heights(type) = type[10]; //! Height of the end cap at the corner and the side
function NEMA_thread_d(type) = type[11]; //! Screw hole diameter
function NEMA_black_caps(type) = type[12]; //! End caps are black
function NEMA_end_connector(type)= type[13]; //! If has a connector then plug goes in the end rather than the side
function NEMA_shaft_length2(type)= type[14]; //! Rear shaft length if non-zero
function NEMA_shaft_bore(type) = type[15]; //! Hollow shaft in non-zero
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_body_colour = grey(20);
stepper_cap_colour = grey(50);
stepper_machined_colour = grey(90);
@ -65,11 +70,21 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
cap = NEMA_cap_heights(type)[1];
cap2 = NEMA_cap_heights(type)[0];
vitamin(str("NEMA(", type[0], "): Stepper motor NEMA", round(NEMA_width(type) / 2.54), " x ", length, "mm"));
thread_d = 3; // Is this always the case?
thread_d = NEMA_thread_d(type);
corner_r = 0.9;
bore = NEMA_shaft_bore(type);
end_connector = NEMA_end_connector(type) && jst_connector;
header = end_connector ? jst_zh_header : jst_ph_header;
socket_size = hdr_box_size(header);
pcb_thickness = 1.6;
tabSize = [16, 4, cap - hdr_ra_height(header) - pcb_thickness];
pins = 6;
end_conn_w = socket_size.x + hdr_pitch(header) * (pins - 1);
end_conn_inset = socket_size.y - 2;
module cap_shape(end)
round(0.5, $fn = 32) difference() {
intersection() {
difference() {
round(corner_r, $fn = 32) intersection() {
square([side, side], center = true);
circle(NEMA_radius(type), $fn = 360);
@ -78,15 +93,26 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
for(x = NEMA_holes(type), y = NEMA_holes(type))
translate([x, y])
circle(d = thread_d);
if(bore)
circle(d = bore + eps);
if(end_connector && end < 0)
translate([0, side / 2])
square([end_conn_w, end_conn_inset * 2], true);
}
color(stepper_body_colour) // black laminations
translate_z(-length / 2)
linear_extrude(length - cap * 2, center = true)
intersection() {
square([side, side], center = true);
difference() {
round(corner_r, $fn = 32)
intersection() {
square([side, side], center = true);
circle(body_rad);
circle(body_rad);
}
circle(d = bore + eps);
}
color(stepper_machined_colour) {
@ -96,11 +122,8 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
cap_shape(1);
}
pcb_thickness = 1.6;
header = jst_ph_header;
socket_size = hdr_box_size(header);
tabSize = [16, 4, cap - hdr_ra_height(header) - pcb_thickness];
color(stepper_cap_colour) { // aluminium end caps
wing_t = 0.5; // end connector side wings
color(NEMA_black_caps(type) ? "black" : stepper_cap_colour) { // aluminium end caps
for(end = [-1, 1]) {
translate_z(-length / 2 + end * (length - cap) / 2)
linear_extrude(cap, center = true)
@ -116,20 +139,36 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
}
if(jst_connector)
translate([-tabSize.x / 2, side / 2, -length])
cube(tabSize);
if(end_connector)
for(x = [-1, 1])
translate([x * (end_conn_w / 2 + wing_t / 2), side / 2 - end_conn_inset, -length + cap / 2])
cube([wing_t, socket_size.y * 2, cap], center = true);
else
translate([-tabSize.x / 2, side / 2, -length])
cube(tabSize);
}
if(jst_connector)
translate([0, side / 2, -length + cap - hdr_ra_height(header)]) {
rotate(180)
not_on_bom()
jst_xh_header(header, 6, true);
if(jst_connector) not_on_bom()
if(end_connector) {
translate([0, side / 2 + hdr_y_offset(header) + socket_size.y / 2 - end_conn_inset, -length + socket_size.z])
rotate([180, 0, 0])
jst_xh_header(header, pins, false, smt = true);
translate_z(-pcb_thickness / 2)
color("green")
cube([socket_size.x + 5 * 2, tabSize.y * 2, pcb_thickness], true);
}
h = cap - socket_size.z;
translate([0, side / 2 + socket_size.y / 2 - end_conn_inset, -length + socket_size.z + h / 2])
color(grey(70))
cube([end_conn_w, socket_size.y, h], center = true);
}
else
translate([0, side / 2, -length + cap - hdr_ra_height(header)]) {
rotate(180)
jst_xh_header(header, pins, true, smt = true);
translate_z(-pcb_thickness / 2)
color("green")
cube([socket_size.x + 5 * 2, tabSize.y * 2, pcb_thickness], true);
}
if(show_threads)
for(x = NEMA_holes(type), y = NEMA_holes(type))
@ -137,14 +176,15 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), cap, colour = stepper_cap_colour);
shaft = NEMA_shaft_length(type);
translate_z(-5)
shaft2 = NEMA_shaft_length2(type);
translate_z(-length + eps - shaft2)
rotate(shaft_angle)
if(!is_list(shaft))
color(stepper_machined_colour)
cylinder(r = shaft_rad, h = shaft + 5); // shaft
tube(or = shaft_rad, ir = bore / 2, h = shaft + length + shaft2, center = false); // shaft
else
not_on_bom()
leadscrew(shaft_rad * 2, shaft.x + 5, shaft.y, shaft.z, center = false);
leadscrew(shaft_rad * 2, shaft.x + length + shaft2, shaft.y, shaft.z, center = false);
if(!jst_connector)
translate([0, side / 2, -length + cap / 2])

View File

@ -21,17 +21,20 @@
// NEMA stepper motor model
//
// corner body boss boss shaft
// side, length, radius, radius, radius, depth, shaft, length, holes, cap heights
NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31, [11.5, 9]];
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31, [12.5, 11]];
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31, [12.5, 11]];
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31, [8, 8]];
NEMA17P = ["NEMA17P", 42.3, 26.5, 53.6/2, 25, 11, 2, 5, 26.5, 31, [10, 8]];
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31, [8, 8]];
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26, [8, 8]];
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1, [8, 8]];
// corner body boss boss shaft cap thread black end shaft shaft
// side, length, radius, radius, radius, depth, shaft, length, holes, heights, dia, caps, conn, length2, bore
NEMA8 = ["NEMA8", 20, 30, 30/2, 20, 7.5, 1.6, 4, 6, 16, [8, 8], 2, true, true, 0, 0];
NEMA8BH = ["NEMA8BH", 20, 30, 30/2, 20, 7.5, 1.6, 5, 12, 16, [8, 8], 2, true, true, 7, 2.8];
NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31, [11.5, 9], 3, false, false, 0, 0];
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31, [12.5, 11], 3, false, false, 0, 0];
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31, [12.5, 11], 3, false, false, 0, 0];
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31, [8, 8], 3, false, false, 0, 0];
NEMA17P = ["NEMA17P", 42.3, 26.5, 53.6/2, 25, 11, 2, 5, 26.5, 31, [10, 8], 3, false, false, 0, 0];
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31, [8, 8], 3, false, false, 0, 0];
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26, [8, 8], 3, false, false, 0, 0];
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1, [8, 8], 3, false, false, 0, 0];
stepper_motors = [NEMA14, NEMA16, NEMA17P, NEMA17S, NEMA17M, NEMA17, NEMA23];
stepper_motors = [NEMA8, NEMA8BH, NEMA14, NEMA16, NEMA17P, NEMA17S, NEMA17M, NEMA17, NEMA23];
small_steppers = [];
use <stepper_motor.scad>