|
@ -440,7 +440,6 @@ volatile bool Temperature::raw_temps_ready = false; |
|
|
|
|
|
|
|
|
SHV(bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); |
|
|
SHV(bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); |
|
|
|
|
|
|
|
|
wait_for_heatup = true; // Can be interrupted with M108
|
|
|
|
|
|
#if ENABLED(PRINTER_EVENT_LEDS) |
|
|
#if ENABLED(PRINTER_EVENT_LEDS) |
|
|
const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius); |
|
|
const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius); |
|
|
LEDColor color = ONHEATINGSTART(); |
|
|
LEDColor color = ONHEATINGSTART(); |
|
@ -449,6 +448,7 @@ volatile bool Temperature::raw_temps_ready = false; |
|
|
TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false); |
|
|
TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false); |
|
|
|
|
|
|
|
|
// PID Tuning loop
|
|
|
// PID Tuning loop
|
|
|
|
|
|
wait_for_heatup = true; // Can be interrupted with M108
|
|
|
while (wait_for_heatup) { |
|
|
while (wait_for_heatup) { |
|
|
|
|
|
|
|
|
const millis_t ms = millis(); |
|
|
const millis_t ms = millis(); |
|
@ -632,6 +632,7 @@ volatile bool Temperature::raw_temps_ready = false; |
|
|
} |
|
|
} |
|
|
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); |
|
|
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); |
|
|
} |
|
|
} |
|
|
|
|
|
wait_for_heatup = false; |
|
|
|
|
|
|
|
|
disable_all_heaters(); |
|
|
disable_all_heaters(); |
|
|
|
|
|
|
|
@ -3060,10 +3061,10 @@ void Temperature::tick() { |
|
|
printerEventLEDs.onHotendHeatingStart(); |
|
|
printerEventLEDs.onHotendHeatingStart(); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
float target_temp = -1.0, old_temp = 9999.0; |
|
|
|
|
|
bool wants_to_cool = false; |
|
|
bool wants_to_cool = false; |
|
|
wait_for_heatup = true; |
|
|
float target_temp = -1.0, old_temp = 9999.0; |
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; |
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; |
|
|
|
|
|
wait_for_heatup = true; |
|
|
do { |
|
|
do { |
|
|
// Target temperature might be changed during the loop
|
|
|
// Target temperature might be changed during the loop
|
|
|
if (target_temp != degTargetHotend(target_extruder)) { |
|
|
if (target_temp != degTargetHotend(target_extruder)) { |
|
@ -3137,6 +3138,7 @@ void Temperature::tick() { |
|
|
} while (wait_for_heatup && TEMP_CONDITIONS); |
|
|
} while (wait_for_heatup && TEMP_CONDITIONS); |
|
|
|
|
|
|
|
|
if (wait_for_heatup) { |
|
|
if (wait_for_heatup) { |
|
|
|
|
|
wait_for_heatup = false; |
|
|
#if ENABLED(DWIN_CREALITY_LCD) |
|
|
#if ENABLED(DWIN_CREALITY_LCD) |
|
|
HMI_flag.heat_flag = 0; |
|
|
HMI_flag.heat_flag = 0; |
|
|
duration_t elapsed = print_job_timer.duration(); // print timer
|
|
|
duration_t elapsed = print_job_timer.duration(); // print timer
|
|
@ -3145,9 +3147,10 @@ void Temperature::tick() { |
|
|
ui.reset_status(); |
|
|
ui.reset_status(); |
|
|
#endif |
|
|
#endif |
|
|
TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onHeatingDone()); |
|
|
TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onHeatingDone()); |
|
|
|
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return wait_for_heatup; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endif // HAS_TEMP_HOTEND
|
|
|
#endif // HAS_TEMP_HOTEND
|
|
@ -3176,11 +3179,6 @@ void Temperature::tick() { |
|
|
#define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed()) |
|
|
#define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed()) |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
float target_temp = -1, old_temp = 9999; |
|
|
|
|
|
bool wants_to_cool = false; |
|
|
|
|
|
wait_for_heatup = true; |
|
|
|
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; |
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) |
|
|
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) |
|
|
KEEPALIVE_STATE(NOT_BUSY); |
|
|
KEEPALIVE_STATE(NOT_BUSY); |
|
|
#endif |
|
|
#endif |
|
@ -3190,6 +3188,10 @@ void Temperature::tick() { |
|
|
printerEventLEDs.onBedHeatingStart(); |
|
|
printerEventLEDs.onBedHeatingStart(); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
bool wants_to_cool = false; |
|
|
|
|
|
float target_temp = -1, old_temp = 9999; |
|
|
|
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; |
|
|
|
|
|
wait_for_heatup = true; |
|
|
do { |
|
|
do { |
|
|
// Target temperature might be changed during the loop
|
|
|
// Target temperature might be changed during the loop
|
|
|
if (target_temp != degTargetBed()) { |
|
|
if (target_temp != degTargetBed()) { |
|
@ -3264,9 +3266,13 @@ void Temperature::tick() { |
|
|
|
|
|
|
|
|
} while (wait_for_heatup && TEMP_BED_CONDITIONS); |
|
|
} while (wait_for_heatup && TEMP_BED_CONDITIONS); |
|
|
|
|
|
|
|
|
if (wait_for_heatup) ui.reset_status(); |
|
|
if (wait_for_heatup) { |
|
|
|
|
|
wait_for_heatup = false; |
|
|
|
|
|
ui.reset_status(); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return wait_for_heatup; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Temperature::wait_for_bed_heating() { |
|
|
void Temperature::wait_for_bed_heating() { |
|
@ -3280,6 +3286,77 @@ void Temperature::tick() { |
|
|
|
|
|
|
|
|
#endif // HAS_HEATED_BED
|
|
|
#endif // HAS_HEATED_BED
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_TEMP_PROBE |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MIN_DELTA_SLOPE_DEG_PROBE |
|
|
|
|
|
#define MIN_DELTA_SLOPE_DEG_PROBE 1.0 |
|
|
|
|
|
#endif |
|
|
|
|
|
#ifndef MIN_DELTA_SLOPE_TIME_PROBE |
|
|
|
|
|
#define MIN_DELTA_SLOPE_TIME_PROBE 600 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
bool Temperature::wait_for_probe(const float target_temp, bool no_wait_for_cooling/*=true*/) { |
|
|
|
|
|
|
|
|
|
|
|
const bool wants_to_cool = isProbeAboveTemp(target_temp); |
|
|
|
|
|
const bool will_wait = !(wants_to_cool && no_wait_for_cooling); |
|
|
|
|
|
if (will_wait) |
|
|
|
|
|
SERIAL_ECHOLNPAIR("Waiting for probe to ", (wants_to_cool ? PSTR("cool down") : PSTR("heat up")), " to ", target_temp, " degrees."); |
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) |
|
|
|
|
|
KEEPALIVE_STATE(NOT_BUSY); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
float old_temp = 9999; |
|
|
|
|
|
millis_t next_temp_ms = 0, next_delta_check_ms = 0; |
|
|
|
|
|
wait_for_heatup = true; |
|
|
|
|
|
while (will_wait && wait_for_heatup) { |
|
|
|
|
|
|
|
|
|
|
|
// Print Temp Reading every 10 seconds while heating up.
|
|
|
|
|
|
millis_t now = millis(); |
|
|
|
|
|
if (!next_temp_ms || ELAPSED(now, next_temp_ms)) { |
|
|
|
|
|
next_temp_ms = now + 10000UL; |
|
|
|
|
|
print_heater_states(active_extruder); |
|
|
|
|
|
SERIAL_EOL(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
idle(); |
|
|
|
|
|
gcode.reset_stepper_timeout(); // Keep steppers powered
|
|
|
|
|
|
|
|
|
|
|
|
// Break after MIN_DELTA_SLOPE_TIME_PROBE seconds if the temperature
|
|
|
|
|
|
// did not drop at least MIN_DELTA_SLOPE_DEG_PROBE. This avoids waiting
|
|
|
|
|
|
// forever as the probe is not actively heated.
|
|
|
|
|
|
if (!next_delta_check_ms || ELAPSED(now, next_delta_check_ms)) { |
|
|
|
|
|
const float temp = degProbe(), |
|
|
|
|
|
delta_temp = old_temp > temp ? old_temp - temp : temp - old_temp; |
|
|
|
|
|
if (delta_temp < float(MIN_DELTA_SLOPE_DEG_PROBE)) { |
|
|
|
|
|
SERIAL_ECHOLNPGM("Timed out waiting for probe temperature."); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
next_delta_check_ms = now + 1000UL * MIN_DELTA_SLOPE_TIME_PROBE; |
|
|
|
|
|
old_temp = temp; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Loop until the temperature is very close target
|
|
|
|
|
|
if (!(wants_to_cool ? isProbeAboveTemp(target_temp) : isProbeBelowTemp(target_temp))) { |
|
|
|
|
|
SERIAL_ECHOLN(wants_to_cool ? PSTR("Cooldown") : PSTR("Heatup")); |
|
|
|
|
|
SERIAL_ECHOLNPGM(" complete, target probe temperature reached."); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (wait_for_heatup) { |
|
|
|
|
|
wait_for_heatup = false; |
|
|
|
|
|
ui.reset_status(); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
else if (will_wait) |
|
|
|
|
|
SERIAL_ECHOLNPGM("Canceled wait for probe temperature."); |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // HAS_TEMP_PROBE
|
|
|
|
|
|
|
|
|
#if HAS_HEATED_CHAMBER |
|
|
#if HAS_HEATED_CHAMBER |
|
|
|
|
|
|
|
|
#ifndef MIN_COOLING_SLOPE_DEG_CHAMBER |
|
|
#ifndef MIN_COOLING_SLOPE_DEG_CHAMBER |
|
@ -3300,15 +3377,14 @@ void Temperature::tick() { |
|
|
#define TEMP_CHAMBER_CONDITIONS (wants_to_cool ? isCoolingChamber() : isHeatingChamber()) |
|
|
#define TEMP_CHAMBER_CONDITIONS (wants_to_cool ? isCoolingChamber() : isHeatingChamber()) |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
float target_temp = -1, old_temp = 9999; |
|
|
|
|
|
bool wants_to_cool = false; |
|
|
|
|
|
wait_for_heatup = true; |
|
|
|
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; |
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) |
|
|
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) |
|
|
KEEPALIVE_STATE(NOT_BUSY); |
|
|
KEEPALIVE_STATE(NOT_BUSY); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
bool wants_to_cool = false; |
|
|
|
|
|
float target_temp = -1, old_temp = 9999; |
|
|
|
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; |
|
|
|
|
|
wait_for_heatup = true; |
|
|
do { |
|
|
do { |
|
|
// Target temperature might be changed during the loop
|
|
|
// Target temperature might be changed during the loop
|
|
|
if (target_temp != degTargetChamber()) { |
|
|
if (target_temp != degTargetChamber()) { |
|
@ -3367,9 +3443,13 @@ void Temperature::tick() { |
|
|
} |
|
|
} |
|
|
} while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS); |
|
|
} while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS); |
|
|
|
|
|
|
|
|
if (wait_for_heatup) ui.reset_status(); |
|
|
if (wait_for_heatup) { |
|
|
|
|
|
wait_for_heatup = false; |
|
|
|
|
|
ui.reset_status(); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return wait_for_heatup; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endif // HAS_HEATED_CHAMBER
|
|
|
#endif // HAS_HEATED_CHAMBER
|
|
|