Understanding problems with MPU6050 calibration

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
rcbebo82
Posts: 15
Joined: Mon Mar 14, 2016 2:20 pm
Country: -

Understanding problems with MPU6050 calibration

Post by rcbebo82 »

Hi,
i build up my second OpenXSensor with a GY86 Board instead an MS5611.
I now have problems to understand the calibration of MPU6050 like described in the config description file.
In the description file there is a section:

ensure that the mpu6050 (GY86) is perfectly horizontal and does not move (e.g. put on a table)

That means that i have to mount the board flat to the table right? If i do this my values for ACCX and ACCY differs in great by the configured values of -150 and -160 i get values like 636 and 1200.
On the board are some arrows for X and Y how must i orientate it? For better purpose here is a small picture of my board:

Image

Later in the description you find the part:

rotate mpu6050 in order to get X or Y axis perfectly vertical and do not move. Now, the 3rd number would become much lower (because it does not measure gravity anymore)

So how should i flip it? Im a bit confused because i dont understand what to do here!
Could someone help me?

mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Understanding problems with MPU6050 calibration

Post by mstrens »

It goes over calibrating accelerations.
Most of time accelerations are generated when an object move. Still even when MPU6050 does not move, it measures gravity.

If X and Y axis (draw on PCB) are both perfectly horizontal, then gravity has no impact on those axis and MPU6050 should ideally report two values that are equal to 0. In practice, it is not the case because the MPU6050 has some internal offsets. This is just what we try here to compensate.
So having both X and Y lines horizontal, get the values reported bu MPU6050 as explained in the description and use those values as accX and accY offsets in the config file. During this test, you should get value about 16000 (I think; I am not 100%) for acceleration along Z axis. This is because Z axis is vertical and get 1 g acceleration. So during this first part of the test, we can't measure the Z offset.

In order to know the offset for Z axis, you have to turn MPU6050 by 90° in order to move the Z axis from vertical to horizontal.
In this position, Acc Z should ideally be 0 but again due to offset, it will probably not be the case. Write the value you get for Acc Z while MPU6050 sit in this position (Z axis horizontal) and fill it in your config.h file as Z offset.
rcbebo82
Posts: 15
Joined: Mon Mar 14, 2016 2:20 pm
Country: -

Re: Understanding problems with MPU6050 calibration

Post by rcbebo82 »

Hi,
ok got it!

Thx for your help!

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”