From c24f9561e99fdf1bb890bc057fcd3bf14a0110c8 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 21 Nov 2022 17:08:08 +0100 Subject: [PATCH] FW Att C: use new param FW_MAN_YR_MAX to control yawing with sticks in attitude controlled mode Signed-off-by: Silvan Fuhrer --- .../fw_att_control/FixedwingAttitudeControl.cpp | 4 ++-- .../fw_att_control/FixedwingAttitudeControl.hpp | 4 +++- .../fw_att_control/fw_att_control_params.c | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index e10a5e65b1..8cfdee6f17 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -549,9 +549,9 @@ void FixedwingAttitudeControl::Run() } } - /* add yaw rate setpoint from sticks in Stabilized mode */ + /* add yaw rate setpoint from sticks in all attitude-controlled modes */ if (_vcontrol_mode.flag_control_manual_enabled) { - body_rates_setpoint(2) += math::constrain(_manual_control_setpoint.r * radians(_param_fw_y_rmax.get()), + body_rates_setpoint(2) += math::constrain(_manual_control_setpoint.r * radians(_param_fw_man_yr_max.get()), -radians(_param_fw_y_rmax.get()), radians(_param_fw_y_rmax.get())); } diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp index 07e3590ba7..c40517a91c 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp @@ -240,7 +240,9 @@ private: (ParamFloat) _param_trim_pitch, (ParamFloat) _param_trim_roll, - (ParamFloat) _param_trim_yaw + (ParamFloat) _param_trim_yaw, + + (ParamFloat) _param_fw_man_yr_max ) ECL_RollController _roll_ctrl; diff --git a/src/modules/fw_att_control/fw_att_control_params.c b/src/modules/fw_att_control/fw_att_control_params.c index 355d85995d..57d31c3e44 100644 --- a/src/modules/fw_att_control/fw_att_control_params.c +++ b/src/modules/fw_att_control/fw_att_control_params.c @@ -805,3 +805,18 @@ PARAM_DEFINE_FLOAT(FW_SPOILERS_DESC, 0.f); * @group FW Attitude Control */ PARAM_DEFINE_INT32(FW_SPOILERS_MAN, 0); + +/** + * Maximum manually added yaw rate + * + * This is the maximally added yaw rate setpoint from the yaw stick in any attitude controlled flight mode. + * The controller already generates a yaw rate setpoint to coordinate a turn, and this value is added to it. + * This is an absolute value, which is applied symmetrically to the negative and positive side. + * + * @unit deg/s + * @min 0 + * @decimal 1 + * @increment 0.5 + * @group FW Attitude Control + */ +PARAM_DEFINE_FLOAT(FW_MAN_YR_MAX, 30.f);