|
@@ -440,7 +440,6 @@ volatile bool Temperature::raw_temps_ready = false;
|
440
|
440
|
|
441
|
441
|
SHV(bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1);
|
442
|
442
|
|
443
|
|
- wait_for_heatup = true; // Can be interrupted with M108
|
444
|
443
|
#if ENABLED(PRINTER_EVENT_LEDS)
|
445
|
444
|
const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius);
|
446
|
445
|
LEDColor color = ONHEATINGSTART();
|
|
@@ -449,6 +448,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
449
|
448
|
TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false);
|
450
|
449
|
|
451
|
450
|
// PID Tuning loop
|
|
451
|
+ wait_for_heatup = true; // Can be interrupted with M108
|
452
|
452
|
while (wait_for_heatup) {
|
453
|
453
|
|
454
|
454
|
const millis_t ms = millis();
|
|
@@ -632,6 +632,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
632
|
632
|
}
|
633
|
633
|
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update());
|
634
|
634
|
}
|
|
635
|
+ wait_for_heatup = false;
|
635
|
636
|
|
636
|
637
|
disable_all_heaters();
|
637
|
638
|
|
|
@@ -3060,10 +3061,10 @@ void Temperature::tick() {
|
3060
|
3061
|
printerEventLEDs.onHotendHeatingStart();
|
3061
|
3062
|
#endif
|
3062
|
3063
|
|
3063
|
|
- float target_temp = -1.0, old_temp = 9999.0;
|
3064
|
3064
|
bool wants_to_cool = false;
|
3065
|
|
- wait_for_heatup = true;
|
|
3065
|
+ float target_temp = -1.0, old_temp = 9999.0;
|
3066
|
3066
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
|
|
3067
|
+ wait_for_heatup = true;
|
3067
|
3068
|
do {
|
3068
|
3069
|
// Target temperature might be changed during the loop
|
3069
|
3070
|
if (target_temp != degTargetHotend(target_extruder)) {
|
|
@@ -3137,6 +3138,7 @@ void Temperature::tick() {
|
3137
|
3138
|
} while (wait_for_heatup && TEMP_CONDITIONS);
|
3138
|
3139
|
|
3139
|
3140
|
if (wait_for_heatup) {
|
|
3141
|
+ wait_for_heatup = false;
|
3140
|
3142
|
#if ENABLED(DWIN_CREALITY_LCD)
|
3141
|
3143
|
HMI_flag.heat_flag = 0;
|
3142
|
3144
|
duration_t elapsed = print_job_timer.duration(); // print timer
|
|
@@ -3145,9 +3147,10 @@ void Temperature::tick() {
|
3145
|
3147
|
ui.reset_status();
|
3146
|
3148
|
#endif
|
3147
|
3149
|
TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onHeatingDone());
|
|
3150
|
+ return true;
|
3148
|
3151
|
}
|
3149
|
3152
|
|
3150
|
|
- return wait_for_heatup;
|
|
3153
|
+ return false;
|
3151
|
3154
|
}
|
3152
|
3155
|
|
3153
|
3156
|
#endif // HAS_TEMP_HOTEND
|
|
@@ -3176,11 +3179,6 @@ void Temperature::tick() {
|
3176
|
3179
|
#define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed())
|
3177
|
3180
|
#endif
|
3178
|
3181
|
|
3179
|
|
- float target_temp = -1, old_temp = 9999;
|
3180
|
|
- bool wants_to_cool = false;
|
3181
|
|
- wait_for_heatup = true;
|
3182
|
|
- millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
|
3183
|
|
-
|
3184
|
3182
|
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
|
3185
|
3183
|
KEEPALIVE_STATE(NOT_BUSY);
|
3186
|
3184
|
#endif
|
|
@@ -3190,6 +3188,10 @@ void Temperature::tick() {
|
3190
|
3188
|
printerEventLEDs.onBedHeatingStart();
|
3191
|
3189
|
#endif
|
3192
|
3190
|
|
|
3191
|
+ bool wants_to_cool = false;
|
|
3192
|
+ float target_temp = -1, old_temp = 9999;
|
|
3193
|
+ millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
|
|
3194
|
+ wait_for_heatup = true;
|
3193
|
3195
|
do {
|
3194
|
3196
|
// Target temperature might be changed during the loop
|
3195
|
3197
|
if (target_temp != degTargetBed()) {
|
|
@@ -3264,9 +3266,13 @@ void Temperature::tick() {
|
3264
|
3266
|
|
3265
|
3267
|
} while (wait_for_heatup && TEMP_BED_CONDITIONS);
|
3266
|
3268
|
|
3267
|
|
- if (wait_for_heatup) ui.reset_status();
|
|
3269
|
+ if (wait_for_heatup) {
|
|
3270
|
+ wait_for_heatup = false;
|
|
3271
|
+ ui.reset_status();
|
|
3272
|
+ return true;
|
|
3273
|
+ }
|
3268
|
3274
|
|
3269
|
|
- return wait_for_heatup;
|
|
3275
|
+ return false;
|
3270
|
3276
|
}
|
3271
|
3277
|
|
3272
|
3278
|
void Temperature::wait_for_bed_heating() {
|
|
@@ -3280,6 +3286,77 @@ void Temperature::tick() {
|
3280
|
3286
|
|
3281
|
3287
|
#endif // HAS_HEATED_BED
|
3282
|
3288
|
|
|
3289
|
+ #if HAS_TEMP_PROBE
|
|
3290
|
+
|
|
3291
|
+ #ifndef MIN_DELTA_SLOPE_DEG_PROBE
|
|
3292
|
+ #define MIN_DELTA_SLOPE_DEG_PROBE 1.0
|
|
3293
|
+ #endif
|
|
3294
|
+ #ifndef MIN_DELTA_SLOPE_TIME_PROBE
|
|
3295
|
+ #define MIN_DELTA_SLOPE_TIME_PROBE 600
|
|
3296
|
+ #endif
|
|
3297
|
+
|
|
3298
|
+ bool Temperature::wait_for_probe(const float target_temp, bool no_wait_for_cooling/*=true*/) {
|
|
3299
|
+
|
|
3300
|
+ const bool wants_to_cool = isProbeAboveTemp(target_temp);
|
|
3301
|
+ const bool will_wait = !(wants_to_cool && no_wait_for_cooling);
|
|
3302
|
+ if (will_wait)
|
|
3303
|
+ SERIAL_ECHOLNPAIR("Waiting for probe to ", (wants_to_cool ? PSTR("cool down") : PSTR("heat up")), " to ", target_temp, " degrees.");
|
|
3304
|
+
|
|
3305
|
+ #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
|
|
3306
|
+ KEEPALIVE_STATE(NOT_BUSY);
|
|
3307
|
+ #endif
|
|
3308
|
+
|
|
3309
|
+ float old_temp = 9999;
|
|
3310
|
+ millis_t next_temp_ms = 0, next_delta_check_ms = 0;
|
|
3311
|
+ wait_for_heatup = true;
|
|
3312
|
+ while (will_wait && wait_for_heatup) {
|
|
3313
|
+
|
|
3314
|
+ // Print Temp Reading every 10 seconds while heating up.
|
|
3315
|
+ millis_t now = millis();
|
|
3316
|
+ if (!next_temp_ms || ELAPSED(now, next_temp_ms)) {
|
|
3317
|
+ next_temp_ms = now + 10000UL;
|
|
3318
|
+ print_heater_states(active_extruder);
|
|
3319
|
+ SERIAL_EOL();
|
|
3320
|
+ }
|
|
3321
|
+
|
|
3322
|
+ idle();
|
|
3323
|
+ gcode.reset_stepper_timeout(); // Keep steppers powered
|
|
3324
|
+
|
|
3325
|
+ // Break after MIN_DELTA_SLOPE_TIME_PROBE seconds if the temperature
|
|
3326
|
+ // did not drop at least MIN_DELTA_SLOPE_DEG_PROBE. This avoids waiting
|
|
3327
|
+ // forever as the probe is not actively heated.
|
|
3328
|
+ if (!next_delta_check_ms || ELAPSED(now, next_delta_check_ms)) {
|
|
3329
|
+ const float temp = degProbe(),
|
|
3330
|
+ delta_temp = old_temp > temp ? old_temp - temp : temp - old_temp;
|
|
3331
|
+ if (delta_temp < float(MIN_DELTA_SLOPE_DEG_PROBE)) {
|
|
3332
|
+ SERIAL_ECHOLNPGM("Timed out waiting for probe temperature.");
|
|
3333
|
+ break;
|
|
3334
|
+ }
|
|
3335
|
+ next_delta_check_ms = now + 1000UL * MIN_DELTA_SLOPE_TIME_PROBE;
|
|
3336
|
+ old_temp = temp;
|
|
3337
|
+ }
|
|
3338
|
+
|
|
3339
|
+ // Loop until the temperature is very close target
|
|
3340
|
+ if (!(wants_to_cool ? isProbeAboveTemp(target_temp) : isProbeBelowTemp(target_temp))) {
|
|
3341
|
+ SERIAL_ECHOLN(wants_to_cool ? PSTR("Cooldown") : PSTR("Heatup"));
|
|
3342
|
+ SERIAL_ECHOLNPGM(" complete, target probe temperature reached.");
|
|
3343
|
+ break;
|
|
3344
|
+ }
|
|
3345
|
+ }
|
|
3346
|
+
|
|
3347
|
+ if (wait_for_heatup) {
|
|
3348
|
+ wait_for_heatup = false;
|
|
3349
|
+ ui.reset_status();
|
|
3350
|
+ return true;
|
|
3351
|
+ }
|
|
3352
|
+ else if (will_wait)
|
|
3353
|
+ SERIAL_ECHOLNPGM("Canceled wait for probe temperature.");
|
|
3354
|
+
|
|
3355
|
+ return false;
|
|
3356
|
+ }
|
|
3357
|
+
|
|
3358
|
+ #endif // HAS_TEMP_PROBE
|
|
3359
|
+
|
3283
|
3360
|
#if HAS_HEATED_CHAMBER
|
3284
|
3361
|
|
3285
|
3362
|
#ifndef MIN_COOLING_SLOPE_DEG_CHAMBER
|
|
@@ -3300,15 +3377,14 @@ void Temperature::tick() {
|
3300
|
3377
|
#define TEMP_CHAMBER_CONDITIONS (wants_to_cool ? isCoolingChamber() : isHeatingChamber())
|
3301
|
3378
|
#endif
|
3302
|
3379
|
|
3303
|
|
- float target_temp = -1, old_temp = 9999;
|
3304
|
|
- bool wants_to_cool = false;
|
3305
|
|
- wait_for_heatup = true;
|
3306
|
|
- millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
|
3307
|
|
-
|
3308
|
3380
|
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
|
3309
|
3381
|
KEEPALIVE_STATE(NOT_BUSY);
|
3310
|
3382
|
#endif
|
3311
|
3383
|
|
|
3384
|
+ bool wants_to_cool = false;
|
|
3385
|
+ float target_temp = -1, old_temp = 9999;
|
|
3386
|
+ millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
|
|
3387
|
+ wait_for_heatup = true;
|
3312
|
3388
|
do {
|
3313
|
3389
|
// Target temperature might be changed during the loop
|
3314
|
3390
|
if (target_temp != degTargetChamber()) {
|
|
@@ -3367,9 +3443,13 @@ void Temperature::tick() {
|
3367
|
3443
|
}
|
3368
|
3444
|
} while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS);
|
3369
|
3445
|
|
3370
|
|
- if (wait_for_heatup) ui.reset_status();
|
|
3446
|
+ if (wait_for_heatup) {
|
|
3447
|
+ wait_for_heatup = false;
|
|
3448
|
+ ui.reset_status();
|
|
3449
|
+ return true;
|
|
3450
|
+ }
|
3371
|
3451
|
|
3372
|
|
- return wait_for_heatup;
|
|
3452
|
+ return false;
|
3373
|
3453
|
}
|
3374
|
3454
|
|
3375
|
3455
|
#endif // HAS_HEATED_CHAMBER
|