Saturday, April 2, 2011

Compass Calibration

I took a walk over to the park next to my place to get as far from extraneous magnetic fields as I could. There is a cement curb between a patch of sand and grass there, which happens to run along true north (as far as Google Maps can tell). I went to the field, stood exactly in-line with this curb, turned on the IMU, aligned it with the curb for a couple of seconds, then spun the thing in my hands.

Now I know that there are extraneous fields in the Logomatic itself, probably especially in the battery, but maybe also in the mounting hardware. No matter. These rotate with the compass, so it is an easy matter to subtract them off. I didn't intentionally rotate the IMU in any particular direction, so I can't average the whole data set, but we can just take the median between the minimum and maximum of each axis.

Now let's see about the magnitude of the vector from the center to the surface of this ball of yarn.

It shows about a 10% variation, but more interestingly, there is a signal matching the rotation I did. The sensor magnitudes don't quite match each other. I haven't figured out what this signal is, but it's not sensor scale.

So, what we will do for our measurement is subtract out the offsets, then divide it all by the length of the vector to get a unit vector. Or, dividing by the expected length, about 640.

No comments:

Post a Comment