Made stepper motor encap paramatric.
Made connector position based on encap height and added PCB.
This commit is contained in:
parent
90047815b0
commit
9a0bad4e61
|
@ -3413,6 +3413,7 @@ NEMA stepper motor model.
|
||||||
| ```NEMA_body_radius(type)``` | Body radius |
|
| ```NEMA_body_radius(type)``` | Body radius |
|
||||||
| ```NEMA_boss_height(type)``` | Boss height |
|
| ```NEMA_boss_height(type)``` | Boss height |
|
||||||
| ```NEMA_boss_radius(type)``` | Boss around the spindle radius |
|
| ```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_hole_pitch(type)``` | Screw hole pitch |
|
| ```NEMA_hole_pitch(type)``` | Screw hole pitch |
|
||||||
| ```NEMA_length(type)``` | Body length |
|
| ```NEMA_length(type)``` | Body length |
|
||||||
| ```NEMA_radius(type)``` | End cap radius |
|
| ```NEMA_radius(type)``` | End cap radius |
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 104 KiB |
|
@ -22,12 +22,12 @@ include <../vitamins/stepper_motors.scad>
|
||||||
use <../utils/layout.scad>
|
use <../utils/layout.scad>
|
||||||
|
|
||||||
module stepper_motors()
|
module stepper_motors()
|
||||||
layout([for(s = stepper_motors) NEMA_width(s)], 5) {
|
layout([for(s = stepper_motors) NEMA_width(s)], 5) let(m = stepper_motors[$i]) {
|
||||||
rotate(180)
|
rotate(180)
|
||||||
NEMA(stepper_motors[$i], 0, $i > 1 && $i < 5);
|
NEMA(m, 0, m == NEMA17M || m == NEMA17M8);
|
||||||
|
|
||||||
translate_z(4)
|
translate_z(4)
|
||||||
NEMA_screws(stepper_motors[$i], M3_pan_screw, n = $i, earth = $i > 4 ? undef : $i - 1);
|
NEMA_screws(m, M3_pan_screw, n = $i, earth = $i > 4 ? undef : $i - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
|
|
|
@ -26,6 +26,7 @@ include <ring_terminals.scad>
|
||||||
include <../vitamins/pin_headers.scad>
|
include <../vitamins/pin_headers.scad>
|
||||||
use <../utils/tube.scad>
|
use <../utils/tube.scad>
|
||||||
use <../utils/thread.scad>
|
use <../utils/thread.scad>
|
||||||
|
use <../utils/round.scad>
|
||||||
use <washer.scad>
|
use <washer.scad>
|
||||||
use <rod.scad>
|
use <rod.scad>
|
||||||
|
|
||||||
|
@ -38,6 +39,8 @@ function NEMA_boss_height(type) = type[6]; //! Boss height
|
||||||
function NEMA_shaft_dia(type) = type[7]; //! Shaft diameter
|
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_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_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_holes(type) = [-NEMA_hole_pitch(type) / 2, NEMA_hole_pitch(type) / 2]; //! Screw positions for for loop
|
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
|
function NEMA_big_hole(type) = NEMA_boss_radius(type) + 0.2; //! Clearance hole for the big boss
|
||||||
stepper_body_colour = "black";
|
stepper_body_colour = "black";
|
||||||
|
@ -59,12 +62,13 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
|
||||||
boss_rad = NEMA_boss_radius(type);
|
boss_rad = NEMA_boss_radius(type);
|
||||||
boss_height =NEMA_boss_height(type);
|
boss_height =NEMA_boss_height(type);
|
||||||
shaft_rad = NEMA_shaft_dia(type) / 2;
|
shaft_rad = NEMA_shaft_dia(type) / 2;
|
||||||
cap = 8;
|
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"));
|
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 = 3; // Is this always the case?
|
||||||
|
|
||||||
module cap_shape(end)
|
module cap_shape(end)
|
||||||
difference() {
|
round(0.5, $fn = 32) difference() {
|
||||||
intersection() {
|
intersection() {
|
||||||
square([side, side], center = true);
|
square([side, side], center = true);
|
||||||
|
|
||||||
|
@ -92,22 +96,40 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
|
||||||
cap_shape(1);
|
cap_shape(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
tabSize = [16, 4, 2.5];
|
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
|
color(stepper_cap_colour) { // aluminium end caps
|
||||||
for(end = [-1, 1])
|
for(end = [-1, 1]) {
|
||||||
translate_z(-length / 2 + end * (length - cap) / 2)
|
translate_z(-length / 2 + end * (length - cap) / 2)
|
||||||
linear_extrude(cap, center = true)
|
linear_extrude(cap, center = true)
|
||||||
cap_shape(end);
|
cap_shape(end);
|
||||||
|
|
||||||
|
translate_z(-length / 2 + end * (length - cap2) / 2)
|
||||||
|
linear_extrude(cap2, center = true)
|
||||||
|
difference() {
|
||||||
|
cap_shape(end);
|
||||||
|
|
||||||
|
circle(body_rad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(jst_connector)
|
if(jst_connector)
|
||||||
translate([-tabSize.x / 2, side / 2, -length])
|
translate([-tabSize.x / 2, side / 2, -length])
|
||||||
cube(tabSize);
|
cube(tabSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jst_connector)
|
if(jst_connector)
|
||||||
translate([0, side / 2 - 2, -length + tabSize.z + 5.75 / 2])
|
translate([0, side / 2, -length + cap - hdr_ra_height(header)]) {
|
||||||
rotate([-90, 0, 0])
|
rotate(180)
|
||||||
jst_xh_header(jst_xh_header, 6);
|
not_on_bom()
|
||||||
|
jst_xh_header(header, 6, true);
|
||||||
|
|
||||||
|
translate_z(-pcb_thickness / 2)
|
||||||
|
color("green")
|
||||||
|
cube([socket_size.x + 5 * 2, tabSize.y * 2, pcb_thickness], true);
|
||||||
|
}
|
||||||
|
|
||||||
if(show_threads)
|
if(show_threads)
|
||||||
for(x = NEMA_holes(type), y = NEMA_holes(type))
|
for(x = NEMA_holes(type), y = NEMA_holes(type))
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
// corner body boss boss shaft
|
// corner body boss boss shaft
|
||||||
// side, length, radius, radius, radius, depth, shaft, length, holes
|
// 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];
|
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];
|
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];
|
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];
|
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31, [8, 8]];
|
||||||
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31];
|
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];
|
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];
|
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1, [8, 8]];
|
||||||
|
|
||||||
stepper_motors = [NEMA14, NEMA16, NEMA17S, NEMA17M, NEMA17, NEMA23];
|
stepper_motors = [NEMA14, NEMA16, NEMA17S, NEMA17M, NEMA17, NEMA23];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue