I thought I had the data rate solved by changing it from the default LSM6DS_RATE_104_HZ to LSM6DS_RATE_833_HZ Problem is when I up my sample rate from 100hz to 250hz, I start to see duplicate entries in the data. The same value well be logged 2 or 3 times. At 100hz there was never any duplicate data.
I wrote a device driver for its bigger brother, the LSM6DSL, and the proper way to handle higher ODR is use the built-in FIFO buffer in the device. The LSM6DS33 apparently has 8 KB. You set it up to "buffer" the acc and gyro data, and signal an interrupt when it's 1/2, 3/4, etc full. You then do a bulk fetch of the data in a single I2C transaction.
When I say buffer, it's the LSM's own FIFO buffer. The LSM accumulate the data in it's own buffer, and when it reaches a configurable threshold, it signals an interrupt to the MCU. The MCU then retrieve the data at once in a single I2C transaction. This will actually improve the performance since you'll have less overhead in fetching individual acc/gyro datasets (12 bytes total if in 16 bit mode).
Yes, I was aware of this. Currently the project I'm working on uses one Accel/Gyro breakout. It's a prototype-proof of concept and we get some data to play with. Next version will have to measure the 7-DOF of the arm + measure movement in the forefinger-thumb. I was include the middle finger to have a 'complete' pen holder's grip but I think finger-thumb may be sufficient.
Having an 8k FIFO will decrease the processor load at the expense of memory. We need to 'sync' all events and log them for post processing. Merging 5 data streams will be a challenge.
I have been fooling with the Arduino WIFI UNO Rev 2 which has the LSM6DS3 inertial module on board. Since I ultimately want to transmit sensor readings by UDP at a high rate, I looked for a library to use. One such is the SparkfunLSM6DS3.h which I downloaded:
(GitHub - sparkfun/SparkFun_LSM6DS3_Arduino_Library: Arduino library for the LSM6DS3).
I have adapted the "FifiExample.ino" offered in the library. This works once you modify the initialization to: LSM6DS3 myIMU( SPI_MODE, 30 ). I'm also running it on VSCode on a Mac.
In addition to the separated data rates as noted above, there is also a "FIFO Sample Rate" setting and I am confused as to how this plays with the individual sensor (Accelerometer, Gyro) rates. I too have experienced garbage data as I experiment with the parameters.