Skip to content

schepelin/pid-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TODO:

  • add min and max values for control action

PID Controller

It's simple implementation of PID Controller. I hadn't found comprehensible library and implemented my own.

Usage

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);
}

Run test

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

About

C++ implementation of basic PID controller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published