Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure very small phase differences of two sinusoidal signals using 2 DAQs?

I would like to measure the phase difference between to sinusoidal signals with the same frequency and not necessarily with the same amplitudes.

The expected angle difference is pretty small (e.g., 0.01 degree). What I need to achieve this solution? May I use 2 DAQs (such as, NI-6210) to perform simultaneous measurements? If positive, how to use LabView to do so?

 

0 Kudos
Message 1 of 15
(5,976 Views)

Hello agnelors,

 

You will only need 1 Analog Input Data Acquistion device to accomplish the task you are attempting. The ability to read small angle differences, however, will depend on the maximum sampling rate of the device. In the Measurement and Automation Explorer, you can simulate different Data Acquisition Devices and use them in your code to test if you will be able to observe this phase offset. If you install LabVIEW and then the DAQmx driver, there is a large range of example programs that will show you exactly what you need to do. Most notably, the Voltage - Continuous Input.vi example.

 

Good Luck!

Collin D.
Software Product Manager
0 Kudos
Message 2 of 15
(5,924 Views)

agnelors,

 

That can be a very difficult measurement to make. The details are important.

 

What is the amplitude difference? How fast can it change? How much noise or interfering signal will be present? How fast can the phase change?  What is the largest phase difference which can occur? Can the phase difference be both positive and negative? What is the signal frequency? Can it change? If so, over what range and how quickly? Do you have a clean reference signal of the same frequency? How quickly do you need the phase measurements after acquiring some samples?

 

Lynn

0 Kudos
Message 3 of 15
(5,860 Views)

Hi johnsold,

 

many of the questions you mentioned are still open because it is actually an open research problem (sub-MHz soil dielectric measurements). The equipment will be used to sweep frequency between 1KHz to 1MHz.

 

This is what I know so far:

 

What is the amplitude difference? 

One signal is the source of the instrumentation (0.01V-2V rms, sinusoildal signal). Depending on the soil characteristics, the measured signal can be very small and it will be amplified by an differential instrumentation amplifier. The worst case I investigated: SNR of only 2dB.

 

How fast can it change?

Not an issue at all. Dielectric changes in soil are very lazy. Therefore, I can use any kind of solution that take, for instance, 1min to conclude. Nonetheless, the demodutation technique to be used will require different values of sampling rate. I will start with one technique that does not require more than 50Sa/s.

 

How much noise or interfering signal will be present?

The worst case I investigated: voltage signal level around 20 microvolts,  SNR of only 2dB.

 

How fast can the phase change?

Not an issue at all, as already commented.

 

What is the largest phase difference which can occur?

-90 degrees. The accuracy problems occur (based on my preliminary investigations without DAQ) when the difference is between -89 and -90.

 

Can the phase difference be both positive and negative?

No, only negative (after calibrating the measurment system) because the soil behavior is always capacitive (non-mganetic soil).

 

What is the signal frequency? Can it change?

1 kHz - 1 MHz.  Controlled change by instrumentation.

 

Do you have a clean reference signal of the same frequency?

Yes, it comes from a DDS after a low-pass filter of 5th order. I can easily control the amplitude of this reference signal.

 

How quickly do you need the phase measurements after acquiring some samples?

For this phase of investigation, the measurement speed is not an issue.

 

 

 

 

 

 

0 Kudos
Message 4 of 15
(5,842 Views)

As a first try I would  the tone detection vi. Sample with about 50 to 100 times of the sine frequency (if possible) and for the angle resolution you will need some statistics 😉

If you measure soil...  and the SNR is only 2db... how stable  is your phase shift, and how stable is the amplitude?  Mean, how many data can you take to mean out the noise? 

 

Another way is a SAM: Sine aproximation method. You apply a linear least square fit on your data of a f(x) = A sin(wt) + B cos(wt) (+C)  (wt is known 🙂 )

 

What DAQ are you using?  If you create the sine with a DDS , I would use a sine frequency of a clear (sample) ration of the DDS clock and use that clock as the reference (and/or sample) clock for the DAQ.

By having a defined sample clock (ratio) between the sine and the DAQ you really know the sine frequency and the SAM can concentrate on the amplitude and phase AND you can cut your data into known multiples of the periode. We found that the fit process performs better if you always fit exact n periodes.

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 15
(5,828 Views)

agnelors,

 

Thanks for the detailed answers.

 

Several issues jump out.

