diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index f7edfafea8..50162d50c1 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -263,7 +263,8 @@ float FixedwingAttitudeControl::get_airspeed_and_update_scaling() * Forcing the scaling to this value allows reasonable handheld tests. */ const float airspeed_constrained = constrain(airspeed, _param_fw_airspd_min.get(), _param_fw_airspd_max.get()); - _airspeed_scaling = _param_fw_airspd_trim.get() / airspeed_constrained; + + _airspeed_scaling = (_param_fw_arsp_scale_en.get()) ? (_param_fw_airspd_trim.get() / airspeed_constrained) : 1.0f; return airspeed; } diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp index 5c48d50735..b825ab0815 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp @@ -149,6 +149,8 @@ private: (ParamFloat) _param_fw_airspd_trim, (ParamInt) _param_fw_arsp_mode, + (ParamInt) _param_fw_arsp_scale_en, + (ParamBool) _param_fw_bat_scale_en, (ParamFloat) _param_fw_dtrim_p_flps, 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 cee3432f40..9cd96e5393 100644 --- a/src/modules/fw_att_control/fw_att_control_params.c +++ b/src/modules/fw_att_control/fw_att_control_params.c @@ -537,6 +537,21 @@ PARAM_DEFINE_FLOAT(FW_FLAPERON_SCL, 0.0f); */ PARAM_DEFINE_INT32(FW_ARSP_MODE, 0); +/** + * Enable airspeed scaling + * + * This enables a logic that automatically adjusts the output of the rate controller to take + * into account the real torque produced by an aerodynamic control surface given + * the current deviation from the trim airspeed (FW_AIRSPD_TRIM). + * + * Enable when using aerodynamic control surfaces (e.g.: plane) + * Disable when using rotor wings (e.g.: autogyro) + * + * @boolean + * @group FW Attitude Control + */ +PARAM_DEFINE_INT32(FW_ARSP_SCALE_EN, 1); + /** * Manual roll scale *