Base class for movable modules - modules::idler::Idler and modules::selector::Selector contains the common code.
More...
#include <movable_base.h>
|
enum | {
Ready = 0
, Moving = 1
, PlannedHome = 2
, HomeForward = 3
,
HomeBack = 4
, TMCFailed = 5
, HomingFailed = 6
, OnHold = 0x80
} |
| Internal states of the state machine. More...
|
|
enum class | OperationResult : uint8_t { Accepted
, Refused
, Failed
} |
| Operation (Engage/Disengage/MoveToSlot) return values. More...
|
|
|
uint8_t | state |
| internal state of the automaton
|
|
uint8_t | plannedSlot |
| planned slot - where to move to
|
|
uint8_t | currentSlot |
| current slot
|
|
bool | homingValid |
| true if the axis is considered as homed
|
|
hal::tmc2130::ErrorFlags | tmcErrorFlags |
| cached TMC2130 error flags - being read only if the axis is enabled and doing something (moving)
|
|
config::Axis | axis |
|
int32_t | axisStart |
|
Base class for movable modules - modules::idler::Idler and modules::selector::Selector contains the common code.
◆ anonymous enum
Internal states of the state machine.
Enumerator |
---|
OnHold | needs to be a separate bit due to homing recovery infrastructure
|
◆ OperationResult
Operation (Engage/Disengage/MoveToSlot) return values.
Enumerator |
---|
Accepted | the operation has been successfully started
|
Refused | another operation is currently underway, cannot start a new one
|
Failed | the operation could not been started due to HW issues
|
◆ FinishHomingAndPlanMoveToParkPos()
virtual bool modules::motion::MovableBase::FinishHomingAndPlanMoveToParkPos |
( |
| ) |
|
|
protectedpure virtual |
◆ HoldOn()
void modules::motion::MovableBase::HoldOn |
( |
| ) |
|
Puts the movable on-hold Also, disables the axis
◆ InitMovement()
Initializes movement of a movable module. Beware: this operation reinitializes the axis/TMC driver as well (may introduce axis creep as we have seen on the Idler)
◆ InvalidateHoming()
void modules::motion::MovableBase::InvalidateHoming |
( |
| ) |
|
|
inline |
Invalidates the homing flag - that is now used to inform the movable component (Idler or Selector) that their current coordinates may have been compromised and a new homing move is to be performed. Each movable component performs the homing move immediately after it is possible to do so:
- Idler immediately (and then moves to desired slot again)
- Selector once there is no filament stuck in it (and then moves to desired slot again) Homing procedure therefore becomes completely transparent to upper layers and it will not be necessary to call it explicitly. Please note this method does not clear any planned move on the component
- on the contrary - the planned move will be peformed immediately after homing (which makes homing completely transparent)
◆ IsOnHold()
bool modules::motion::MovableBase::IsOnHold |
( |
| ) |
const |
|
inline |
- Returns
- true if the movable is on-hold
◆ PlanHome()
Prepare a homing move of the axis
- Returns
- true if the move has been planned successfully (i.e. movable is NOT on-hold)
◆ SetCurrents()
void modules::motion::MovableBase::SetCurrents |
( |
uint8_t |
iRun, |
|
|
uint8_t |
iHold |
|
) |
| |
Set TMC2130 iRun current level for this axis iRun == 0 means set the default from config
◆ Slot()
uint8_t modules::motion::MovableBase::Slot |
( |
| ) |
const |
|
inline |
virtual ~MovableBase(); intentionally disabled, see description in logic::CommandBase
- Returns
- currently active slot This state is updated only when a planned move is successfully finished, so it is safe for higher-level state machines to use this call as a waiting condition for the desired state of the derive class (idler/selector) While homing, Slot() returns 0xff as the current slot index is invalid.
◆ StallGuardAllowed()
virtual bool modules::motion::MovableBase::StallGuardAllowed |
( |
bool |
forward | ) |
const |
|
inlineprotectedvirtual |
- Returns
- true if the StallGuard signal is to be considered while homing. It may sound counterintuitive, but due to SG/homing issues on the Idler, it needs to avoid processing the SG while rotating over the filament. The Idler must consider SG signal only when close to its real end stops. Selector considers the SG signal all the time while homing, therefore the default implementation is empty
Reimplemented in modules::idler::Idler.
◆ State()
uint8_t modules::motion::MovableBase::State |
( |
| ) |
const |
|
inline |
- Returns
- internal state of the state machine
The documentation for this class was generated from the following files: