센서 > MPU9150 DMP | Hari's Blog

TODAY746 TOTAL2,229,304
사이트 이용안내
Login▼/회원가입
최신글보기 질문게시판 기술자료 동영상강좌

아두이노 센서 ATMEGA128 PWM LED 초음파 AVR 블루투스 LCD UART 모터 적외선


BASIC4MCU | 센서 | 자이로센서 | MPU9150 DMP | Hari's Blog

페이지 정보

작성자 키트 작성일2017-08-22 16:00 조회1,526회 댓글0건

본문

MPU9150 data log analysis

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 . The DMP 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

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 & Psi drifted 42.6128degrees. We can conclude, the average drift rate is 0.0047348 degrees/sec ( 0.284085degrees/min).

Euler angles during the 2hr 30 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

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 isDMP 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:

  1. Tweak the DMP part related to magnetometer ( may not be possible until InvenSense provides a solution).
  2. (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 intoEXT_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.
  3. 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.

MPU9150 IMU I2C Library for 32-bit ARM STM32f103xx family

If you are looking for a I2C library for the MPU9150 for STM32 family of microcontrollers, you may like to visit my opensource GitHub repository. There seems to be a decent libraryMPU9150Lib for Arduino by pansenti, but not available for ARM Cortex-M3 based STM32F103xx micros. Hence, I thought to share it for open community out there. It has been tested onOlimex STM32-P103 development board using only 5 pins of Sparkfun MPU9150 breakout board. The dev board has STM32F103RB micro. Unlike my other libraries for MPU6050 &HMC5883L, this library make use of latest ST’s CPAL ( Communication Peripheral Application Library) & handles communication errors. I also provided a complete project source based onIAR EWARM along with pre-compiled binary image which you can directly download to FLASH memory of your STM32 board. Download the USB Virtual COM port drivers here.

For testing the data coming from the board, you can download MPU9150gui. This software application developed  using C# .NET & replicates the functionality of Python based client application provided by Invensense for evaluating MPU6050/MPU9150. In addition, it prints Compass data ( command invc) & also you can log the orientation data into .csv file for further use. You just select the COM port allocated for your board, then Click Open Port button. For sending commands to the board, just type the commands in the text box, they will be received by the board. I hope to extend the functionality of MPU9150gui over time.

MPU9150 interface with Olimex STM32-P103 development board

MPU9150 interface with Olimex STM32-P103 development board.

MPU9150gui1

MPU9150gui_Console

Doxygen html documentation will come soon. For the library source files & updates visit : GitHub MPU9150 Repository
If you find it useful in your application, Just say thanks & use it. I appreciate any comments/contributions for improving it further. That’s it, that’s all I have for this week. Thanks for reading.
Note: This library is working successfully on STM32F103RB with Sparkfun MPU9150 breakout board. It should work on other microcontrollers of the same family too.



댓글 0

조회수 1,526

등록된 댓글이 없습니다.

센서HOME > 센서 > 자이로센서 목록

게시물 검색

2022년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2021년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2020년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2019년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2018년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
Privacy Policy
MCU BASIC ⓒ 2020
모바일버전으로보기