Selfmade Tilt compensated Compass Pitch, Roll, Yaw

Hi,

I want to build that kind of compass,too.

But what I understand from the lowcost paper by Mr. Caruso is that only roll and pitch are necessary for calculating heading, NOT yaw. Which is natural enough, yaw being the degree of freedom that coincides with that of magnetic heading, of course.

So one needs a 2 axis accelerometer and a 3 axis magnetometer.
As accelerometers aren't drifting that much it may be enough to calibrate it once and save and retrieve the offsets in eeprom which are subtracted or added to the reading values.

The GPS speed is no guarantee for a stillstand because below a speed of 2 knots the GPS will display speed = 0. So the best way for calibration of the accel may be to calibrate it once and store the offsets.

However, it may be an interesting idea to correct the calculated heading by the GPS track ( if one is going on a straight line) and to store the correction values. However, it would require to give input to the compass and set it into and out of calibration mode. This is, by the way, how modern autopilots from RAYMARINE are calibrating themselves. They need a GPS connection for that. Once calibrated they steer autonomously by magnetic heading.

Has anyone managed to get the magnetic calibration to work?

Andreas