MAG 3110 Magnetometer calibration question

Hello,

For my project I am using MAG 3110 sensor, for my needs I think that I don't need to calibrate the sensor because I am only interesting in the change of magnetic field due to vehicle which is distorting earth magnetic field .

But I have strange values on the Z axis , The Z axis samples are much more higher then the X,Y axis.

for example :

187 265 2517
190 262 2517
184 261 2519
186 265 2524
186 265 2524
185 262 2507

Additionally sometimes only the Z axis are jumps to values like 251714 , you may see it on the graph image below :

My questions are :

  1. Why Z values are so high then the X,Y values ?
  2. Is this jumps on Z values is normal behavior, I should filter them ?
  3. May calibration fix this issues ?

Thanks you very much !

Try calibrating the sensor, and see if that changes the behavior.

Overview of calibration here.

Thanks jremington I know ,
I asked the question to see what other people think/know about values without calibration .

I know that calibration is only subtraction mid value between min,max values in all angels from the axis.
So I don't believe I need to west time to learn calibration things right now .

I know that calibration is only subtraction

Wrong.

However, you are most likely confusing signed with unsigned integers, and getting sign inversions. If you were to actually go through the calibration process, you would probably figure out that your readings are nonsense.

jremington:
Wrong.

However, you are most likely confusing signed with unsigned integers, and getting sign inversions. If you were to actually go through the calibration process, you would probably figure out that your readings are nonsense.

I know that the values stored in the registers are 2’s complement,
I am using int16_t to read the values and I am getting negative numbers is that wrong ?

int16_t mag_read_value(int msb_reg, int lsb_reg)
{
int16_t val_low, val_high; //define the MSB and LSB
val_high = mag_read_register(msb_reg);
delayMicroseconds(2); //needs at least 1.3us free time between start and stop
val_low = mag_read_register(lsb_reg);
int16_t out = (val_low | (val_high << 8)); //concatenate the MSB and LSB
return out;
}

By review the article you gave , Calibration is :
CalibratedData = ( unCalibratedData – Offset ) / Scaling Factor

so I am not so wrong , please read my questions again and tell me if your right
“your readings are nonsense”.

If I need only the change, they should make sense the graphs shows it .

I know that calibration is only subtraction mid value between min,max values

You forgot about the scale factor.

The calibration procedure requires you to orient the magnetometer in many different orientations and calculate two corrections for every axis, so six values in total.

You know the magnitude of the Earth's magnetic field.

When you are finished with the calibration process, the readings should make sense and give the correct value in every direction, especially when each axis is aligned parallel or antiparallel to the Earth's magnetic field lines.

Until you have done that exercise and get reasonable values along all three axes, for every possible orientation, you ARE wasting your time.