From f5dc9c822d41b1d5b60b057350559e9b9b375fda Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 17 Sep 2018 23:38:35 +0200 Subject: [PATCH] 1_Fix normalize_mix() (#11855) Mix factors needed to be updated consistent with the recent Stepper/Planner code refactor. --- Marlin/Marlin_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 45e5fb48a0..c1404dd5f9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -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; } }