Skip to content

Commit

Permalink
fix preheating
Browse files Browse the repository at this point in the history
  • Loading branch information
studiodyne committed Nov 8, 2022
1 parent c209626 commit 22b42db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2317,8 +2317,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5
#error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5."
#elif MILLISECONDS_PREHEAT_TIME < 30000
#error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 30000."
#elif MILLISECONDS_PREHEAT_TIME < 15000
#error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 15000."
#endif
#undef _BAD_MINTEMP
#endif
Expand Down
10 changes: 9 additions & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2407,7 +2407,15 @@ void Temperature::updateTemperaturesFromRawValues() {
max_temp_error((heater_id_t)e);

const bool heater_on = temp_hotend[e].target > 0;
if (heater_on && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min))) {

/*
//DEBUG PREHEAT HEATER
SERIAL_ECHOLNPGM("\nExtruder = ", e ," Preheating On/Off = ",is_preheating(e));
const float test_is_preheating = (preheat_end_time[HOTEND_INDEX] - millis()) / 1000;
if (test_is_preheating < 31) SERIAL_ECHOLNPGM("Extruder = ", e ," Preheating remaining time = ", test_is_preheating , "s", "\n");
*/

if (!is_preheating(e) && (heater_on && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min)))) {
if (TERN1(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, ++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED))
min_temp_error((heater_id_t)e);
}
Expand Down

0 comments on commit 22b42db

Please sign in to comment.