OK guys, this is a tricky one.....ive been on it for days and am running into more and more stones, so im sure this will be interesting to anyone trying to work an AHRS.
What i have so far is an MPU9250 running on an Arduino Nano via I2C and a Kris Winer Code, only adopted to accept my MPU on another I2C adress (0x73 iso 0x71). Data is put out via serial to SerialPlot.
For those unfarmiliar with his code, it has many calibration options, bias settings and other things coded that accually make it rather easy to use. BUT.....i'm not at all happy with my results.
(I have also downloaded the Bolder Flight code, but it does not provide pitch and roll and yaw indications.)
Setup: The sensor is mounted to a box to enable better rotation around the corners of the block.
Orientation: x North, y West, flat on table.
Value readings: Pitch 0, Roll 0, Heading -70 (So far so good, only heading somewhere else)
Moving the sensor around fixed y-axis -> Pitching up x-axis to 45deg
Expecting: Pitch 45, Roll 0, Heading -70
Actual: Pitch 0, Roll 45, Heading +90
Observation: Slight jitter in X axis despite multiple smooth tries. Heading jumps parallel to roll significantly. After setting the sensor back to level the heading drifts slowly back to original value.
Next move:
Moving the sensor around fixed x-axis -> Rolling y-axis to 45deg
Expecting: Pitch 0, Roll 45, Heading -70
Actual: Pitch 45, Roll 0, Heading -20
Observation: Virtually no jitter on x axis, this is probably induced by me moving it. Heading moves instantaneous and in paralell.
Next move:
Putting the sensor with X pointing straight up and Y pointing west.
Expecting: Pitch 90, Roll 0, Heading ?
Actual: Pitch 0, Roll 90, Heading drifting at 20 deg/s
I have then turned the sensor 90deg westward and repeated.
Expecting: Pitch 0, Roll 0, Heading -160
Actual: Pitch 0, Roll 0, Heading +20
Moving the sensor around fixed y-axis -> Pitching up x-axis to 45deg
Expecting: Pitch 45, Roll 0, Heading +20
Actual: Pitch 0, Roll 45, Heading +50
Observation: Same as before. Heading is severly less influenced than when facing north.
Last move:
Moving the sensor around fixed x-axis -> Rolling y-axis to 45deg
Expecting: Pitch 0, Roll 45, Heading +20
Actual: Pitch 45, Roll 0, Heading 0
Observation: Same as before. Heading is severly less influenced than when facing north.
What do i take from this? Heading seems to work in 90 degree steps for the tested orientations. It is not calibrated "Facing North". However it is severely influenced by pitching and rolling motions. Influence varies with actual heading.
Pitch and Roll are changed according to labeling.
Is this a calibration issue or a code issue? The calibration according code has been performed.....


