kriswiner/MPU6050

A question about magnetometer calibration and calibration values.

Closed this issue · 12 comments

Hi, I have a question about magnetometer calibration.
For a simple example, when I rotate magnetometer about Z axis, then I think the magnetometer will measure the same max and min value at X and Y axis, but it get the different values.
Do you know why?

Maybe I can ask the question more clear.
The magnetic field will be an ellipse due to the soft iron. Under no hard iron affect, I rotate magnetometer about Z axis, both X and Y orientation will pass the same max and min value, it means
Xmax - Xmin = Ymax - Ymin
But if they are the same value, it isn't an ellipse.
So I want to know why or something I wrong.

Sorry, I cannot understand what you mean.
This is one of my calibration values. (It's can work)
mag_max[0] = 284;
mag_max[1] = 301;
mag_max[2] = 0;
mag_min[0] = -111;
mag_min[1] = -92;
mag_min[2] = -494;
I rotate the magnetometer in a figure eight, so I just want to know when I rotate to let all XYZ's axis positive direction pass the same point, why they didn't get the same value?

OK, so I think it is due to what material to manufacture magnetometer or what principle to let magnetometer work. Do you mean it?

Yes, I have seen it. But it is only say hard iron and soft iron will give bias. I want to know if I set my magnetometer at a fixed point and rotate it, it will get the same max and min values or not.

According to my calibration values (I tried to rotate in a small field.), they get the different values, so I want to know the reason.

Hello, thanks for posting info on calibrating. I have one question regarding the mag calibration function;
void magcalMPU9250(float * dest1, float * dest2)
What is the function expecting for dest1 and dest2? What do these number represent?
Thanks,
-Matt

@Alchemy455
dest1 and dest2 are pointers to arrays from layer that calls magcalMPU9250() method.
In other words : there are output values not input.

OK, I think I got the answer.
https://www.sensorsmag.com/components/compensating-for-tilt-hard-iron-and-soft-iron-effects
"The distortion produced by soft-iron materials is dependent upon the orientation of the material relative to the sensor and the magnetic field." I think it means the soft-iron distortion affect the material in magnetometer, and different orientation will measure different magnetic field. I set my magnetometer at a fixed point and rotate it, it will get different values at different orientation, so X and Y direction will not get the same max and min values.
Does anyone can answer me what my thought is true or false?