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

Oversampling rate for MPL3115A2 pressure sensor #11296

Closed
LeoMustafaNXP opened this issue Jan 25, 2019 · 4 comments
Closed

Oversampling rate for MPL3115A2 pressure sensor #11296

LeoMustafaNXP opened this issue Jan 25, 2019 · 4 comments

Comments

@LeoMustafaNXP
Copy link

LeoMustafaNXP commented Jan 25, 2019

Describe the bug
On my test flights I see that the drone is not able to keep height and jumps +-2m up and down.
Parameters?

In the log files I saw that the Barometer Altitude is very noisy. In the driver for the MPL3115A2 the default Oversampling rate is set to 0. This means that the minimum time between data samples is 6ms. I have done some test flights with different OSRs and it seems to be better to use as default OSR 2. This means that the minimum time between data samples is 18ms. In outdoor test flights the drone was able to hold the height better and jumps only +-0.5m up and down.

Please change the default OSR from 0 to 2.
(File: /src/drivers/barometer/mpl3115a2.cpp line 100)
#define MPL3115A2_OSR 2

To Reproduce
FMU: NXP FMU K66
Drone: LJI500 frame
GPS: Pixhawk 4
Telemetry: Holybro 433MHz radio

Log Files and Screenshots

OSR 1: https://review.px4.io/plot_app?log=c90e1169-a56f-4694-8372-628e4567865c
osr1

OSR 2: https://review.px4.io/plot_app?log=aaefb21d-73c8-4427-9ea6-aa92bc8a56c9
osr2

OSR 3: https://review.px4.io/plot_app?log=41b6562d-f1de-4e50-9062-81d98e9012b5
osr3

OSR 4: https://review.px4.io/plot_app?log=88647968-63ee-48d0-ab29-e055ddd84098
osr4

@dagar
Copy link
Member

dagar commented Jan 25, 2019

Seems like a clear improvement. Any input on this @priseborough or @davids5?

@priseborough
Copy link
Contributor

This should be an improvement. The only potential downside is faster heating of the sensor at the higher sampling rate which with some sensor models in the past has provided higher levels of thermal drift. Inspection of the devices measured temperature and pressure in the logs does not indicate this to be an issue with this model of sensor so the higher oversampling rate looks like the way to go.

@davids5
Copy link
Member

davids5 commented Jan 29, 2019

Thank you @LeoMustafaNXP and @priseborough PR is in. #11332

@dagar
Copy link
Member

dagar commented Jan 29, 2019

Fixed in #11332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants