VTOL: change transition airspeed threshold: only look at VT_ARSP_TRANS (#22581)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2024-01-11 13:35:01 +01:00 committed by GitHub
parent 603c3f6636
commit e1ad1b60d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 14 deletions

View File

@ -598,18 +598,19 @@ float VtolType::getOpenLoopFrontTransitionTime() const
}
float VtolType::getTransitionAirspeed() const
{
return math::max(_param_vt_arsp_trans.get(), getMinimumTransitionAirspeed());
}
float VtolType::getMinimumTransitionAirspeed() const
{
// Since the stall airspeed increases with vehicle weight, we increase the transition airspeed
// by the same factor.
float weight_ratio = 1.0f;
if (_param_weight_base.get() > FLT_EPSILON && _param_weight_gross.get() > FLT_EPSILON) {
weight_ratio = math::constrain(_param_weight_gross.get() / _param_weight_base.get(), kMinWeightRatio, kMaxWeightRatio);
weight_ratio = math::constrain(_param_weight_gross.get() /
_param_weight_base.get(), kMinWeightRatio, kMaxWeightRatio);
}
return sqrtf(weight_ratio) * _param_airspeed_min.get();
return sqrtf(weight_ratio) * _param_vt_arsp_trans.get();
}
float VtolType::getBlendAirspeed() const
{
return _param_vt_arsp_blend.get();

View File

@ -237,12 +237,6 @@ public:
*/
float getOpenLoopFrontTransitionTime() const;
/**
*
* @return The minimum calibrated airspeed compensated for weight [m/s]
*/
float getMinimumTransitionAirspeed() const;
/**
*
* @return The calibrated blending airspeed [m/s]
@ -371,8 +365,7 @@ protected:
(ParamFloat<px4::params::MPC_LAND_ALT2>) _param_mpc_land_alt2,
(ParamFloat<px4::params::VT_LND_PITCH_MIN>) _param_vt_lnd_pitch_min,
(ParamFloat<px4::params::WEIGHT_BASE>) _param_weight_base,
(ParamFloat<px4::params::WEIGHT_GROSS>) _param_weight_gross,
(ParamFloat<px4::params::FW_AIRSPD_MIN>) _param_airspeed_min
(ParamFloat<px4::params::WEIGHT_GROSS>) _param_weight_gross
)