mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 02:33:34 +08:00
mc_att_control: reenable TPA for I term
In commit
eb67686b11
the TPA scaled integral gain was reverted back to the
normal unscaled gain which rendered the I part of TPA
useless.
This commit is contained in:
@@ -519,7 +519,7 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
|
|||||||
rates(2) -= _sensor_bias.gyro_z_bias;
|
rates(2) -= _sensor_bias.gyro_z_bias;
|
||||||
|
|
||||||
Vector3f rates_p_scaled = _rate_p.emult(pid_attenuations(_tpa_breakpoint_p.get(), _tpa_rate_p.get()));
|
Vector3f rates_p_scaled = _rate_p.emult(pid_attenuations(_tpa_breakpoint_p.get(), _tpa_rate_p.get()));
|
||||||
//Vector3f rates_i_scaled = _rate_i.emult(pid_attenuations(_tpa_breakpoint_i.get(), _tpa_rate_i.get()));
|
Vector3f rates_i_scaled = _rate_i.emult(pid_attenuations(_tpa_breakpoint_i.get(), _tpa_rate_i.get()));
|
||||||
Vector3f rates_d_scaled = _rate_d.emult(pid_attenuations(_tpa_breakpoint_d.get(), _tpa_rate_d.get()));
|
Vector3f rates_d_scaled = _rate_d.emult(pid_attenuations(_tpa_breakpoint_d.get(), _tpa_rate_d.get()));
|
||||||
|
|
||||||
/* angular rates error */
|
/* angular rates error */
|
||||||
@@ -567,7 +567,7 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Perform the integration using a first order method and do not propagate the result if out of range or invalid
|
// Perform the integration using a first order method and do not propagate the result if out of range or invalid
|
||||||
float rate_i = _rates_int(i) + _rate_i(i) * rates_err(i) * dt;
|
float rate_i = _rates_int(i) + rates_i_scaled(i) * rates_err(i) * dt;
|
||||||
|
|
||||||
if (PX4_ISFINITE(rate_i) && rate_i > -_rate_int_lim(i) && rate_i < _rate_int_lim(i)) {
|
if (PX4_ISFINITE(rate_i) && rate_i > -_rate_int_lim(i) && rate_i < _rate_int_lim(i)) {
|
||||||
_rates_int(i) = rate_i;
|
_rates_int(i) = rate_i;
|
||||||
|
|||||||
Reference in New Issue
Block a user