# 3-axis Magnetometer Question

Apologies if this is a stupid question, but if I have a 3-axis magnetometer, and I calculate the vector magnitude as

sqrt(magX * magX + magY * magY + magZ * magZ)


...then should I not always get the same value, regardless of the sensor's orientation? Mine is all over the place, and I feel as though I'm missing something obvious.

I don't think it would make a difference what the orientation is. I would recommend maybe using hall effect sensors instead of a 3 axis magnetometer if ALL else fails. That would be a last resort though because they are probably not going to give you the kind of accuracy and precision you are looking for.

• Yeah, I looked into the matter using a different IMU, and got different results. I think the problematic IMU has some user configuration settings on it that are bogus. Thanks! Feb 5, 2015 at 21:42