Skip to content

Latest commit

 

History

History
163 lines (151 loc) · 5.08 KB

stepper-motor.md

File metadata and controls

163 lines (151 loc) · 5.08 KB

Stepper Motor


List of Functions

StepperMotorProfile( ... )create profile
StepperMotor( profile )generate stepper motor
StepperMotorPanelHole( profile )generate 2D holes for panel mounting

StepperMotorProfile( ... )

model user defined model name
nemaModel 1A use info from NEMA model (unless overridden)
bodyDiameter 1B width and depth of the motor
bodyLength 1B length excluding shafts and cylinders
shaftDiameter 1B shaft diameter
shaftLength 1B shaft length
boltProfile 2A use info from bolt profile (unless overridden)
boltDiameter 2B bolt diameter
boltLength 2B bolt length
boltToBoltDistance distance between bolts
frontCylinder list [ diameter, height ]
backCylinder list [ diameter, height ]
flangeThickness list [ upper height, lower height ]
bodyTaper taper on body between flanges
overallTaper taper on motor body
backShaftLength = 0 length of shaft at the back
panelHoleDiameter size of center hole for panel mounting the motor
returnKVTree profile

StepperMotor( profile )

profilestepper motor profile to display

StepperMotorPanelHole( profile )

profilestepper motor profile to generate panel holes for

Data Structure

type         : "stepper motor"
model        : "Wantai 57BYGH420-2"
nema         : ""
bodyDiameter : 56.4
length       = all          : 77
               body         : 57.6
               bodyOnly     : 56
               frontCylinder: 1.6
               backCylinder : 0
               shaft        : 19.4
               backShaft    : 0
               frontFlange  : 4.8
               backFlange   : 0
shaft        = diameter: 6.35
               length  : 19.4
backShaft    = diameter: 6.35
               length  : 0
bolt         = diameter: 5
               length  : 10
               distance: 47.14
panelHole    : 8.35
frontCylinder= diameter: 38.1
               length  : 1.6
backCylinder = diameter: 0
               length  : 0
taper        = overall: 2.82
               body   : 1   

Sample Code

photo

profile1 = StepperMotorProfile( nemaModel="NEMA17" );
PartAndPanel() {
    StepperMotor( profile1 );
    StepperMotorPanelHoles( profile1 );
};

// custom size
// https://www.sparkfun.com/products/13656 ==> Wantai 57BYGH420-2
// https://www.openimpulse.com/blog/wp-content/uploads/wpsc/downloadables/57BYGH420-Stepper-Motor-Datasheet.pdf
profile2 = StepperMotorProfile(
    model           = "Wantai 57BYGH420-2",
    bodyDiameter    = 56.4,
    bodyLength      = 56,
    shaftDiameter   = 6.35,
    shaftLength     = 21-1.6,
    boltDiameter    = 5,
    boltLength      = 10,
    boltDistance    = 47.14,
    frontCylinder   = [ 38.1, 1.6 ], // diameter, height
    flangeThickness = [  4.8,   0 ], // upper, lower
    bodyTaper       = 1 );
translate( [100,0,0] )
PartAndPanel() {
    StepperMotor( profile2 );
    StepperMotorPanelHoles( profile2, enlargeBolt=3 );
};
kvEchoAligned( profile2 );

// with gear, bolts on gear
profile3 = StepperMotorProfile(
    nemaModel     = "NEMA23",
    boltDistance  = 20,
    frontCylinder = [40,20]
);
translate( [200,0,0] )
PartAndPanel() {
    StepperMotor( profile3 );
    StepperMotorPanelHoles( profile3 );
};
    
// with gear, bolts on body, back cylinder and shaft
// bigger panel hole
profile4 = StepperMotorProfile(
    nemaModel          = "NEMA23",
    boltDiameter       = 8,
    boltLength         = 25+8,    // go below frontCylinderLength
    boltDistance       = 38,
    frontCylinder      = [40,25],
    backCylinder       = [40,20],
    panelHoleDiameter  = 40+2,    // larger than frontCylinderDiameter
    backShaftLength    = 20 );
translate( [300,0,0] ) {
    // position to upper flange
    translate( [0,0, kvGet(profile4,"length.frontCylinder")] )
        StepperMotor( profile4 );
    translate( [0,-100,0] ) PanelOnly()
        StepperMotorPanelHoles( profile4 );
}

// position to lower shaft
translate( [400,0,0] ) {
    translate( [0,0,kvGet(profile3,"length.body")] )
        StepperMotor( profile3 );
}

// position to bottom of body, excluding lower cylinder
translate( [500,0,0] ) {
    translate( [0,0,kvGet(profile4,"length.body")-kvGet(profile4,"length.backCylinder")] )
        StepperMotor( profile4 );
}

module PartAndPanel() {
    children(0);
    translate( [0,-100,0] )
        PanelOnly() children(1);
}
module PanelOnly() {
    linear_extrude( 3 )
    difference() {
        square( [60,60], center=true );
        children();
    }
}