cancel
Showing results for 
Search instead for 
Did you mean: 

Ellipsoid fitting for magnetic values (LSM303AGR)

DZimm.16
Associate

Hello everyone,

I started with the implementation of the rotated ellipsoid fitting described in DT0059 for the LSM303AGR compass. There is as well a sample matlab code which I use to verify my implementation.

My software inside the microcontroller calculated all the steps described in the design tip 59. I get the same offsets, eigenvectors and -values as in Matlab.

In the paper, there are three steps described to correct the magnetic input values:

  1. Subtract the offset
  2. Multiply with the invers
  3. Divide by the gains

I made a simple test, where I fixed the PCB in the XY plane and rotate it (around the z-axis).

0690X000006C2P4QAK.png

The red data points are the collected values, whereas the green should be the corrected fitted values.

My question now is:

How do I need to order the eigenvalues and -vectors, so that the input values and transformed to the correct places? The design tip just tells to "juxtaposition the three eigenvectors" (page 3), but depending on the order I get completely different results and unfortunately, none of them really makes sense.

Thank you and best regards

Daniel

0 REPLIES 0