Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
Classes | Public Member Functions | List of all members
modules::pulse_gen::PulseGen Class Reference

Public Member Functions

 PulseGen (steps_t max_jerk, steps_t acceleration)
 
steps_t Jerk () const
 
void SetJerk (steps_t max_jerk)
 Set maximum jerk for the axis.
 
steps_t Acceleration () const
 
void SetAcceleration (steps_t accel)
 Set acceleration for the axis.
 
bool PlanMoveTo (pos_t pos, steps_t feed_rate, steps_t end_rate=0)
 
void AbortPlannedMoves (bool halt=true)
 
pos_t Position () const
 
pos_t CurPosition () const
 
void SetPosition (pos_t x)
 
steps_t Rate () const
 
bool QueueEmpty () const
 
bool Full () const
 
uint8_t PlannedMoves () const
 
st_timer_t Step (const hal::tmc2130::MotorParams &motorParams)
 

Member Function Documentation

◆ AbortPlannedMoves()

void modules::pulse_gen::PulseGen::AbortPlannedMoves ( bool  halt = true)

Stop whatever moves are being done

Parameters
haltWhen true, also abruptly stop axis movement.

◆ Acceleration()

steps_t modules::pulse_gen::PulseGen::Acceleration ( ) const
inline
Returns
the acceleration for the axis

◆ CurPosition()

pos_t modules::pulse_gen::PulseGen::CurPosition ( ) const

Fetch the current position of the axis while stepping. This function is expensive! It's necessary only in exceptional cases. For regular usage, Position() should probably be used instead.

Returns
the current position of the axis

◆ Full()

bool modules::pulse_gen::PulseGen::Full ( ) const
inline
Returns
false if new moves can still be planned

◆ Jerk()

steps_t modules::pulse_gen::PulseGen::Jerk ( ) const
inline
Returns
the jerk for the axis

◆ PlanMoveTo()

bool modules::pulse_gen::PulseGen::PlanMoveTo ( pos_t  pos,
steps_t  feed_rate,
steps_t  end_rate = 0 
)

Enqueue a single move in steps starting and ending at zero speed with maximum feedrate. Moves can only be enqueued if the axis is not Full().

Parameters
postarget position
feed_ratemaximum feedrate
end_rateendding feedrate (may not be reached!)
Returns
true if the move has been enqueued

◆ Position()

pos_t modules::pulse_gen::PulseGen::Position ( ) const
inline
Returns
the head position of the axis at the end of all moves

◆ QueueEmpty()

bool modules::pulse_gen::PulseGen::QueueEmpty ( ) const
inline
Returns
true if all planned moves have been finished

◆ Rate()

steps_t modules::pulse_gen::PulseGen::Rate ( ) const
inline

Fetch the target rate of the last planned segment, or the current effective rate when the move has been aborted.

◆ SetPosition()

void modules::pulse_gen::PulseGen::SetPosition ( pos_t  x)
inline

Set the position of the axis Should only be called when the queue is empty.

Parameters
xposition to set

◆ Step()

st_timer_t modules::pulse_gen::PulseGen::Step ( const hal::tmc2130::MotorParams motorParams)
inline

Single-step the axis

Returns
the interval for the next tick

The documentation for this class was generated from the following files: