|
StepperII
Dual Axis Stepper Controller
|
Move the stepper motor a given number of steps. More...
#include <CStepPeriod.h>
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 |
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.
| steps | Number of steps to move (pos - CW, neg - CCW). |
| accel | Accelration to use, in 0.01*rad/sec^2. |
| decel | Decelration to use, in 0.01*rad/sec^2. |
| speed | Max 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
| 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
1.7.3