|
Aquarium Cooling Controller
ESP32 firmware for aquarium cooling fan control, monitoring, telemetry, and fault handling.
|
Tracks fan RPM plausibility and latches persistent fan faults. More...
#include <fault_monitor.h>
Public Member Functions | |
| FaultMonitor (const FaultMonitorConfig &config=kDefaultFaultMonitorConfig) | |
| Creates a fan fault monitor. | |
| void | reset () |
| Clears counters and any latched fan fault. | |
| FaultMonitorSnapshot | evaluate (uint8_t commandedPwmPercent, uint16_t measuredRpm, uint32_t nowMs) |
| Evaluates fan RPM plausibility for the current PWM command. | |
Tracks fan RPM plausibility and latches persistent fan faults.
The class watches for PWM command changes, waits for fan speed to settle, and then compares measured RPM against the interpolated fan curve. A latched fault clears only after enough consecutive plausible samples have been observed.
|
explicit |
Creates a fan fault monitor.
| config | Fault detection and recovery thresholds. |
| FaultMonitorSnapshot FaultMonitor::evaluate | ( | uint8_t | commandedPwmPercent, |
| uint16_t | measuredRpm, | ||
| uint32_t | nowMs | ||
| ) |
Evaluates fan RPM plausibility for the current PWM command.
| commandedPwmPercent | Current fan PWM command in percent. |
| measuredRpm | Latest measured fan speed. |
| nowMs | Current monotonic timestamp in milliseconds. |