How to read Quat6 data without using FIFO in ICM20948

  • Working with an ICM20948 IMU sensor to obtain the yaw values using the example_7 _DMP_Quant6_EulerAngels of the Arduino library from Sparkfun.
  • 80ms interval is given between every data read command as the host controller is occupied with other tasks.
  • Observed a slight delay (500 to 800ms) in values being updated as all values in FIFO are flushed at once.
  • For instance, when the IMU sensor rotates about the z-axis for 100 degrees, we receive the following numbers : 0, 36, 67, 78,95,100, rather than a simple 100.
  • More real-time values are required than FIFO-stored values. Is it possible to read real-time values directly from the DMP bypassing FIFO ?
  • In the ICM 20948.c library, we found an API labeled “readDMPMems(reg,length, array)” for reading data from a register in DMP memory, but no instructions on which register to call to obtain the most recent values from DMP.

My workbench

  • Platform : Arduino IDE
  • Microcontroller: Arduino Nano BLE
  • Sensor: ICM20948
  • Wiring: Jumper Cable Connections
  • Arduino Nano ICM20948
  • 3.3V ----------------->> VIN
  • GND ---------------->> GND
  • A4 ---------------->> SDA
  • A5 ------------------->> SCL
  • This setup is powered up by Laptop USB

Hi mohammed.shams,

Welcome to the Tech Forum!

I don’t have first-hand experience, but I am looking into this. I have a couple of questions for you.

  • 80ms interval is given between every data read command as the host controller is occupied with other tasks.

Are you trying to read the IMU every 80ms, or is that what you believe is the update rate of the IMU?

  • Observed a slight delay (500 to 800ms) in values being updated as all values in FIFO are flushed at once.

Are you saying the values read are delayed by 500 - 800ms compared to the current position?

  • For instance, when the IMU sensor rotates about the z-axis for 100 degrees, we receive the following numbers : 0, 36, 67, 78,95,100, rather than a simple 100.

I would expect it to read out whatever is in the FIFO whenever you check it. So, if it is filling in the FIFO with calculated values at some frequency, if you don’t check it faster than its update rate, it will contain more than a single value.

  • More real-time values are required than FIFO-stored values. Is it possible to read real-time values directly from the DMP bypassing FIFO ?

I need to read a bit more to be certain, but I’m fairly sure there is a way to configure an interrupt pin to indicate every time there is new data in the FIFO, which should give you closer to real-time data if you read it every time the interrupt pin indicates new data.

  • In the ICM 20948.c library, we found an API labeled “readDMPMems(reg,length, array)” for reading data from a register in DMP memory, but no instructions on which register to call to obtain the most recent values from DMP.

I haven’t read through this yet. However, it wouldn’t surprise me if that referred to getting the raw data (angular rate of rotation rather than calculated degrees of rotation).