95 Commits

Author SHA1 Message Date
Roman Bapst
8ad93464c7
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>
2024-06-11 14:09:36 +02:00
Silvan Fuhrer
30b63f6a82 AirspeedSelector: set default of ASPD_FS_T_STOP to 1 and clean up meta data
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-10 12:42:54 +02:00
Silvan Fuhrer
5513dfa95d AirspeedSelector: define start/stop delay params as floats
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-10 12:42:54 +02:00
Silvan Fuhrer
9d00a3ae4d AirspeedSelector: remove option to disable airspeed sensor through ASPD_PRIMARY
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-21 11:34:28 +01:00
Silvan Fuhrer
29714a0fba AirspeedValidator: make wind estimate more dynamic
Increase wind process noise default (ASPD_WIND_NSD) and gate
(ASPD_TAS_GATE) to be able to catch rapid wind increases with
the internal wind estimator of the airspeed validator.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-09 09:42:43 +01:00
Silvan Fuhrer
cf03b99ab4 AirspeedValidator: inrease default of ASPD_BETA_NOISE
Trust the beta innovations more compated to the TAS innovations.
That should help with detecting real airspeed failures even with
a dynamic wind estimate (as long as vehicle doesn't fly straight)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-09 09:42:43 +01:00
Silvan Fuhrer
8bc3785345 AirspeedSelector: improve/shorten param descriptions
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-09-29 11:07:46 +02:00
Daniel Agar
45968c614e airspeed_selector: fix aspd typos 2023-07-17 20:37:46 -04:00
Daniel Agar
c0a56ce268 airspeed_selector: fix groundspeed typos 2023-07-17 20:37:46 -04:00
Silvan Fuhrer
4cd078409d AirspeedValidator: disable innovation checks if lpos invalid
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-05-08 21:46:45 -04:00
Silvan Fuhrer
edc570adff AirspeedSelector: fix attitude rotation for tailsitter
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-22 10:05:32 +01:00
Silvan Fuhrer
167e58abba AirspeedSelector: remove unused variable
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-20 11:35:24 +01:00
Silvan Fuhrer
0c735dea2e AirspeedSelector: use scientific notation for small param
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-28 10:31:17 -05:00
Silvan Fuhrer
20342216e2
Airspeed Selector: use better density source and only save scale parameter if valid (#20764)
* AirspeedSelector: use vehicle_air_data.rho for calculating groundspeed-wind CAS

Previously the vehicle_air_data.temperature and pressure was used, instead of the
density field directly.
Only makes a difference if there is an airspeed sensor connected to provide
the air temperature.

* AirspeedSelector: only safe estimated scale in param if airspeed is valid

* AirspeedSelector: remove 0.01 cliff for saving learned scale to param

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-12-20 15:52:54 +01:00
Silvan Fuhrer
9c66f1b14a
AirspeedValidator: Remvoe airspeed variance after boot check (#20678)
This checks was introduced to catch the (unlikely) case of the driver publishing
a stale value that is not actually from a current measurement right after boot.
This was done by declaring it invalid if there is no update of the measurement
within the first 10s after boot.
Practice though has shown that around 0, many airspeed sensors have such a low
resolution that the reported airspeed value is often at the exact same value
for longer periods of time on totally healthy sensors, and thus we trigger
some false positive failure detections.
Given that this failure mode (driver publishing stale data) is quite rare (if
it doesn't receive new data it should stop publishing), I remove this check
here again.
When in aerodynamic flight mode and armed, there is still the data stuck
check that can trigger if there is no update for 2s.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-12-19 11:36:48 +01:00
Matthias Grob
5ca28dd6dc Use isAllFinite() in all places that check finiteness on entire vectors or matrices 2022-10-19 19:09:20 +02:00
Silvan Fuhrer
aade01776a airspeed selector: only do sideslip fusion (for airspeed less wind estimate) if not landed
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-19 10:35:28 +02:00
Silvan Fuhrer
ebc883f157 airspeed selector: remove redundant armed check (it already checks for in_air)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-19 10:35:28 +02:00
Silvan Fuhrer
0c4b2cd0c5 airspeed_selector: update wind estimator (w/o airspeed fusion) always if in FW mode
This fixes a bug where by accident the vtol_status was considered instead of the
vehicle_status, preventing it from running on planes.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-19 10:35:28 +02:00
Silvan Fuhrer
13fc5918cc AirspeedValidator: keep data stuck test but only enable in FW mode
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-09-19 17:44:44 +02:00
Silvan Fuhrer
1a5d0f4347 AirspeedValidator: add new check (variance after boot) and disable data stuck check by default
This new check is inteded to trigger if there is no data variation published by
the airspeed driver for the first 10s after the first data is published.
This is to capture malfunctioning sensors/drivers that do publish a value, this
value though does not come from real sensor measurements.
Previously this was captured by the data stuck check, but it has shown that
some drivers can publish a stuck value without being actually malfunctioning
(e.g. when the airspeed is outside of their measurement range). Checking for
any data variation is the more conservative check that still catches the above
described failure case.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-09-19 17:44:44 +02:00
RomanBapst
0c860fa227 airspeed_selector: don't declare wind estimate valid if estmator is not initialised
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-09-05 10:21:38 -04:00
Beat Küng
04f7df3848 SubscriptionMultiArray: use Subscription instead of SubscriptionInterval
Saves ~3KB RAM on fmu-v5.
2022-08-25 22:02:15 -04:00
RomanBapst
f11f2e9797 addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-08-02 15:29:25 +02:00
RomanBapst
fbd4534edc WindEstimator: reworked filter initialisation
- separate initialisation with and without airspeed

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-08-02 15:29:25 +02:00
RomanBapst
a63f1b71fe wind_estimator: added simple check for validity of synthetic airspeed
- synthetic airspeed will only be declared valid as soon as the wind variance
has dropped below a parameterized threshold. This is useful for vehicles without
an airspeed sensor which rely on synthetic airspeed but only once the vehicle
has turned sufficiently for the wind estimates to be reliable.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-08-02 15:29:25 +02:00
Silvan Fuhrer
638eff426a AirspeedValidator: increase max update step size of tas_scale_validated from 1% to 5%
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-29 09:29:27 +02:00
Daniel Agar
a2f83269e9 airspeed_selector: don't consider vehicle_local_position valid if dead_reckoning 2022-07-13 09:01:33 +02:00
bresch
680191cc75 WindEstimator: make wind process noise tuning same as EKF2 2022-06-14 18:44:30 +10:00
bresch
e105869986 wind_estimator: use noise spectral density for process noise tuning
The noise spectral density, NSD, (square root of power spectral density) is a
continuous-time parameter that makes the tuning independent from the EKF
prediction rate.
NSD corresponds to the rate at which the state uncertainty increases
when no measurements are fused into the filter.
Given that the current prediction rate of the wind estimator is 1Hz, the
same tuning is obtained with the same values as before.
2022-06-14 18:39:10 +10:00
fury1895
283aad01fd Airspeed params: change default for ASPD_SCALE_APPLY to 2 2022-06-10 14:02:41 +02:00
Silvan Fuhrer
2b7efeacca vtol_vehicle_status: replace several status bools by single vehicle_vtol_state
Replace vtol_in_rw_mode, vtol_in_trans_mode, in_transition_to_fw by vehicle_vtol_state.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-18 10:01:04 +02:00
Daniel Agar
f4c3084c26 init adjustments to ensure used topics are advertised early (primarily for logging)
- multi-EKF create each instance as soon as IMU & mag are advertised (before device id populated)
2022-03-23 16:51:16 -04:00
fury1895
be92165c54 AirspeedSelector: fix messaging 2022-02-21 15:21:13 +03:00
Jukka Laitinen
9449ed6e66 Add support for protected build in drivers, systemcmds and modules Kconfig
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:58:58 +01:00
Yannick Fuhrer
26ea70e729
Airspeed selector: fix condition for messaging (#19173)
Change warning message after airspeed failure on the ground, 
recommend RTL only if flying.
2022-02-15 17:23:36 +01:00
Silvan Fuhrer
0ce44cebb7 WindEstimator: use vehicle heading instead of ground course for initialisation
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-14 17:42:01 -05:00
Silvan Fuhrer
1a4b2b37bb AirspeedValidator: remove unused variable _tas_gate
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-14 17:42:01 -05:00
Beat Küng
4ba84d56c9 logger: introduce optional topics
The current practice of adding topics to the default set isn't scalable,
as it affects all setups.
By making sure topics are advertised on init, logger can just discard
topics that don't exist. This does not work for all topics, so topics are
specifically marked as optional. It can be extended to more topics later
on though.

This reduces the list of topics by ~35 on a pixracer configured as quad,
and reduces RAM usage by ~1KB.
2021-11-15 09:02:03 -05:00
Silvan Fuhrer
f9cfcc5cfa AirspeedSelector: add bitmask to enable checks seperately in ASPD_DO_CHECKS
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
73fe300c00 WindEstimator: remove option to disable scale estimation
The situation where this would be desired is unclear, plus it's basically
the same as setting ASPD_SC_P_NOISE to a very small value.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
c0754cf324 AirspeedValidator: pass vI as reference
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
f9682b86d1 AirspeedSelector: some clean up
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
7537fa36c8 AirspeedValidator: fix airspeed scale validation (feed raw TAS)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
a2faac148f AirspeedValidator: check_airspeed_innovation() check absolute innovations
Do no longer use tas_innovation from wind estimator and test ratio, but calculate
the innovation  based on wind estimate, TAS measurement (including currently applied scale)
and ground velocity. Use innovations directly to trigger failure.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
f6d37ecacf AirspeedSelector: make sure we don't try to access a negative array index
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
ccab93e68b AirspeedSelector: use Vector3f
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
cad7851774 AirspeedSelector: add _CAS_scale_validated to airspeed_wind for logging
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
625f556b0e AirspeedSelector: airspeed scale estimation improvements and robustification
- run airspeed scale estimation always, not in dedicated mode
- add option to apply scale automatically, with extra feasibility check
- add airspeed scale for all 3 possible airspeed instances
- clean up parameters
- add check for data stuck (non-changing airspeed data)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Shubham Shah
b56bd7cb21 Update AirspeedValidator.cpp 2021-10-09 19:39:43 -04:00