3 Replies Latest reply on Jul 10, 2015 9:23 AM by MichelleLee

    Is it possible to get LSM9DS0 IMU polling at >1000Hz?


      I'm working on a project that requires the use of a LSM9DS0 to gather data at at least 1000Hz. Right now the IMU is connected via I2C to the Edison via a mini breakout board, and reading data works. However, I can only get a maximum polling rate of about 400-550Hz. I'm using RTIMULib to interface with the IMU, and my code is written in C++.


      According to the datasheet of the IMU, the accelerometer is capable of operating at 1600Hz, while the gyro can be polled at 760Hz, and the magnetometer at 100Hz. Of the three, the accelerometer is the most important reading for me.


      To try and get the maximum possible speed, I've disabled the other two sensors, leaving on the accelerometer enabled. Even in this configuration, I could not get a polling rate of over 600Hz on a good run.


      Is there any way I can get at least 1000Hz polling with the IMU and the Edison, or is this some sort of hardware limitation? I've heard that SPI is much faster than I2C, but I'm not sure if this will fix my issues. Additionally, I've tried the IMU on my Raspberry Pi with the I2C frequency set at 400KHz, which only marginally increased polling rates over the standard speed.


      Thanks in advance for any help.


      EDIT: Here is the code I have so far. I've tried to make it so that the read loop runs as fast as possible by cutting out file writes mostly. All data read is stored in memory, which is written to file at the end of the loop. I'm sure there are a lot of ways to make this more efficient, so I'm completely open to ideas.