Wednesday, February 16, 2011

A custom gyro compass (Phase 1)

I have completed Phase 1 of my project, and I am very impressed by the performance of the MicroMag3 magnetometer. No hysteresis, spectacular real-time responsiveness: it looks like the motion-corrected part of the project (Phase 3) will not be necessary with this technology.

Here is the set-up used for these preliminary tests. The magnetometer on the breadboard is connected to a MAVRIC-IIB controller through the SPI bus, plus two other control lines as described in the datasheet. The microcontroller sends the calculated heading to a computer running Hyperterminal via a serial-to-USB converter.




When measuring only 2 axes on the horizontal plane with a resolution better than 0.1 degree, a sampling rate of 14.25 Hz can be achieved. Higher sampling rates could be used at the expense of the resolution. 

Here is the output produced when the breadboard is quickly snapped to a new angle every second or so.



The responsiveness is so sharp than you can even calculate the time taken during the quick rotation: it is around 3 time steps or 0.2 second. In a practical compass application, there is no need for a gyro: the rate of turn can be calculated directly from the magnetometer output.

Now some design considerations.

The objective is to get a resolution of 0.1 degree, with a 10 Hz update rate. In my location, the horizontal magnetic field is 17.7 microteslas (uT), which means that the resolution of the magnetometer should be 17.7 * 0.1 / 90.0 = 0.0197 uT. The MicroMag3 can achieve a resolution of 0.015 uT, but at the expense of an average sampling time of around 35 ms for each of the 3 axis. As it can measure only 1 axis at a time, this means a total sampling time of 105 ms, or 9.5 Hz at best. This does not leave time to add the accelerometer and tilt compensation calculations. To keep with the initial objective of 10 Hz, one would need 2 magnetometers working in parallel. In fact, I have decided to use 3 MicroMag3 in parallel for the final design, to insure that the measurements of each of the 3 axis of the moving compass will start exactly at the same time. It’s definitely not an economical or an elegant solution, but sometimes you have to use some brute force.

In this preliminary test, the Micromag3 was operated at 5 V, but it is optimized for an operation at 3.0 V. In the final design, I will use a microprocessor that can operate at 3 V to get the best accuracy, and to avoid a LOT of logic level conversions between the microprocessor and the 3 magnetometers. Another interesting characteristic of the Micromag3 is that you can calibrate all three axis with the official published magnetic field data for your location.


UPDATE :  the finished compass is described in this post.

No comments:

Post a Comment