Humidistat
Arduino firmware for a humidistat (humidity controller)
Loading...
Searching...
No Matches
Humidistat Class Reference

Base class for a humidistat. Holds a reference to a HumiditySensor instance. More...

#include <Humidistat.h>

Inheritance diagram for Humidistat:
[legend]
Collaboration diagram for Humidistat:
[legend]

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 ConfigStoregetConfigStore ()
 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 ConfigStorecs
 
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.
 

Detailed Description

Base class for a humidistat. Holds a reference to a HumiditySensor instance.

Definition at line 10 of file Humidistat.h.

Constructor & Destructor Documentation

◆ Humidistat()

Humidistat::Humidistat ( const ConfigStore * cs,
HumiditySensor * hs,
double Kp,
double Ki,
double Kd,
double Kf,
uint16_t dt,
double cvMin,
double cvMax )

Constructor.

Parameters
csPointer to a ConfigStore instance
hsPointer to a HumiditySensor instance
KpProportional gain
KiIntegral gain (in 1/s)
KdDerivative gain (in s)
KfFeed-forward gain
dtTimestep (in ms)
cvMinLower limit for control value
cvMaxUpper limit for control value

Definition at line 3 of file Humidistat.cpp.

Member Function Documentation

◆ getCvMax()

double Humidistat::getCvMax ( ) const

Definition at line 35 of file Humidistat.cpp.

Here is the caller graph for this function:

◆ getCvMin()

double Humidistat::getCvMin ( ) const

Definition at line 31 of file Humidistat.cpp.

Here is the caller graph for this function:

◆ getHumidity()

double Humidistat::getHumidity ( ) const

Read the humidity.

Returns
Relative humidity (percent)

Definition at line 7 of file Humidistat.cpp.

Here is the caller graph for this function:

◆ getTemperature()

double Humidistat::getTemperature ( ) const

Read the temperature.

Returns
Temperature (Celsius)

Definition at line 11 of file Humidistat.cpp.

Here is the caller graph for this function:

◆ runCycle()

void Humidistat::runCycle ( )
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.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ hs

HumiditySensor& Humidistat::hs
protected

Definition at line 12 of file Humidistat.h.


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