Do not overflow during LA acceleration limiting
Perform the check one step earlier, avoiding 32bit overflow for very low compression factors. Fixes #2566 (although for K15 to have effect the conversion probably needs to be adjusted on the low end)
This commit is contained in:
parent
02a36c498c
commit
13b0e27cd7
1 changed files with 3 additions and 3 deletions
|
@ -1081,9 +1081,9 @@ Having the real displacement of the head, we can calculate the total movement le
|
||||||
if (e_D_ratio > 3.0)
|
if (e_D_ratio > 3.0)
|
||||||
block->use_advance_lead = false;
|
block->use_advance_lead = false;
|
||||||
else if (e_D_ratio > 0) {
|
else if (e_D_ratio > 0) {
|
||||||
const uint32_t max_accel_steps_per_s2 = cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm;
|
const float max_accel_per_s2 = cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio);
|
||||||
if (block->acceleration_st > max_accel_steps_per_s2) {
|
if (cs.acceleration > max_accel_per_s2) {
|
||||||
block->acceleration_st = max_accel_steps_per_s2;
|
block->acceleration_st = ceil(max_accel_per_s2 * steps_per_mm);
|
||||||
#ifdef LA_DEBUG
|
#ifdef LA_DEBUG
|
||||||
SERIAL_ECHOLNPGM("LA: Block acceleration limited due to max E-jerk");
|
SERIAL_ECHOLNPGM("LA: Block acceleration limited due to max E-jerk");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue