|
Aquarium Cooling Controller
ESP32 firmware for aquarium cooling fan control, monitoring, telemetry, and fault handling.
|
Pure cooling-control calculations. More...
Functions | |
| bool | isTargetTemperatureValid (float targetTemperatureC, const ControlConfig &config=kDefaultControlConfig) |
| Checks whether a target temperature is finite and inside configured limits. | |
| bool | isControlConfigValid (const ControlConfig &config) |
| Checks whether a full staged-control configuration is internally valid. | |
| float | sanitizeTargetTemperature (float targetTemperatureC, const ControlConfig &config=kDefaultControlConfig) |
| Replaces invalid target temperatures with the configured default. | |
| ControlSnapshot | compute (const ControlInputs &inputs, const ControlConfig &config=kDefaultControlConfig) |
| Computes the fan command and control mode for the current inputs. | |
| const char * | modeLabel (ControlMode mode) |
| Converts a control mode to a stable diagnostic label. | |
Pure cooling-control calculations.
Functions in this namespace avoid direct hardware access. Callers provide sensor validity and temperature values, and the namespace returns the PWM decision plus stable labels for logs and telemetry.
| ControlSnapshot ControlEngine::compute | ( | const ControlInputs & | inputs, |
| const ControlConfig & | config = kDefaultControlConfig |
||
| ) |
Computes the fan command and control mode for the current inputs.
Water temperature is the only closed-loop control variable. The previous control mode is used to hold the current state within the hysteresis band. If the water sensor is invalid, the configured fallback PWM is used.
| inputs | Sensor validity, measured temperatures, and requested target. |
| config | Control limits and hysteresis settings. |
| bool ControlEngine::isControlConfigValid | ( | const ControlConfig & | config | ) |
Checks whether a full staged-control configuration is internally valid.
| config | Candidate control configuration. |
| bool ControlEngine::isTargetTemperatureValid | ( | float | targetTemperatureC, |
| const ControlConfig & | config = kDefaultControlConfig |
||
| ) |
Checks whether a target temperature is finite and inside configured limits.
| targetTemperatureC | Candidate target temperature in degrees Celsius. |
| config | Control limits used for validation. |
| const char * ControlEngine::modeLabel | ( | ControlMode | mode | ) |
Converts a control mode to a stable diagnostic label.
| mode | Control mode to label. |
| float ControlEngine::sanitizeTargetTemperature | ( | float | targetTemperatureC, |
| const ControlConfig & | config = kDefaultControlConfig |
||
| ) |
Replaces invalid target temperatures with the configured default.
| targetTemperatureC | Candidate target temperature in degrees Celsius. |
| config | Control limits and default target. |