mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 19:33:34 +08:00
AirspeedValidator: Remove extra delay from airspeed innovation check (#23244)
* AirspeedValidator: remove additional one second of hysteresis for triggering innovation checks - this check already uses an integrator and so adding more delay just makes log analysis more difficult and does not really add any value Signed-off-by: RomanBapst <bapstroman@gmail.com> * removed unnecessary conditions Signed-off-by: RomanBapst <bapstroman@gmail.com> * AirspeedValidator: only disable innov checks if ASPD_FS_INTEG is negative Signed-off-by: Silvan Fuhrer <silvan@auterion.com> * get rid of unnecessary check on innovation threshold parameter Signed-off-by: RomanBapst <bapstroman@gmail.com> --------- Signed-off-by: RomanBapst <bapstroman@gmail.com> Signed-off-by: Silvan Fuhrer <silvan@auterion.com> Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
co-authored by
Silvan Fuhrer
parent
9ececfdd65
commit
8ad93464c7
@@ -222,16 +222,13 @@ AirspeedValidator::check_airspeed_innovation(uint64_t time_now, float estimator_
|
||||
}
|
||||
|
||||
// reset states if check is disabled, we are not flying or wind estimator was just initialized/reset
|
||||
if (!_innovation_check_enabled || !_in_fixed_wing_flight || (time_now - _time_wind_estimator_initialized) < 5_s
|
||||
|| _tas_innov_integ_threshold <= 0.f) {
|
||||
if (!_innovation_check_enabled || !_in_fixed_wing_flight || (time_now - _time_wind_estimator_initialized) < 5_s) {
|
||||
_innovations_check_failed = false;
|
||||
_time_last_tas_pass = time_now;
|
||||
_aspd_innov_integ_state = 0.f;
|
||||
|
||||
} else if (!lpos_valid || estimator_status_vel_test_ratio > 1.f || estimator_status_mag_test_ratio > 1.f) {
|
||||
//nav velocity data is likely not good
|
||||
//don't run the test but don't reset the check if it had previously failed when nav velocity data was still likely good
|
||||
_time_last_tas_pass = time_now;
|
||||
_aspd_innov_integ_state = 0.f;
|
||||
|
||||
} else {
|
||||
@@ -249,11 +246,7 @@ AirspeedValidator::check_airspeed_innovation(uint64_t time_now, float estimator_
|
||||
_aspd_innov_integ_state = 0.f;
|
||||
}
|
||||
|
||||
if (_tas_innov_integ_threshold > 0.f && _aspd_innov_integ_state < _tas_innov_integ_threshold) {
|
||||
_time_last_tas_pass = time_now;
|
||||
}
|
||||
|
||||
_innovations_check_failed = (time_now - _time_last_tas_pass) > TAS_INNOV_FAIL_DELAY;
|
||||
_innovations_check_failed = _aspd_innov_integ_state > _tas_innov_integ_threshold;
|
||||
}
|
||||
|
||||
_time_last_aspd_innov_check = time_now;
|
||||
|
||||
@@ -150,9 +150,7 @@ private:
|
||||
float _tas_innov_threshold{1.0}; ///< innovation error threshold for triggering innovation check failure
|
||||
float _tas_innov_integ_threshold{-1.0}; ///< integrator innovation error threshold for triggering innovation check failure
|
||||
uint64_t _time_last_aspd_innov_check{0}; ///< time airspeed innovation was last checked (uSec)
|
||||
uint64_t _time_last_tas_pass{0}; ///< last time innovation checks passed
|
||||
float _aspd_innov_integ_state{0.0f}; ///< integral of excess normalised airspeed innovation (sec)
|
||||
static constexpr uint64_t TAS_INNOV_FAIL_DELAY{1_s}; ///< time required for innovation levels to pass or fail (usec)
|
||||
uint64_t _time_wind_estimator_initialized{0}; ///< time last time wind estimator was initialized (uSec)
|
||||
|
||||
// states of load factor check
|
||||
|
||||
Reference in New Issue
Block a user