include <./common.scad>; //NEMA 17 Constants NEMA17OuterWidth = 42; NEMA17BoltD = 3; NEMA17BoltSpacing = 31; NEMA17BoltOffsetZ = -1.9; NEMA17ShaftD = 5; NEMA17PadD = 22; NEMA17ShaftHobble = 4.5; NEMA17ShaftHobbleZ = 4.7; //Geared Motor Constants GearedMotorBoxX = 46; GearedMotorBoxY = 32; GearedMotorBoxZ = 21; GearedMotorMountX = 32.5; GearedMotorMountY = 17.5; GearedMotorShaftD = 6; GearedMotorShaftH = 16; GearedMotorShaftHobble = 1; module NEMA17_motor_shaft (pos = [0, 0, 0], L = 22.75) { //shaft translate(pos) difference () { cylinder(r = R(NEMA17ShaftD), h = L, center = true, $fn = 30); translate([0, NEMA17ShaftHobble, NEMA17ShaftHobbleZ]) cube([NEMA17ShaftD, NEMA17ShaftD, L+1], center = true); } } module NEMA17_bolt_void (pos = [0, 0, 0]) { translate(pos) cylinder(r = R(NEMA17BoltD), h = 4, center = true, $fn=30); } module NEMA17_pad (pos = [0, 0, 0]) { translate(pos) { cylinder(r = R(NEMA17PadD), h = 1.9, center = true, $fn = 100); } } //NEMA17 Stepper module NEMA17 (pos = [0, 0, 0], H = 33 ) { //alt = 47.5 BoltX = NEMA17BoltSpacing / 2; BoltY = NEMA17BoltSpacing / 2; BoltZ = (H / 2) + NEMA17BoltOffsetZ; translate(pos) { difference () { cube([NEMA17OuterWidth, NEMA17OuterWidth, H], center = true); //corners for (i = [0 : 3]) { rotate([0, 0, (i * 90) + 45]) translate([29.7, 0, 0]) cube([5.5, 5.5, H + 1], center = true); } NEMA17_bolt_void([BoltX, BoltY, BoltZ]); NEMA17_bolt_void([-BoltX, BoltY, BoltZ]); NEMA17_bolt_void([BoltX, -BoltY, BoltZ]); NEMA17_bolt_void([-BoltX, -BoltY, BoltZ]); } //pad NEMA17_pad([0, 0, (H/2) + (1.9/2)]); //shaft NEMA17_motor_shaft([0, 0, (H/2) + (22.75/2)]); } } module geared_motor_shaft (pos = [0, 0, 0], rot = [0, 0, 0]) { translate(pos) rotate(rot) difference () { cylinder(r = R(GearedMotorShaftD), h = GearedMotorShaftH, center = true, $fn = 60); translate([GearedMotorShaftD - GearedMotorShaftHobble, 0, 0]) cube([GearedMotorShaftD, GearedMotorShaftD, GearedMotorShaftH + 1], center = true); } } module geared_motor_mount_pad (pos = [0, 0, 0], D, Z) { translate(pos) difference () { cylinder(r = R(D), h = Z, center = true, $fn = 40); //bolt void cylinder(r = R(2.5), h = Z + 1, center = true, $fn = 40); } } module geared_motor_mounts (pos = [0, 0, 0], MountX, MountY) { MountX = GearedMotorMountX / 2; MountY = GearedMotorMountY / 2; Z = 1.5; D = 7.5; translate(pos) { geared_motor_mount_pad([MountX, MountY, 0], D, Z); geared_motor_mount_pad([-MountX, MountY, 0], D, Z); geared_motor_mount_pad([MountX, -MountY, 0], D, Z); geared_motor_mount_pad([-MountX, -MountY, 0], D, Z); } } //Geartisan Worm Gear Motor - JSX40-370 module geared_motor (pos = [0, 0, 0]) { translate(pos) { cube([GearedMotorBoxX, GearedMotorBoxY, GearedMotorBoxZ], center = true); translate([(GearedMotorBoxX / 2) + (30 / 2), 0, 1.5]) rotate([0, 90, 0]) cylinder(r = 24 / 2, h = 30, center = true, $fn = 80); geared_motor_shaft([-(46 / 2) + 14.5, 0, -18.5], [0, 0, 90]); //pad translate([-(46 / 2) + 14.5, 0, -(1 / 2) - 10.5]) cylinder(r = 13 / 2, h = 1, center = true, $fn = 60); //mount pads geared_motor_mounts([-0.5, 0, -(1.5 / 2) - 10.5]); } }