fw multiply integrator gain in loop

This commit is contained in:
Daniel Agar
2016-03-25 17:28:39 -04:00
parent 0ea55e25f9
commit 82cf1827d4
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -217,12 +217,12 @@ float ECL_YawController::control_bodyrate_impl(const struct ECL_ControlData &ctl
id = math::min(id, 0.0f);
}
_integrator += id;
_integrator += id * _k_i;
}
/* integrator limit */
//xxx: until start detection is available: integral part in control signal is limited here
float integrator_constrained = math::constrain(_integrator * _k_i, -_integrator_max, _integrator_max);
float integrator_constrained = math::constrain(_integrator, -_integrator_max, _integrator_max);
/* Apply PI rate controller and store non-limited output */
_last_output = (_bodyrate_setpoint * _k_ff + _rate_error * _k_p + integrator_constrained) * ctl_data.scaler *