kriswiner/MPU9250

Need assistance.

Closed this issue · 1 comments

I am testing some 9dof sensors I picked up from Amazon and I need to make sure they are functioning properly. I am running my tests in an Arduino Mega 2560. The final assembly of my project is going to be run by an ESP32 running MicroPython for which there are libraries available for fusion and also the MPU9250. It is easier to get familiar with the MPU using the Arduino.

I only need the pitch and roll from the sensor but the values I am getting seem outta wack.
I am a newbie with the MPU9250, so the geek speak is going to go over my head. I just don't know the vocabulary, so you are going to have to dum down your answers quite a bit.

I do not know the ranges the pitch and roll output in, it would be ideal for pitch to be at 0 when locked on the horizon pitching down would be negative and up would be positive. roll would be 0 at no roll negative for a left roll and positive for a right roll.

I am using the MPU9250BasicAHRS sketch, I have commented out all of the Adafruit display code and changed the interrupt pin to pin 2 which is where I have the MPU9250 interrupt attached to.

Without moving the thing at all the pitch roll and yaw values keep on changing, the yaw moves a few degrees and the pitch and roll move around less than a degree.

This is the output of the sketch with the MPU9250 laying flat on the table.

Sketch Output (click to expand)
MPU9250 I AM 71 I should be 71
MPU9250 is online...
x-axis self test: acceleration trim within : 1.5% of factory value
y-axis self test: acceleration trim within : -1.0% of factory value
z-axis self test: acceleration trim within : -0.5% of factory value
x-axis self test: gyration trim within : 85.2% of factory value
y-axis self test: gyration trim within : 28.1% of factory value
z-axis self test: gyration trim within : 4.2% of factory value
MPU9250 initialized for active data mode....
AK8963 I AM 48 I should be 48
AK8963 initialized for active data mode....
X-Axis sensitivity adjustment value 1.21
Y-Axis sensitivity adjustment value 1.22
Z-Axis sensitivity adjustment value 1.17
ax = -45.72 ay = -0.73 az = 953.98 mg
gx = -0.03 gy = 0.09 gz = -0.32 deg/s
mx = 439 my = -77 mz = 55 mG
q0 = 0.03 qx = 0.12 qy = 0.19 qz = -0.97
Yaw, Pitch, Roll: -192.60, 14.42, -22.35
rate = 0.17 Hz
ax = -47.67 ay = 0.31 az = 950.32 mg
gx = -0.06 gy = 0.11 gz = -0.24 deg/s
mx = 455 my = -72 mz = 75 mG
q0 = 0.64 qx = 0.02 qy = 0.01 qz = -0.77
Yaw, Pitch, Roll: -113.85, 2.56, -0.05
rate = 211.59 Hz
ax = -45.53 ay = -1.10 az = 952.21 mg
gx = -0.11 gy = 0.14 gz = -0.28 deg/s
mx = 448 my = -72 mz = 64 mG
q0 = 0.65 qx = 0.02 qy = 0.02 qz = -0.76
Yaw, Pitch, Roll: -112.82, 2.72, -0.01
rate = 209.12 Hz
ax = -45.59 ay = 1.16 az = 952.27 mg
gx = -0.03 gy = 0.08 gz = -0.39 deg/s
mx = 426 my = -72 mz = 57 mG
q0 = 0.64 qx = 0.02 qy = 0.02 qz = -0.77
Yaw, Pitch, Roll: -113.82, 2.70, 0.01
rate = 209.32 Hz
ax = -46.33 ay = 1.40 az = 952.21 mg
gx = -0.01 gy = 0.08 gz = -0.16 deg/s
mx = 437 my = -79 mz = 57 mG
q0 = 0.65 qx = 0.02 qy = 0.02 qz = -0.76
Yaw, Pitch, Roll: -113.03, 2.71, 0.02
rate = 209.05 Hz
ax = -48.46 ay = -1.34 az = 951.66 mg
gx = -0.05 gy = 0.06 gz = -0.29 deg/s
mx = 436 my = -66 mz = 66 mG
q0 = 0.65 qx = 0.02 qy = 0.02 qz = -0.76
Yaw, Pitch, Roll: -113.29, 2.70, -0.01
rate = 210.46 Hz
ax = -45.04 ay = -0.18 az = 952.88 mg
gx = 0.03 gy = 0.10 gz = -0.07 deg/s
mx = 455 my = -87 mz = 68 mG
q0 = 0.64 qx = 0.02 qy = 0.02 qz = -0.77
Yaw, Pitch, Roll: -113.88, 2.84, -0.01
rate = 209.27 Hz
ax = -45.47 ay = -0.92 az = 953.67 mg
gx = 0.02 gy = -0.05 gz = -0.29 deg/s
mx = 436 my = -70 mz = 66 mG
q0 = 0.65 qx = 0.02 qy = 0.01 qz = -0.76
Yaw, Pitch, Roll: -113.31, 2.63, 0.02

Any help is greatly appreciated

I found my problem.. It was a P.E.B.K.A.C. issue (Problem Exists Between Keyboard And Chair)