- add min and max values for control action
It's simple implementation of PID Controller. I hadn't found comprehensible library and implemented my own.
I suppose to use it for arduino sensors
Simple example:
#include "PID.h"
int main() {
double targetCondition = 1000;
float proportionalGain, integralGain, derivativeGain = 0.1;
float timeDelta = 0.01;
PIDController pid (targetCondition, proportionalGain, integralGain, derivativeGain, timeDelta);
double currentCondition = yourModel.getData();
double controllAction = pid.compute(currentCondition);
yourModel.apply(controllAction);
}
To run test you have to install CxxTest
CXX_PATH=/your/path/to/cxx make test
by default CXX_PATH is set /usr/local/include