Browse Source

Reduce 'first loop' temperature residency time (#18421)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
espr14 5 years ago
parent
commit
ea8c3a9388
No account linked to committer's email address
1 changed files with 6 additions and 12 deletions
  1. 6
    12
      Marlin/src/module/temperature.cpp

+ 6
- 12
Marlin/src/module/temperature.cpp View File

@@ -3100,9 +3100,7 @@ void Temperature::tick() {
3100 3100
           if (!residency_start_ms) {
3101 3101
             // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time.
3102 3102
             if (temp_diff < TEMP_WINDOW) {
3103
-              residency_start_ms = now;
3104
-              if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_RESIDENCY_TIME);
3105
-            }
3103
+              residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_RESIDENCY_TIME) / 3 : 0);
3106 3104
           }
3107 3105
           else if (temp_diff > TEMP_HYSTERESIS) {
3108 3106
             // Restart the timer whenever the temperature falls outside the hysteresis.
@@ -3227,10 +3225,8 @@ void Temperature::tick() {
3227 3225
 
3228 3226
           if (!residency_start_ms) {
3229 3227
             // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
3230
-            if (temp_diff < TEMP_BED_WINDOW) {
3231
-              residency_start_ms = now;
3232
-              if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_BED_RESIDENCY_TIME);
3233
-            }
3228
+            if (temp_diff < TEMP_BED_WINDOW)
3229
+              residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_BED_RESIDENCY_TIME) / 3 : 0);
3234 3230
           }
3235 3231
           else if (temp_diff > TEMP_BED_HYSTERESIS) {
3236 3232
             // Restart the timer whenever the temperature falls outside the hysteresis.
@@ -3319,7 +3315,7 @@ void Temperature::tick() {
3319 3315
         }
3320 3316
 
3321 3317
         now = millis();
3322
-        if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up.
3318
+        if (ELAPSED(now, next_temp_ms)) { // Print Temp Reading every 1 second while heating up.
3323 3319
           next_temp_ms = now + 1000UL;
3324 3320
           print_heater_states(active_extruder);
3325 3321
           #if TEMP_CHAMBER_RESIDENCY_TIME > 0
@@ -3343,10 +3339,8 @@ void Temperature::tick() {
3343 3339
 
3344 3340
           if (!residency_start_ms) {
3345 3341
             // Start the TEMP_CHAMBER_RESIDENCY_TIME timer when we reach target temp for the first time.
3346
-            if (temp_diff < TEMP_CHAMBER_WINDOW) {
3347
-              residency_start_ms = now;
3348
-              if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME);
3349
-            }
3342
+            if (temp_diff < TEMP_CHAMBER_WINDOW)
3343
+              residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME) / 3 : 0);
3350 3344
           }
3351 3345
           else if (temp_diff > TEMP_CHAMBER_HYSTERESIS) {
3352 3346
             // Restart the timer whenever the temperature falls outside the hysteresis.

Loading…
Cancel
Save