kriswiner / MPU9250

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

Tilt without Gforce #278

Open itayrosenml opened 6 years ago

itayrosenml commented 6 years ago

Hi,

I'm trying to detect a slope in a device (mobility scooter to be exact). Using Pitch, I'm able to get exact degrees of rotation. However, the values are affected by the Gforce and therefore when the device is in motion (e.g. driving, accelerating, slowing down), so does the Pitch.

Is it possible to get rotation degrees around Yaxis which is not affected by Gforce?

kriswiner commented 6 years ago

You could remove gravity from the acceleration and re-calculate quaternions I suppose...or just use the linear accelerations to estimate pitch.

On Sun, Jun 3, 2018 at 1:22 AM, itayrosenml notifications@github.com wrote:

Hi,

I'm trying to detect a slope in a device (mobility scooter to be exact). Using Pitch, I'm able to get exact degrees of rotation. However, the values are affected by the Gforce and therefore when the device is in motion (e.g. driving, accelerating, slowing down), so does the Pitch.

Is it possible to get rotation degrees around Yaxis which is not affected by Gforce?

— 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/278, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkh4HdBH0cxnfJjYI_7NlovrNUSoks5t45yqgaJpZM4UX_my .

itayrosenml commented 6 years ago

Hi,

Unfortunately acceleration is measured with Gforce, so I guess I need to somehow measure it differently.

kriswiner commented 6 years ago

Yes, but you can estimate gravity and gravity-less acceleration by converting the quaternions into a rotation matrix. The using the gravity-less accelerations and gyro, you can estimate tilt. See here https://github.com/kriswiner/Ladybug/blob/master/MPU9250_MS5637_BasicAHRS2_Ladybug.ino .

Line 558-560 are gravity-less linear acceleration

On Sun, Jun 3, 2018 at 7:05 AM, itayrosenml notifications@github.com wrote:

Hi,

Unfortunately acceleration is measured with Gforce, so I guess I need to somehow measure it differently.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/278#issuecomment-394164644, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qr2zsgh-C67mwuDwSjWQo7i65Hboks5t4-0ggaJpZM4UX_my .