MPU9150 - Yaw drifting problem

Hello everyone

is there anyone who find a way to solve the problem of yaw drift in the first few seconds ???
any calibration or filter ??

thanks in advance :slight_smile:

What you are asking for is most likely an Attitude and heading reference system (AHRS).

adafruit got some code (not sure under which license it's under...)

But just google for "AHRS Arduino github" and you'll find something about "fusion". In other words fusing two or more degrees of freedom to get a no-drift gyroscope. Usually it's Gyroscope + Accelerator, but there also exists Gyro + Accelerator + Magnet-ometer(or whatever it's called).

cooperaj @ github is some code that fuses gyro + accelero + magneto. I haven't tried it but that's the code I would've gone with if I were you.

if you would've said how many dof's you had I would've been able to pin-point the optimal code for you :slight_smile:

Moustafa_279:
Hello everyone

is there anyone who find a way to solve the problem of yaw drift in the first few seconds ???
any calibration or filter ??

thanks in advance :slight_smile:

Do you see drift on only one axis, and a different axis depending on which way your IMU is situated?

I've found that at higher sensitivities, those solid state MEMS accelerometers can detect the rotation of the earth. Maybe that's what you're seeing?

the problem it's in the first 10 seconds when the sensor start to take the readings but after that it works well
in this video i'm fixing the sensor but but the yaw still drfting

You have calibrated the magnetometer? They don’t come pre-calibrated because this depends
on nearby iron and steel objects distorting the earth’s field. (Most surface mount
resistors and capacitors have steel contacts, for instance)