After putting it off for a while I finally got around to calibrating the compass on the Robovero. Basically what this does is measure the effects of hard iron (metal objects around the compass), soft iron (circuit effects) and misalignment between the chip axis and the Robovero body axis. To my surprise the compass wasn't too bad, basically wanding around the compass should give a unit sphere centered at 0. It was close but after applying the calibration procedure given in LSM303DLH-compass-app-note.pdf, I came out with the following compass measurements.

compass calibration

Following this, I was able to write an extended kalman filter (EKF) to estimate roll, pitch and yaw as well as gyro biases.  The results were pretty good.  I significantly reduced the noise on roll and pitch over pure acceleration measurements (which is expected) and with the addition of the compass I could knock out drift on the heading calculation.  The results are shown below ... pretty cool.  Now just need to implement it on the Robovero.

attitude_ekf

Last modified Wed, 27 Mar, 2013 at 18:21