From 319fec47f0e32208f949bf26b61e2099e020846a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 19 Feb 2023 12:43:21 +0000 Subject: [PATCH] preheat: improve target temperature threshold MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use 5°C threshold to be consistant with other parts of the firmware. Relying on 95% of the target temperature creates a dependency on the temperature: PLA: Target = 215°C, threshold = 10.75°C PETG: Target = 230°C, threshold = 11.5°C ABS: Target = 255°C, threshold = 12.75°C ASA: Target =260°C, threshold = 13.0°C PC: Target = 275°C, threshold = 13.75°C My proposal is we instead use a constant TEMP_HYSTERESIS = 5, which is consistent with M109, and behavior when restoring print from RAM and some of the MMU code (like unload function) Change in memory: Flash: +2 bytes SRAM: 0 bytes --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index d2acf60cc..771d6a5e4 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1888,7 +1888,7 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) lcd_timeoutToStatus.stop(); - if (current_temperature[0] > (target_temperature[0] * 0.95)) + if (fabs(current_temperature[0] - target_temperature[0]) > TEMP_HYSTERESIS) { switch (eFilamentAction) {