4 dt,
double cvMin,
double cvMax)
5 :
Controller(cs, Kp, Ki, Kd, Kf, dt, cvMin, cvMax, 50, (cvMin + cvMax) / 2), hs(*hs) {}
8 return hs.getHumidity();
12 return hs.getTemperature();
24 if (!isnan(
hs.getHumidity()))
25 pv =
hs.getHumidity();
Base class for a controller. Owns a PID instance, and holds a reference to a ConfigStore instance.
double pv
Process variable.
unsigned long sensorLastRead
double getHumidity() const
Read the humidity.
Humidistat(const ConfigStore *cs, HumiditySensor *hs, double Kp, double Ki, double Kd, double Kf, uint16_t dt, double cvMin, double cvMax)
Constructor.
double getTemperature() const
Read the temperature.
void runCycle()
Run a cycle of the controller. Reads a sample from the humidity controller and runs PID.
void setAuto(bool inAuto)
Set the mode of the controller.
bool compute()
Run a cycle of the PID loop.
double cvMax
Lower/upper limits for cv.
Config store containing variables, which can be stored in EEPROM.
uint16_t dt
Global interval for PID/logger (based on polling rate of sensor, in millis)