StepperII
Dual Axis Stepper Controller
Public Member Functions | Static Public Attributes

CStepPeriod Class Reference

Move the stepper motor a given number of steps. More...

#include <CStepPeriod.h>

List of all members.

Public Member Functions

void init (CProfile *, CRunProfile *)
void move (int step)
void doStep (void)
 Timer/Counter1 Output Compare A Match Interrupt.
void changeSpeed (void)
void off (void)

Static Public Attributes

static const long timerFreq = F_CPU / 8

Detailed Description

Move the stepper motor a given number of steps.

Holding data used by timer interrupt for speed ramp calculation.

Makes the stepper motor move the given number of steps. It accelrate with given accelration up to maximum speed and decelerate with given deceleration so it stops at the given step. If accel/decel is too small and steps to move is too few, speed might not reach the max speed limit before deceleration starts.

Parameters:
stepsNumber of steps to move (pos - CW, neg - CCW).
accelAccelration to use, in 0.01*rad/sec^2.
decelDecelration to use, in 0.01*rad/sec^2.
speedMax speed, in 0.01*rad/sec.

Table of coefficients to normalize motor speed regardless of microstep settings

Contains data used by timer interrupt to calculate speed profile. Data is written to it by move(), when stepper motor is moving (timer interrupt running) data is read/updated when calculating a new step_delay


Member Function Documentation

void CStepPeriod::doStep ( void  )

Timer/Counter1 Output Compare A Match Interrupt.

Timer/Counter1 Output Compare A Match Interrupt. Increments/decrements the position of the stepper motor except after last position, when it stops. The step_delay defines the period of this interrupt and controls the speed of the stepper motor. A new step delay is calculated to follow wanted speed profile on basis of accel/decel parameters.

void CStepPeriod::move ( int  step)

Number of steps before deceleration


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