Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB DAQ control with PI(D)

I am trying to build a PI controller:

 

Windows 7, USB-6251 DAQ BNC, normal Labview 2011 - no toolkits, not even the Control and Design one.

 

The datasheet for the USB DAQ says

 

"With four waveform analog outputs, two 80 MHz counter/timers, and four high-speed data streams on USB, M Series devices can execute multiple control loops simultaneously."

 

I have not been able to do this, even with my own PID.  What does "high speed" mean?

 

 

The USB DAQ *does not have* hardware timing so the following won't work.  I need basically exactly this, but with a USB DAQ device:

 

12fbdcae1641.gif

 

 

The closest I've come to a successful version is the following (thanks to a member here), but it's very slow (50 ms delay between original signal and output signal).  My only sample clock options are "continous" or "finite" samples:

 

slooow.png

 

Without moving to a real-time system (expensive and complicated), or buying new hardware (expensive), are there other algorithms that would work faster?  producer/consumer, state machine...?

 

The delay seems to be in the writing, not the reading.  

 

Thank you.

0 Kudos
Message 1 of 3
(4,216 Views)
I believe the high speed refers to the high sample rates available with especially the analog input and output on USB.

You do have hardware timed I/O but apparently not single point hardware timing. What is the sample rate and number of samples that you specify? With non-regeneration mode for the analog output, the entire buffer had to be written each time. How many points are you writing? Have you tried a single point? What sort of rate do you need?
0 Kudos
Message 2 of 3
(4,203 Views)

I've tried various rates and # of samples.  In the case of this working code, at 1kHz rate, the time for input/output (whole loop) is 1ms per sample.  e.g. 500 samples = 500 ms...  Sample rate does not affect this. Increasing sample rate, of course, leads to "The application is not able to keep up with the hardware acquisition."

 

I want to get below 10 ms read/write, which is something like 100 samples and 15 kS/s, nominally. But of course... "not able to keep up"

 

This is for feedback control, so a single point as fast as possible would be ideal,  but if I have to output a waveform, which it seems I do, I need that waveform to be short in time.  So,  100 samples, 15 kS/s = 6ms of data, if I understand right.

 

If I set it to a single point, I get about a 5ms delay, but only a very low sample rate is available (about 200 Hz) and my output signal is heavily digitized, meaning anything that changes faster than say, 5 Hz, won't be controlled quickly.

 

I suspect USB DAQ devices are bad for fast feedback control loops.

0 Kudos
Message 3 of 3
(4,197 Views)