My IMU application is a sailboat autopilot. As such, I do not need absolute accuracy but heading data must be stable and fairly linear.
Breadboard setup:
Sparkfun IMU-9250 (SKU: SEN-13762)
Arduino Nano (ATmega328P - same as Pro Mini)
Kris Winer’s Example Code straight from SF’s hook-up guide
Initial testing:
(IMU stationary for >30 at startup)
I2C communications as expected
Pitch and roll values (from Mahony filter) are stable +/- 1 deg
Yaw values drift at rates from .2 deg/sec up to 2 deg/sec over a large range (+/- 50 deg)
All three mag values also drifting.
Update rate 435 hz (higher than expected)
Troubleshooting so far:
Tested in alternate location (away from any iron or magnets)
Tested with/without 10k pull-up resistors on SDA & SCL
Negated the mz in the filter argument list (-myIMU.mz) as suggested in one of the forum posts
Tested with loop delay (ahead and after interrupt sense) to lower update rate to 100 hz
— yaw and mag data drift behavior the same in all cases.
Did I just get a board with a bad AK8963? Suggestions welcome.
Thanks!