Fix, improve Linear Advance (#24533)

This commit is contained in:
tombrazier
2022-07-31 03:39:48 +01:00
committed by Scott Lahteine
parent 5dad7e0d03
commit fd319928d2
4 changed files with 304 additions and 350 deletions

View File

@ -239,11 +239,10 @@ typedef struct PlannerBlock {
// Advance extrusion
#if ENABLED(LIN_ADVANCE)
bool use_advance_lead;
uint16_t advance_speed, // STEP timer value for extruder speed offset ISR
max_adv_steps, // max. advance steps to get cruising speed pressure (not always nominal_speed!)
final_adv_steps; // advance steps due to exit speed
float e_D_ratio;
uint32_t la_advance_rate; // The rate at which steps are added whilst accelerating
uint8_t la_scaling; // Scale ISR frequency down and step frequency up by 2 ^ la_scaling
uint16_t max_adv_steps, // Max advance steps to get cruising speed pressure
final_adv_steps; // Advance steps for exit speed pressure
#endif
uint32_t nominal_rate, // The nominal step rate for this block in step_events/sec
@ -1018,7 +1017,7 @@ class Planner {
return target_velocity_sqr - 2 * accel * distance;
}
#if ENABLED(S_CURVE_ACCELERATION)
#if EITHER(S_CURVE_ACCELERATION, LIN_ADVANCE)
/**
* Calculate the speed reached given initial speed, acceleration and distance
*/