10-29-2021 02:16 PM
Hi All,
We are currently using a USB analog output DAQ card USB 6002 to control two channels of a galvo mirror. Speed, low latency and repetability are of utmost importance to us. We time the loop as we control as the output of the galvo mirrors. We have noticed that occasionally, it takes 2-3 ms extra for the voltages to be written to the galvo as compared to the average. This non-uniformity is not ideal for us. We would want the voltage writing operation to take the same amount of time.
We are wondering if its an hardware issue? Should we get a PCI or a PCIe based analog output card for low latency? Any suggestions on this matter is appreciated.
Thank you,
Avinash Kumar
10-29-2021 03:37 PM
Hi Avinash,
First, you need to classify whether this 2-3ms extra is due to the windows OS and software loopback or the USB protocol being the bottleneck. I suspect that you are implementing some kind of PID or some control system decision making in the software and that is written back to the hardware. If this is the case, the 2-3ms will be present always unless you implement your algorithm on an FPGA.
Please share your code to understand the way you are using the DAQmx APIs.
10-31-2021 11:25 AM
@kumaravi wrote:
Speed, low latency and repetability are of utmost importance to us.
Situations where speed, low latency, and repeatability (also called "determinism") are important suggests LabVIEW Real-Time, which uses a separate processor running a Real-Time Operating System (which Windows is not). NI makes a number of these, including Single Board RIOs (sbRIO) and a "student" device called a myRIO which would probably fulfill your timing and latency requirements, but would require additional LabVIEW expertise (including an understanding of how to work with Real-Time systems and how to create and manage a LabVIEW Project that runs on two processors, the Host PC that handles all of the User interactions and the Real-Time Processor that handles all of the time-critical I/O with its attached hardware.
Bob Schor
10-31-2021 12:35 PM
@kumaravi wrote:
Speed, low latency and repetability are of utmost importance to us. We time the loop as we control as the output of the galvo mirrors. We have noticed that occasionally, it takes 2-3 ms extra for the voltages to be written to the galvo as compared to the average. This non-uniformity is not ideal for us. We would want the voltage writing operation to take the same amount of time.
How are you controlling what the outputs should be? Do you have a feedback that is read and adjust the output? Or are you just trying to run waveforms? As previously stated, showing some code would help us understand your situation and give more detailed advice.
Assuming a control algorithm with feedback, I would be looking at an FPGA based DAQ where the FPGA can do all of the control. This will have the lowest latency and fastest speed. But if you are just playing waveforms, you probably just need a DAQ with more memory so you can keep writing the waveform as it is played. With enough buffer depth, you can easily overcome those 2-3ms hiccups Windows likes to do.