kriswiner / MPU9250

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

[solved]Roll and Pitch changes affect Yaw #79

Closed marcirsch closed 8 years ago

marcirsch commented 8 years ago

Dear Kris!

I am using your mbed library, with an stm32f042, also tried with stm32f446. I have calibrated the accelerometer, gyroscope static, and the magnetometer with the calibration function (and 8 figure). Using bandwidth 41Hz for gyro, 44.8 for accelerometer. Output rate is 200 Hz. Not using fifo. As you can see on the picture attached, the correlation between yaw and other angles is pretty strong. I am stuck here, any help is appreciated!

Thank you for your work on these libraries! 9250

kriswiner commented 8 years ago

Are you passing the Madgwick filter the data in the proper order? I mean accel z = -mag z, etc.

-----Original Message----- From: marcirsch [mailto:notifications@github.com] Sent: October 4, 2016 11:08 AM To: kriswiner/MPU-9250 Subject: [kriswiner/MPU-9250] Roll and Pitch changes affect Yaw (#79)

Dear Kris!

I am using your mbed library, with an stm32f042, also tried with stm32f446. I have calibrated the accelerometer, gyroscope static, and the magnetometer with the calibration function (and 8 figure). Using bandwidth 41Hz for gyro, 44.8 for accelerometer. Output rate is 200 Hz. Not using fifo. As you can see on the picture attached, the correlation between yaw and other angles is pretty strong. I am stuck here, any help is appreciated!

Thank you for your work on these libraries! 9250 https://cloud.githubusercontent.com/assets/22622263/19085968/94d4a83c-8a6c- 11e6-9822-0203a2f5db50.JPG

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/79 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qj76fZAreQ9Ciwmhgcyx- asIyEdWks5qwpXngaJpZM4KN-5A . https://github.com/notifications/beacon/AGY1qq7700LFFR6-hRcXFAOShuSrLFFiks5 qwpXngaJpZM4KN-5A.gif

kriswiner commented 8 years ago

See this discussion:

https://forum.pjrc.com/threads/25965-9-and-10-DoF-LSM9DS0-shield-for-Teensy-3-1?p=117389&viewfull=1#post117389

marcirsch commented 8 years ago

Hi Kris!

Thank you for your advice! I didn't pay attention to the different orientation of the magnetometer. After changing the arguments, it works! One more question: What do you recommend for fast motion capturing? Now Output rate is 1kHz, sending rate is 100Hz, Beta is unchanged. It misses some fast spins. Changing gyro sensitivity would do the thing?

Marci

marcirsch commented 8 years ago

So I've just found out setting low pass filters' bandwidth a bit higher, around 200, setting gyro sensitivity to 1000 DPS, and Accelerometer to 8gs gives a decent result.

Thank you for your help! Marci

Sanjanawinchester commented 6 years ago

hey @marcirsch can you please elaborate exactly how your problem was solved? Because I am facing the same problem and there doesn't seem to be any way out.

marcirsch commented 6 years ago

This is the way you should call the filter update: //magnetometer is upside down mpu9250.MadgwickQuaternionUpdate(ax, ay, az, gx*PI/180.0f, gy*PI/180.0f, gz*PI/180.0f, my, mx, -mz);

Hope it helps

kriswiner commented 6 years ago

This is if you have chosen your board design/sensor placement such that you designate Ax to lie along the North direction and if you have chosen Az to point down.

On Wed, Jul 4, 2018 at 5:25 AM, Marcell Rausch notifications@github.com wrote:

This is the way you should call the filter update: //magnetometer is upside down mpu9250.MadgwickQuaternionUpdate(ax, ay, az, gxPI/180.0f, gyPI/180.0f, gz*PI/180.0f, my, mx, -mz);

Hope it helps

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/79#issuecomment-402463804, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qmlmhyTjbaQaRUnBT-Jm-iZjogTcks5uDLRDgaJpZM4KN-5A .

Sanjanawinchester commented 6 years ago

@marcirsch ...I tried that but only sometimes the problem is solved. Only sometimes the pitch doesn't affect the roll and yaw, but many times it does.

Sanjanawinchester commented 6 years ago

I included the code for calibration of the magnetometer, but how to move the IMU while calibrating. I read to move in figure 8 but exactly how?

kriswiner commented 6 years ago

Sample the entire 3D response surface

On Thu, Jul 5, 2018 at 3:30 AM, Sanjanawinchester notifications@github.com wrote:

I included the code for calibration of the magnetometer, but how to move the IMU while calibrating. I read to move in figure 8 but exactly how?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/79#issuecomment-402679145, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qstW0Yxr1FHs-TSLoetzNSfwy0eOks5uDeqsgaJpZM4KN-5A .

Sanjanawinchester commented 6 years ago

I did not quite get you. Can you please explain in detail @kriswiner ?

kriswiner commented 6 years ago

https://github.com/kriswiner/MPU6050/wiki/Simple-and-Effective-Magnetometer-Calibration

On Thu, Jul 5, 2018 at 10:52 PM, Sanjanawinchester <notifications@github.com

wrote:

I did not quite get you. Can you please explain in detail @kriswiner https://github.com/kriswiner ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/79#issuecomment-402933434, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qrHwza7YUZhxdGVtyW9gY1XuRIDtks5uDvslgaJpZM4KN-5A .