32#ifndef __STEPGENERATOR_H__
33#define __STEPGENERATOR_H__
63#ifndef HIDE_FROM_DOXYGEN
70 MOVE_TARGET_REL_END_POSN,
98 virtual bool Move(int32_t dist,
99 MoveTarget moveTarget = MOVE_TARGET_REL_END_POSN);
166 m_posnAbsolute = posn;
184 return m_posnAbsolute;
267 return MoveStateGet() == MS_IDLE;
287 return MoveStateGet() == MS_CRUISE;
293 uint32_t LimitRampPos : 1;
294 uint32_t LimitRampNeg : 1;
295 uint32_t EnterHWLimit : 1;
296 uint32_t InPosHWLimit : 1;
297 uint32_t InNegHWLimit : 1;
298 uint32_t InPosHWLimitLast : 1;
299 uint32_t InNegHWLimitLast : 1;
309 InNegHWLimitLast(0) {}
324 uint32_t m_stepsPrevious;
325 uint32_t m_stepsPerSampleMax;
326 MoveStates m_moveState;
329 bool m_lastMoveWasPositional;
331 LimitStatus m_limitInfo;
333 int32_t m_posnAbsolute;
335 volatile const bool &Direction()
340 volatile const MoveStates &MoveStateGet()
345 void StepsCalculated();
347 uint32_t StepsPrevious()
349 return m_stepsPrevious;
352 bool CheckTravelLimits();
354 void PosLimitActive(
bool isActive)
356 m_limitInfo.InPosHWLimit = isActive;
359 void NegLimitActive(
bool isActive)
361 m_limitInfo.InNegHWLimit = isActive;
365 int32_t m_stepsCommanded;
369 bool m_moveDirChange;
377 int32_t m_velLimitQx;
378 int32_t m_altVelLimitQx;
379 int32_t m_accelLimitQx;
380 int32_t m_altDecelLimitQx;
381 int64_t m_posnCurrentQx;
382 int32_t m_velCurrentQx;
383 int32_t m_accelCurrentQx;
384 int64_t m_posnTargetQx;
385 int32_t m_velTargetQx;
386 int64_t m_posnDecelQx;
390 int32_t m_velLimitPendingQx;
391 int32_t m_altVelLimitPendingQx;
392 int32_t m_accelLimitPendingQx;
393 int32_t m_altDecelLimitPendingQx;
395 virtual void OutputDirection() = 0;
396 void StepsPerSampleMaxSet(uint32_t maxSteps);
398 void AltVelMax(int32_t velMax);
407 void UpdatePendingMoveLimits()
409 m_velLimitQx = m_velLimitPendingQx;
410 m_altVelLimitQx = m_altVelLimitPendingQx;
411 m_accelLimitQx = m_accelLimitPendingQx;
412 m_altDecelLimitQx = m_altDecelLimitPendingQx;
ClearCore motor-connector manager.
Definition MotorManager.h:46
ClearCore Step and Direction generator class.
Definition StepGenerator.h:58
void PositionRefSet(int32_t posn)
Sets the absolute commanded position to the given value.
Definition StepGenerator.h:164
void MoveStopDecel(uint32_t decelMax=0)
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:285
void AccelMax(uint32_t accelMax)
Sets the maximum acceleration in step pulses per second^2.
void EStopDecelMax(uint32_t decelMax)
Sets the maximum deceleration for E-stop Deceleration 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.
volatile const int32_t & PositionRefCommanded()
Accessor for the StepGenerator's position reference.
Definition StepGenerator.h:182
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.
bool StepsComplete()
Function to check if no steps are currently being commanded to the motor.
Definition StepGenerator.h:265
Namespace to encompass the ClearCore board API.
Definition AdcManager.h:36