Browse Source

PID: don't reset _last_error on reset_I()

resetting _last_error when you have a non-zero D term causes the D
contribution to the next call to be massively amplified. This can
cause crazy behaviour on auto takeoff in ArduPlane if you have a
non-zero D term for the roll or picth controllers

Thanks to Chris Miser for providing the tlog that allowed this bug to
be found.
mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
f6fce1e238
  1. 1
      libraries/PID/PID.cpp

1
libraries/PID/PID.cpp

@ -78,7 +78,6 @@ void @@ -78,7 +78,6 @@ void
PID::reset_I()
{
_integrator = 0;
_last_error = 0;
_last_derivative = 0;
}

Loading…
Cancel
Save