diff options
author | Mark Whitehorn <kd0aij@gmail.com> | 2015-03-17 20:52:51 -0600 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-18 11:19:06 +0200 |
commit | 7f418445f2a2108b1026a31b3763da5e6d960fe1 (patch) | |
tree | d3733e0a3ac64e472a8887e9a6ca07f0085d6bf5 /src/modules/mc_att_control | |
parent | a07712bb1e41538de72686562c8295f2688f6880 (diff) | |
download | px4-firmware-7f418445f2a2108b1026a31b3763da5e6d960fe1.tar.gz px4-firmware-7f418445f2a2108b1026a31b3763da5e6d960fe1.tar.bz2 px4-firmware-7f418445f2a2108b1026a31b3763da5e6d960fe1.zip |
add new parameters for roll and pitch angular rate limits
Diffstat (limited to 'src/modules/mc_att_control')
-rw-r--r-- | src/modules/mc_att_control/mc_att_control_main.cpp | 11 | ||||
-rw-r--r-- | src/modules/mc_att_control/mc_att_control_params.c | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index 6c9048bdb..e140acea6 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -202,7 +202,7 @@ private: float roll_rate_max; float pitch_rate_max; float yaw_rate_max; - math::Vector<3> mc_rate_max; /**< attitude rate limits in stabilized modes */ + math::Vector<3> mc_rate_max; /**< attitude rate limits in all modes */ float man_roll_max; float man_pitch_max; @@ -656,14 +656,11 @@ MulticopterAttitudeControl::control_attitude(float dt) /* calculate angular rates setpoint */ _rates_sp = _params.att_p.emult(e_R); - /* limit roll and pitch rates */ - for (int i = 0; i < 2; i++) { - _rates_sp(i) = math::constrain(_rates_sp(i), -_params.acro_rate_max(i), _params.acro_rate_max(i)); + /* limit rates */ + for (int i = 0; i < 3; i++) { + _rates_sp(i) = math::constrain(_rates_sp(i), -_params.mc_rate_max(i), _params.mc_rate_max(i)); } - /* limit yaw rate */ - _rates_sp(2) = math::constrain(_rates_sp(2), -_params.yaw_rate_max, _params.yaw_rate_max); - /* feed forward yaw setpoint rate */ _rates_sp(2) += _v_att_sp.yaw_sp_move_rate * yaw_w * _params.yaw_ff; } diff --git a/src/modules/mc_att_control/mc_att_control_params.c b/src/modules/mc_att_control/mc_att_control_params.c index 3f19a51f0..3f63f2fc0 100644 --- a/src/modules/mc_att_control/mc_att_control_params.c +++ b/src/modules/mc_att_control/mc_att_control_params.c @@ -215,7 +215,7 @@ PARAM_DEFINE_FLOAT(MC_YAW_FF, 0.5f); * @max 360.0 * @group Multicopter Attitude Control */ -PARAM_DEFINE_FLOAT(MC_ROLLRATE_MAX, 360.0f); +PARAM_DEFINE_FLOAT(MC_ROLLRATE_MAX, 120.0f); /** * Max pitch rate @@ -227,7 +227,7 @@ PARAM_DEFINE_FLOAT(MC_ROLLRATE_MAX, 360.0f); * @max 360.0 * @group Multicopter Attitude Control */ -PARAM_DEFINE_FLOAT(MC_PITCHRATE_MAX, 360.0f); +PARAM_DEFINE_FLOAT(MC_PITCHRATE_MAX, 120.0f); /** * Max yaw rate |