forked from Archive/PX4-Autopilot
mc_att_control: att rate integral fix
This commit is contained in:
parent
5a7a356c20
commit
d933d523eb
|
@ -654,8 +654,9 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
|
||||||
_rates_prev = rates;
|
_rates_prev = rates;
|
||||||
|
|
||||||
/* update integral only if not saturated on low limit */
|
/* update integral only if not saturated on low limit */
|
||||||
if (_thrust_sp > 0.1f && _att_control.length() < _thrust_sp) {
|
if (_thrust_sp > 0.1f) {
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
if (fabsf(_att_control(i)) < _thrust_sp) {
|
||||||
float rate_i = _rates_int(i) + _params.rate_i(i) * rates_err(i) * dt;
|
float rate_i = _rates_int(i) + _params.rate_i(i) * rates_err(i) * dt;
|
||||||
|
|
||||||
if (isfinite(rate_i) && rate_i > -RATES_I_LIMIT && rate_i < RATES_I_LIMIT &&
|
if (isfinite(rate_i) && rate_i > -RATES_I_LIMIT && rate_i < RATES_I_LIMIT &&
|
||||||
|
@ -664,6 +665,7 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue