kriswiner / ESP32

Arduino sketches for the ESP32
167 stars 47 forks source link

Problem with Roll,pith and yaw #19

Open FilipeRG1 opened 5 years ago

FilipeRG1 commented 5 years ago

Hello Kris, Please excuse me for my English.

I'm trying to use your MPU9250 reading code, but unfortunately the roll, pitch and yaw angles are being printed as "nan". Quaternions also have the same problem.

The print ax = -563.48 ay = -931.58 az = 616.94 mg gx = 12.00 gy = -7.16 gz = 88.43 deg/s mx = 2147483647 my = 2147483647 mz = 2147483647 mG q0 = nan qx = nan qy = nan qz = nan Gyro temperature is 17.7 degrees C Yaw, Pitch, Roll: nan, nan, nan Grav_x, Grav_y, Grav_z: nan, nan, nan mg Lin_ax, Lin_ay, Lin_az: nan, nan, nan mg sumCount = 0 sum = 0.00 rate = nan Hz

kriswiner commented 5 years ago

Magnetometer not working:

mx = 2147483647 my = 2147483647 mz = 2147483647 mG

On Tue, Jan 22, 2019 at 10:32 AM FilipeRG1 notifications@github.com wrote:

Hello Kris, Please excuse me for my English.

I'm trying to use your MPU9250 reading code, but unfortunately the roll, pitch and yaw angles are being printed as "nan". Quaternions also have the same problem.

The print ax = -563.48 ay = -931.58 az = 616.94 mg gx = 12.00 gy = -7.16 gz = 88.43 deg/s mx = 2147483647 my = 2147483647 mz = 2147483647 mG q0 = nan qx = nan qy = nan qz = nan Gyro temperature is 17.7 degrees C Yaw, Pitch, Roll: nan, nan, nan Grav_x, Grav_y, Grav_z: nan, nan, nan mg Lin_ax, Lin_ay, Lin_az: nan, nan, nan mg sumCount = 0 sum = 0.00 rate = nan Hz

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

FilipeRG1 commented 5 years ago

Do you think the problem is in the module?

kriswiner commented 5 years ago

Likely software/code you are using.

On Wed, Jan 23, 2019 at 11:17 AM FilipeRG1 notifications@github.com wrote:

Do you think the problem is in the module?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/ESP32/issues/19#issuecomment-456930812, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qqBVKE1DSnbyRwtrZja4kVAXP5lcks5vGLVigaJpZM4aNQ7S .

FilipeRG1 commented 5 years ago

I tried with another MPU and got the following data

ax = 891.72 ay = 231.99 az = -97.84 mg gx = 3.04 gy = -4.48 gz = -68.95 deg/s mx = -93 my = -23 mz = -50 mG q0 = -0.23 qx = 0.28 qy = 0.82 qz = 0.44 Gyro temperature is 29.2 degrees C Yaw, Pitch, Roll: 174.42, -38.96, 129.96 Grav_x, Grav_y, Grav_z: -596.00, -628.81, -499.38 mg Lin_ax, Lin_ay, Lin_az: 1487.73, 860.80, 401.54 mg sumCount = 630 sum = 0.56 rate = 1133.86 Hz

Do you think these data are right? and thank you very much your code will be of great use.

kriswiner commented 5 years ago

Looks better, but when the sensor is flat and motion less you should get 0, 0 1000 mg on the accel and 0, 0, 0 dps on the gyro.

Mag should read such that sqrt(mx2 + my2 + mz**2) = 500 mG

On Wed, Jan 23, 2019 at 11:32 AM FilipeRG1 notifications@github.com wrote:

I tried with another MPU and got the following data

ax = 891.72 ay = 231.99 az = -97.84 mg gx = 3.04 gy = -4.48 gz = -68.95 deg/s mx = -93 my = -23 mz = -50 mG q0 = -0.23 qx = 0.28 qy = 0.82 qz = 0.44 Gyro temperature is 29.2 degrees C Yaw, Pitch, Roll: 174.42, -38.96, 129.96 Grav_x, Grav_y, Grav_z: -596.00, -628.81, -499.38 mg Lin_ax, Lin_ay, Lin_az: 1487.73, 860.80, 401.54 mg sumCount = 630 sum = 0.56 rate = 1133.86 Hz

Do you think these data are right? and thank you very much your code will be of great use.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/ESP32/issues/19#issuecomment-456935922, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1quGyxP1skb6-4SoxMVX3AbhdwbVvks5vGLjggaJpZM4aNQ7S .