10-07-2008 11:01 PM
Hi,
I am using 6024E DAQ card to acquire three 50Hz sine waves. sampling rate 20Khz, Sample to read:2000Samples. I will need to display and measure the phase difference between the signals. However I understand that there is interchannel delay, resulting in the out of phase measurement. From the book LabVIEW Graphical Programming, it advised to input to common signal and display on the same graph. use graph cursors to measure the channel-to-channel timing skew. Then apply timebase correction values may be applied to data by adjusting X0 (initial time).
What I've tried what I attached in the printscreen. But I do not know how to include the other channel into the same graph to compare the signal. Can someone please enlighten me on how to do this?
I'm using labVIEW 8.0.
Your help is greatly appreciated.
Poh (NTU Student)
Solved! Go to Solution.
10-08-2008 02:15 AM
Hi Poh,
I don't know if it will help, but here's some code (from a current project) that acquires, extracts tone info, and adjusts for AtoD sampling delay. 9 channels are acquired, the first is the "reference".
A key point is that AIConversionRate - the inverse of inter-sample delay - is available from the DAQmx Timing node (this allows inter-sample compensation to adapt to different aqcuisition frequencies.)
Cheers!
10-08-2008 02:24 AM
Hey,
I hope you are using NI DAQmx (and not trad. DAQ). If so, you just need to create a Task which includes all the channels you need to acquire. So for the physical channels input you can e.g. type in Dev1/ai0:2 to acquire Ch 0,1,2. When reading the acuqired data with DAQmx Read.vi you can select Mutliple Channels>Multiple Samples>2D Double as output datatype. So you get a 2D Array which you can connect directly to a waveform chart or graph.
Due to the interchannel delay you are talking about i want to mention that their are two different ways of scanning (descriped here: http://digital.ni.com/public.nsf/allkb/4F9D107D8B26233B86256F250057C9B3?OpenDocument ...and here: http://digital.ni.com/public.nsf/websearch/DBE7AC32661BCF9B86256AC000682154?OpenDocument
You could use a DAQmx Timing property node to set the AI Convert clock regarding to your sample frequency so that you get a certain phase shift between the signals.
Please have a look at the links. Round Robin Sampling would be the mode I'm talking about.
Hope this helps,
Christian
10-08-2008 08:40 AM
Hi thanks for the replies. I'm using DAQ Assistant for the simplicity. And seen examples using DAQmx which gives me greater understanding of the interchannel delay. My apologies that somehow the picture attached previously didn't seem to appear. Hope it does now. I've been trying means to correct this phase difference which is inevitable. I cant change the delay to compensate for this, as my signal is 50Hz, meaning 20ms. This is way beyond the limit.
tbd, I've seen the VI you posted, however I don't understand how the phase shift could be done to compensate this delay. Is it achieved via the normalization? How carry out the normalization?
Is there a simple way to achieve this? As the delay is fixed, what I was trying to do was to read the start time of channel zero and and subtract from the other channel. I realised that the start-time is the same. So I'm really lost now.
Poh
10-08-2008 01:10 PM
CP Poh wrote:tbd, I've seen the VI you posted, however I don't understand how the phase shift could be done to compensate this delay. Is it achieved via the normalization?
The Inter-channel delays correction is immediately after the FFT loop - see "Prog.Com.TQA_ATP.!Test.PhaseShift.AtoDCorrection.vi"
Sorry for the confusion! The example attached includes a Normalization step after Inter-channel correction. The Single Tone VI returns phase angles that are, roughly, between +/- 360deg. Phase angles over 180 may be represented as a negative angle and this can be annoying when comparing two very close waveforms with phase angles 360 deg apart! (one positive - one negative.) The Normalization VI makes sure all the non-reference signals will be displayed on the same "side" of the reference.- adding or subtracting 360 as necessary. Please refer to the embedded comments!
Cheers!
10-08-2008 10:46 PM - edited 10-08-2008 10:46 PM
Hi All,
Mind me interrupting the discussion. CP Poh, I have a question if you do not mind answering
The three signal, sinewave with 50 Hz, when you acquire, are they in the same phase before entering 6024E DAQ card?
If yes, then you have only to worry about interchannel delay. If you want to correct the phase between three signal from different channels, I believe the code attached by tbd, "....AtoDCorrection.vi" should do the job. Basically, when you know the interchannel delay (sec) you can correct the phase of three signals by aligning the array of the three signals based on the delay. Please correct me if I am wrong.
Let me know if you managed to solve the problems!
Sincerely,
Krisna Wisnu
10-09-2008 09:09 AM
Hi, thanks for the advise so far..but I still didn't managed to implement the VI from tbd.
Here's how I've got it solved. I've tried to change the start time as the book mentioned, but no change to it, even if the offset is increased, it still did not change the displayed waveform. the timestamps there were used to check that there is a change from the offset inputted.
So just need to implement align waveforms vi available in the library will work to an accuracy of about 0.01degrees.
Alright this problem solved!
Cheers!
Poh
06-18-2009 04:00 AM
Hello Everyone,
I have similar type of problem. I am using NI 6024E for sensing input voltage. However When I ouput same voltage using DAQ assistant, I see a phase difference between input and output.
Can anyone tell me what to do?
Please refer attachment
06-18-2009 08:18 AM
You will find your answer here http://forums.ni.com/ni/board/message?board.id=170&message.id=416898&jump=true
Please from now keep questions with same topic to one thread