LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase Measurement

Randall,

Thanks for your suggestion. It really helped me out. In my data acquisition program (which I am developing in LabVIEW), the user sets the number of records required as well as the record length (number of sample points in a record, which can be 256, 512, 1024, 2048, 4096, etc.). I have a test sensor mounted onto a slide (which is a positioning system) and the sensor is moved from 0" (flush on the material under test) to about 1". Now, for a given record and record length (say for example - 4096 points) the phase changes dynamically depending on the acceleration & velocity of the slide and as the sensor is moved away from the material. Right now in my program, the phase is being measured & read properly, but the phase values remain a constant for a given record and only change from record to record rather than within a record. This is irrespective of the number of sample points in a given record. Is there a way to correct this or is this the way a data acquisition program is supposed to work. I am really not sure on this, as I am working on a data acquisition application for the first time. Pls refer to the attached text file of sample test data acquired. The last column in the file is the phase data. Will appreciate some pointers on this issue. Thanks!

0 Kudos
Message 31 of 65
(1,848 Views)
The attached should do what you want as long as the sampling rate is much higher than the frequency you are sampling.  The closer they are together, the larger the error in the results.  This kind of problem may limit the usable velocity of your test.

I would also continue to sample for a little bit before and after the motion.  There are errors at the beginning and end of the data when a Hilbert Transform is performed on a finite data set, so sample a little extra at the beginning and end to stabilize the data and throw out those points at the beginning and end.

Message Edited by rpursley8 on 12-16-2005 01:10 PM

Randall Pursley
0 Kudos
Message 32 of 65
(1,840 Views)

Randall,

What is the difference in functionality of this phase vi compared to the previous one (which involved normalization)? A brief explanantion would suffice. Also, you have mentioned that while using this phase vi, one needs to sample at a much higher rate than the frequency of the message signal. Is this argument also valid for the previous phase vi (which involves normalization). In your current phase vi, phase shift in the range of 270 to 360 degrees is measured as -90 to -1.27 degrees respectively. In your earlier phase vi, phase shift in the range of 180 to 360 degrees is measured as -180 to 0 degrees. What is the reason for this difference? Thanks!

0 Kudos
Message 33 of 65
(1,824 Views)
The first one requires normalization so the trigonometric identities can be utilized to find the phase and it also requires the frequency of the signal to remain constant.  The result being between -180 and 180 is just the result of the complex to polar function.

The second one determines the phase of each signal individually and then subtracts them.  If you want the same range of output, just feed the phase into a polar to complex function (connect a constant equal to 1 into r) and then into a complex to polar function.  The phase should then be in the -180 to 180 range.

This first approach assumes the phase is constant throughout the whole sample, so you can think of the result being the average phase of the whole data set.  The second approach computes the phase at each point and so it is much easier for error to creep into it since phase is much more sensitive to noise.  Since the first one is more of an average phase, the sampling rate is not as significant (as long as it is above Nyquist).  I suggested a higher sampling rate for the second one to minimize the jumps in phase from point to point, but there will be a trade off with how much noise is introduced into the system by sampling at a higher rate which will distort the phase.
Randall Pursley
0 Kudos
Message 34 of 65
(1,816 Views)

Randall,

Thanks for your reply. Tried it out and it works perfectly fine. Going back to the two versions of phase vi's (normalized and w/o normalization) we discussed in my previous email, which one is more accurate than the other for a typical data acquisition application. Also, how does one zip an "lvm" file (or for that matter any file) in LabVIEW? Tried using the zip file vi's, but for some reason I am getting errors which I really don't understand. Pls refer to the attached "File Save.jpg" file. Thanks!

0 Kudos
Message 35 of 65
(1,801 Views)
The first one is more accurate, but with your test setup it probably isn't as practical.  The second can be accurate too, but you just have to be more careful setting up the acquisition.

As for the lvm and zip, I haven't used the lvm files so I can't really help you with that.



Randall Pursley
0 Kudos
Message 36 of 65
(1,799 Views)

Randall,

You suggested the following - "a higher sampling rate for the second one (w/o normalization) to minimize the jumps in phase from point to point, but there will be a trade off with how much noise is introduced into the system by sampling at a higher rate which will distort the phase".

How does one obtain this trade off - by trial and error approach or is there a specific method? Will this work fine as long as one is sampling well above the Nyquist rate. Attached is a sample data file containing data obtained using the phase vi w/o normalization. Does the user have control on changing the titles of each data column in the sample data file (the data columns have default titles as Untitled, Untitled1, etc). Thanks.

0 Kudos
Message 37 of 65
(1,796 Views)
It appears that whatever you have things set up as now, it seems to work well.

 I don't think I can answer your other question.  Someone with more knowledge of the Dynamic Data Type could answer it.


Randall Pursley
0 Kudos
Message 38 of 65
(1,789 Views)

Randall,

Thanks for your reply. Wish you and your family a Merry Christmas and a Happy New Year. Appreciate all you help and advise. Thanks!

0 Kudos
Message 39 of 65
(1,781 Views)

Randall,

In the Phase vi (w/o normalization), which I have incorporated in my LabVIEW application, why is it that the phase data is different when measured in degrees as an "array of double" and as a "dynamic data type". Shouldn't they be the same irrespective of the data type(s)? Pls refer to the attached Phase.jpg file.

0 Kudos
Message 40 of 65
(1,765 Views)