Browse Source

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

Regression from 9823a37
woisy00 2 years ago
parent
commit
9338b7f06e
No account linked to committer's email address
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      Marlin/Configuration_adv.h
  2. 1
    1
      Marlin/src/module/planner.cpp

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -414,7 +414,7 @@
414 414
  */
415 415
 #define AUTOTEMP
416 416
 #if ENABLED(AUTOTEMP)
417
-  #define AUTOTEMP_OLDWEIGHT    0.98
417
+  #define AUTOTEMP_OLDWEIGHT    0.98  // Factor used to weight previous readings (0.0 < value < 1.0)
418 418
   // Turn on AUTOTEMP on M104/M109 by default using proportions set here
419 419
   //#define AUTOTEMP_PROPORTIONAL
420 420
   #if ENABLED(AUTOTEMP_PROPORTIONAL)

+ 1
- 1
Marlin/src/module/planner.cpp View File

@@ -1457,7 +1457,7 @@ void Planner::check_axes_activity() {
1457 1457
 
1458 1458
     float t = autotemp_min + high * autotemp_factor;
1459 1459
     LIMIT(t, autotemp_min, autotemp_max);
1460
-    if (t < oldt) t *= (1.0f - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT);
1460
+    if (t < oldt) t = t * (1.0f - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT);
1461 1461
     oldt = t;
1462 1462
     thermalManager.setTargetHotend(t, active_extruder);
1463 1463
   }

Loading…
Cancel
Save