Humidistat
Arduino firmware for a humidistat (humidity controller)
|
Base class for a humidistat. Holds a reference to a HumiditySensor instance. More...
#include <Humidistat.h>
Public Member Functions | |
Humidistat (const ConfigStore *cs, HumiditySensor *hs, double Kp, double Ki, double Kd, double Kf, uint16_t dt, double cvMin, double cvMax) | |
Constructor. | |
double | getHumidity () const |
Read the humidity. | |
double | getTemperature () const |
Read the temperature. | |
double | getCvMin () const |
double | getCvMax () const |
Public Member Functions inherited from Controller | |
Controller (const ConfigStore *cs, double Kp, double Ki, double Kd, double Kf, uint16_t dt, double cvMin, double cvMax, double defaultSP, double defaultCV) | |
Constructor. | |
void | getTerms (double &pTerm, double &iTerm, double &dTerm) const |
Get the three PID terms by reference. | |
void | update () |
Run the controller: Typically reads a sensor, runs a cycle of the PID loop and drives some actuator. | |
void | updatePIDParameters () |
Update the PID parameters from the configStore. | |
const ConfigStore * | getConfigStore () |
Get a pointer to the ConfigStore instance. | |
Protected Member Functions | |
void | runCycle () |
Run a cycle of the controller. Reads a sample from the humidity controller and runs PID. | |
Protected Attributes | |
HumiditySensor & | hs |
Protected Attributes inherited from Controller | |
PID | pid |
const ConfigStore & | cs |
unsigned long | sensorLastRead = 0 |
Additional Inherited Members | |
Public Attributes inherited from Controller | |
bool | active = false |
double | pv = 0 |
Process variable. | |
double | sp |
Setpoint. | |
double | cv |
Control variable. | |
Base class for a humidistat. Holds a reference to a HumiditySensor instance.
Definition at line 10 of file Humidistat.h.
Humidistat::Humidistat | ( | const ConfigStore * | cs, |
HumiditySensor * | hs, | ||
double | Kp, | ||
double | Ki, | ||
double | Kd, | ||
double | Kf, | ||
uint16_t | dt, | ||
double | cvMin, | ||
double | cvMax ) |
Constructor.
cs | Pointer to a ConfigStore instance |
hs | Pointer to a HumiditySensor instance |
Kp | Proportional gain |
Ki | Integral gain (in 1/s) |
Kd | Derivative gain (in s) |
Kf | Feed-forward gain |
dt | Timestep (in ms) |
cvMin | Lower limit for control value |
cvMax | Upper limit for control value |
Definition at line 3 of file Humidistat.cpp.
double Humidistat::getCvMax | ( | ) | const |
double Humidistat::getCvMin | ( | ) | const |
double Humidistat::getHumidity | ( | ) | const |
Read the humidity.
Definition at line 7 of file Humidistat.cpp.
double Humidistat::getTemperature | ( | ) | const |
Read the temperature.
Definition at line 11 of file Humidistat.cpp.
|
protected |
Run a cycle of the controller. Reads a sample from the humidity controller and runs PID.
Definition at line 15 of file Humidistat.cpp.
|
protected |
Definition at line 12 of file Humidistat.h.