PID: Add a full reset method

This commit is contained in:
Michael du Breuil 2017-10-12 15:26:22 -07:00 committed by Tom Pittenger
parent 615f6dfadb
commit f8ac4efb1d
2 changed files with 9 additions and 0 deletions

View File

@ -119,6 +119,11 @@ PID::reset_I()
_pid_info.I = 0;
}
void PID::reset() {
memset(&_pid_info, 0, sizeof(_pid_info));
reset_I();
}
void
PID::load_gains()
{

View File

@ -39,6 +39,10 @@ public:
///
float get_pid(float error, float scaler = 1.0);
/// Reset the whole PID state
//
void reset();
/// Reset the PID integrator
///
void reset_I();