Aquarium Cooling Controller
ESP32 firmware for aquarium cooling fan control, monitoring, telemetry, and fault handling.
Loading...
Searching...
No Matches
Classes | Namespaces | Functions | Variables
fan_curve.h File Reference

Measured fan PWM-to-RPM curve and plausibility helpers. More...

#include <Arduino.h>
Include dependency graph for fan_curve.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FanCurvePoint
 One measured point in the fan curve. More...
 

Namespaces

namespace  FanCurve
 Fan characterization table and interpolation helpers.
 

Functions

size_t FanCurve::pointCount ()
 Returns the number of measured fan-curve points.
 
const FanCurvePointFanCurve::points ()
 Returns the measured fan-curve table.
 
uint16_t FanCurve::expectedRpmForPwm (uint8_t pwmPercent)
 Interpolates the expected RPM for a PWM command.
 
uint16_t FanCurve::rpmToleranceForExpected (uint16_t expectedRpm)
 Calculates the tolerated RPM deviation for an expected speed.
 
bool FanCurve::isPlausibilityRegion (uint8_t pwmPercent)
 Checks whether a PWM command is high enough for RPM plausibility checks.
 

Variables

constexpr uint8_t FanCurve::kStartPwmPercent = 12
 PWM where the fan reliably starts.
 
constexpr uint8_t FanCurve::kMinimumHoldPwmPercent = 10
 Lowest PWM used after the fan is spinning.
 
constexpr uint8_t FanCurve::kMinimumPlausibilityPwmPercent = 18
 Minimum PWM where RPM plausibility is checked.
 
constexpr uint8_t FanCurve::kPlausibilityTolerancePercent = 12
 RPM tolerance around the expected curve.
 

Detailed Description

Measured fan PWM-to-RPM curve and plausibility helpers.

The curve represents the production fan used by the controller. It is shared by diagnostics and fault detection so expected RPM values are calculated from the same measured data that is shown over serial output.