mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 11:23:33 +08:00
perfromance model: add FW_AIRSPD_FLP_SC to reduce with flaps
Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
@@ -144,17 +144,18 @@ float PerformanceModel::getCalibratedTrimAirspeed() const
|
||||
return math::constrain(_param_fw_airspd_trim.get() * sqrtf(getWeightRatio()), _param_fw_airspd_min.get(),
|
||||
_param_fw_airspd_max.get());
|
||||
}
|
||||
float PerformanceModel::getMinimumCalibratedAirspeed(float load_factor) const
|
||||
float PerformanceModel::getMinimumCalibratedAirspeed(float load_factor, float flaps_setpoint) const
|
||||
{
|
||||
|
||||
load_factor = math::max(load_factor, FLT_EPSILON);
|
||||
return _param_fw_airspd_min.get() * sqrtf(getWeightRatio() * load_factor);
|
||||
const float airspeed_flap_factor = math::lerp(1.f, _param_fw_airspd_flp_sc.get(), flaps_setpoint);
|
||||
return (_param_fw_airspd_min.get() * airspeed_flap_factor) * sqrtf(getWeightRatio() * load_factor);
|
||||
}
|
||||
|
||||
float PerformanceModel::getCalibratedStallAirspeed(float load_factor) const
|
||||
float PerformanceModel::getCalibratedStallAirspeed(float load_factor, float flaps_setpoint) const
|
||||
{
|
||||
load_factor = math::max(load_factor, FLT_EPSILON);
|
||||
return _param_fw_airspd_stall.get() * sqrtf(getWeightRatio() * load_factor);
|
||||
const float airspeed_flap_factor = math::lerp(1.f, _param_fw_airspd_flp_sc.get(), flaps_setpoint);
|
||||
return (_param_fw_airspd_stall.get() * airspeed_flap_factor) * sqrtf(getWeightRatio() * load_factor);
|
||||
}
|
||||
|
||||
float PerformanceModel::getMaximumCalibratedAirspeed() const
|
||||
|
||||
@@ -94,11 +94,12 @@ public:
|
||||
float getCalibratedTrimAirspeed() const;
|
||||
|
||||
/**
|
||||
* Get the minimum airspeed compensated for weight and load factor due to bank angle.
|
||||
* Get the minimum airspeed compensated for weight, load factor due to bank angle and flaps.
|
||||
* @param load_factor due to banking
|
||||
* @param flaps_setpoint Flaps setpoint, normalized in range [0,1]
|
||||
* @return calibrated minimum airspeed in m/s
|
||||
*/
|
||||
float getMinimumCalibratedAirspeed(float load_factor = 1.0f) const;
|
||||
float getMinimumCalibratedAirspeed(float load_factor, float flaps_setpoint) const;
|
||||
|
||||
/**
|
||||
* Get the maximum airspeed.
|
||||
@@ -109,9 +110,10 @@ public:
|
||||
/**
|
||||
* get the stall airspeed compensated for load factor due to bank angle.
|
||||
* @param load_factor load factor due to banking
|
||||
* @param flaps_setpoint Flaps setpoint, normalized in range [0,1]
|
||||
* @return calibrated stall airspeed in m/s
|
||||
*/
|
||||
float getCalibratedStallAirspeed(float load_factor) const;
|
||||
float getCalibratedStallAirspeed(float load_factor, float flaps_setpoint) const;
|
||||
|
||||
/**
|
||||
* Run some checks on parameters and detect unfeasible combinations.
|
||||
@@ -134,7 +136,9 @@ private:
|
||||
(ParamFloat<px4::params::FW_THR_MAX>) _param_fw_thr_max,
|
||||
(ParamFloat<px4::params::FW_THR_MIN>) _param_fw_thr_min,
|
||||
(ParamFloat<px4::params::FW_THR_ASPD_MIN>) _param_fw_thr_aspd_min,
|
||||
(ParamFloat<px4::params::FW_THR_ASPD_MAX>) _param_fw_thr_aspd_max)
|
||||
(ParamFloat<px4::params::FW_THR_ASPD_MAX>) _param_fw_thr_aspd_max,
|
||||
(ParamFloat<px4::params::FW_AIRSPD_FLP_SC>) _param_fw_airspd_flp_sc
|
||||
)
|
||||
|
||||
/**
|
||||
* Get the sea level trim throttle for a given calibrated airspeed setpoint.
|
||||
|
||||
@@ -212,3 +212,16 @@ PARAM_DEFINE_FLOAT(FW_AIRSPD_MIN, 10.0f);
|
||||
* @group FW Performance
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(FW_AIRSPD_MAX, 20.0f);
|
||||
|
||||
/**
|
||||
* Airspeed scale with full flaps
|
||||
*
|
||||
* Factor applied to the minimum and stall airspeed when flaps are fully deployed.
|
||||
*
|
||||
* @min 0.5
|
||||
* @max 1
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
* @group FW Performance
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(FW_AIRSPD_FLP_SC, 1.f);
|
||||
|
||||
@@ -77,18 +77,6 @@ public:
|
||||
const matrix::Vector2f &wind_vel, float max_airspeed, float min_ground_speed) const;
|
||||
|
||||
private:
|
||||
/*
|
||||
* Determines a reference air velocity *without curvature compensation, but
|
||||
* including "optimal" true airspeed reference compensation in excess wind conditions.
|
||||
* Nominal and maximum true airspeed member variables must be set before using this method.
|
||||
*
|
||||
* @param[in] wind_vel Wind velocity vector [m/s]
|
||||
* @param[in] bearing_setpoint Bearing
|
||||
* @param[in] airspeed_true True airspeed setpoint[m/s]
|
||||
* @return Air velocity vector [m/s]
|
||||
*/
|
||||
matrix::Vector2f refAirVelocity(const matrix::Vector2f &wind_vel, const float bearing_setpoint,
|
||||
float airspeed_true, float min_ground_speed) const;
|
||||
/*
|
||||
* Projection of the air velocity vector onto the bearing line considering
|
||||
* a connected wind triangle.
|
||||
|
||||
Reference in New Issue
Block a user