kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.03k stars 472 forks source link

Yet another Yaw / magnetometer calibration issue #176

Open arilotter opened 7 years ago

arilotter commented 7 years ago

Hello! I've followed your https://github.com/kriswiner/MPU6050/wiki/Simple-and-Effective-Magnetometer-Calibration guide, but it results in a hard iron bias of {0, 0, 0}. I can see the magnetometer output, and the soft iron bias is a non-zero number, but the Yaw axis is still totally wrong (almost sinusoidal). The code's running at ~140MHz on an adafruit feather 32u4

kriswiner commented 7 years ago

offset bias of 0, 0, 0 is highly unlikely. Looks like you have an error in implementation.

On Tue, Aug 15, 2017 at 1:21 PM, Ari Lotter notifications@github.com wrote:

Hello! I've followed your https://github.com/kriswiner/ MPU6050/wiki/Simple-and-Effective-Magnetometer-Calibration guide, but it results in a hard iron bias of {0, 0, 0}. I can see the magnetometer output, and the soft iron bias is a non-zero number, but the Yaw axis is still totally wrong (almost sinusoidal). The code's running at ~140MHz on an adafruit feather 32u4

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/176, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qoZZoV9ujEnytfIxPJIQdfjxeMj4ks5sYf21gaJpZM4O4EAL .

henzim commented 7 years ago

From where did you call magcalMPU9250() ? I had the same problem when I called the function from the setup(), without waiting for
if (readByte(MPU9250_ADDRESS, INT_STATUS) & 0x01) { // On interrupt, check if data ready interrupt try calling it later in the loop()