-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
Conversation
8c8883b
to
c46c987
Compare
@@ -48,6 +47,29 @@ | |||
|
|||
__BEGIN_DECLS | |||
|
|||
enum AIRSPEED_SENSOR_MODEL { | |||
AIRSPEED_SENSOR_MODEL_MEMBRANE = 0, | |||
AIRSPEED_SENSOR_MODEL_SDP3X, |
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.
We could have the drivers themselves report the model.
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.
Indeed, good idea.
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.
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.
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.
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.
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.
@dagar I added all this here now. No more params required by default.
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.
Thanks!
c46c987
to
f680952
Compare
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. |
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. |
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 |
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. |
Great. My main concern are issues in the C version. |
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? |
I should have one tomorrow to validate against ground speed. |
e597a53
to
6ddf773
Compare
@AndreasAntener This should be good to go for testing. |
This allows to get very accurate readings from the SDP3x sensor series from Sensirion using a complete sensor model.
…egative compensation values
7215fce
to
604356d
Compare
Rebased on master for logging all differential pressure sensors and device ids. |
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.