05-19-2003 05:40 PM
05-21-2003 04:11 PM
11-29-2007 08:00 PM
I realize this is an old post, but it is relevant to what I'm working on. I have created a software lock-in amplifier using LabView 8.2 and a PCIe-6259. I am generating CW sinusoidal output with a frequency range of 0.01 to 2,000 Hz, sampling at 10 kHz. The output drives a voltage-controlled current amplifier which feeds a large magnet coil. The input reads an analog voltage from a magnetic field sensor. I want to use the phase array used in my AO loop to generate the sin and cos reference signals for demodulating the input, and here's where the delay issue comes into play. I am doing double-buffered acquisition and excitation by allocating the buffer size to the circular buffer size (8000 samples) and doing reads/writes of half that size. The AO loop writes it's output phase array to a USR-style global variable every time through its loop. The AI loop does the same with the data it reads and then uses a notifier to signal a third thread for processing. As a test, I've wired the output (DAC0) to the input (AI0). Initially, I tried an excitation frequency of 2.5 Hz (the update rate). And integer multiples of this, the phase is consistent, but by changing excitaiton frequency by 0.01 Hz shifts, I found a phase error of 687 deg./Hz!!
To remedy this, the USR-type global for housing the phase array became a 2-D array with read and write pointers to different rows. The phase aligns when the "written" output and the input are shifted by 7 half-buffers. Would disabling regeneration shorten this delay to what I would expect, i.e. 3 half-buffers? If so, where is this property accessed in DAQmx under LabView 8.2? Thanks.
Kevin Pratt
Tristan Technologies, Inc.
11-30-2007 04:29 PM
11-30-2007 07:11 PM
12-03-2007 05:35 PM
12-05-2007 07:17 PM
I found and implemented the "Do Not Allow Regeneration". It reduced the delay from when the output is "written" to when it actually shows up at the output from 7 half buffers (2.4 seconds) to 6 (2 seconds). Anyway, here's the code. It's in 8.2.1.
Kevin
12-06-2007 06:54 PM - edited 12-06-2007 06:55 PM
Hello again squidmixer,
I took a look at your vi and although the structure is good, it is a little
difficult for me to follow since I am not familiar with your application.
I am working on writing an example that shows the behavior we are talking about
so I can actually see the delay on my hardware, but I need to make sure it is
correct, clean it up, and document it. I will post it as soon as I have
something worthy of posting. If you would try to whittle down your
program as much as possible and still show the behavior, I would
appreciate it.
12-07-2007 03:55 PM
Hi Neal,
I pared down the execution to eliminate the FFT, FRF, and noise reduction. I still included the lock-in because it is instrumental in demonstrating the phase shift vs buffer size and frequency. To test this, simply attach a BNC-2110 to your DAQ card and connect DAC0 to AI0.
Thanks,
Kevin Pratt
12-07-2007 07:36 PM
Can someone link this thread to the LabView forum? I realize I kind of hijacked it from the wrong message board.
Kevin