SparkFun Forums 

Where electronics enthusiasts find answers.

Hardware or product specific questions are best asked here.
User avatar
By cworsdale
#241336
Hello,

My setup involves using an OpenLog Artemis (DEV-16832) with one/two Micro 6DoF IMUs (ISM330DHCX) through an 8 Channel Mux Breakout (TCA9548A). I am logging acceleration data to a microSD card and have configured the serial terminal baud rate to 460800 bps.

I am using this setup to capture the accel data at the fastest rate possible to plot a natural frequency response (~10Hz). In the terminal output configuration options I am able to select a sampling rate of 455Hz with one IMU connected, and 302Hz with two IMUs connected. However, the outputed "Actual Hertz" value in the logged data is much lower at 79Hz and 58Hz respectively for one and two IMUs connected.

I need to plot the data at >200Hz to get a cleaner response curve. What is the limiting factor for the data collection log rate/sampling frequency? Why is it logging at a lower frequency than what is being set in the terminal?

Thank you for any help you can give in understanding this!

Chris
User avatar
By PaulZC
#241349
Hi Chris,

I haven't got time to give you a full detailed write-up on this, but I'll try and clarify things for you.

The OLA gives you an estimate of the maximum log rate based on how long it takes to read data from the attached sensors. But - IIRC - that doesn't include printing the data or writing it to SD. So the real achievable rate will be lower.

With a single ISM330 attached to the OLA, and with no mux, I see it takes about 2.5ms to read the data from the ISM. With printing and writing to SD, I'm getting a rate of about 90Hz.

If I turn off the console (terminal) printing, it makes no difference to the rate.

If I run the I2C bus at 400kHz, the read time reduces to about 1ms. (Option 6 - then Configure Qwiic Settings). But the overall rate is now about 125Hz. And it won't let me set it any higher. Strange... I should be able to set it faster than that.

OK. If I turn off logging the rate, and disable the timestamps. Right. Now I can set the rate to 240Hz. And it looks like I'm achieving that. It's about 4ms between samples. I guess the limiting factor is the SD write time?

I can't predict what the maximum rate is for two sensors via a qwiic mux. Setting the mux port slows things down as the code has to write two extra bytes each time the port changes: the mux address and the port settings.

In summary, it looks like you might be able to achieve >100Hz with two sensors. But will struggle to achieve >= 200Hz.

If you really need 200Hz, it might be better to start again with different hardware. A ESP32 Thing Plus C has a built-in microSD card slot. The ESP32 SD library is very fast. Interfacing the two ISM330's via SPI instead of I2C would speed up the read dramatically. And you could start using the end-of-conversion interrupts to make it even more efficient. Let me know if you need more suggestions in this direction. Most of the code you need already exists as examples. It would be a case of cutting and pasting the right bits together.

Best wishes,
Paul
User avatar
By Alishawarner
#241568
Hello, Breakout may have specific limitations on the maximum sampling rate they can support. It's essential to check the datasheets and specifications of each component to determine their capabilities.

Serial Communication Speed: The baud rate of 460800 bps should be sufficient for transmitting the data at a higher rate. However, ensure that the data logging process and serial communication are not causing any bottlenecks or delays. It's worth verifying that the serial communication is functioning correctly and not introducing any slowdowns.
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum