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

Airspeed measurement: Add accurate models for dynamic pressure #7702

Merged
merged 4 commits into from
Sep 19, 2017

Conversation

LorenzMeier
Copy link
Member

This allows to get very accurate readings from the SDP3x sensor series from Sensirion using a complete sensor model.

@AndreasAntener Another set of test flights with this in would be great. I've left the unfiltered value uncompensated so that we can compare efficiently.

@@ -48,6 +47,29 @@

__BEGIN_DECLS

enum AIRSPEED_SENSOR_MODEL {
AIRSPEED_SENSOR_MODEL_MEMBRANE = 0,
AIRSPEED_SENSOR_MODEL_SDP3X,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have the drivers themselves report the model.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There also seems to be a desire for supporting multiple airspeed sensors (even for only this kind of testing). Getting some kind identifier in place for extending the calibration is the first step. I suppose we'd still need a completely separate dev id and model enum though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First step would be to add uint32 device_id # unique device ID for the sensor that does not change between power cycles and then decode that struct to extract the sensor type ID. But I'll do that separately to not clutter this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dagar I added all this here now. No more params required by default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@priseborough
Copy link
Contributor

Where do we include the correction for positional error scale factor which is installation (not sensor) dependent? That can be up to +-20% depending in sensor location.

@dagar
Copy link
Member

dagar commented Jul 30, 2017

There's a field for it here. https://github.com/PX4/Firmware/blob/master/src/drivers/drv_airspeed.h#L71

Then we'll need appropriate parameters and to glue it all together.

@priseborough
Copy link
Contributor

priseborough commented Jul 30, 2017

As a separate PR, I could implement a simple 3-state filter enabling the scale factor to be adjusted on-line during fight testing. In my experience, most users don't understand the difference between TAS and IAS/EAS and as a result calibrate the system incorrectly.

Edit: I'd forgotten that this has already been done here: #7424

@AndreasAntener
Copy link
Member

I ran the correction over the data from my last test and it looks pretty good:

screen shot 2017-08-02 at 14 58 57

@AndreasAntener
Copy link
Member

I found some negative values that cause problems during the correction calculation and found a mistake in the C version, will add a commit and test.

@LorenzMeier
Copy link
Member Author

Great. My main concern are issues in the C version.

@AndreasAntener
Copy link
Member

I ran out of office time to run another test with the firmware (long meeting..) but the compensation on the data looks good. I'm not around for another test until next Tuesday though.. Who else has a setup?

@LorenzMeier
Copy link
Member Author

I should have one tomorrow to validate against ground speed.

@LorenzMeier
Copy link
Member Author

Very low speed bench test:

screen shot 2017-08-06 at 23 31 11

@LorenzMeier
Copy link
Member Author

Similar test without compensation:
screen shot 2017-08-06 at 20 32 40

@LorenzMeier
Copy link
Member Author

@AndreasAntener This should be good to go for testing.

@dagar
Copy link
Member

dagar commented Aug 20, 2017

Rebased on master for logging all differential pressure sensors and device ids.

@LorenzMeier LorenzMeier merged commit 0780e43 into master Sep 19, 2017
@LorenzMeier LorenzMeier deleted the pr-accurate-pitot branch September 19, 2017 16:01
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.

4 participants