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

Controls flow. Holds a reference to a FlowSensor instance. More...

#include <FlowController.h>

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

Public Member Functions

 FlowController (const FlowSensor *fs, const ConfigStore *cs, uint8_t solenoidPin, uint8_t pwmRes)
 Constructor.
 
void update ()
 
void updatePIDParameters ()
 
- 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.
 

Private Attributes

const FlowSensorfs
 
const uint8_t solenoidPin
 
const uint8_t pwmRes
 

Additional Inherited Members

- Public Attributes inherited from Controller
bool active = false
 
double pv = 0
 Process variable.
 
double sp
 Setpoint.
 
double cv
 Control variable.
 
- Protected Attributes inherited from Controller
PID pid
 
const ConfigStorecs
 
unsigned long sensorLastRead = 0
 

Detailed Description

Controls flow. Holds a reference to a FlowSensor instance.

Definition at line 11 of file FlowController.h.

Constructor & Destructor Documentation

◆ FlowController()

FlowController::FlowController ( const FlowSensor * fs,
const ConfigStore * cs,
uint8_t solenoidPin,
uint8_t pwmRes )

Constructor.

Parameters
fsPointer to a FlowSensor instance
csPointer to a ConfigStore instance
solenoidPinSolenoid pin
pwmResPWM resolution (bits)

Definition at line 5 of file FlowController.cpp.

Member Function Documentation

◆ update()

void FlowController::update ( )

Definition at line 9 of file FlowController.cpp.

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

◆ updatePIDParameters()

void FlowController::updatePIDParameters ( )

Definition at line 28 of file FlowController.cpp.

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

Member Data Documentation

◆ fs

const FlowSensor& FlowController::fs
private

Definition at line 13 of file FlowController.h.

◆ pwmRes

const uint8_t FlowController::pwmRes
private

Definition at line 15 of file FlowController.h.

◆ solenoidPin

const uint8_t FlowController::solenoidPin
private

Definition at line 14 of file FlowController.h.


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