Browse Source

fw attitude control: compute integrator correctly

- I gain was applied wrongly, such that the integrator value was depending
direcly on the I gain. This made the integrator value jump when the gain
was changed

Signed-off-by: Roman <bapstroman@gmail.com>
master
Roman 8 years ago committed by Lorenz Meier
parent
commit
55401ec1b0
  1. 2
      attitude_fw/ecl_roll_controller.cpp

2
attitude_fw/ecl_roll_controller.cpp

@ -124,7 +124,7 @@ float ECL_RollController::control_bodyrate(const struct ECL_ControlData &ctl_dat @@ -124,7 +124,7 @@ float ECL_RollController::control_bodyrate(const struct ECL_ControlData &ctl_dat
/* 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 * ctl_data.scaler +

Loading…
Cancel
Save