- You talk about 50 samples/second maximum. This does not make any sense. The Nyquist criterion requires the sampling rate to be greater than twice the lowest frequency component to be measured, which is the excitation frequency you specified as 1 kHz to 1 MHz.  For a direct, brute force phase angle measurement with a resolution of 0.01 degree the sampling rate needs to be at least 36000 times the frequency of the signal.  At the upper end of your frequency range this would require a 36 GHz samping rate. How many hundreds of thousands of dollars do you have to spend?

- Low signal to noise ratio makes precise phase meaurements more difficult.

- Every amplifier and filter in any part of the system will introduce delays (or equivalent phase shifts). Depending on the type of device the delays may vary with frequency.  For some devices temperature shifts of a few degrees might cause >0.01 degrees of phase shift.  Designing or calibrating to that level may be a challenge. A differential amplifier for a 20 uV signal with 2 dB SNR at 1 MHz is not straigtforward.

 

Suggestions:

- Use an I/Q technique. Multiply the signal by the reference signal and by a second reference signal 90 degrees from the first reference. Low pass filter the products and digitze the results. (Plus and minus 45 degrees from the excitation phase might be better than 0 and 90 degrees, where one of the outputs may be very near zero).  The DDS can probably generate all these signals. Watch the phase shifts in the output filters.

- Buy or build some very good electronics to do the amplification, multiplications, and low pass filtering in the analog domain.

- Carefully characterize or calibrate the phase shifts over the frequency and signal amplitude ranges of interest.

- Plan to take many readings and to average over many cycles of the excitation signal at low signal to noise ratios.

 

Lynn

0 Kudos
Message 6 of 15
(5,821 Views)

Given the wide frequency range and small voltages that are needed, might I suggest looking into a commercial lockin amplifier? If you can live with an upper frequency bound of 100-200 kHz, there are a bunch of suitable models. If you need to go up to a MHz, the choices are more limited (and expensive); a wideband model like the Signal Recovery 7280 would work. 

0 Kudos
Message 7 of 15
(5,814 Views)

Hi johnsold,

 

You are right, there is a typo (I tried to correct it now but it is not possible): it is 50MSa/s (rather than 50Sa/s). This number is only related to the lower frequencies (~1KHz) in order to evaluate the solution for the best case scenario before scaling to higher frequencies. Anyway, my DAQ solution (USB-6210) at this moment can only go up to 250 kSa/s.

 

For sinusoidal signal only (and square waves also), there is a theory (60s) of sub-sampling for phase difference calculation that allows moving the problem from higher frequencies (hundred of KHz) to lower frequencies (hundreds of Hz). The idea is that, assuming that the signals are only basically different due to phase, it is not necessary to sample all the period of a cycle, just a small portion of it, although in high sampling rate mode. This is one approach I would like to investigate using DAQs. Soon, I will post the references about this theory here. If this approach holds, I still can use 50MSa/s (or much smaller rate) for frequencies higher than 5KHz. Note that this is not a violation of the Nyquist criterion because the idea is not to "rebuild" the original data (we already know that both signals are sinusoids) - the goal is only to get the phase deviation by comparing a very tiny portion of the signals in time domain.

 

Regarding the I/Q technique: the 90-shift circuit for different frequencies is an issue for me (at least at the analog domain). Is there a way to easily perform this using a chip (at microwave frequencies, it is relatively easy to achieve the quadrature of a signal) or inside LabView (while still maintaining accuracy)? I personally like the I/Q approach due the easy way to mitigate the noise. It would be for sure my first option for a single-frequency operation.

 

 

0 Kudos
Message 8 of 15
(5,812 Views)

Hi Henrik_Volkers,

 

I heard about the sine-fitting technique in 2 or 3 papers (regarding water conductivity, similar problem as mine considering critical phase differences).

Do you know about any LabView work using this technique?

 

I have a NI USB-6210 16-Bit, 250 kS/s M Series Multifunction DAQ.   I know that it will be not enough for my goals, but I would like to test a solution at lower frequencies (<5KHz) using this device and LabView, before upgrading the solution to achieve measurements up to 1MHz.

 

It is possible that I have to relax the requirements to have upper frequency of 100KHz and resolution of 0.1 degree.

 

 

 

 

 

0 Kudos
Message 9 of 15
(5,809 Views)

Hi dmsilev,

 

You touched at other possibility I did not investigate very well.

Assuming that I limit the higher frequency to 100KHz, what commercial lockin amps would you recommend?

 

0 Kudos
Message 10 of 15
(5,802 Views)