Aquarium Cooling Controller
ESP32 firmware for aquarium cooling fan control, monitoring, telemetry, and fault handling.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
FaultMonitor Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FaultMonitor()

FaultMonitor::FaultMonitor ( const FaultMonitorConfig config = kDefaultFaultMonitorConfig)
explicit

Creates a fan fault monitor.

Parameters
configFault detection and recovery thresholds.

Member Function Documentation

◆ evaluate()

FaultMonitorSnapshot FaultMonitor::evaluate ( uint8_t  commandedPwmPercent,
uint16_t  measuredRpm,
uint32_t  nowMs 
)

Evaluates fan RPM plausibility for the current PWM command.

Parameters
commandedPwmPercentCurrent fan PWM command in percent.
measuredRpmLatest measured fan speed.
nowMsCurrent monotonic timestamp in milliseconds.
Returns
Snapshot describing the current plausibility and fault state.

The documentation for this class was generated from the following files: