MS5611 vs temperature

608 views
Skip to first unread message

Radek Voltr

unread,
Nov 11, 2014, 3:38:42 AM11/11/14
to drones-...@googlegroups.com
Hi

I am trying to get more detailed info how MS5611 sensor works and how is implemented in APM code. I would like to share some of my findings and maybe we can discuss some possible improvement.

Here is shortly about my testing setup - simple mini Arduino with MS5611 (steel cap) on i2c and long wire. I did couple of measurements and touched back of board to heat it. Then I checked how temperature compensation work and did couple of charts.

Here are charts (moving average have 32 samples) :


You can see spikes in temperature. I used two calculation of Altitude, one is based on fixed temp (so it is similar to current code in APM) and second is based on direct temp from sensor (and is totally useless). Also there is visible that Meas recommended temperature compensation doesn't work too well because pressure changing after temp change.


I have simple question for you guys - does this worth some action or not ? I didn't fly PixHawk with 3.2 yet (moved from MPNG on 2560 few weeks ago and waiting for suitable weather and time) so I am not sure how stable is temperature in PixHawk case. I see increasing of temp/alt after power up on my desk (as electronics heating) but not sure how this work on field and in flight. I have two ideas how to work against this (external temperature sensor like Dallas to get temperature from outside of case and copter/plane and/or compassmot like table based compensation when we will record difference between expected Alt (not changed) and real calculated for each temp points)


Jonathan Challinger

unread,
Nov 11, 2014, 5:23:04 PM11/11/14
to drones-...@googlegroups.com
It almost looks like we're applying the temperature compensation in the wrong direction.

--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Challinger

unread,
Nov 11, 2014, 5:31:52 PM11/11/14
to drones-...@googlegroups.com
But wait, there is no temperature compensation offset that should be applied above 20C, according to the datasheet. Why are you seeing this difference at all?

Jonathan Challinger

unread,
Nov 11, 2014, 5:36:02 PM11/11/14
to drones-...@googlegroups.com
Can you describe your methodology more? Are you using our code? If not, what code?

Radek Voltr

unread,
Nov 12, 2014, 2:36:23 AM11/12/14
to drones-...@googlegroups.com
As I noticed in datasheet (page 7 & 8), there is two levels of temperature compensation. One is based on stored data and second is on page 8. I am using code which do first level of compensation (not APM but exactly same, I checked it) from Page 7 and stored PROM data. Second order from page 8 is really not used on 20C plus compensation.

First order compensation generated Compensated Pressure as you can see on second chart. Unfortunately, it clearly shows that temperature compensation in datasheet is not enough and pressure readings still changing with sensor temperature.

Altitude calculations are included just to show how big difference can this non compensate reading generate. APM code using fixed temperature (updated before arming of copter and don't change during flight, right ?) so difference is about 2 meters per 10C on sensor. Chart with calculating based on temperature from sensor is just for record and to show that current code is best what we can get with datasheet implementation.


So main question is - how stable is PixHawk internal temperature during flight ? Take this case :

- outside temperature 22C
- copter connected and armed without long waiting
- electronics in case start generate heat and temperature on baro sensor rising. Outside temp is not low enough to cool case down and make temperature stable, especially in case of loiter type flying
- unfortunately, even compensated readings rise too and generate fake vertical speed change

I did this in simulation mode, on ground so I can be 100% sure that accells don't tell to change alt, I have changed parameter to 7 so accels is even more valuable than baro but still, I am getting slow alt change requests. I am not sure how often this case can happen, how long it normally takes between connect and fly. Till now I used MPNG board without case so heating was not problem (but zillion of other problems made me to upgrade) and so I was pretty surprised with see slow increase in baro and not just oscilation arround some number and slow changes based on outside pressure changes.

Well, I can imagine that transition from loiter to speed flight can cool down case and generate fake altitude decrease. In this case it will not be problem but oposite situation, where from speed to loiter will start increasing Alt can be problem as code can try to compensate and copter can go slowly down.

Also there will be different behavior if you have px on wind, in copter, near ESC or other temperature sources.

Unfortunately, I see only one possibility how to work around this - compassmot like calibration.

Reply all
Reply to author
Forward
0 new messages