Inconsistent altitude reading with MPL3115A2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inconsistent altitude reading with MPL3115A2

1,214 Views
chiranjeevikinn
Contributor III

Hi All,

 

We are using MPL3115A2 for altitude measurement. our application demands a real time altitude.

We are running linux on iMX6 and MPL3115 is connected on I2C. Using the evtest application to get the altitude from the input subsystem. Tried both RAW mode and post processing mode.

Following is the output of the evtest, Altitude is calculated as 26*0.0625 = 1.625 Metres ( we actually are testing from 9th floor of the building which is around 53 m high) Interestingly even the freedom sensor kit also shows around 1.5 to 2.0 metres. Can someone please throw some light. we are confused.

 

vent: time 1470274587.595498, -------------- Report Sync ------------

Event: time 1470274588.595494, type 3 (Absolute), code 24 (Pressure), value 26

Event: time 1470274588.595499, -------------- Report Sync ------------

Event: time 1470274589.595494, type 3 (Absolute), code 24 (Pressure), value 20

Event: time 1470274589.595500, -------------- Report Sync ------------

Event: time 1470274590.585493, type 3 (Absolute), code 24 (Pressure), value 27

Event: time 1470274590.585499, -------------- Report Sync ------------

Event: time 1470274591.585494, type 3 (Absolute), code 24 (Pressure), value 29

Event: time 1470274591.585500, -------------- Report Sync ------------

Event: time 1470274592.575494, type 3 (Absolute), code 24 (Pressure), value 23

Event: time 1470274592.575499, -------------- Report Sync ------------

Event: time 1470274593.575493, type 3 (Absolute), code 24 (Pressure), value 30

Event: time 1470274593.575499, -------------- Report Sync ------------

Event: time 1470274594.575497, type 3 (Absolute), code 24 (Pressure), value 34

Event: time 1470274594.575503, -------------- Report Sync ------------

Event: time 1470274595.565499, type 3 (Absolute), code 24 (Pressure), value 24

Event: time 1470274595.565504, -------------- Report Sync ------------

Event: time 1470274596.565497, type 3 (Absolute), code 24 (Pressure), value 25

Event: time 1470274596.565502, -------------- Report Sync ------------

Event: time 1470274598.555505, type 3 (Absolute), code 24 (Pressure), value 18

Event: time 1470274598.555511, -------------- Report Sync ------------

Event: time 1470274599.555505, type 3 (Absolute), code 24 (Pressure), value 25

Event: time 1470274599.555510, -------------- Report Sync ------------

Event: time 1470274600.546570, type 3 (Absolute), code 24 (Pressure), value 20

Event: time 1470274600.546576, -------------- Report Sync ------------

Event: time 1470274601.545484, type 3 (Absolute), code 24 (Pressure), value 31

Event: time 1470274601.545490, -------------- Report Sync ------------

Event: time 1470274602.545487, type 3 (Absolute), code 24 (Pressure), value 20

Event: time 1470274602.545493, -------------- Report Sync ------------

Event: time 1470274604.535496, type 3 (Absolute), code 24 (Pressure), value 19

Event: time 1470274604.535501, -------------- Report Sync ------------

Event: time 1470274605.525512, type 3 (Absolute), code 24 (Pressure), value 18

Event: time 1470274605.525517, -------------- Report Sync ------------

Event: time 1470274606.525512, type 3 (Absolute), code 24 (Pressure), value 15

Event: time 1470274606.525517, -------------- Report Sync ------------

Event: time 1470274607.525510, type 3 (Absolute), code 24 (Pressure), value 18

Event: time 1470274607.525516, -------------- Report Sync ------------

Event: time 1470274609.515464, type 3 (Absolute), code 24 (Pressure), value 23

Event: time 1470274609.515470, -------------- Report Sync ------------

Event: time 1470274610.505466, type 3 (Absolute), code 24 (Pressure), value 14

Event: time 1470274610.505472, -------------- Report Sync ------------

Event: time 1470274611.505465, type 3 (Absolute), code 24 (Pressure), value 22

Event: time 1470274611.505470, -------------- Report Sync ------------

Event: time 1470274612.505464, type 3 (Absolute), code 24 (Pressure), value 18

Event: time 1470274612.505470, -------------- Report Sync ------------

Event: time 1470274613.495465, type 3 (Absolute), code 24 (Pressure), value 16

Event: time 1470274613.495470, -------------- Report Sync ------------

Event: time 1470274614.495464, type 3 (Absolute), code 24 (Pressure), value 15

Event: time 1470274614.495469, -------------- Report Sync ------------

Event: time 1470274615.485513, type 3 (Absolute), code 24 (Pressure), value 17

Event: time 1470274615.485519, -------------- Report Sync ------------

Event: time 1470274616.485479, type 3 (Absolute), code 24 (Pressure), value 20

 

Thanks in advance!

Best regards,

Chiranjeevi

Labels (1)
3 Replies

913 Views
michaelestanley
NXP Employee
NXP Employee

Chiranjeevi,

I'm unfamiliar with the evtest application, but I can comment on the MPL3115A2 as I did some of the initial architectural work on that device.

First, you should know that it computes altitude as a function of pressure and temperature using the NASA Standard Atmospheric Model of 1976.  That standard includes equations which model describe idealized altitude versus those two input parameters.  "Idealized" because the equations completely ignore the effect of weather.  We used them as a way of modeling changes in altitude versus changes in pressure and temperature.  That's why the MPL3115A2 has some convenient "offset" registers - to allow you to adjust your baseline to current conditions.

As to changing values...  The analog to digital conversion on the MPL3115A2 is a complicated affair.  The heart of the system is a roughly 16.5 bit hybrid sigma-delta/SAR.  This is then massively oversampled to drive the accuracy up to the range where we can measure sub-meter altitude increments.  That oversample ratio is controlled in part by the OS2:0 bits in the CTRL_REG1 register.  The higher the output data rate, the poorer the resolution.  So if your samples were taken at a higher data rate, it would be expected that you would see varying values.  That's the natural noise in the signal.

Regards,

MIke

913 Views
chiranjeevikinn
Contributor III

Hi Mike,

Thanks for your explanation.

Can I assume that reading the register value (16.5 bits) and multiply by 0.0625 is the right way of getting the absolute altitude?

Best regards,

Chiru

0 Kudos

913 Views
michaelestanley
NXP Employee
NXP Employee

Chiranjeevi,

Again, you are never going to get absolute altitude. I would not recommend that you simply multiply a low resolution value by a constant to gain it up.  The result will be pretty useless unless you filter it first.   As discussed, the part will do that for you if you put it in it's highest oversample mode as per Table 59 of the spec.  If you want to do your own filtering for some reason, I can put you in touch with an apps engineer for them to advise on details (I think it's just a low pass filter with unity low-frequency gain - but I better put you in the hands of someone who's more familiar with that mode of operation).

If you would like to talk with an apps engineer, shoot me an email at mike.stanley@nxp.com with your contact information, and I'll have someone reach out.

Mike

0 Kudos