|
|
@@ -524,7 +524,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
|
|
|
#if HAS_TEMP_CHAMBER
|
|
|
|
#if HAS_TEMP_CHAMBER
|
|
|
|
chamber_info_t Temperature::temp_chamber; // = { 0 }
|
|
|
|
chamber_info_t Temperature::temp_chamber; // = { 0 }
|
|
|
|
#if HAS_HEATED_CHAMBER
|
|
|
|
#if HAS_HEATED_CHAMBER
|
|
|
|
millis_t next_cool_check_ms_2 = 0;
|
|
|
|
millis_t next_cool_check_ms = 0;
|
|
|
|
celsius_float_t old_temp = 9999;
|
|
|
|
celsius_float_t old_temp = 9999;
|
|
|
|
raw_adc_t Temperature::mintemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_LO_TEMP,
|
|
|
|
raw_adc_t Temperature::mintemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_LO_TEMP,
|
|
|
|
Temperature::maxtemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_HI_TEMP;
|
|
|
|
Temperature::maxtemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_HI_TEMP;
|
|
|
@@ -546,7 +546,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
|
|
|
raw_adc_t Temperature::mintemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_LO_TEMP,
|
|
|
|
raw_adc_t Temperature::mintemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_LO_TEMP,
|
|
|
|
Temperature::maxtemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_HI_TEMP;
|
|
|
|
Temperature::maxtemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_HI_TEMP;
|
|
|
|
#if WATCH_COOLER
|
|
|
|
#if WATCH_COOLER
|
|
|
|
cooler_watch_t Temperature::watch_cooler{0};
|
|
|
|
cooler_watch_t Temperature::watch_cooler; // = { 0 }
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
millis_t Temperature::next_cooler_check_ms, Temperature::cooler_fan_flush_ms;
|
|
|
|
millis_t Temperature::next_cooler_check_ms, Temperature::cooler_fan_flush_ms;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@@ -617,11 +617,11 @@ volatile bool Temperature::raw_temps_ready = false;
|
|
|
|
|
|
|
|
|
|
|
|
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1
|
|
|
|
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1
|
|
|
|
#define MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR 1
|
|
|
|
#define MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR 1
|
|
|
|
uint8_t Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 };
|
|
|
|
uint8_t Temperature::consecutive_low_temperature_error[HOTENDS]; // = { 0 }
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if PREHEAT_TIME_HOTEND_MS > 0
|
|
|
|
#if PREHEAT_TIME_HOTEND_MS > 0
|
|
|
|
millis_t Temperature::preheat_end_ms_hotend[HOTENDS] { 0 };
|
|
|
|
millis_t Temperature::preheat_end_ms_hotend[HOTENDS]; // = { 0 };
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if HAS_HEATED_BED && PREHEAT_TIME_BED_MS > 0
|
|
|
|
#if HAS_HEATED_BED && PREHEAT_TIME_BED_MS > 0
|
|
|
|
millis_t Temperature::preheat_end_ms_bed = 0;
|
|
|
|
millis_t Temperature::preheat_end_ms_bed = 0;
|
|
|
@@ -1781,15 +1781,15 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
|
|
|
|
if (!flag_chamber_excess_heat && temp_chamber.is_above_target((HIGH_EXCESS_HEAT_LIMIT) - 1)) {
|
|
|
|
if (!flag_chamber_excess_heat && temp_chamber.is_above_target((HIGH_EXCESS_HEAT_LIMIT) - 1)) {
|
|
|
|
// Open vent after MIN_COOLING_SLOPE_TIME_CHAMBER_VENT seconds if the
|
|
|
|
// Open vent after MIN_COOLING_SLOPE_TIME_CHAMBER_VENT seconds if the
|
|
|
|
// temperature didn't drop at least MIN_COOLING_SLOPE_DEG_CHAMBER_VENT
|
|
|
|
// temperature didn't drop at least MIN_COOLING_SLOPE_DEG_CHAMBER_VENT
|
|
|
|
if (next_cool_check_ms_2 == 0 || ELAPSED(ms, next_cool_check_ms_2)) {
|
|
|
|
if (next_cool_check_ms == 0 || ELAPSED(ms, next_cool_check_ms)) {
|
|
|
|
if (temp_chamber.celsius - old_temp > MIN_COOLING_SLOPE_DEG_CHAMBER_VENT)
|
|
|
|
if (temp_chamber.celsius - old_temp > MIN_COOLING_SLOPE_DEG_CHAMBER_VENT)
|
|
|
|
flag_chamber_excess_heat = true; // the bed is heating the chamber too much
|
|
|
|
flag_chamber_excess_heat = true; // the bed is heating the chamber too much
|
|
|
|
next_cool_check_ms_2 = ms + SEC_TO_MS(MIN_COOLING_SLOPE_TIME_CHAMBER_VENT);
|
|
|
|
next_cool_check_ms = ms + SEC_TO_MS(MIN_COOLING_SLOPE_TIME_CHAMBER_VENT);
|
|
|
|
old_temp = temp_chamber.celsius;
|
|
|
|
old_temp = temp_chamber.celsius;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
next_cool_check_ms_2 = 0;
|
|
|
|
next_cool_check_ms = 0;
|
|
|
|
old_temp = 9999;
|
|
|
|
old_temp = 9999;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (flag_chamber_excess_heat && temp_chamber.is_above_target((LOW_EXCESS_HEAT_LIMIT) - 1))
|
|
|
|
if (flag_chamber_excess_heat && temp_chamber.is_above_target((LOW_EXCESS_HEAT_LIMIT) - 1))
|
|
|
@@ -2492,7 +2492,7 @@ void Temperature::updateTemperaturesFromRawValues() {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
// DEBUG PREHEATING TIME
|
|
|
|
// DEBUG PREHEATING TIME
|
|
|
|
SERIAL_ECHOLNPGM("\nExtruder = ", e, " Preheat On/Off = ", is_preheating(e));
|
|
|
|
SERIAL_ECHOLNPGM("\nExtruder = ", e, " Preheat On/Off = ", is_preheating(e));
|
|
|
|
const float test_is_preheating = (preheat_end_time[HOTEND_INDEX] - millis()) * 0.001f;
|
|
|
|
const float test_is_preheating = (preheat_end_ms_hotend[HOTEND_INDEX] - millis()) * 0.001f;
|
|
|
|
if (test_is_preheating < 31) SERIAL_ECHOLNPGM("Extruder = ", e, " Preheat remaining time = ", test_is_preheating, "s", "\n");
|
|
|
|
if (test_is_preheating < 31) SERIAL_ECHOLNPGM("Extruder = ", e, " Preheat remaining time = ", test_is_preheating, "s", "\n");
|
|
|
|
//*/
|
|
|
|
//*/
|
|
|
|
|
|
|
|
|
|
|
@@ -3551,7 +3551,7 @@ void Temperature::isr() {
|
|
|
|
#if ENABLED(FAN_SOFT_PWM)
|
|
|
|
#if ENABLED(FAN_SOFT_PWM)
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(USE_CONTROLLER_FAN)
|
|
|
|
#if ENABLED(USE_CONTROLLER_FAN)
|
|
|
|
WRITE(CONTROLLER_FAN_PIN, soft_pwm_controller.add(pwm_mask, soft_pwm_controller_speed));
|
|
|
|
WRITE(CONTROLLER_FAN_PIN, soft_pwm_controller.add(pwm_mask, controllerFan.soft_pwm_speed));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#define _FAN_PWM(N) do{ \
|
|
|
|
#define _FAN_PWM(N) do{ \
|
|
|
@@ -4183,7 +4183,7 @@ void Temperature::isr() {
|
|
|
|
|
|
|
|
|
|
|
|
bool wants_to_cool = false;
|
|
|
|
bool wants_to_cool = false;
|
|
|
|
celsius_float_t target_temp = -1.0, old_temp = 9999.0;
|
|
|
|
celsius_float_t 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, cool_check_ms = 0;
|
|
|
|
wait_for_heatup = true;
|
|
|
|
wait_for_heatup = true;
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
// Target temperature might be changed during the loop
|
|
|
|
// Target temperature might be changed during the loop
|
|
|
@@ -4241,9 +4241,9 @@ void Temperature::isr() {
|
|
|
|
if (wants_to_cool) {
|
|
|
|
if (wants_to_cool) {
|
|
|
|
// Break after MIN_COOLING_SLOPE_TIME seconds
|
|
|
|
// Break after MIN_COOLING_SLOPE_TIME seconds
|
|
|
|
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG
|
|
|
|
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG
|
|
|
|
if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
|
|
|
|
if (!cool_check_ms || ELAPSED(now, cool_check_ms)) {
|
|
|
|
if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break;
|
|
|
|
if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break;
|
|
|
|
next_cool_check_ms = now + SEC_TO_MS(MIN_COOLING_SLOPE_TIME);
|
|
|
|
cool_check_ms = now + SEC_TO_MS(MIN_COOLING_SLOPE_TIME);
|
|
|
|
old_temp = temp;
|
|
|
|
old_temp = temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -4320,7 +4320,7 @@ void Temperature::isr() {
|
|
|
|
|
|
|
|
|
|
|
|
bool wants_to_cool = false;
|
|
|
|
bool wants_to_cool = false;
|
|
|
|
celsius_float_t target_temp = -1, old_temp = 9999;
|
|
|
|
celsius_float_t target_temp = -1, old_temp = 9999;
|
|
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
|
|
|
|
millis_t now, next_temp_ms = 0, cool_check_ms = 0;
|
|
|
|
wait_for_heatup = true;
|
|
|
|
wait_for_heatup = true;
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
// Target temperature might be changed during the loop
|
|
|
|
// Target temperature might be changed during the loop
|
|
|
@@ -4376,9 +4376,9 @@ void Temperature::isr() {
|
|
|
|
if (wants_to_cool) {
|
|
|
|
if (wants_to_cool) {
|
|
|
|
// Break after MIN_COOLING_SLOPE_TIME_BED seconds
|
|
|
|
// Break after MIN_COOLING_SLOPE_TIME_BED seconds
|
|
|
|
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED
|
|
|
|
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED
|
|
|
|
if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
|
|
|
|
if (!cool_check_ms || ELAPSED(now, cool_check_ms)) {
|
|
|
|
if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_BED)) break;
|
|
|
|
if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_BED)) break;
|
|
|
|
next_cool_check_ms = now + SEC_TO_MS(MIN_COOLING_SLOPE_TIME_BED);
|
|
|
|
cool_check_ms = now + SEC_TO_MS(MIN_COOLING_SLOPE_TIME_BED);
|
|
|
|
old_temp = temp;
|
|
|
|
old_temp = temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -4515,7 +4515,7 @@ void Temperature::isr() {
|
|
|
|
|
|
|
|
|
|
|
|
bool wants_to_cool = false;
|
|
|
|
bool wants_to_cool = false;
|
|
|
|
float target_temp = -1, old_temp = 9999;
|
|
|
|
float target_temp = -1, old_temp = 9999;
|
|
|
|
millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
|
|
|
|
millis_t now, next_temp_ms = 0, cool_check_ms = 0;
|
|
|
|
wait_for_heatup = true;
|
|
|
|
wait_for_heatup = true;
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
// Target temperature might be changed during the loop
|
|
|
|
// Target temperature might be changed during the loop
|
|
|
@@ -4567,9 +4567,9 @@ void Temperature::isr() {
|
|
|
|
if (wants_to_cool) {
|
|
|
|
if (wants_to_cool) {
|
|
|
|
// Break after MIN_COOLING_SLOPE_TIME_CHAMBER seconds
|
|
|
|
// Break after MIN_COOLING_SLOPE_TIME_CHAMBER seconds
|
|
|
|
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_CHAMBER
|
|
|
|
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_CHAMBER
|
|
|
|
if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
|
|
|
|
if (!cool_check_ms || ELAPSED(now, cool_check_ms)) {
|
|
|
|
if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_CHAMBER)) break;
|
|
|
|
if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_CHAMBER)) break;
|
|
|
|
next_cool_check_ms = now + SEC_TO_MS(MIN_COOLING_SLOPE_TIME_CHAMBER);
|
|
|
|
cool_check_ms = now + SEC_TO_MS(MIN_COOLING_SLOPE_TIME_CHAMBER);
|
|
|
|
old_temp = temp;
|
|
|
|
old_temp = temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|