26#ifndef APPLICATION_ATMOSPHERE_H_
27#define APPLICATION_ATMOSPHERE_H_
33#define RECIP_STD_DENSITY_TIMES_2 1.632f
36#define GAS_CONST_DRY_AIR 287.058f
38#define GAS_CONST_WATER_VAPOR 461.523f
40#define ONE_MINUS_RATIO_GAS_CONSTANTS 0.378f
42#define CELSIUS_TO_KELVIN_OFFSET 273.15f
50 have_ambient_air_data(
false),
54 density_correction(1.0f),
55 density_correction_averager(0.001f),
58 density_correction_averager.
settle(1.0f);
62 density_correction_averager.
respond(density_correction);
78 return (1.0496346613e-5f * pressure + 0.1671546011f) * density_correction_averager.
get_output();
82 float tmp = 8.104381531e-4f * pressure;
83 return -
tmp *
tmp + 0.20867299170f * pressure - 14421.43945f;
95 this->temperature = temperature;
96 this->humidity = humidity;
97 have_ambient_air_data =
true;
101 have_ambient_air_data =
false;
115 density_correction =
result.density_correction;
120 float calculateGasConstantHumAir(
121 float humidity,
float pressure,
float temperature);
122 float calculateAirDensity(
123 float humidity,
float pressure,
float temperature);
124 float calculateSaturationVaporPressure(
float temp);
125 bool have_ambient_air_data;
129 float density_correction;
air-density measurement (interface)
#define RECIP_STD_DENSITY_TIMES_2
Maintains offset and slope of the air density measurement.
Measures air density and reference pressure.
air_data_result feed_metering(float pressure, float MSL_altitude)
void initialize(float altitude)
Maintenance of atmosphere data like pressure, density etc.
float get_density(void) const
void disregard_ambient_air_data(void)
float get_pressure(void) const
atmosphere_t(float p_abs)
float get_negative_altitude(void) const
float get_IAS_from_dynamic_pressure(float dynamic_pressure) const
float get_TAS_from_dynamic_pressure(float dynamic_pressure) const
void initialize(float altitude)
void set_pressure(float p_abs)
void feed_QFF_density_metering(float pressure, float MSL_altitude)
void set_ambient_air_data(float temperature, float humidity)
void update_density_correction(void)
void settle(const datatype &present_input)
datatype get_output(void) const
datatype respond(const datatype &input)
mathematical vector of arbitrary type and size
defines platform-dependent algorithms and constants
tunable second order IIR lowpass filter (butterworth)