Airspeed selector: remove ASPD_STALL and replace by FW_AIRSPD_STALL

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2021-05-10 13:43:05 +02:00
parent 3b27864e53
commit c8ec6b3d08
8 changed files with 42 additions and 33 deletions
@@ -170,8 +170,7 @@ private:
(ParamFloat<px4::params::ASPD_FS_INNOV>) _tas_innov_threshold, /**< innovation check threshold */
(ParamFloat<px4::params::ASPD_FS_INTEG>) _tas_innov_integ_threshold, /**< innovation check integrator threshold */
(ParamInt<px4::params::ASPD_FS_T_STOP>) _checks_fail_delay, /**< delay to declare airspeed invalid */
(ParamInt<px4::params::ASPD_FS_T_START>) _checks_clear_delay, /**< delay to declare airspeed valid again */
(ParamFloat<px4::params::ASPD_STALL>) _airspeed_stall /**< stall speed*/
(ParamInt<px4::params::ASPD_FS_T_START>) _checks_clear_delay /**< delay to declare airspeed valid again */
)
void init(); /**< initialization of the airspeed validator instances */
@@ -295,8 +294,6 @@ AirspeedModule::Run()
update_params();
}
bool armed = (_vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED);
// check for new connected airspeed sensors as long as we're disarmed
@@ -348,8 +345,11 @@ AirspeedModule::Run()
input_data.airspeed_timestamp = airspeed_raw.timestamp;
input_data.air_temperature_celsius = airspeed_raw.air_temperature_celsius;
float airspeed_stall = 7.0f;
param_get(param_find("FW_AIRSPD_STALL"), &airspeed_stall);
// takeoff situation is active from start till one of the sensors' IAS or groundspeed_CAS is above stall speed
if (airspeed_raw.indicated_airspeed_m_s > _airspeed_stall.get() || _ground_minus_wind_CAS > _airspeed_stall.get()) {
if (airspeed_raw.indicated_airspeed_m_s > airspeed_stall || _ground_minus_wind_CAS > airspeed_stall) {
_in_takeoff_situation = false;
}
@@ -386,6 +386,9 @@ void AirspeedModule::update_params()
{
updateParams();
float airspeed_stall = 7.0f;
param_get(param_find("FW_AIRSPD_STALL"), &airspeed_stall);
_wind_estimator_sideslip.set_wind_p_noise(_param_west_w_p_noise.get());
_wind_estimator_sideslip.set_tas_scale_p_noise(_param_west_sc_p_noise.get());
_wind_estimator_sideslip.set_tas_noise(_param_west_tas_noise.get());
@@ -410,7 +413,7 @@ void AirspeedModule::update_params()
_airspeed_validator[i].set_tas_innov_integ_threshold(_tas_innov_integ_threshold.get());
_airspeed_validator[i].set_checks_fail_delay(_checks_fail_delay.get());
_airspeed_validator[i].set_checks_clear_delay(_checks_clear_delay.get());
_airspeed_validator[i].set_airspeed_stall(_airspeed_stall.get());
_airspeed_validator[i].set_airspeed_stall(airspeed_stall);
}
// if the airspeed scale estimation is enabled and the airspeed is valid,
@@ -184,15 +184,3 @@ PARAM_DEFINE_INT32(ASPD_FS_T_STOP, 2);
* @max 1000
*/
PARAM_DEFINE_INT32(ASPD_FS_T_START, -1);
/**
* Airspeed fault detection stall airspeed
*
* This is the minimum indicated airspeed at which the wing can produce 1g of lift.
* It is used by the airspeed sensor fault detection and failsafe calculation to detect a
* significant airspeed low measurement error condition and should be set based on flight test for reliable operation.
*
* @group Airspeed Validator
* @unit m/s
*/
PARAM_DEFINE_FLOAT(ASPD_STALL, 10.0f);