-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSM6DSO32 getEvent seems to be slow #22
Comments
Having the same issue with a lsm6ds33 connected via i2c to an Adafruit Feather nRF52840 board maxing out at 208Hz rate. A contributing factor to slowness is that Adafruit_LSM6DS/Adafruit_LSM6DS.cpp Lines 450 to 502 in 1ea3bd2
This is clearly not necessary and should be done only once efter e.g. reset(), and if the ranges are changed with |
Yes you've right @anders-bogild this os clearly not necessary |
a tested PR to add caching would be awesome! |
In #31, I addressed this problem by buffering the ranges. This is a substantial performance gain, especially when reading the IMU with fast sample rates. |
@simon88: try connecting the IMU per SPI and with a data ready-line on an interrupt. I could max an ISM330 out with 6.66kHz sample rate on an ESP32 feather. The bigger problem was to send this collected data over WIFI, as it generates about 300kB/s when using a timestamp and 6 |
Should this new PR change affect LSM6DSOX getEvent in the same way? I'm running an LSM6DSOX over i2c with a feather m0, and am being capped at around 313Hz - and was starting to get a bit confused as to why this was running so slow. The code I am running is basically;
|
It should get you an improvement, as it removes two additional reads of registers. If you want to test it, wait until @ladyada releases a new version or clone the repo locally to get the new code.
If you really want to read out the sensor fast, you have to connect it by SPI and with an interrupt on the DRDY-line to keep the latency low. I²C is maxed out at 400kHz, with SPI you can rise the datarate to 10MHz, which is 25x faster. In my first attempt I also connected the sensors by I²C, but I couldn't get much higher overall than about 50Hz with three different sensors on the same bus (ADS1115, ISM330 and LIS3MDL) and with many collisions and overruns, which negatively impacted latency and jitter. But that was before I removed the register reads for the range in both drivers (ISM330/LSM6DSOX and LIS3MDL), so YMMV.
|
Hi all,
I'am working with an LSM6DSO32 and one SAMD21E18A. I've a personal board, so I use your library. But it's seem to be slow, I have a delay of 3ms for calling getEvent. I set my captor (accel and gyro) at 208Hz with LSM6DS_RATE_208_HZ mask in my setup function.
After that I have a loop and I call getEvent when new data are availables like this
3ms seems to be long no? If I increase my data rate at 400Hz I can't getEvent beceause I have a minimum of 3ms in my loop just to read the register. So the maximum frequency of my loop is 333Hz....
The text was updated successfully, but these errors were encountered: