I've decided that the compass support on ArduPilotMega needs beefing up. I'm working on this in a few ways:
1. Added MicroMag3 support - this is accomplished, though I still need to refactor to make things part of a better OO-design.
2. Added a LUT for both magnetic declination and inclination so that these values are populated by the GPS.
3. Looking to improve the drift correction algorithm. I like in an area where the inclination of the magnetic field is about 70 degrees from horizontal. Many people assume that the magnetic runs tagent to the earth's surface - this is significantly untrue. Becuase the magnetic field vector is so close to vertical here, it actually provides a much better estimator for pitch and roll than yaw if the plane is horizontal. Thus, I intend to modify the drift correction in the DCM to use the magnetic vector as a truly 3D vector. This means that depending on the orientation of the plane, it will correct for pitch, roll, and/or yaw with varying levels of accracy. Has anyone already looked into this?
4. Make a calibration wizard in "setup" and have it store the values in the EEPROM.