This post is continuation of previous post on MPU9150. Using MPU9150gui utility program, orientation data has been logged for 2 hours 30 minutes. Note that the MPU9150 DMP initialized with default settings according to the Invensense library eMPL& I did not do any calibration. You may be interested in the logged data . TheDMP quaternion data has been logged at every second after dev board power up & DMP configuration. The quaternion data converted into Euler angles ( degrees ) to analyze the drift when the MPU9150 is at rest ( no motion) for 2 hr 30 min. The first graph here shows how the DMP output converging & then starts drifting.
Euler angles during first 20sec.
The Euler angles at 4th sec in the time line are Phi = -1.7398 Theta = -1.1055 Psi = -14.9286 & at 2 hrs 30 min are Phi = -1.5823 Theta = -1.1658 Psi = 27.6842. This shows us that the Phi drifted 0.1575 degrees, Theta drifted 0.0603 degrees & Psidrifted 42.6128 degrees. We can conclude, the average drift rate is0.0047348 degrees/sec ( 0.284085 degrees/min).
Euler angles during the 2hr 30 min.
The graph below gives an insight to the above graph & shows that there is noise ( non-linearity) too in Psi during the drift.
Zoomed-in view of the above graph.
As of now, the eMPL inside MotionDriver5.1 has capability to produce only 6-axis DMP quaternion & it doesn’t uses magnetometer data. This preliminary analysis results also show that MPU9150 DMP quaternion produces heading drift using eMPL. The 9-axis fusion that is DMP quaternion + magnetometer data left for users ( whatever, they did not release source). Currently this is a bottleneck in using the DMP quaternion as it is. For improved heading stability, users have to find their own way of fusion.
The following are the possibilities for 9-axes orientation:
- Tweak the DMP part related to magnetometer ( may not be possible until InvenSense provides a solution).
- (i) Get the DMP quaterion, read only magnetometer data in bypass mode. Implement effective 9-axis fusion ( DMP quaterion+mag ) method on microcontroller platform.
(ii) Configure MPU9150 to populate DMP quaternion into FIFO, magnetometer data into EXT_SENS_DATA_xx ( adress 0x49 ) & read it. Implement effective 9-axis fusion ( DMP quaterion+mag ) method on microcontroller platform.
(iii) Configure MPU9150 to populate DMP quaternion & the magnetometer data into FIFO, then read it. Implement effective 9-axis fusion ( DMP quaterion+mag ) method on microcontroller platform.
- Just get the sensors ( Accel, Gyro, Mag) raw data & implement any stable 9-axis AHRS fusion algorithm ( DCM or EKF).
I was able to get magnetometer data using the method 2(ii) ( have a look at my GitHub repository). Next job is 9-axis fusion, stay tuned it will be done soon.