Hello,

I am attempting to use a NXP 9-DOF w/ FXOS8700 + FXAS21002 (Product ID 3463) with the AHRS fusion code provided by Adafruit to determine the angle between my board when moved from a starting position to a new position using quaternions and the Madgwick filter option. Taking the starting position values (a1, b1, c1, d1) and the end position values (a2, b2, c2, d2), I am plugging them into the following formula to return the relative angle between the two positions: theta = 2*arccos(abs(a1*a2+b1*b2+c1*c2+d1*d2))

To test the accuracy of this method, I have sketched angles on a sheet of paper (15, 30, 45, 90) and am seeing how close I can get to the actual values by moving the board between the angles. For 45 & 90 I get values that are very close to actual, but for 15 and 30 I get approximately double the angle. I'm assuming this has something to do with the fact that I'm using quaternions and the math behind them, but I can't figure it out.

Is this a common problem with quaternions? Any and all help would be greatly appreciated. Thanks!