AP_TECS: prevent airspeed demand spikes causing large pitch changes

a short term spike in the derivative of speed demand could cause the
constraint on the pitch integrator to push the pitch integrator to
very low values, causing a sharp nose down which takes a long time to
recover from
This commit is contained in:
Andrew Tridgell 2019-03-29 21:49:13 +11:00
parent 4eaee039f0
commit 6898ec5776

View File

@ -858,6 +858,15 @@ void AP_TECS::_update_pitch(void)
// causing massive integrator changes. See Issue#4066
integSEB_delta = constrain_float(integSEB_delta, -integSEB_range*0.1f, integSEB_range*0.1f);
// prevent the constraint on pitch integrator _integSEB_state from
// itself injecting step changes in the variable. We only want the
// constraint to prevent large changes due to integSEB_delta, not
// to cause step changes due to a change in the constrain
// limits. Large steps in _integSEB_state can cause long term
// pitch changes
integSEB_min = MIN(integSEB_min, _integSEB_state);
integSEB_max = MAX(integSEB_max, _integSEB_state);
// integrate
_integSEB_state = constrain_float(_integSEB_state + integSEB_delta, integSEB_min, integSEB_max);