9150 + MotionDriver 5.1 + Compass

By lilin , 26 March 2013

Hello,
i've got a strange problem here... I try to tilt compensate the raw compass data but i can´t get good data out of this stuff.

Here is what i do:
I use the MPU functions to generate a 6x Quaternion. Everytime the interrupt tells me there is a new quaternion in fifo, i read it and then read out the compass:

            dmp_read_fifo(gyro, accel, quat, &sensor_timestamp, &sensors,
&more);
if (!more)

mpu_get_compass_reg (compass,0);


Via RS232 i get a data file that contains the quaternion (a b c d) and the compass raw-data (x y z).

From the quaternion i calculate the pitch and roll. Works fine!
Second step: I add the Hard-Iron Values to the compass-data.
Works also fine, I get a sphere around 0,0,0.

Then i try to re-rotate the compass-data with pitch and roll. I think that should give me a circle around 0,0 with an offset on the Z-Axis.
But all i get is another sphere...

Any Ideas?
phpbb Topic ID
15174