-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
AP_Airspeed: check for baro baro data in SDP3X #18232
Conversation
this matters for SDP3X as AP_Periph sensor with no baro
2516cfc
to
f896439
Compare
float baro_pressure; | ||
if (baro == nullptr || baro->num_instances() == 0) { | ||
// with no baro assume sea level | ||
baro_pressure = SSL_AIR_PRESSURE; |
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.
This is actually a terrible assumption on this airspeed sensor. We are FAR safer to declare the sensor unhealthy and not update in this case. The airspeed can be off by a ridiculous margin with this approach.
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.
A slightly better option would be using the temperature, gps altitude, and baro at launch to determine a pressure altitude.
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.
the reason for this PR is people are using the SDP3xx on AP_Periph nodes that have no other sensors. They were getting NaN as the output. They can't use GPS or baro.
I just ran some tests on a SDP3X with changes to the pressure. I first set it up to be reading 20 m/s at sea level (101325Pa). That required a reading from the sensor of 155.
Then I changed it to 10k feet, with a pressure of 69681. The airspeed changed to 20.9 m/s with the same reading from the sensor.
So with a 10k feet change we have a 0.9 m/s error. I wouldn't call that "terrible"
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.
It's not a good solution, they are much much better off not using those on the periph nodes. Unless we've added back the compensation terms that were dropped to make the processing take less time the sensor is off at 8K DA by approximately 3-5 m/s (I can't recall what it was) with a working baro. With a non working baro compounding that I'd hate to see it on an aircraft.
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.
supporting an existing sensor is vastly better than giving NaN. I will merge
discussed with Michael and on balance decided to merge
@Hwurzburg we need to ensure the wiki recommends not using the SDP3x at higher altitudes (say anything over 3k feet pressure altitude ASL) as we believe it will give poor airspeed |
this matters for SDP3X as AP_Periph sensor with no baro
See https://discuss.ardupilot.org/t/sdp3x-airspeed-sensor-broken-on-canbus/74409