diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-10-24 17:57:21 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-10-24 17:57:21 +0200 |
commit | 1e89f30120f30f0cac9c4bdd7b81ee2da96bcc8f (patch) | |
tree | 94bf3b4eb750868bdc7fbf95a8c8a063b206d91e /src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp | |
parent | ccc6dd73a02f83d8fb857ca25cfe998a3b1303d4 (diff) | |
download | px4-firmware-1e89f30120f30f0cac9c4bdd7b81ee2da96bcc8f.tar.gz px4-firmware-1e89f30120f30f0cac9c4bdd7b81ee2da96bcc8f.tar.bz2 px4-firmware-1e89f30120f30f0cac9c4bdd7b81ee2da96bcc8f.zip |
constrain integrator part in control output until startup detection is available for safety reasons
Diffstat (limited to 'src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp')
-rw-r--r-- | src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp b/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp index e56a8d08d..b6938a59a 100644 --- a/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp +++ b/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp @@ -147,9 +147,10 @@ float ECL_YawController::control_bodyrate(float roll, float pitch, } /* integrator limit */ - _integrator = math::constrain(_integrator, -_integrator_max, _integrator_max); + //xxx: until start detection is available: integral part in control signal is limited here + float integrator_constrained = math::constrain(_integrator * k_i_rate, -_integrator_max, _integrator_max); /* store non-limited output */ - _last_output = ((_rate_error * _k_d * scaler) + _integrator * k_i_rate * scaler + (_rate_setpoint * k_ff)) * scaler; + _last_output = ((_rate_error * _k_d * scaler) + integrator_constrained * scaler + (_rate_setpoint * k_ff)) * scaler; return math::constrain(_last_output, -_max_deflection_rad, _max_deflection_rad); } |