Skip to content

Commit

Permalink
preheat: improve target temperature threshold
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gudnimg committed Feb 19, 2023
1 parent 1283c2c commit 319fec4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 319fec4

Please sign in to comment.