-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add a function to check the health of the Barometer #8233
Add a function to check the health of the Barometer #8233
Conversation
@robustini We need to test this without the modifications made by Konstantin (#8201), because then your Baro will work incorrectly, and these modifications made by me will take effect and make the Baro unusable (which was not done before). What target can I compile for you to test this? |
Thanks mate, it was absolutely necessary! |
[master 11f6d976a] Revert "Merge pull request #8201 from iNavFlight/de_remove_baro_median"
It seems that after the revert it doesn't want to compile. |
How likely is it that a healthy Baro in a static stable position doesn't show any pressure/temperature changes over 2 seconds ? Looking at Baro sensor logging it seems very unlikely given the amount of random variation but is that true in all cases ? |
Look at the barometer data in my second log in the issue, the barometer after a few seconds from the takeoff went to 0 for the whole flight. |
Actually not yet, for AutoPilot to use GPS altitude when Baro health is poor, it is necessary to change the sanity check in the |
you have to add |
No, no false negative will happen, the barometer is noisy, its previous value will always be different from the current one. |
If I have to do this then the revert won't work. |
What I want with this PR is for the system to make sure the Baro reads are good to use, and that the algorithm doesn't just get stuck on validating whether or not the baro was found in I2C. Previously, the |
I was comparing your solution for |
I don't think I agree with that... Just check if the sensor is available on the bus to validate health? I don't think so... For me, it's more convenient to check if the sensor is responding to each machine cycle. Using the method described by you may be flawed, when the sensor is recognized but does not deliver good readings, or even no readings at all. |
I totally agree with you that it should have a way to report more than only |
I added this to a test build and found that it breaks functionality with HITL simulation. AS the simulated baro will not have any drift, it is flagged as unhealthy. |
|
@ricardodeazambuja yep, no problem with this PR. Baro is seen as valid in INAV when HITL is connected. |
@JulioCesarMatias, I am also focused on using MSP_BARO from other sources, like @b14ckyy, and it would be weird to be forced to make sure the baro is not perfect to make it work. I still think this should be in the driver side of the things. |
This PR tries to fix #8224
If the pressure or temperature does not change after 2 seconds, the Barometer is marked as unhealthy. When the barometer was forced (through a minor code change) to not update the pressure and temperature, Baro health was marked as bad in iNav Configurator.