Temperature variance monitor (#23373)

This commit is contained in:
John Lagonikas
2022-01-02 02:18:07 +02:00
committed by GitHub
parent 4de84031d8
commit 63f71d85f2
7 changed files with 64 additions and 9 deletions

View File

@@ -1035,12 +1035,18 @@ class Temperature {
return (RunawayIndex)_MAX(heater_id, 0);
}
enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway };
enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway
OPTARG(THERMAL_PROTECTION_VARIANCE_MONITOR, TRMalfunction)
};
typedef struct {
millis_t timer = 0;
TRState state = TRInactive;
float running_temp;
#if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR)
millis_t variance_timer = 0;
celsius_float_t last_temp = 0.0, variance = 0.0;
#endif
void run(const_celsius_float_t current, const_celsius_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc);
} tr_state_machine_t;