Skip to content

Commit 1c3883f

Browse files
author
David Forrest
committed
README.md: Add references. Add GetTi(), GetTd()
1 parent 95def29 commit 1c3883f

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

PID_v1_bc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ void PID::SetControllerDirection(int Direction)
225225
******************************************************************************/
226226
double PID::GetKp(){ return dispKp; }
227227
double PID::GetKi(){ return dispKi;}
228+
double PID::GetTi(){ return dispKp/dispKi;}
228229
double PID::GetKd(){ return dispKd;}
230+
double PID::GetTd(){ return dispKd/dispKp;}
229231
int PID::GetMode(){ return inAuto ? AUTOMATIC : MANUAL;}
230232
int PID::GetDirection(){ return controllerDirection;}
231233

PID_v1_bc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ class PID
5252
// the PID calculation is performed. default is 100
5353

5454

55-
5655
//Display functions ****************************************************************
5756
double GetKp(); // These functions query the pid for interal values.
5857
double GetKi(); // they were created mainly for the pid front-end,
5958
double GetKd(); // where it's important to know what is actually
6059
int GetMode(); // inside the PID.
6160
int GetDirection(); //
61+
double GetTi();
62+
double GetTd();
6263

6364
private:
6465
void Initialize();
@@ -70,7 +71,6 @@ class PID
7071
double kp; // * (P)roportional Tuning Parameter
7172
double ki; // * (I)ntegral Tuning Parameter
7273
double kd; // * (D)erivative Tuning Parameter
73-
7474
int controllerDirection;
7575
int pOn;
7676

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ The back calculation should prevent integral windup be dynamically limiting the
1818
from exceeding the limits. Large errors far outside of the proportional range (error > MaxOutput/kP) will produce MaxOutput and
1919
inhibit integral growth.
2020

21-
See
21+
Alternative libraries:
2222

23+
* PID -- Brett Beauregard's well documented original uses static limits on integral windup or PonM scheme
24+
* QuickPID -- has several anti-windup forms
25+
* PID_RT -- Has anti-windup but Proportional-on-measurement
26+
27+
28+
See:
29+
* https://en.wikipedia.org/wiki/PID_controller#Integral_windup -- overview of Integral Windup & common solutions
30+
* https://en.wikipedia.org/wiki/Integral_windup -- overview of Integral Windup & common solutions
31+
* https://www.cds.caltech.edu/~murray/courses/cds101/fa02/caltech/astrom-ch6.pdf -- Textbook chaper with windup and backcalculation
32+
* https://controlguru.com/integral-reset-windup-jacketing-logic-and-the-velocity-pi-form/ -- good pics
33+
* https://homepages.laas.fr/lzaccari/preprints/ZackEJC09.pdf -- A comprehensive paper on more complicated anti-windup schemes than backcalculation
2334
* https://github.com/br3ttb/Arduino-PID-Library/pull/116 -- Pull request to the PID_v1 library
24-
* https://github.com/br3ttb/Arduino-PID-Library/issues/76#issuecomment-1445273655
35+
* https://github.com/br3ttb/Arduino-PID-Library/issues/76
2536

0 commit comments

Comments
 (0)