Real-time data streaming and processing from high-speed sensors/ADCs often prove to be challenging. This happens due the limited onboard memory of the HSDIO hardware. One can overcome this limitation by optimization techniques and acquire data for a longer period of time.(from as low as 100 ms without optimization to 200 seconds and beyond with optimization).
Consider a requirement to acquire XYZ position data from a gyrometer and to plot the position on a graph in real time using National Instruments PXIe-6556. Typically, the application is programmed to run at the maximum clock rate of the HSDIO, 200 MHz in this case, and the maximum SPI clock that the device/sensor supports. This choice of clock rate for the HSDIO would work well in general but is not optimized for maximizing the data capture time.
This article describes 3 ways to optimize the onboard memory usage to capture high sample rate data from ADCs or sensors and to process the data in real time – (1) Selection of HSDIO sample clock rate based on sensors data rate (2) Stopping the acquisition during data idle time (3) Real-time streaming of block of data using fetch method.
Selection of HSDIO Clock Rate
When the HSDIO acquires samples at 200 MHz (max rate), it reads a lot of redundant sample points than required for SPI communication at 20 MHz. Let us assume that the gyrometer supports 20 MHz SPI clock. Then, it is sufficient to run the HSDIO at 40 MHz to achieve 20 MHz of SPI communication with the gyrometer. The following waveform illustrates the SPI clock waveform and the HSDIO sample points when acquired at 200 MHz (max rate) and at 40 MHz (twice the SPI clock rate).
Green dots: Acquiring samples at 200 MHz
Red dots: Acquiring samples at 40 MHz
When the optimum HSDIO sample rate for SPI communication is chosen, the number of redundant points captured is reduced, thereby increasing the capture time for the available onboard memory; in this case, from 40 ms to 200 ms.
Capture time comparison:
|Memory Per Channel||8 Mbits|
|HSDIO Sample Rate||200 MHz||40 MHz|
|Capture Time||40 ms||200 ms|
Stopping the acquisition during data idle time:
If the gyrometer (sensor) sends XYZ data at 1,000 Hz, then the time between each sample from the sensor is 1 ms. If the data acquisition is stopped in this period, which is the idle time in between actual data, then the number of acquired data points will be reduced and data capture time can be extended.
How can the system be configured to capture the points of interest in the communication (sensor data) and to not capture any data during the idle time?
Interested to read more? We cover:
(1) How to configure the HSDIO to capture points of interest in the communication and not any idle time data,
(2) How to capture data continuously and display it in real time, and
(3) Performance comparison & code snippets.