32 #ifndef __STEPGENERATOR_H__ 33 #define __STEPGENERATOR_H__ 61 #ifndef HIDE_FROM_DOXYGEN 67 MOVE_TARGET_REL_END_POSN,
95 virtual bool Move(int32_t dist,
96 MoveTarget moveTarget = MOVE_TARGET_REL_END_POSN);
162 m_posnAbsolute = posn;
179 return m_posnAbsolute;
210 void VelMax(uint32_t velMax);
262 return MoveStateGet() == MS_IDLE;
281 return MoveStateGet() == MS_CRUISE;
286 uint32_t LimitRampPos : 1;
287 uint32_t LimitRampNeg : 1;
288 uint32_t EnterHWLimit : 1;
289 uint32_t InPosHWLimit : 1;
290 uint32_t InNegHWLimit : 1;
291 uint32_t InPosHWLimitLast : 1;
292 uint32_t InNegHWLimitLast : 1;
302 InNegHWLimitLast(0) {}
316 uint32_t m_stepsPrevious;
317 uint32_t m_stepsPerSampleMax;
318 MoveStates m_moveState;
321 bool m_lastMoveWasPositional;
323 LimitStatus m_limitInfo;
325 int32_t m_posnAbsolute;
327 volatile const bool &Direction() {
331 volatile const MoveStates &MoveStateGet() {
335 void StepsCalculated();
337 uint32_t StepsPrevious() {
338 return m_stepsPrevious;
341 bool CheckTravelLimits();
343 void PosLimitActive(
bool isActive) {
344 m_limitInfo.InPosHWLimit = isActive;
347 void NegLimitActive(
bool isActive) {
348 m_limitInfo.InNegHWLimit = isActive;
353 int32_t m_stepsCommanded;
357 bool m_moveDirChange;
366 int32_t m_velLimitQx;
367 int32_t m_altVelLimitQx;
368 int32_t m_accelLimitQx;
369 int32_t m_altDecelLimitQx;
370 int64_t m_posnCurrentQx;
371 int32_t m_velCurrentQx;
372 int32_t m_accelCurrentQx;
373 int64_t m_posnTargetQx;
374 int32_t m_velTargetQx;
375 int64_t m_posnDecelQx;
379 int32_t m_velLimitPendingQx;
380 int32_t m_altVelLimitPendingQx;
381 int32_t m_accelLimitPendingQx;
382 int32_t m_altDecelLimitPendingQx;
384 virtual void OutputDirection() = 0;
385 void StepsPerSampleMaxSet(uint32_t maxSteps);
387 void AltVelMax(int32_t velMax);
396 void UpdatePendingMoveLimits() {
397 m_velLimitQx = m_velLimitPendingQx;
398 m_altVelLimitQx = m_altVelLimitPendingQx;
399 m_accelLimitQx = m_accelLimitPendingQx;
400 m_altDecelLimitQx = m_altDecelLimitPendingQx;
406 #endif // __STEPGENERATOR_H__ virtual bool MoveVelocity(int32_t velocity)
Issues a velocity move at the specified velocity.
bool CruiseVelocityReached()
Function to check if the commanded move is at the cruising velocity - Acceleration portion of movemen...
Definition: StepGenerator.h:280
bool StepsComplete()
Function to check if no steps are currently being commanded to the motor.
Definition: StepGenerator.h:261
volatile const int32_t & PositionRefCommanded()
Accessor for the StepGenerator's position reference.
Definition: StepGenerator.h:178
void EStopDecelMax(uint32_t decelMax)
Sets the maximum deceleration for E-stop Deceleration in step pulses per second^2. This is only for MoveStopDecel.
void PositionRefSet(int32_t posn)
Sets the absolute commanded position to the given value.
Definition: StepGenerator.h:161
Namespace to encompass the ClearCore board API.
Definition: AdcManager.h:36
void VelMax(uint32_t velMax)
Sets the maximum velocity for position moves, in step pulses per second.
int32_t VelocityRefCommanded()
Accessor for the StepGenerator's momentary velocity.
void AccelMax(uint32_t accelMax)
Sets the maximum acceleration in step pulses per second^2.
virtual bool Move(int32_t dist, MoveTarget moveTarget=MOVE_TARGET_REL_END_POSN)
Issues a positional move for the specified distance.
ClearCore Step and Direction generator class.
Definition: StepGenerator.h:56
ClearCore motor-connector manager.
Definition: MotorManager.h:46
void MoveStopDecel(uint32_t decelMax=0)