项目作者: cbchoi

项目描述 :
Simple PID Controller
高级语言: C++
项目地址: git://github.com/cbchoi/lucidPID.git
创建时间: 2017-05-01T14:30:24Z
项目社区:https://github.com/cbchoi/lucidPID

开源协议:Apache License 2.0

下载


lucidPID: C++ library for PID Controller

The lucidPID Controller is simple PID Controller library. The lucidPID Controller implements the controller based on the control theory.

Design Concept

The lucidPID Controller adopts the object-oriented design concepts.

How to use it

Utilizing lucidPID Controller is easy and intuitive. All you need to do is just instantiate an instance.

Proportional Controller

  1. // Proportional gain
  2. double _Kp = 1;
  3. // Desired valuer
  4. double desired = 20;
  5. double actural = 0;
  6. double request = 0;
  7. // Instantiating controller
  8. lucidPropCtrl contrl = lucidPropCtrl(_Kp);
  9. for(int i = 0; i < _Loop; i++)
  10. {
  11. request = contrl.compute(desired, actural);
  12. actual = request; // You must pass request value to the plant
  13. std::cout << "Desire:" << desired <<"\tRequest:" << request <<"\tActual:" << actural << std::endl;
  14. }