|
|
@ -233,8 +233,8 @@ hotend_info_t Temperature::temp_hotend[HOTENDS]; // = { 0 }
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if WATCH_CHAMBER
|
|
|
|
#if WATCH_CHAMBER
|
|
|
|
heater_watch_t Temperature::watch_chamber = { 0 };
|
|
|
|
heater_watch_t Temperature::watch_chamber = { 0 };
|
|
|
|
millis_t Temperature::next_chamber_check_ms;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
millis_t Temperature::next_chamber_check_ms;
|
|
|
|
#endif // HAS_HEATED_CHAMBER
|
|
|
|
#endif // HAS_HEATED_CHAMBER
|
|
|
|
#endif // HAS_TEMP_CHAMBER
|
|
|
|
#endif // HAS_TEMP_CHAMBER
|
|
|
|
|
|
|
|
|
|
|
@ -1058,12 +1058,14 @@ void Temperature::manage_heater() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // WATCH_BED
|
|
|
|
#endif // WATCH_BED
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(PIDTEMPBED)
|
|
|
|
#if DISABLED(PIDTEMPBED)
|
|
|
|
if (PENDING(ms, next_bed_check_ms)
|
|
|
|
if (PENDING(ms, next_bed_check_ms)
|
|
|
|
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
|
|
|
|
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
|
|
|
|
&& paused == last_pause_state
|
|
|
|
&& paused == last_pause_state
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
) return;
|
|
|
|
) break;
|
|
|
|
next_bed_check_ms = ms + BED_CHECK_INTERVAL;
|
|
|
|
next_bed_check_ms = ms + BED_CHECK_INTERVAL;
|
|
|
|
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
|
|
|
|
#if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
|
|
|
|
last_pause_state = paused;
|
|
|
|
last_pause_state = paused;
|
|
|
@ -1108,6 +1110,9 @@ void Temperature::manage_heater() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HAS_HEATED_BED
|
|
|
|
#endif // HAS_HEATED_BED
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_HEATED_CHAMBER
|
|
|
|
#if HAS_HEATED_CHAMBER
|
|
|
@ -1129,9 +1134,9 @@ void Temperature::manage_heater() {
|
|
|
|
else
|
|
|
|
else
|
|
|
|
start_watching_chamber(); // Start again if the target is still far off
|
|
|
|
start_watching_chamber(); // Start again if the target is still far off
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // WATCH_CHAMBER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (PENDING(ms, next_chamber_check_ms)) return;
|
|
|
|
if (ELAPSED(ms, next_chamber_check_ms)) {
|
|
|
|
next_chamber_check_ms = ms + CHAMBER_CHECK_INTERVAL;
|
|
|
|
next_chamber_check_ms = ms + CHAMBER_CHECK_INTERVAL;
|
|
|
|
|
|
|
|
|
|
|
|
if (WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) {
|
|
|
|
if (WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) {
|
|
|
@ -1152,6 +1157,7 @@ void Temperature::manage_heater() {
|
|
|
|
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
|
|
|
|
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
|
|
|
|
thermal_runaway_protection(tr_state_machine_chamber, temp_chamber.current, temp_chamber.target, -2, THERMAL_PROTECTION_CHAMBER_PERIOD, THERMAL_PROTECTION_CHAMBER_HYSTERESIS);
|
|
|
|
thermal_runaway_protection(tr_state_machine_chamber, temp_chamber.current, temp_chamber.target, -2, THERMAL_PROTECTION_CHAMBER_PERIOD, THERMAL_PROTECTION_CHAMBER_HYSTERESIS);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Implement true PID pwm
|
|
|
|
// TODO: Implement true PID pwm
|
|
|
|
//temp_bed.soft_pwm_amount = WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP) ? (int)get_pid_output_chamber() >> 1 : 0;
|
|
|
|
//temp_bed.soft_pwm_amount = WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP) ? (int)get_pid_output_chamber() >> 1 : 0;
|
|
|
@ -1788,8 +1794,8 @@ void Temperature::init() {
|
|
|
|
|
|
|
|
|
|
|
|
#if WATCH_CHAMBER
|
|
|
|
#if WATCH_CHAMBER
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Start Heating Sanity Check for hotends that are below
|
|
|
|
* Start Heating Sanity Check for chamber that is below
|
|
|
|
* their target temperature by a configurable margin.
|
|
|
|
* its target temperature by a configurable margin.
|
|
|
|
* This is called when the temperature is set. (M141, M191)
|
|
|
|
* This is called when the temperature is set. (M141, M191)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void Temperature::start_watching_chamber() {
|
|
|
|
void Temperature::start_watching_chamber() {
|
|
|
|