|
|
@ -142,6 +142,7 @@ float Planner::previous_speed[NUM_AXIS], |
|
|
|
|
|
|
|
#if ENABLED(LIN_ADVANCE) |
|
|
|
float Planner::extruder_advance_k = LIN_ADVANCE_K, |
|
|
|
Planner::advance_ed_ratio = LIN_ADVANCE_E_D_RATIO, |
|
|
|
Planner::position_float[NUM_AXIS] = { 0 }; |
|
|
|
#endif |
|
|
|
|
|
|
@ -1324,7 +1325,12 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const |
|
|
|
&& (uint32_t)esteps != block->step_event_count |
|
|
|
&& de_float > 0.0; |
|
|
|
if (block->use_advance_lead) |
|
|
|
block->abs_adv_steps_multiplier8 = lround(extruder_advance_k * (de_float / mm_D_float) * block->nominal_speed / (float)block->nominal_rate * axis_steps_per_mm[E_AXIS_N] * 256.0); |
|
|
|
block->abs_adv_steps_multiplier8 = lround( |
|
|
|
extruder_advance_k |
|
|
|
* (UNEAR_ZERO(advance_ed_ratio) ? de_float / mm_D_float : advance_ed_ratio) // Use the fixed ratio, if set
|
|
|
|
* (block->nominal_speed / (float)block->nominal_rate) |
|
|
|
* axis_steps_per_mm[E_AXIS_N] * 256.0 |
|
|
|
); |
|
|
|
|
|
|
|
#elif ENABLED(ADVANCE) |
|
|
|
|
|
|
@ -1478,14 +1484,3 @@ void Planner::refresh_positioning() { |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(LIN_ADVANCE) |
|
|
|
|
|
|
|
void Planner::advance_M905(const float &k) { |
|
|
|
if (k >= 0.0) extruder_advance_k = k; |
|
|
|
SERIAL_ECHO_START; |
|
|
|
SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k); |
|
|
|
SERIAL_EOL; |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|