added integral term reset functionality
This commit is contained in:
parent
fb095d8cfc
commit
31b8bc0777
@ -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
|
||||
******************************************************************************/
|
||||
|
4
PID_v1.h
4
PID_v1.h
@ -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
|
||||
|
@ -16,6 +16,7 @@ SetMode KEYWORD2
|
||||
Compute KEYWORD2
|
||||
SetOutputLimits KEYWORD2
|
||||
SetTunings KEYWORD2
|
||||
ResetI KEYWORD2
|
||||
SetControllerDirection KEYWORD2
|
||||
SetSampleTime KEYWORD2
|
||||
GetKp KEYWORD2
|
||||
|
Loading…
Reference in New Issue
Block a user