Browse Source

Ability to disable airspeed scaling (#14334)

sbg
Roman Dvořák 5 years ago committed by GitHub
parent
commit
152427ecdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/modules/fw_att_control/FixedwingAttitudeControl.cpp
  2. 2
      src/modules/fw_att_control/FixedwingAttitudeControl.hpp
  3. 15
      src/modules/fw_att_control/fw_att_control_params.c

3
src/modules/fw_att_control/FixedwingAttitudeControl.cpp

@ -263,7 +263,8 @@ float FixedwingAttitudeControl::get_airspeed_and_update_scaling() @@ -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;
}

2
src/modules/fw_att_control/FixedwingAttitudeControl.hpp

@ -149,6 +149,8 @@ private: @@ -149,6 +149,8 @@ private:
(ParamFloat<px4::params::FW_AIRSPD_TRIM>) _param_fw_airspd_trim,
(ParamInt<px4::params::FW_ARSP_MODE>) _param_fw_arsp_mode,
(ParamInt<px4::params::FW_ARSP_SCALE_EN>) _param_fw_arsp_scale_en,
(ParamBool<px4::params::FW_BAT_SCALE_EN>) _param_fw_bat_scale_en,
(ParamFloat<px4::params::FW_DTRIM_P_FLPS>) _param_fw_dtrim_p_flps,

15
src/modules/fw_att_control/fw_att_control_params.c

@ -537,6 +537,21 @@ PARAM_DEFINE_FLOAT(FW_FLAPERON_SCL, 0.0f); @@ -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
*

Loading…
Cancel
Save