Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
Public Member Functions | Protected Member Functions | List of all members
modules::pulley::Pulley Class Reference

#include <pulley.h>

Inheritance diagram for modules::pulley::Pulley:
Inheritance graph
[legend]
Collaboration diagram for modules::pulley::Pulley:
Collaboration graph
[legend]

Public Member Functions

bool Step ()
 
void PlanMove (mm::P_pos_t delta, mm::P_speed_t feed_rate, mm::P_speed_t end_rate={ 0 })
 
void __attribute__ ((always_inline)) PlanMove(unit
 
int32_t CurrentPosition_mm ()
 
void InitAxis ()
 
void Disable ()
 
- Public Member Functions inherited from modules::motion::MovableBase
constexpr MovableBase (config::Axis axis)
 
uint8_t Slot () const
 virtual ~MovableBase(); intentionally disabled, see description in logic::CommandBase More...
 
uint8_t State () const
 
hal::tmc2130::ErrorFlags TMCErrorFlags () const
 
void InvalidateHoming ()
 
OperationResult PlanHome ()
 
bool HomingValid () const
 
config::Axis Axis () const
 
void SetCurrents (uint8_t iRun, uint8_t iHold)
 
void HoldOn ()
 
bool IsOnHold () const
 
void Resume ()
 Allows the movable to move/home again after begin suspended by HoldOn.
 

Protected Member Functions

virtual void PrepareMoveToPlannedSlot () override
 
virtual void PlanHomingMoveForward () override
 
virtual void PlanHomingMoveBack () override
 
virtual bool FinishHomingAndPlanMoveToParkPos () override
 
virtual void FinishMove () override
 
- Protected Member Functions inherited from modules::motion::MovableBase
virtual bool StallGuardAllowed (bool forward) const
 
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
 

Additional Inherited Members

- Public Types inherited from modules::motion::MovableBase
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...
 
- Protected Attributes inherited from modules::motion::MovableBase
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
 

Detailed Description

The Pulley model is an analogy to Idler and Selector. It encapsulates the same error handling principles like the other two (motored) modules. On the other hand - the Pulley is much simpler, there is no homing, engage/disengage and slots, but it supports free rotation in either directions and some computation on top of it.

Member Function Documentation

◆ CurrentPosition_mm()

int32_t modules::pulley::Pulley::CurrentPosition_mm ( )
Returns
rounded current position (rotation) of the Pulley This exists purely to avoid expensive float (long double) computations of distance traveled by the filament

◆ FinishHomingAndPlanMoveToParkPos()

virtual bool modules::pulley::Pulley::FinishHomingAndPlanMoveToParkPos ( )
overrideprotectedvirtual
Returns
true if the measured axis length is within the expected range, false otherwise

Implements modules::motion::MovableBase.

◆ Step()

bool modules::pulley::Pulley::Step ( )

Performs one step of the state machine according to currently planned operation

Returns
true if the pulley 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: