The Idler model handles asynchronnous Engaging / Disengaging operations and keeps track of idler's current state.
More...
#include <idler.h>
|
virtual void | PrepareMoveToPlannedSlot () override |
|
virtual void | PlanHomingMoveForward () override |
|
virtual void | PlanHomingMoveBack () override |
|
virtual bool | FinishHomingAndPlanMoveToParkPos () override |
|
virtual void | FinishMove () override |
|
virtual bool | StallGuardAllowed (bool forward) const override |
|
OperationResult | InitMovement () |
|
OperationResult | InitMovementNoReinitAxis () |
| Initializes movement of a movable module without reinitializing the axis/TMC driver.
|
|
void | PerformMove () |
|
void | PerformHomeForward () |
|
void | PerformHomeBack () |
|
void | HomeFailed () |
|
void | CheckTMC () |
|
uint16_t | AxisDistance (int32_t curPos) const |
|
|
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 |
|
The Idler model handles asynchronnous Engaging / Disengaging operations and keeps track of idler's current state.
◆ Disengage()
Plan disengaging of the idler, i.e. parking the idler
- Returns
- OperationResult
- Note
- if(state==OnHold) all attempts to Disengage are rejected with OperationResult::Rejected
◆ Engage()
Plan engaging of the idler to a specific filament slot
- Parameters
-
slot | index to be activated |
- Returns
- OperationResult
- Note
- if(state==OnHold) all attempts to Engage are rejected with OperationResult::Rejected
◆ Engaged()
bool modules::idler::Idler::Engaged |
( |
| ) |
const |
|
inline |
- Returns
- the current state of idler - engaged / disengaged / partially disengaged 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 idler
◆ FinishHomingAndPlanMoveToParkPos()
bool modules::idler::Idler::FinishHomingAndPlanMoveToParkPos |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ IdleSlotIndex()
static constexpr uint8_t modules::idler::Idler::IdleSlotIndex |
( |
| ) |
|
|
inlinestaticconstexpr |
- Returns
- the index of idle position of the idler, usually 5 in case of 0-4 valid indices of filament slots
◆ Init()
void modules::idler::Idler::Init |
( |
| ) |
|
Initializes the idler after restart/cold boot Reads the active slot from the EEPROM and decides if the idler is safe to move (not hold the filament while printing)
- free -> home the idler
- blocked -> set idler's position according to the active filament slot
◆ IntermediateSlotPosition()
static constexpr mm::I_pos_t modules::idler::Idler::IntermediateSlotPosition |
( |
uint8_t |
slot | ) |
|
|
inlinestaticconstexpr |
- Returns
- predefined intermediate positions between individual slots
◆ PartiallyDisengage()
◆ SlotPosition()
static constexpr mm::I_pos_t modules::idler::Idler::SlotPosition |
( |
uint8_t |
slot | ) |
|
|
inlinestaticconstexpr |
- Returns
- predefined positions of individual slots
◆ StallGuardAllowed()
bool modules::idler::Idler::StallGuardAllowed |
( |
bool |
forward | ) |
const |
|
overrideprotectedvirtual |
- 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 from modules::motion::MovableBase.
◆ Step()
bool modules::idler::Idler::Step |
( |
| ) |
|
Performs one step of the state machine according to currently planned operation
- Returns
- true if the idler is ready to accept new commands (i.e. it has finished the last operation)
The documentation for this class was generated from the following files: