Rename equivalent airspeed (EAS) to calibrated airspeed (CAS)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2020-10-05 11:38:31 +02:00
parent f8d5b09b56
commit 8f858d95e6
13 changed files with 78 additions and 80 deletions
+4 -4
View File
@@ -186,17 +186,17 @@ float calc_IAS(float differential_pressure)
}
float calc_TAS_from_EAS(float speed_equivalent, float pressure_ambient, float temperature_celsius)
float calc_TAS_from_CAS(float speed_calibrated, float pressure_ambient, float temperature_celsius)
{
if (!PX4_ISFINITE(temperature_celsius)) {
temperature_celsius = 15.f; // ICAO Standard Atmosphere 15 degrees celcius
}
return speed_equivalent * sqrtf(CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C / get_air_density(pressure_ambient,
return speed_calibrated * sqrtf(CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C / get_air_density(pressure_ambient,
temperature_celsius));
}
float calc_EAS_from_IAS(float speed_indicated, float scale)
float calc_CAS_from_IAS(float speed_indicated, float scale)
{
return speed_indicated * scale;
}
@@ -228,7 +228,7 @@ float get_air_density(float static_pressure, float temperature_celsius)
return static_pressure / (CONSTANTS_AIR_GAS_CONST * (temperature_celsius - CONSTANTS_ABSOLUTE_NULL_CELSIUS));
}
float calc_EAS_from_TAS(float speed_true, float pressure_ambient, float temperature_celsius)
float calc_CAS_from_TAS(float speed_true, float pressure_ambient, float temperature_celsius)
{
return speed_true * sqrtf(get_air_density(pressure_ambient, temperature_celsius) / CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C);
}
+11 -13
View File
@@ -86,34 +86,32 @@ __EXPORT float calc_IAS_corrected(enum AIRSPEED_COMPENSATION_MODEL pmodel,
__EXPORT float calc_IAS(float differential_pressure);
/**
* Calculate true airspeed (TAS) from equivalent airspeed (EAS).
* Calculate true airspeed (TAS) from calibrated airspeed (CAS).
*
* Note that the true airspeed is NOT the groundspeed, because of the effects of wind
*
* @param speed_equivalent current equivalent airspeed
* @param speed_equivalent current calibrated airspeed
* @param pressure_ambient pressure at the side of the tube/airplane
* @param temperature_celsius air temperature in degrees celcius
* @return TAS in m/s
*/
__EXPORT float calc_TAS_from_EAS(float speed_indicated, float pressure_ambient,
__EXPORT float calc_TAS_from_CAS(float speed_indicated, float pressure_ambient,
float temperature_celsius);
/**
* Calculate equivalent airspeed (EAS) from indicated airspeed (IAS).
* Note that we neglect the conversion from CAS (calibrated airspeed) to EAS.
* Calculate calibrated airspeed (CAS) from indicated airspeed (IAS).
*
* @param speed_indicated current indicated airspeed
* @param scale scale from IAS to CAS (accounting for instrument and pitot position erros)
* @return EAS in m/s
* @return CAS in m/s
*/
__EXPORT float calc_EAS_from_IAS(float speed_indicated, float scale);
__EXPORT float calc_CAS_from_IAS(float speed_indicated, float scale);
/**
* Directly calculate true airspeed (TAS)
*
* Here we assume to have no instrument or pitot position error (IAS = CAS),
* and neglect the CAS to EAS conversion (CAS = EAS).
* Here we assume to have no instrument or pitot position error (IAS = CAS).
* Note that the true airspeed is NOT the groundspeed, because of the effects of wind.
*
* @param total_pressure pressure inside the pitot/prandtl tube
@@ -132,16 +130,16 @@ __EXPORT float calc_TAS(float total_pressure, float static_pressure, float tempe
__EXPORT float get_air_density(float static_pressure, float temperature_celsius);
/**
* Calculate equivalent airspeed (EAS) from true airspeed (TAS).
* It is the inverse function to calc_TAS_from_EAS()
* Calculate calibrated airspeed (CAS) from true airspeed (TAS).
* It is the inverse function to calc_TAS_from_CAS()
*
*
* @param speed_true current true airspeed
* @param pressure_ambient pressure at the side of the tube/airplane
* @param temperature_celsius air temperature in degrees celcius
* @return EAS in m/s
* @return CAS in m/s
*/
__EXPORT float calc_EAS_from_TAS(float speed_true, float pressure_ambient,
__EXPORT float calc_CAS_from_TAS(float speed_true, float pressure_ambient,
float temperature_celsius);
__END_DECLS
@@ -33,7 +33,7 @@
/**
* @file AirspeedValidator.cpp
* Estimates airspeed scale error (from indicated to equivalent airspeed), performes
* Estimates airspeed scale error (from indicated to calibrated airspeed), performes
* checks on airspeed measurement input and reports airspeed valid or invalid.
*/
@@ -52,8 +52,8 @@ AirspeedValidator::update_airspeed_validator(const airspeed_validator_update_dat
_previous_airspeed_timestamp = input_data.airspeed_timestamp;
}
update_EAS_scale();
update_EAS_TAS(input_data.air_pressure_pa, input_data.air_temperature_celsius);
update_CAS_scale();
update_CAS_TAS(input_data.air_pressure_pa, input_data.air_temperature_celsius);
update_wind_estimator(input_data.timestamp, input_data.airspeed_true_raw, input_data.lpos_valid, input_data.lpos_vx,
input_data.lpos_vy,
input_data.lpos_vz, input_data.lpos_evh, input_data.lpos_evv, input_data.att_q);
@@ -117,22 +117,22 @@ AirspeedValidator::set_airspeed_scale_manual(float airspeed_scale_manual)
}
void
AirspeedValidator::update_EAS_scale()
AirspeedValidator::update_CAS_scale()
{
if (_wind_estimator.is_estimate_valid()) {
_EAS_scale = 1.0f / math::constrain(_wind_estimator.get_tas_scale(), 0.5f, 2.0f);
_CAS_scale = 1.0f / math::constrain(_wind_estimator.get_tas_scale(), 0.5f, 2.0f);
} else {
_EAS_scale = _airspeed_scale_manual;
_CAS_scale = _airspeed_scale_manual;
}
}
void
AirspeedValidator::update_EAS_TAS(float air_pressure_pa, float air_temperature_celsius)
AirspeedValidator::update_CAS_TAS(float air_pressure_pa, float air_temperature_celsius)
{
_EAS = calc_EAS_from_IAS(_IAS, _EAS_scale);
_TAS = calc_TAS_from_EAS(_EAS, air_pressure_pa, air_temperature_celsius);
_CAS = calc_CAS_from_IAS(_IAS, _CAS_scale);
_TAS = calc_TAS_from_CAS(_CAS, air_pressure_pa, air_temperature_celsius);
}
void
@@ -204,7 +204,7 @@ AirspeedValidator::check_load_factor(float accel_z)
if (_in_fixed_wing_flight) {
if (!bad_number_fail) {
float max_lift_ratio = fmaxf(_EAS, 0.7f) / fmaxf(_airspeed_stall, 1.0f);
float max_lift_ratio = fmaxf(_CAS, 0.7f) / fmaxf(_airspeed_stall, 1.0f);
max_lift_ratio *= max_lift_ratio;
_load_factor_ratio = 0.95f * _load_factor_ratio + 0.05f * (fabsf(accel_z) / 9.81f) / max_lift_ratio;
@@ -79,10 +79,10 @@ public:
void update_airspeed_validator(const airspeed_validator_update_data &input_data);
float get_IAS() { return _IAS; }
float get_EAS() { return _EAS; }
float get_CAS() { return _CAS; }
float get_TAS() { return _TAS; }
bool get_airspeed_valid() { return _airspeed_valid; }
float get_EAS_scale() {return _EAS_scale;}
float get_CAS_scale() {return _CAS_scale;}
wind_estimate_s get_wind_estimator_states(uint64_t timestamp);
@@ -115,15 +115,15 @@ private:
WindEstimator _wind_estimator{}; ///< wind estimator instance running in this particular airspeedValidator
// wind estimator parameter
bool _wind_estimator_scale_estimation_on{false}; ///< online scale estimation (IAS-->CAS/EAS) is on
bool _wind_estimator_scale_estimation_on{false}; ///< online scale estimation (IAS-->CAS) is on
float _airspeed_scale_manual{1.0f}; ///< manually entered airspeed scale
// general states
bool _in_fixed_wing_flight{false}; ///< variable to bypass innovation and load factor checks
float _IAS{0.0f}; ///< indicated airsped in m/s
float _EAS{0.0f}; ///< equivalent airspeed in m/s
float _CAS{0.0f}; ///< calibrated airspeed in m/s
float _TAS{0.0f}; ///< true airspeed in m/s
float _EAS_scale{1.0f}; ///< scale factor from IAS to EAS
float _CAS_scale{1.0f}; ///< scale factor from IAS to CAS
uint64_t _time_last_airspeed{0}; ///< time last airspeed measurement was received (uSec)
@@ -162,8 +162,8 @@ private:
float lpos_vy,
float lpos_vz,
float lpos_evh, float lpos_evv, const float att_q[4]);
void update_EAS_scale();
void update_EAS_TAS(float air_pressure_pa, float air_temperature_celsius);
void update_CAS_scale();
void update_CAS_TAS(float air_pressure_pa, float air_temperature_celsius);
void check_airspeed_innovation(uint64_t timestamp, float estimator_status_vel_test_ratio,
float estimator_status_mag_test_ratio);
void check_load_factor(float accel_z);