Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect reading using multiple channels on USB-6251

Hello all,

 

I'm working on a VI to generate one voltage, and read two voltages (as sine waveforms) using a USB-6251.  The generated waveform stimulates a probe to create a shear wave in a physical medium.  Another probe receives the shear wave and generates a response voltage.  It is very important for the relative timing between these waves to be known, as I'm trying to determine the travel time of the wave.  For this reason, the generated waveform is pulsed using a loop with delay to only send one full wavelength at a time.  The first read wave is a direct connection from the output channel generating the waveform to an input channel.  The second waveform (after transition through the physical medium) is connected to a different input channel.  I have one DAQ assistant reading both input channels, to maintain relative time alignment as close as possible (does that work, I assume it is the easiest way to align the actions of the multiplexer: the sample rate is set at 100,000 Hz for both channels).  The first channel reads (+-) 10V, and the second is set from (+-) 50 mV.  These waves are averaged over time to reduce noise, using a trigger and gate to align the waves.  The trigger is set to the rising action of the first wave, so the data of the second wave is just along for the ride.

 

All of this appears to work correctly, but the second waveform does not look as expected (it looks more like half a sine wave, and doesn't vary with changing input).  I connected the second waveform to a Pico ADC 212, which shows it exactly as expected, so there must be something wrong with how I'm reading the data or physically wiring the device.  Wiring is straightforward, so I assume it's something wrong with my program.  Any suggestions?

I tried both ‘differential wiring' and let ‘NI DAQ choose' within the DAQ Assistant, with no change.  Also tried connecting to different input channels.

 

Thanks,

(I know this is not a proper average, I may divide by loop iteration in the future)

0 Kudos
Message 1 of 6
(4,614 Views)

Hi,

Inside of your inner while loop, you are essentially acquiring a piece of your N sample signal (depending on the settings of the Trigger and Gate Express VI) over and over again, until there is no more data.  Instead of building a waveform that contains all of these pieces of waveform, you are using the last piece of your N sample signal that is acquired. This may or may not contain the 1000 samples that you had set up in the Trigger and Gate Express VI.  Then, you send the last piece of each signal to be displayed on a graph.  You repeat this over and over and over again, such that you only display the last piece of each signal that is acquired through each iteration of the outer while loop.  Is this what you're trying to do?  What is the nature of your signals?  Are they periodic?

If periodic, what are the frequencies of your signals?  For example, in the screenshot below, I have simulated two separate signals of different frequencies.  If I "pulsed this waveform in a loop," I would not be receiving one full waveform of Plot 0, while Plot 1 would look as expected. 


plotting two signals.JPGplotting two signals.JPG
 
In repsonse to your question about determining the time delay between waveforms:
The time difference between the acquired waveforms due to the multiplexer associated with the USB-6251 is referred to as interchannel delay.  Basically, interchannel delay is the amount of time which passes between sampling consecutive channels in the channel list. The convert rate is the reciprocal of the interchannel delay. The interchannel delay must be short enough to allow for sampling all the channels in the channel list within one sample clock period. The greater the interchannel delay, the more time your amplifier is given to settle before the next reading.  The interchannel delay can be programmatically changed through adjusting the value of the convert clock.  Refer to the following KnowledgeBase article for more information.

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 2 of 6
(4,594 Views)

Sara, thanks for the response.  In a separate while loop not shown in my posted VI, I generate the initial signal using a Wait Until Next ms Multiple.  I use that so there is a delay between each transmission of a single sine wavelength, typically at 1000 Hz.  The delay prevents the transmission of the next waveform from disrupting the measured reaction of the previous, and in this way I know which generated wave aligns with which responce.  This is shown as expected in the first attached pic.  My inner loop shown in the posted VI is reading constant sections of data, and passing them along to the Trigger and Gate Express VI.  I read larger sections than the gate passes, but that's my intention.  It is not important that I catch every wave transmission generated (because the reaction should be the same with each pulse).  I just need to average that reaction over and over to remove the effects of noise.  My trigger and gate appear to pass the subsection of data I desire every time, not simply the last section of data.  The 1000 samples it passes are averaged and passed back into the loop to be averaged again with the next section of data passed from the trigger and gate.

 

The first pic is what I expect to see, and are data from the transmitting and receiving probes touching.  The second pic is with a medium between the probes.  This is the half wavelength I referred to in my original post (like it's only showing half the reaction it should).  The third pic is Pico scope software and equipment reading the received wave from pic two. You can see how different they are, and the pico reaction is what I expect to see.  Most noticeable is the polarity of the wave is opposite (once again, for my physical setup the pico is reading correctly).  These two methods always seem to show opposite polarity from one another.  But the waveform is also completely different.  This is the source of my worries.  Could the reaction I see in pic two be a cross talk of some sort?  If either probe breaks contact with the physical medium, the reaction is completely different, so it reacts proving the transmitted signal has an effect, but is not showing the reality of the signal.  I hope the images help clear up what I'm trying to do.

Download All
0 Kudos
Message 3 of 6
(4,579 Views)

Hi, Cort.

 

I took another look over your code and had inadvertently missed that the "reset after each trigger found" was checked.  Now, I think I see what is happening.  Your graph does not depict the signal until it reaches 100 samples before it reaches 1V.  Can I assume that your response signal is just an attenuated version of your generated signal?  It is possible that the 100 pre-samples will not be enough to see that initial undershoot of the generated or response signal.

 

In looking at your PicoScope capture, I'm seeing that the highest peak is located at a value of 0mV.  Is this correct?  The initial undershoot of your signal goes all the way down to about -6mV.  Is it possible that when you were measuring the signal with the PicoScope, the (+) and (-) probes were reversed, such that you're seeing this reversed polarity of the signal that you're expecting?  Or if you're expecting this negative polarity, maybe the the signal is being applied incorrectly to the pins of the USB-6251?  Check out page 4-5 of the M series user manual (Table 4-2), which lists the pins to use for different analog input modes.

 

I hope you're having a great day!

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 4 of 6
(4,551 Views)
 

Yes, the received signal is just an attenuated signal.  Following the wiring diagram on page 4-15 of the link you sent, I rewired the system to include a ground as described for Using Differential Connections for Floating Signal Sources.  While testing out the system, I connected the 2nd input channel (that is of the received wave) directly to the output channel, without the probes; the signal came through just as expected.  Then, I disconnected the wires, cutting all connection to the 2nd input channel, but it still registered reading the signal, with slightly reduced amplitude (~7 V from a transmitted 10 V).  This persists until the positive terminal of the input channel is grounded, after which the readings flat line, as expected.

 

I thought I might be reading the channels too rapidly, and a residual signal remained from the previous input channel (which is always a direct connection from the output to first input channel).  Slowing down the readings (from 100,000 Hz to 2,000 Hz) had no observable effect though.

 

Being properly wired, the received signal seems to be overpowered by this ghost reading, as PicoScope verifies that a real signal does exist.  The received signal is measured in the range of (+-) 20 mV typically.  Do you have any ideas how this ghost signal is getting to the 2nd input channel without being wired to anything?

 

Thanks

0 Kudos
Message 5 of 6
(4,530 Views)

Hi, Cort.

 

There is a great Knowledgebase that will give you more information on how ghosting occurs and what you should do to eliminate this effect from your measurements.

 

Let me know if you need any more information.  I hope you're having a great day!

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 6 of 6
(4,500 Views)