This commit is contained in:
Narek Galstyan 2017-02-15 15:03:32 +00:00 committed by GitHub
commit 5a04c78307
3 changed files with 12 additions and 0 deletions

View File

@ -99,6 +99,13 @@ void PID::SetTunings(double Kp, double Ki, double Kd)
}
}
/* ResetI() *******************************************************************
* Resets the build up integral term of the PID
******************************************************************************/
void PID::ResetI() {
ITerm = 0;
}
/* SetSampleTime(...) *********************************************************
* sets the period, in Milliseconds, at which the calculation is performed
******************************************************************************/

View File

@ -35,6 +35,10 @@ class PID
void SetTunings(double, double, // * While most users will set the tunings once in the
double); // constructor, this function gives the user the option
// of changing tunings during runtime for Adaptive control
void ResetI(); // * Resets Integral term of PID: Useful especially for multicopters.
// * This allows to reset this term when the multicopter descends to
// * the ground and contionues the flight again later.
void SetControllerDirection(int); // * Sets the Direction, or "Action" of the controller. DIRECT
// means the output will increase when error is positive. REVERSE
// means the opposite. it's very unlikely that this will be needed

View File

@ -16,6 +16,7 @@ SetMode KEYWORD2
Compute KEYWORD2
SetOutputLimits KEYWORD2
SetTunings KEYWORD2
ResetI KEYWORD2
SetControllerDirection KEYWORD2
SetSampleTime KEYWORD2
GetKp KEYWORD2