-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Airspeed validation & selection module #12353
Conversation
@RomanBapst please have a first look |
a7bad41
to
713394c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfuhrer I made a first pass. Will probably need a couple more iterations.
My suggestion for now is the following:
- address the my review and push fixes to this branch if necessary
- Clean up the history as discussed. (Check out a new branch based on master and then add the changes. Make separate commits for the library and the airspeed module).
Don't add the changes for multiple airspeed sensors in the sensors.cpp. Let's focus on merging the airdata module first. Also don't do any changes in the commander.
} | ||
} | ||
|
||
if (_valid_airspeed_index < 0 && !_vehicle_local_position_valid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfuhrer For now this is ok, but we need to figure out a way how to tell if the wind from the sideslip estimator is healthy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfuhrer Also move this statement outside of the if (find_new_valid_index). If you have no airspeed sensors then the system will keep index =-1 even if local position is not valid.
561cda0
to
745254c
Compare
f4b6053
to
eafbefb
Compare
7db8865
to
7880e2e
Compare
@tstastny would be cool if you could test the scale estimation and compare it to what you get. As I mentioned in the description it is currently quite slow, so you would have to have it enabled for a few minutes. Feel free to play around with the wind estimator tuning gains! |
@bkueng could you please review? |
69c6c06
to
66d9adc
Compare
4d619f2
to
46cb548
Compare
@dagar Could you please make a suggestion regarding the few failing builds? This is ready to merge from our side. |
|
It is already removed from the omnibus. Probably the updated ecl takes up too much flash...anything else we could disable to make if fit on the omnibus @dagar @bkueng ?
Done. |
… state (equivalent airspeed) Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This validator takes measurements from a single airspeed sensor and: -checks validity of measurement -can estimate an airspeed scale factor (estimation enabled with parameter setting) to accout for errors in airspeed due due placement of sensor Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
…getting low Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
…on, validation) module. This new airspeed module does: -runns an airspeed validator for every airspeed sensor present, which checks measurement validity and estimates an airspeed scale -selects another airspeed sensor if for the current one a failure is detected -estimates airspeed with groundspeed-windspeed if no valid airspeed sensor is present -outputs airspeed_validated topic Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
…lash after ecl update for airspeed selection module Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
…g after rebase Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
35f5136
to
cdf28ac
Compare
Can you dampen airspeed oscilations by averaging ? |
What airspeed oscillations are your referring to, measurement noise? As it is used in low-level control loops it is usually required to have airspeed with as little delay as possible, and thus isn't filtered a lot. But maybe we could increase filtering a bit yes. |
yes , i mean measurement noise. |
@sfuhrer |
Did you look at airspeed_validated.equivalent_airspeed? Because that's the one that should get scaled then (and from it then also airspeed_validated.true_airspeed) |
where is it ? i can not find it in tlog. |
Are you sure you're flying 1.10? It's not in 1.9 |
@sfuhrer Did you test this feature ? |
This PR re-purposes the current wind estimator module into an airspeed (selection) module.
Overview
The airspeed valid checks are taken from #11846 . They are here performed for every sensor and the code is located in the new airspeed selector module (currently the checks in commander are still there, but the idea is to only have them in the airspeed module in the end).
The output of the airspeed module is a airspeed validated topic, that gets logged but currently doesn't affect any control modules. All control modules still subscribe to the "old" airspeed topic. Of course this is supposed to be changed in the future (fuse all airspeed data through this module before using it).
Here's a rough drawing:
Description
The output of the module is a airspeed_validated topic, containing:
For failure detection as well as for the estimation of a scale factor from IAS to EAS, per airspeed sensor a wind estimator is run, fusing sideslip and the airspeed measurement from the corresponding sensor. Another wind estimator is run to estimate the windspeed used for the groundspeed-windspeed airspeed estimate (this wind estimator is only fusing sideslip, no airspeed measurement).
Detailed diagram of new Module:
https://www.draw.io/#G1xrT_nPgBEt5Qh5dGYbX-CyKz9cROWnRT
Usage
Performing airspeed checks
The same/very similar checks as with the current checks in commander. Also takes the same parameter to set them (eg COM_TAS_FS_INNOV for innovation threshold). If the airspeed measurement for the sensor is declared invalid, the module outputs all airspeed(IAS, EAS, TAS) based on windpeed-groundspeed (if local position is valid) and sets the flag airspeed_sensor_measurement_valid to false. If local position is also invalid, then airspeed_valid is set to false.
Estimating airspeed scale
In-flight estimation of the scale factor (EAS = scale * IAS) is turned on by setting the parameter ARSP_SCALE_EST to 1. Then the factor is estimated inside the wind estimator (otherwise it is set to 1 inside the wind estimator). After some minutes of flight, the scale should have converged to the correct value, and the estimation can be switched off by setting ARSP_SCALE_EST to 0. By doing this, the estimated scale is written to the parameter ARSP_ARSP_SCALE and keeps being used to scale the airspeed. The value is limited to 0.75..1.25.
The scale can also be set manually by setting ARSP_ARSP_SCALE manually.
Test data / coverage
logs: https://review.px4.io/plot_app?log=e63b36b6-53d1-48ef-aaea-6151ad5487cd
Messages in QGC:
Procedure:
-set the innovation check params to normal values --> airspeed is declared valid again
In these plots you can see how the airspeed_validated/true_airspeed is bounded between 12.5 and 14.2m/s while the artificial airspeed check failures are produced and it is thus sometimes calculated from groundspee-windspeed (when measurement not valid) or from pitot measurement with scale applied.
We also did the scale estimation while loitering (not in this flight), with much slower convergence. Should consider tuning the wind estimator to make if faster.
https://review.px4.io/plot_app?log=1c98f1a2-6d0e-4a79-b065-2f67b603228f
(for this test we connected 2 airspeed sensors and made each publish an airspeed topic)
Description: data_missing failure was triggered by unplugging the airspeed sensor with index 0. The airspeedValidator detects that and switches to index 1 (second sensor). Next all the airspeed sensors are plugged out, and the validator switches to index -2 (indicating no valid airspeed, as groundspeed-windspeed is not valid as performed indoor without GPS). Afterwards, the sensors are reconnected and the valid sensor index goes back to 0.
Further work
As mentioned, this PR only brings in the new module passively, without effect on any control modules. The idea is to get feedback and work e.g. on the tuning of the validity checks, and also to get it tested with higher winds (so far the max we tested it with was about 4 m/s). Follow up work is: