Add GetIntegral() and SetIntegral(double) for user-space anti-windup

This commit is contained in:
David Forrest 2023-03-02 16:13:29 -05:00
parent 9b4ca0e5b6
commit 5a5320e7e6
2 changed files with 16 additions and 0 deletions

View File

@ -182,6 +182,20 @@ void PID::SetMode(int Mode)
inAuto = newAuto;
}
/* GetIntegral(...)*************************************************************
* Get Integral term for user access to anti-windup schemes
******************************************************************************/
double PID::GetIntegral(){
return outputSum;
}
/* SetIntegral(...)*************************************************************
* Set Integral term for user access to anti-windup schemes
******************************************************************************/
void PID::SetIntegral(double Integral){
outputSum = Integral;
}
/* Initialize()****************************************************************
* does all the things that need to happen to ensure a bumpless transfer
* from manual to automatic mode.

View File

@ -50,6 +50,7 @@ class PID
// once it is set in the constructor.
void SetSampleTime(int); // * sets the frequency, in Milliseconds, with which
// the PID calculation is performed. default is 100
void SetIntegral(double); // * sets the internal Integral term, in output units
@ -59,6 +60,7 @@ class PID
double GetKd(); // where it's important to know what is actually
int GetMode(); // inside the PID.
int GetDirection(); //
double GetIntegral(); //
private:
void Initialize();