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
3
Controller::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
7
void
Controller::getTerms
(
double
&pTerm,
double
&iTerm,
double
&dTerm)
const
{
8
pTerm =
pid
.
pTerm
;
9
iTerm =
pid
.
iTerm
;
10
dTerm =
pid
.
dTerm
;
11
}
12
13
const
ConfigStore
*
Controller::getConfigStore
() {
14
return
&
cs
;
15
}
Controller.h
Controller::getConfigStore
const ConfigStore * getConfigStore()
Get a pointer to the ConfigStore instance.
Definition
Controller.cpp:13
Controller::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.
Definition
Controller.cpp:3
Controller::pid
PID pid
Definition
Controller.h:13
Controller::cs
const ConfigStore & cs
Definition
Controller.h:14
Controller::getTerms
void getTerms(double &pTerm, double &iTerm, double &dTerm) const
Get the three PID terms by reference.
Definition
Controller.cpp:7
PID::iTerm
double iTerm
Definition
PID.h:33
PID::dTerm
double dTerm
Definition
PID.h:33
PID::pTerm
double pTerm
Definition
PID.h:33
ConfigStore
Config store containing variables, which can be stored in EEPROM.
Definition
EEPROMConfig.h:7
src
control
Controller.cpp
Generated by
1.12.0