1_Fix normalize_mix() (#11855)
Mix factors needed to be updated consistent with the recent Stepper/Planner code refactor.
This commit is contained in:
parent
1a89c3ceae
commit
f5dc9c822d
@ -3280,10 +3280,11 @@ static void homeaxis(const AxisEnum axis) {
|
||||
|
||||
void normalize_mix() {
|
||||
float mix_total = 0.0;
|
||||
for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mix_total += RECIPROCAL(mixing_factor[i]);
|
||||
for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mix_total += mixing_factor[i];
|
||||
// Scale all values if they don't add up to ~1.0
|
||||
if (!NEAR(mix_total, 1.0)) {
|
||||
SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling.");
|
||||
mix_total = RECIPROCAL(mix_total);
|
||||
for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mixing_factor[i] *= mix_total;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user