ClearCore Step and Direction generator class.
This class manages the generation and communication of movement profiles for the MotorDriver connectors.
For more detailed information on the ClearCore Motor Control and Motion Generation systems, check out the Motor Control System and Step and Direction Control informational pages.
ClearCore Step and Direction generator class.
More...
#include <StepGenerator.h>
|
enum | MoveTarget { MOVE_TARGET_ABSOLUTE,
MOVE_TARGET_REL_END_POSN
} |
|
void ClearCore::StepGenerator::AccelMax |
( |
uint32_t |
accelMax | ) |
|
bool ClearCore::StepGenerator::CruiseVelocityReached |
( |
| ) |
|
|
inline |
Function to check if the commanded move is at the cruising velocity - Acceleration portion of movement has finished.
- Returns
- Returns true if there the move is in the cruise state
- Note
- The motor will still need to decelerate after cruising
-
For use with Step and Direction mode.
void ClearCore::StepGenerator::EStopDecelMax |
( |
uint32_t |
decelMax | ) |
|
Sets the maximum deceleration for E-stop Deceleration in step pulses per second^2. This is only for MoveStopDecel.
Value will be clipped if out of bounds
- Parameters
-
[in] | decelMax | The new e-stop deceleration limit |
- Note
- For use with Step and Direction mode.
virtual bool ClearCore::StepGenerator::Move |
( |
int32_t |
dist, |
|
|
MoveTarget |
moveTarget = MOVE_TARGET_REL_END_POSN |
|
) |
| |
|
virtual |
Issues a positional move for the specified distance.
- Note
- When making absolute moves, ClearCore tracks the current position based on the zero position at program-start. If there is a move in progress when a new move is issued, the target position will be adjusted according to the moveTarget parameter, the new acceleration and velocity limits will be applied, and the new move is merged seamlessly with the previous motion. If you want to make sure that the previous move fully completes without being merged with a new command, wait for StepsComplete() to return true.
- Parameters
-
[in] | dist | The distance of the move in step pulses |
[in] | moveTarget | (optional) Specify the type of movement that should be done. Absolute or relative to the end position of the current move. Invalid will result in move relative to the end position. Default: MOVE_TARGET_REL_END_POSN |
- Note
- For use with Step and Direction mode.
Reimplemented in ClearCore::MotorDriver.
void ClearCore::StepGenerator::MoveStopAbrupt |
( |
| ) |
|
Interrupts the current move; the motor may stop abruptly.
- Note
- For use with Step and Direction mode.
void ClearCore::StepGenerator::MoveStopDecel |
( |
uint32_t |
decelMax = 0 | ) |
|
Interrupts any current move and commands the motor to stop. The stopping acceleration used will be the higher of either
- 1) the move's current acceleration rate, or
- 2) the value of EStopDecelMax.
This function's decelMax parameter can be used to update the EStopDecelMax value used for stopping.
- Parameters
-
[in] | decelMax | The new EStop deceleration rate to set instead of the value that was set prior to issuing the move. Passing 0 maintains the EStopDecelMax that was previously set. |
- Note
- For use with Step and Direction mode.
virtual bool ClearCore::StepGenerator::MoveVelocity |
( |
int32_t |
velocity | ) |
|
|
virtual |
Issues a velocity move at the specified velocity.
- Note
- Any existing move will be immediately overwritten with the new velocity.
- Parameters
-
[in] | velocity | The velocity of the move in step pulses/second. |
- Note
- For use with Step and Direction mode.
Reimplemented in ClearCore::MotorDriver.
volatile const int32_t& ClearCore::StepGenerator::PositionRefCommanded |
( |
| ) |
|
|
inline |
Accessor for the StepGenerator's position reference.
- Returns
- Returns the absolute commanded position.
- Note
- For use with Step and Direction mode.
void ClearCore::StepGenerator::PositionRefSet |
( |
int32_t |
posn | ) |
|
|
inline |
Sets the absolute commanded position to the given value.
- Parameters
-
[in] | posn | The new position to be set. |
- Note
- For use with Step and Direction mode.
bool ClearCore::StepGenerator::StepsComplete |
( |
| ) |
|
|
inline |
Function to check if no steps are currently being commanded to the motor.
- Returns
- Returns true if there is no valid current command.
- Note
- The motor may still be moving after steps are done being sent.
-
For use with Step and Direction mode.
void ClearCore::StepGenerator::VelMax |
( |
uint32_t |
velMax | ) |
|
int32_t ClearCore::StepGenerator::VelocityRefCommanded |
( |
| ) |
|
Accessor for the StepGenerator's momentary velocity.
- Returns
- Returns the momentary commanded velocity.
- Note
- For use with Step and Direction mode.
The documentation for this class was generated from the following file: