Magnetometer

https://groups.google.com/forum/m/#!topic/uavdevboard/8wK9qk65xDo

Magnetic declination

https://groups.google.com/forum/m/#!topic/uavdevboard/MqzXKiuaGAQ Level plane with initializing

Regarding location of any IMU in general, including UDB in particular, there are two sensors to think about, the gyros and the accelerometers.

As far as the gyros are concerned, there are no restrictions at all on location, since the rotation rate is the same at any location on the plane.

It is only the accelerometers that you need to think about, because of unaccounted for centrifugal effects. The acceleration of the IMU is equal to the acceleration of the center of gravity, plus the centrifugal acceleration of the IMU with respect to the center of gravity, due to rotation of the plane.

The only location where the accelerometers do not experience an unaccounted for centrifugal effect is the center of gravity. So, ideally, that is where you would mount the IMU.

However, the unaccounted centrifugal acceleration is usually small, so you can get away with mounting an IMU anywhere on the plane, as long as it is not too far from center of gravity.

Most of the error arises from yaw rate. The unaccounted for acceleration in meters/sec/sec is W*W*R, where W is the yaw rate in radians per second, and R is distance from center of gravity in meters.

Mounting the IMU in front of or behind center of gravity will generate pitch error. Mounting the IMU off the side will generate roll error. But as long as you keep the offset less than about 12 inches, you should be fine.

For example, lets suppose you put your plane into a continuous tight turn at 60 degrees/sec (6 seconds for a full turn). That is about 1 radian per second. Suppose you mount the IMU 12 inches off center radially. That will generate an acceleration on the IMU of about 0.333 meters/sec/sec, or about 0.0333 g, which will generate an equivalent tilt error of about 2 degree. Nothing to worry about.

Notice that I keep using the phrase "unaccounted for centrifugal effect". That is because there is already a centrifugal compensation computation to account for centrifugal effects, that assumes the IMU is mounted at the center of gravity.

Actually, it is theoretically possible to account for the acceleration effect of mounting the IMU very far away from the center of gravity, all you need to know is the 3D location of the IMU with respect to center of gravity. But as far as I know, none of the popular autopilots let you do that.

magnetometer nulling

MatrixPilot_NASA_challenge branch : turn off magnetometer auto nulling and alignment during ground tests. to use this feature, #define GROUND_TEST (1)

https://code.google.com/p/gentlenav/source/detail?r=2755