Skip to content

Commit

Permalink
mc_att_control: reenable TPA for I term
Browse files Browse the repository at this point in the history
In commit
eb67686
the TPA scaled integral gain was reverted back to the
normal unscaled gain which rendered the I part of TPA
useless.
  • Loading branch information
MaEtUgR committed Mar 26, 2018
1 parent 500a1c8 commit 76bf9c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/mc_att_control/mc_att_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
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_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()));

/* angular rates error */
Expand Down Expand Up @@ -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
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)) {
_rates_int(i) = rate_i;
Expand Down

0 comments on commit 76bf9c6

Please sign in to comment.