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

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
espr14 2020-07-07 01:52:21 +02:00 committed by GitHub
parent 378b5685b3
commit ea8c3a9388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3100,9 +3100,7 @@ void Temperature::tick() {
if (!residency_start_ms) { if (!residency_start_ms) {
// Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time.
if (temp_diff < TEMP_WINDOW) { if (temp_diff < TEMP_WINDOW) {
residency_start_ms = now; residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_RESIDENCY_TIME) / 3 : 0);
if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_RESIDENCY_TIME);
}
} }
else if (temp_diff > TEMP_HYSTERESIS) { else if (temp_diff > TEMP_HYSTERESIS) {
// Restart the timer whenever the temperature falls outside the hysteresis. // Restart the timer whenever the temperature falls outside the hysteresis.
@ -3227,10 +3225,8 @@ void Temperature::tick() {
if (!residency_start_ms) { if (!residency_start_ms) {
// Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
if (temp_diff < TEMP_BED_WINDOW) { if (temp_diff < TEMP_BED_WINDOW)
residency_start_ms = now; residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_BED_RESIDENCY_TIME) / 3 : 0);
if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_BED_RESIDENCY_TIME);
}
} }
else if (temp_diff > TEMP_BED_HYSTERESIS) { else if (temp_diff > TEMP_BED_HYSTERESIS) {
// Restart the timer whenever the temperature falls outside the hysteresis. // Restart the timer whenever the temperature falls outside the hysteresis.
@ -3343,10 +3339,8 @@ void Temperature::tick() {
if (!residency_start_ms) { if (!residency_start_ms) {
// Start the TEMP_CHAMBER_RESIDENCY_TIME timer when we reach target temp for the first time. // Start the TEMP_CHAMBER_RESIDENCY_TIME timer when we reach target temp for the first time.
if (temp_diff < TEMP_CHAMBER_WINDOW) { if (temp_diff < TEMP_CHAMBER_WINDOW)
residency_start_ms = now; residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME) / 3 : 0);
if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME);
}
} }
else if (temp_diff > TEMP_CHAMBER_HYSTERESIS) { else if (temp_diff > TEMP_CHAMBER_HYSTERESIS) {
// Restart the timer whenever the temperature falls outside the hysteresis. // Restart the timer whenever the temperature falls outside the hysteresis.