Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 89 additions & 74 deletions stepper.scad
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ NemaBackAxleLength = 15;
NemaAxleFlatDepth = 16;
NemaAxleFlatLengthFront = 17;
NemaAxleFlatLengthBack = 18;
NemaAluPlateHeight = 19;

NemaA = 1;
NemaB = 2;
Expand Down Expand Up @@ -73,7 +74,8 @@ Nema08 = [
[NemaBackAxleLength, 9.9*mm],
[NemaAxleFlatDepth, -1*mm],
[NemaAxleFlatLengthFront, 0*mm],
[NemaAxleFlatLengthBack, 0*mm]
[NemaAxleFlatLengthBack, 0*mm],
[NemaAluPlateHeight, 0*mm]
];

Nema11 = [
Expand All @@ -95,7 +97,8 @@ Nema11 = [
[NemaBackAxleLength, 10*mm],
[NemaAxleFlatDepth, 0.5*mm],
[NemaAxleFlatLengthFront, 10*mm],
[NemaAxleFlatLengthBack, 9*mm]
[NemaAxleFlatLengthBack, 9*mm],
[NemaAluPlateHeight, 0*mm]
];

Nema14 = [
Expand All @@ -117,7 +120,8 @@ Nema14 = [
[NemaBackAxleLength, 10*mm],
[NemaAxleFlatDepth, 0.5*mm],
[NemaAxleFlatLengthFront, 15*mm],
[NemaAxleFlatLengthBack, 9*mm]
[NemaAxleFlatLengthBack, 9*mm],
[NemaAluPlateHeight, 0*mm]
];

Nema17 = [
Expand All @@ -127,7 +131,7 @@ Nema17 = [
[NemaLengthLong, 47*mm],
[NemaSideSize, 42.20*mm],
[NemaDistanceBetweenMountingHoles, 31.04*mm],
[NemaMountingHoleDiameter, 4*mm],
[NemaMountingHoleDiameter, 3*mm],
[NemaMountingHoleDepth, 4.5*mm],
[NemaMountingHoleLip, -1*mm],
[NemaMountingHoleCutoutRadius, 0*mm],
Expand All @@ -139,7 +143,8 @@ Nema17 = [
[NemaBackAxleLength, 15*mm],
[NemaAxleFlatDepth, 0.5*mm],
[NemaAxleFlatLengthFront, 15*mm],
[NemaAxleFlatLengthBack, 14*mm]
[NemaAxleFlatLengthBack, 14*mm],
[NemaAluPlateHeight, 9*mm]
];

Nema23 = [
Expand All @@ -161,7 +166,8 @@ Nema23 = [
[NemaBackAxleLength, 15.60*mm],
[NemaAxleFlatDepth, 0.5*mm],
[NemaAxleFlatLengthFront, 16*mm],
[NemaAxleFlatLengthBack, 14*mm]
[NemaAxleFlatLengthBack, 14*mm],
[NemaAluPlateHeight, 0*mm]
];

Nema34 = [
Expand All @@ -183,7 +189,8 @@ Nema34 = [
[NemaBackAxleLength, 34*mm],
[NemaAxleFlatDepth, 1.20*mm],
[NemaAxleFlatLengthFront, 25*mm],
[NemaAxleFlatLengthBack, 25*mm]
[NemaAxleFlatLengthBack, 25*mm],
[NemaAluPlateHeight, 0*mm]
];


Expand Down Expand Up @@ -224,84 +231,92 @@ module motor(model=Nema23, size=NemaMedium, dualAxis=false, pos=[0,0,0], orienta
axleFlatDepth = lookup(NemaAxleFlatDepth, model);
axleFlatLengthFront = lookup(NemaAxleFlatLengthFront, model);
axleFlatLengthBack = lookup(NemaAxleFlatLengthBack, model);

color(stepperBlack){
translate(pos) rotate(orientation) {
translate([-mid, -mid, 0])
difference() {
cube(size=[side, side, length + extrSize]);

// Corner cutouts
if (lip > 0) {
translate([0, 0, lip]) cylinder(h=length, r=cutR);
translate([side, 0, lip]) cylinder(h=length, r=cutR);
translate([0, side, lip]) cylinder(h=length, r=cutR);
translate([side, side, lip]) cylinder(h=length, r=cutR);

aluHeight = lookup(NemaAluPlateHeight, model);

translate(pos) rotate(orientation) {
translate([-mid, -mid, 0])
difference() {
union() {
color(stepperAluminum)
cube(size=[side, side, extrSize + aluHeight]);
color(stepperBlack)
translate([0,0, extrSize + aluHeight])
cube(size=[side, side, length - 2 * aluHeight]);
color(stepperAluminum)
translate([0,0,extrSize + length - aluHeight])
cube(size=[side, side, aluHeight]);
}
// Corner cutouts
if (lip > 0) {
translate([0, 0, lip]) cylinder(h=length, r=cutR);
translate([side, 0, lip]) cylinder(h=length, r=cutR);
translate([0, side, lip]) cylinder(h=length, r=cutR);
translate([side, side, lip]) cylinder(h=length, r=cutR);

}

// Bevelled edges
if (roundR > 0) {
for (r = [0:90:405])
translate([mid,mid, 0])
rotate([0,0,r])
translate([mid,mid, length/2])
rotate([0,0,45])
union()
{
color(stepperAluminum)
translate([0,0,-(length - aluHeight - extrSize)/2])
cube(size=[roundR, roundR*2, extrSize + aluHeight+0.1], center=true);
color(stepperBlack)
translate([0,0,extrSize])
cube(size=[roundR, roundR*2, length - 2 * aluHeight], center=true);
color(stepperAluminum)
translate([0,0,extrSize+(length - aluHeight)/2])
cube(size=[roundR, roundR*2, aluHeight + 0.1], center=true);
}
}

// Rounded edges
if (roundR > 0) {
translate([mid+mid, mid+mid, length/2])
rotate([0,0,45])
cube(size=[roundR, roundR*2, 4+length + extrSize+2], center=true);
translate([mid-(mid), mid+(mid), length/2])
rotate([0,0,45])
cube(size=[roundR*2, roundR, 4+length + extrSize+2], center=true);
translate([mid+mid, mid-mid, length/2])
rotate([0,0,45])
cube(size=[roundR*2, roundR, 4+length + extrSize+2], center=true);
translate([mid-mid, mid-mid, length/2])
rotate([0,0,45])
cube(size=[roundR, roundR*2, 4+length + extrSize+2], center=true);
// Bolt holes
color(stepperAluminum, $fs=holeRadius/8) {
translate([mid+holeDist,mid+holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);
translate([mid-holeDist,mid+holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);
translate([mid+holeDist,mid-holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);
translate([mid-holeDist,mid-holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);

}

// Bolt holes
color(stepperAluminum, $fs=holeRadius/8) {
translate([mid+holeDist,mid+holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);
translate([mid-holeDist,mid+holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);
translate([mid+holeDist,mid-holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);
translate([mid-holeDist,mid-holeDist,-1*mm]) cylinder(h=holeDepth+1*mm, r=holeRadius);

}

// Grinded flat
color(stepperAluminum) {
difference() {
translate([-1*mm, -1*mm, -extrSize])
cube(size=[side+2*mm, side+2*mm, extrSize + 1*mm]);
translate([side/2, side/2, -extrSize - 1*mm])
cylinder(h=4*mm, r=extrRad);
}
}
}

// Grinded flat
color(stepperAluminum) {
difference() {
translate([-1*mm, -1*mm, -extrSize])
cube(size=[side+2*mm, side+2*mm, extrSize + 1*mm]);
translate([side/2, side/2, -extrSize - 1*mm])
cylinder(h=4*mm, r=extrRad);
}
}
}

// Axle
translate([0, 0, extrSize-axleLengthFront]) color(stepperAluminum)
difference() {

cylinder(h=axleLengthFront + 1*mm , r=axleRadius, $fs=axleRadius/10);
// Axle
translate([0, 0, extrSize-axleLengthFront]) color(stepperAluminum)
difference() {

// Flat
if (axleFlatDepth > 0)
translate([axleRadius - axleFlatDepth,-5*mm,-extrSize*mm -(axleLengthFront-axleFlatLengthFront)] ) cube(size=[5*mm, 10*mm, axleLengthFront]);
}
cylinder(h=axleLengthFront + 1*mm , r=axleRadius, $fs=axleRadius/10);

if (dualAxis) {
translate([0, 0, length+extrSize]) color(stepperAluminum)
difference() {

cylinder(h=axleLengthBack + 0*mm, r=axleRadius, $fs=axleRadius/10);
// Flat
if (axleFlatDepth > 0)
translate([axleRadius - axleFlatDepth,-5*mm,-extrSize*mm -(axleLengthFront-axleFlatLengthFront)] ) cube(size=[5*mm, 10*mm, axleLengthFront]);
}

// Flat
if (axleFlatDepth > 0)
translate([axleRadius - axleFlatDepth,-5*mm,(axleLengthBack-axleFlatLengthBack)]) cube(size=[5*mm, 10*mm, axleLengthBack]);
}
if (dualAxis) {
translate([0, 0, length+extrSize]) color(stepperAluminum)
difference() {

}
cylinder(h=axleLengthBack + 0*mm, r=axleRadius, $fs=axleRadius/10);

// Flat
if (axleFlatDepth > 0)
translate([axleRadius - axleFlatDepth,-5*mm,(axleLengthBack-axleFlatLengthBack)]) cube(size=[5*mm, 10*mm, axleLengthBack]);
}
}
}
}
Expand Down