StepperII
Dual Axis Stepper Controller
Public Member Functions | Public Attributes

CStepper Class Reference

List of all members.

Public Member Functions

void init (uint8_t *s, CMotor *pMotor, CStepTimer *pStepTimer, const char axis, char consoleStatus=0)
 Initialze the axis.
void setSprIndex (int x)
 Set axis microstepping.
void setDirection (char)
 Set motor direction before move, include CProfile::reverse setting.
void brakeOn (void)
 Activate motor brake.
void brakeOff (void)
 De-activate motor brake.
int readPosition (void)
 Return position in units based on CProfile::units.
void writePosition (int x)
 Set axis position to x.
void step (int x)
 Relative move, x is in signed degrees or steps.
void stepTo (int position)
 Absolute move, position is in signed degrees or steps.
void doPulse (void)
void stepMotor (void)
 Move motor one step.
void on (char direction)
 Turn on motor in given direction.
void autoHome (void)
 Look for home.
void setHomeOffset (int offset)
void changeSpeed (void)
 Change speed if in continuous mode.
void timerCompareA (void)
 Executed on counter 1A top.
void timerOverflow (void)
 Process timer overflow event.
int indexToSteps (char index)
 Convert 0,1,2... to 200,400,800...
char stepsToIndex (int steps)
 Convert 200,400,800... to 0,1,2...
int stepsToMove (int x)
 Calculate number of steps to move to target.
int toSteps (int x)
 Convert input x to steps.
int toUnits (int x)
 Convert input x to units, based on CProfile::units.

Public Attributes

CProfile profile
 Axis configuration.
CRunProfile runProfile
 Axis run-time (motion) parameters.
CStepPeriod avrStep
 Axis motion pulse width calculator.
CMotorpMotor
 Axis motor control object.
CStepTimerpStepTimer
 Axis motion pulse timer.

Member Function Documentation

int CStepper::indexToSteps ( char  index)

Convert 0,1,2... to 200,400,800...

Convert index (0 through 4) to microsteps (200 through 3200). If index is not valid, return 3200 (slowest) steps

Parameters:
[in]index0, 1, 2, 3, or 4
Returns:
microsteps 200, 400, 800, 1600, or 3200 (steps per motor rev)
char CStepper::stepsToIndex ( int  steps)

Convert 200,400,800... to 0,1,2...

Convert microsteps (200 through 3200) to index (0 through 4). If index is not valid, return 4 (slowest) index

Parameters:
[in]steps200, 400, 800, 1600, or 3200 (steps per motor rev)
Returns:
index 0, 1, 2, 3, or 4
void CStepper::timerCompareA ( void  )

Executed on counter 1A top.

int CStepper::toSteps ( int  x)

Convert input x to steps.

Convert degrees or steps to steps.

Parameters:
[in]xnumber of steps in degrees or steps
Returns:
x converted to steps, truncated to signed integer
int CStepper::toUnits ( int  x)

Convert input x to units, based on CProfile::units.

Convert steps to degrees if CProfile::units is 0.

Parameters:
[in]xsteps
Returns:
x converted to steps or degrees, truncated to signed integer

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines