1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-29 23:07:42 +00:00

1_Fix normalize_mix() (#11855)

Mix factors needed to be updated consistent with the recent Stepper/Planner code refactor.
This commit is contained in:
AnHardt 2018-09-17 23:38:35 +02:00 committed by Scott Lahteine
parent 1a89c3ceae
commit f5dc9c822d

View File

@ -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;
}
}