An Arduino Library for compass tilt compensation and hard iron offset

Hello,

We have been working on a new arduino library for compass tilt compensation and hard iron offset. Its finally complete today, so I thought I would share it with the arduino community.

The three main parts are:

  1. Compass Hard Iron Offset Auto-Solver
  2. Accelerometer Yaw Pitch & Roll Calculator
  3. 360° Compass Tilt Compensation

The auto solver is a Gaussian elimination solver requiring at least 6 datasets, the code included will filter and capture 8 datasets around the sphere and compute the best solution possible. Tilt compensation is not angle limited, it will compensate in any orientation. All the calculations that need to be done in the loop() are using fixed point integer math. The library has 3 examples that use the Honeywell HMC5883L 3 axis compass and the Freescale MMA8453Q 3 axis accelerometer. However any 3 axis compass & accelerometer pair will do.

The library and a more descriptive blog entry can be found here:
http://n0m1.com/2012/02/27/6dof-arduino-compass-accelerometer/

Enjoy! XD Please give us feedback, so we can improve it.

Impressive work, well done!

I think the link is not active anymore. Can you post an active link ?.

possibly - http://krazatchu.ca/2012/02/27/6dof-arduino-compass-accelerometer/ - ???

Thanks rob. http://krazatchu.ca/2012/02/27/6dof-arduino-compass-accelerometer/ does work. The library is hidden behind the hyperlink :smiley:

Cana you post a copy of the lib as attachment in this thread for future reference?

The link worked for me, and a most interesting one at that...
Thank You Rob for a most interesting 30 minutes...

Doc