mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
Ability to disable airspeed scaling (#14334)
This commit is contained in:
@@ -263,7 +263,8 @@ float FixedwingAttitudeControl::get_airspeed_and_update_scaling()
|
|||||||
* Forcing the scaling to this value allows reasonable handheld tests.
|
* 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());
|
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;
|
return airspeed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,6 +149,8 @@ private:
|
|||||||
(ParamFloat<px4::params::FW_AIRSPD_TRIM>) _param_fw_airspd_trim,
|
(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_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,
|
(ParamBool<px4::params::FW_BAT_SCALE_EN>) _param_fw_bat_scale_en,
|
||||||
|
|
||||||
(ParamFloat<px4::params::FW_DTRIM_P_FLPS>) _param_fw_dtrim_p_flps,
|
(ParamFloat<px4::params::FW_DTRIM_P_FLPS>) _param_fw_dtrim_p_flps,
|
||||||
|
|||||||
@@ -537,6 +537,21 @@ PARAM_DEFINE_FLOAT(FW_FLAPERON_SCL, 0.0f);
|
|||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(FW_ARSP_MODE, 0);
|
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
|
* Manual roll scale
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user