title: What is magnetometer tilt compensation and why is it required?
body: <p>When reading about magnetometer / magnetic field / "compass" sensors it is often said that sensor tilt compensation e.g. by using an accelerometer is required in order to get correct measurements. (Note that I am not talking about hard iron and soft iron effects here.) All these sources make use of the two-dimensional compass for clarification which, when tilted, would not work.</p>
  
  <p>When using a 3D magnetometer (e.g. HMC5883L), my understanding is that they provide a 3D vector pointing in (or along) the direction of the strongest magnetic field, which - in case of the earth - should be towards magnetic north.</p>
  
  <p>I was under the impression that I could use the cross product of a gravity vector measured by an accelerometer and the magnetometer "north" vector to get all axes required for determining a reference frame and from that, local orientation.</p>
  
  <p>Then, what <em>is</em> tilt compensation and why would it be required?</p>