🐛 Fix AUTOTEMP bug (thermal runaway) (#23025)

Regression from 9823a37
x301
woisy00 3 years ago committed by Scott Lahteine
parent 8d21ea55a2
commit 2142e1dae4

@ -414,7 +414,7 @@
*/ */
#define AUTOTEMP #define AUTOTEMP
#if ENABLED(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 // Turn on AUTOTEMP on M104/M109 by default using proportions set here
//#define AUTOTEMP_PROPORTIONAL //#define AUTOTEMP_PROPORTIONAL
#if ENABLED(AUTOTEMP_PROPORTIONAL) #if ENABLED(AUTOTEMP_PROPORTIONAL)

@ -1457,7 +1457,7 @@ void Planner::check_axes_activity() {
float t = autotemp_min + high * autotemp_factor; float t = autotemp_min + high * autotemp_factor;
LIMIT(t, autotemp_min, autotemp_max); 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; oldt = t;
thermalManager.setTargetHotend(t, active_extruder); thermalManager.setTargetHotend(t, active_extruder);
} }

Loading…
Cancel
Save