Humidistat
Arduino firmware for a humidistat (humidity controller)
Loading...
Searching...
No Matches
Controller.cpp
Go to the documentation of this file.
1#include "Controller.h"
2
3Controller::Controller(const ConfigStore *cs, double Kp, double Ki, double Kd, double Kf, uint16_t dt, double cvMin,
4 double cvMax, double defaultSP, double defaultCV)
5 : pid(&pv, &cv, &sp, Kp, Ki, Kd, Kf, dt, cvMin, cvMax, cs->a), cs(*cs), sp(defaultSP), cv(defaultCV) {}
6
7void Controller::getTerms(double &pTerm, double &iTerm, double &dTerm) const {
8 pTerm = pid.pTerm;
9 iTerm = pid.iTerm;
10 dTerm = pid.dTerm;
11}
12
14 return &cs;
15}
const ConfigStore * getConfigStore()
Get a pointer to the ConfigStore instance.
Controller(const ConfigStore *cs, double Kp, double Ki, double Kd, double Kf, uint16_t dt, double cvMin, double cvMax, double defaultSP, double defaultCV)
Constructor.
Definition Controller.cpp:3
const ConfigStore & cs
Definition Controller.h:14
void getTerms(double &pTerm, double &iTerm, double &dTerm) const
Get the three PID terms by reference.
Definition Controller.cpp:7
double iTerm
Definition PID.h:33
double dTerm
Definition PID.h:33
double pTerm
Definition PID.h:33
Config store containing variables, which can be stored in EEPROM.
Definition EEPROMConfig.h:7