Improve max temp / target
This commit is contained in:
committed by
Scott Lahteine
parent
df1ef496d1
commit
cfa6c7d45b
@ -3386,10 +3386,10 @@ void MarlinSettings::reset() {
|
||||
SERIAL_ECHOLNPAIR_P(
|
||||
PSTR(" M145 S"), i
|
||||
#if HAS_HOTEND
|
||||
, PSTR(" H"), TEMP_UNIT(ui.material_preset[i].hotend_temp)
|
||||
, PSTR(" H"), parser.to_temp_units(ui.material_preset[i].hotend_temp)
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
, SP_B_STR, TEMP_UNIT(ui.material_preset[i].bed_temp)
|
||||
, SP_B_STR, parser.to_temp_units(ui.material_preset[i].bed_temp)
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
, PSTR(" F"), ui.material_preset[i].fan_speed
|
||||
|
@ -253,7 +253,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
|
||||
|
||||
#if HAS_HOTEND
|
||||
hotend_info_t Temperature::temp_hotend[HOTEND_TEMPS]; // = { 0 }
|
||||
const uint16_t Temperature::heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP);
|
||||
const uint16_t Temperature::hotend_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP);
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_POWER_E_FANS)
|
||||
@ -267,6 +267,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
|
||||
#if ENABLED(AUTO_POWER_COOLER_FAN)
|
||||
uint8_t Temperature::coolerfan_speed; // = 0
|
||||
#endif
|
||||
|
||||
#if HAS_FAN
|
||||
|
||||
uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 }
|
||||
@ -552,7 +553,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
|
||||
TERN_(HAS_AUTO_FAN, next_auto_fan_check_ms = next_temp_ms + 2500UL);
|
||||
|
||||
if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - HOTEND_OVERSHOOT)) {
|
||||
if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) {
|
||||
SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
|
||||
return;
|
||||
@ -1512,7 +1513,7 @@ void Temperature::manage_heater() {
|
||||
|
||||
if (cooler.is_enabled()) {
|
||||
flag_cooler_state = true; // used to allow M106 fan control when cooler is disabled
|
||||
if (temp_cooler.target == 0) temp_cooler.target = COOLER_MINTEMP;
|
||||
if (temp_cooler.target == 0) temp_cooler.target = COOLER_MIN_TARGET;
|
||||
if (ELAPSED(ms, next_cooler_check_ms)) {
|
||||
next_cooler_check_ms = ms + COOLER_CHECK_INTERVAL;
|
||||
if (temp_cooler.celsius > temp_cooler.target) {
|
||||
|
@ -323,7 +323,8 @@ class Temperature {
|
||||
#if HAS_HOTEND
|
||||
#define HOTEND_TEMPS (HOTENDS + ENABLED(TEMP_SENSOR_1_AS_REDUNDANT))
|
||||
static hotend_info_t temp_hotend[HOTEND_TEMPS];
|
||||
static const uint16_t heater_maxtemp[HOTENDS];
|
||||
static const uint16_t hotend_maxtemp[HOTENDS];
|
||||
FORCE_INLINE static uint16_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); }
|
||||
#endif
|
||||
TERN_(HAS_HEATED_BED, static bed_info_t temp_bed);
|
||||
TERN_(HAS_TEMP_PROBE, static probe_info_t temp_probe);
|
||||
@ -639,7 +640,7 @@ class Temperature {
|
||||
start_preheat_time(ee);
|
||||
#endif
|
||||
TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on());
|
||||
temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - HOTEND_OVERSHOOT);
|
||||
temp_hotend[ee].target = _MIN(celsius, hotend_max_target(ee));
|
||||
start_watching_hotend(ee);
|
||||
}
|
||||
|
||||
@ -785,13 +786,7 @@ class Temperature {
|
||||
|
||||
#if HAS_COOLER
|
||||
static void setTargetCooler(const int16_t celsius) {
|
||||
temp_cooler.target =
|
||||
#ifdef COOLER_MAXTEMP
|
||||
_MIN(celsius, COOLER_MAXTEMP - 10)
|
||||
#else
|
||||
celsius
|
||||
#endif
|
||||
;
|
||||
temp_cooler.target = constrain(celsius, COOLER_MIN_TARGET, COOLER_MAX_TARGET);
|
||||
start_watching_cooler();
|
||||
}
|
||||
#endif
|
||||
@ -878,7 +873,7 @@ class Temperature {
|
||||
TERN_(HAS_DISPLAY, static void set_heating_message(const uint8_t e));
|
||||
|
||||
#if HAS_LCD_MENU && HAS_TEMPERATURE
|
||||
static void lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb);
|
||||
static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user