Skip to content
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

meas_airspeed status aspd_com_err #6506

Merged
merged 1 commit into from
Feb 4, 2017

Conversation

dagar
Copy link
Member

@dagar dagar commented Feb 3, 2017

Since we updated the airspeed calibration to fail if the airspeed driver has a non zero comms error count I've seen several people struggling to calibrate. After working with someone and going through the usual suggestions, use a short i2c run, 3.3V sensor, etc they were still getting low single digit error counts.

A took a look at the current driver and it's counting a comms error every time there's an i2c read failure, or the status flag from the sensor is non zero. According to the MEAS i2c guide only status 3 indicates a fault detected.

image

It's not clear yet if this explains some of the calibration difficultly, but it seems wrong to me. Bench tested so far, but more testing coming.

@Antiheavy
Copy link
Contributor

The past couple days we've tested 1.5.5 released firmware compared to a test firmware from @dagar with a modified MEAS i2c airspeed driver.

Conclusion first:
The modified driver seems to have cleared up our airspeed calibration problem. It turns out we are getting occasional "Stale Data" status packets. The standard 1.5.5 firmware counts these packets as errors preventing successful airspeed calibration. The modified driver does not and instead prints a "WARN .... Stale Data" message in the console. After many hours of testing today the modified driver has yet to get any aspd_com_err counts and always calibrates successfully. I hope this improved driver finds it way into the released firmware.

Setup and background
We've had a lot of airspeed sensor calibration headaches for a while now. Usually the problem is a "error count non zero" warning preventing calibration. It typically takes 4-5 system reboots before getting a successful calibration. Our hardware is pixracer and i2c-as airspeed sensor from AUAV (great guys!). We have a nice clean professional installation. However, our i2c wire harness to the airspeed sensor in the wing is almost 1 meter long and through an interconnect . Of course we suspected the wire length as the source of our problems at first, but we see the same "error count non zero" problems when plugging the sensor in directly using a short 15cm cable.

(okay yes, "1 meter professional i2c cable" might be an oxymoron, but we are stuck with i2c for now - I'll offer that we've used CANbus airspeed sensors on other UAV programs and they are great for all sorts of reasons not least among them reliability - okay off my soapbox).

As background investigation I read the following other posts related to airspeed problems:
#6314
pixhawk/Hardware#55
#3544
#6324

Test Details
This testing was done on multiple UAVs with ~1 meter cables as well as a simple bench setup with short cables. We plugged in a dronecode probe (https://zubax.com/products/dronecode-probe/) and used "perf" in the console to monitor "apsd_com_err" event counts. Here is a picture of the bench setup (sorry don't have a pic of the UAV install):
image

Firmware 1.5.5:
We consistently see single digit "aspd_com_err" events over test durations of 20-40 minutes. The first event often occurs within the first minute or two after boot preventing airspeed calibration. I suspect this is what we've been seeing for the past couple months as the source of our calibration problems. Similar results across multiple UAVs and the simple bench setup. Here is a typical "perf" output from one of many ~30 minute tests:
image

Firmware 1.5.5.(with modified MEAS i2c driver)
No more "aspd_com_err" event counts! Similar results across multiple UAVs and the simple bench setup. Here is a typical "perf" output from one of many ~30 minute tests:
image
Also, with the test firmware we get a new WARN message in the console. Here is an example after letting the simple bench test setup (short i2c cable) sit for about and hour:
image

We also tested unplugging the i2c cable during operation. When this happens we get many many error counts. I suppose this is expected/correct behavior.

Finally, using the modified driver firmware, we let a couple sets of hardware stay powered on for several hours and went back and forth and performed a whole bunch of airspeed calibrations. All calibrations where successful.

@LorenzMeier LorenzMeier merged commit 384e3bb into PX4:master Feb 4, 2017
@dagar dagar deleted the meas_airspeed_status branch July 3, 2019 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants