04-05-2022 01:32 PM
Yes, I use LAN cable..How can resolve these delays?
04-05-2022 02:56 PM
Hi Maxim,
@Maxim898 wrote:
Yes, I use LAN cable..How can resolve these delays?
You can't (with your current setup)...
04-05-2022 04:55 PM
I'm assuming you have an embedded real-time controller in a PXI chassis and the LAN cable is just to connect to the host PC to provide a simple-to-implement user interface from the LabVIEW dev environment.
You'll need the AO task to be unbuffered for sure. I'd make the AI task unbuffered too, at least initially. All you need to do is *not* include a call to DAQmx Timing and that'll leave your tasks in software-timed "on-demand" mode. In this mode you'll read and write just 1 sample at a time so the main control loop will need to iterate at a high rate.
I haven't been around RT in a long time, but IIRC, the real-time DAQmx driver has a lot less overhead for these on-demand reads and writes. So you'll not only be able to have reliable timing under RT, but you should be able to get a pretty fast loop rate.
And you're going to *need* it. Dunno what frequencies you need to "cancel", but your loop rate probably needs to be faster than those frequencies. I'm guessing you'll want a loop rate of at least 5 kHz.
It may be important for you *not* to update any indicators inside the main control loop. I'm not sure how VI Server handles this stuff when managing the LAN traffic with your host-side GUI, but those updates might slow the loop down. You can put the indicator updates in a parallel "consumer" loop and have your main loop push data to it with an RTFIFO, a lossy Queue, or similar mechanism.
As to the actual science of noise cancellation, I have no idea. I can only help give hints about making a faster control loop with low latency. I don't know what that control algorithm needs to look like.
-Kevin P
04-06-2022 02:41 AM
Kevin thank ypu for your cooperation.
By loop rate you mean sample clock rate that initialize in DAQmx sampleClock?
I would like to riduce tone pure in the range between 100 and 500 Hz.
To reduce delay, Can I use in the picture
used in Multi-Function-Synch AI-AO.vi?
04-06-2022 07:00 AM
By loop rate you mean sample clock rate that initialize in DAQmx sampleClock?
Nope. I've been suggesting NO sample clock (and thus no buffer). Loop rate means the iteration rate of the control loop. Under RT, it'd be useful to make that a Timed Loop instead of a While Loop.
To reduce delay, Can I use in the picture used in Multi-Function-Synch AI-AO.vi?
Again, nope, not much point. That pic shows one method for sync'ing the start time of 2 tasks that use a sample clock and buffer. Sync is often pretty important in those cases. But for *your* control loop case with on-demand sampling, it isn't going to matter.
FWIW, cancelling a pure tone in the 100-500 Hz range sounds pretty feasible under RT. Dunno anything about your adaptive filters or noise cancellation algorithms in general, but you have a nice regular (and predictable!) signal to cancel at a modest frequency. Both work in your favor.
-Kevin P
04-06-2022 07:46 AM
Ok thank you very much.
In Period and Source Name in time loop Can I use, for a tone pure to 100 Hz, Period = 100 and Source name= 1KHz?
In Daqmx read and write I use Analog 1D DBL NChan 1Samp and Analog DBL 1Chan 1 sam. Is it correct?
Tahnks a lotMax
04-06-2022 08:11 AM
In Period and Source Name in time loop Can I use, for a tone pure to 100 Hz, Period = 100 and Source name= 1KHz?
Again no. That would loop every 100 cycles of a 1kHz clock, i.e., 10 Hz. Not nearly enough. Use the 1MHz Source and start with something like 500 for period, i.e. 2 kHz.
In Daqmx read and write I use Analog 1D DBL NChan 1Samp and Analog DBL 1Chan 1 sam. Is it correct?
Yes, for on-demand sampling, 1 sample (per channel) at a time is correct.
-Kevin P
04-06-2022 08:16 AM
In the source name and source type I writed 1 MHz.
04-06-2022 08:41 AM
In attached my VI, It stil doesn't work.
Can you help me? My "Error Mic" gets unstable, instead x+y during the time tend to zero.
04-06-2022 08:42 AM
In the last VI, x+y doesn't work, it doesn't tend to zero.
Thanks a loto
Max