Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
|
Public Member Functions | |
bool | InitAxis (Axis axis) |
bool | InitAxis (Axis axis, MotorCurrents mc) |
bool | Enabled (Axis axis) const |
Return the axis power status. | |
void | SetEnabled (Axis axis, bool enabled) |
void | Disable (Axis axis) |
void | SetMode (Axis axis, MotorMode mode) |
void | SetMode (MotorMode mode) |
Set the same mode of TMC/motors operation for all axes. More... | |
bool | StallGuard (Axis axis) |
void | StallGuardReset (Axis axis) |
clear StallGuard flag reported on an axis | |
void | PlanStallGuardThreshold (Axis axis, int8_t sg_thrs) |
void | PlanMoveTo (Axis axis, pos_t pos, steps_t feed_rate, steps_t end_rate=0) |
template<Axis A> | |
constexpr void | PlanMoveTo (AxisUnit< pos_t, A, Lenght > pos, AxisUnit< steps_t, A, Speed > feed_rate, AxisUnit< steps_t, A, Speed > end_rate={ 0 }) |
template<Axis A, config::UnitBase B> | |
constexpr void | PlanMoveTo (config::Unit< long double, B, Lenght > pos, config::Unit< long double, B, Speed > feed_rate, config::Unit< long double, B, Speed > end_rate={ 0 }) |
void | PlanMove (Axis axis, pos_t delta, steps_t feed_rate, steps_t end_rate=0) |
template<Axis A> | |
constexpr void | PlanMove (AxisUnit< pos_t, A, Lenght > delta, AxisUnit< steps_t, A, Speed > feed_rate, AxisUnit< steps_t, A, Speed > end_rate={ 0 }) |
template<Axis A, config::UnitBase B> | |
constexpr void | PlanMove (config::Unit< long double, B, Lenght > delta, config::Unit< long double, B, Speed > feed_rate, config::Unit< long double, B, Speed > end_rate={ 0 }) |
pos_t | Position (Axis axis) const |
template<Axis A> | |
constexpr AxisUnit< pos_t, A, Lenght > | Position () const |
pos_t | CurPosition (Axis axis) const |
template<Axis A> | |
constexpr AxisUnit< pos_t, A, Lenght > | CurPosition () const |
void | SetPosition (Axis axis, pos_t x) |
steps_t | Acceleration (Axis axis) const |
void | SetAcceleration (Axis axis, steps_t accel) |
template<Axis A> | |
void | SetAcceleration (AxisUnit< steps_t, A, Accel > accel) |
template<Axis A, config::UnitBase B> | |
void | SetAcceleration (config::Unit< long double, B, Accel > accel) |
steps_t | Jerk (Axis axis) const |
void | SetJerk (Axis axis, steps_t max_jerk) |
steps_t | Rate (Axis axis) const |
st_timer_t | Step () |
bool | QueueEmpty () const |
bool | QueueEmpty (Axis axis) const |
uint8_t | PlannedMoves (Axis axis) const |
bool | Full (Axis axis) const |
void | AbortPlannedMoves (Axis axis, bool halt=true) |
void | AbortPlannedMoves (bool halt=true) |
hal::tmc2130::TMC2130 & | DriverForAxis (Axis axis) |
hal::tmc2130::TMC2130 & | MMU_NEEDS_ATTENTION_DriverForAxis (Axis axis) |
const pulse_gen::PulseGen & | CtrlForAxis (Axis axis) const |
const MotorCurrents & | CurrentsForAxis (Axis axis) const |
void | SetIRunForAxis (Axis axis, uint8_t i) |
void modules::motion::Motion::AbortPlannedMoves | ( | Axis | axis, |
bool | halt = true |
||
) |
Stop whatever moves are being done for one axis
axis | axis requested |
halt | When true, also abruptly stop axis movement. |
void modules::motion::Motion::AbortPlannedMoves | ( | bool | halt = true | ) |
Stop whatever moves are being done on all axes
halt | When true, also abruptly stop axis movement. |
|
inline |
Get current acceleration for the selected axis
axis | axis affected |
|
inline |
|
inlineconstexpr |
Fetch the current axis position, but in AxisUnit. This function is expensive! The Axis needs to be supplied as the first template argument: CurPosition<axis>().
pos_t modules::motion::Motion::CurPosition | ( | Axis | axis | ) | 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.
axis | axis affected |
|
inline |
Disable axis motor. One must manually ensure no moves are currently being performed by calling QueueEmpty().
|
inline |
|
inline |
axis | axis requested |
bool modules::motion::Motion::InitAxis | ( | Axis | axis | ) |
Init axis driver - @TODO this should be probably hidden somewhere deeper ... something should manage the axes and their state especially when the TMC may get randomly reset (deinited)
|
inline |
Get current jerk for the selected axis
axis | axis affected |
|
inline |
|
inline |
Enqueue a single axis move in steps starting and ending at zero speed with maximum feedrate. Moves can only be enqueued if the axis is not Full().
axis | axis affected |
delta | relative to current position |
feed_rate | maximum feedrate |
end_rate | endding feedrate (may not be reached!) |
|
inlineconstexpr |
Enqueue a single axis move using PlanMove, but using AxisUnit. The Axis needs to be supplied as the first template argument: PlanMove<axis>(pos, rate).
|
inlineconstexpr |
Enqueue a single axis move using PlanMove, but using physical units. The Axis needs to be supplied as the first template argument: PlanMove<axis>(pos, rate).
void modules::motion::Motion::PlanMoveTo | ( | Axis | axis, |
pos_t | pos, | ||
steps_t | feed_rate, | ||
steps_t | end_rate = 0 |
||
) |
Enqueue a single axis move in steps starting and ending at zero speed with maximum feedrate. Moves can only be enqueued if the axis is not Full().
axis | axis affected |
pos | target position |
feed_rate | maximum feedrate |
end_rate | endding feedrate (may not be reached!) |
|
inlineconstexpr |
Enqueue a single axis move using PlanMoveTo, but using AxisUnit. The Axis needs to be supplied as the first template argument: PlanMoveTo<axis>(pos, rate).
|
inlineconstexpr |
Enqueue a single axis move using PlanMoveTo, but using physical units. The Axis needs to be supplied as the first template argument: PlanMoveTo<axis>(pos, rate).
|
inline |
void modules::motion::Motion::PlanStallGuardThreshold | ( | Axis | axis, |
int8_t | sg_thrs | ||
) |
Sets (plans) StallGuard threshold for an axis (basically the higher number the lower sensitivity) The new SGTHRS value gets applied in Init(), it is NOT written into the TMC immediately in this method.
|
inlineconstexpr |
pos_t modules::motion::Motion::Position | ( | Axis | axis | ) | const |
axis | axis affected |
bool modules::motion::Motion::QueueEmpty | ( | ) | const |
|
inline |
axis | requested |
|
inline |
Fetch the target rate of the last planned segment for the requested axis, or the current effective rate when the move has been aborted.
axis | axis affected |
|
inline |
Set acceleration for the selected axis
axis | axis affected |
accel | acceleration |
|
inline |
Set acceleration for the selected axis, but using AxisUnit. The Axis needs to be supplied as the first template argument: SetAcceleration<axis>(accel).
|
inline |
Set acceleration for the selected axis, but using physical units. The Axis needs to be supplied as the first template argument: SetAcceleration<axis>(accel).
A | axis affected |
B | unit base for the axis |
accel | acceleration |
void modules::motion::Motion::SetEnabled | ( | Axis | axis, |
bool | enabled | ||
) |
Set axis power status. One must manually ensure no moves are currently being performed by calling QueueEmpty().
|
inline |
Set maximum jerk for the selected axis
axis | axis affected |
max_jerk | maximum jerk |
void modules::motion::Motion::SetMode | ( | Axis | axis, |
MotorMode | mode | ||
) |
Set mode of TMC/motors operation. One must manually ensure no moves are currently being performed by calling QueueEmpty().
void modules::motion::Motion::SetMode | ( | MotorMode | mode | ) |
Set the same mode of TMC/motors operation for all axes.
|
inline |
Set the position of an axis. Should only be called when the queue is empty.
axis | axis affected |
x | position to set |
bool modules::motion::Motion::StallGuard | ( | Axis | axis | ) |
|
inline |
State machine doing all the planning and stepping. Called by the stepping ISR.