From 2c92cf4b5fa01b307b0a4f61a1cfceb46198cec3 Mon Sep 17 00:00:00 2001 From: woisy00 Date: Tue, 26 Oct 2021 09:33:05 +0200 Subject: [PATCH 1/3] Removed wrong temperature multiplication (#22899) --- Marlin/src/module/planner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index b89a313f2bcb..0a3ed679bfd7 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1457,7 +1457,7 @@ void Planner::check_axes_activity() { float t = autotemp_min + high * autotemp_factor; LIMIT(t, autotemp_min, autotemp_max); - if (t < oldt) t *= (1.0f - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT); + if (t < oldt) t = (1.0f - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT); oldt = t; thermalManager.setTargetHotend(t, active_extruder); } From 9db7865ca4a6d0b79d1d782135b40119eb675afa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Oct 2021 17:53:04 -0500 Subject: [PATCH 2/3] Restore proper calculation Regression from 9823a37362 --- Marlin/src/module/planner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 0a3ed679bfd7..2552efc69a26 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1457,7 +1457,7 @@ void Planner::check_axes_activity() { float t = autotemp_min + high * autotemp_factor; LIMIT(t, autotemp_min, autotemp_max); - if (t < oldt) t = (1.0f - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT); + if (t < oldt) t = t * (1.0f - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT); oldt = t; thermalManager.setTargetHotend(t, active_extruder); } From 63132b377743281b208e95d0acb2130fe1741826 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Oct 2021 17:57:36 -0500 Subject: [PATCH 3/3] Vaguely explain AUTOTEMP_OLDWEIGHT --- Marlin/Configuration_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fbf2c419439a..d6217ba94061 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -414,7 +414,7 @@ */ #define AUTOTEMP #if ENABLED(AUTOTEMP) - #define AUTOTEMP_OLDWEIGHT 0.98 + #define AUTOTEMP_OLDWEIGHT 0.98 // Factor used to weight previous readings (0.0 < value < 1.0) // Turn on AUTOTEMP on M104/M109 by default using proportions set here //#define AUTOTEMP_PROPORTIONAL #if ENABLED(AUTOTEMP_PROPORTIONAL)