Author Topic: Precise Measurement of Phase Difference  (Read 7290 times)

0 Members and 1 Guest are viewing this topic.

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2400
  • Country: de
Precise Measurement of Phase Difference
« on: June 15, 2014, 06:04:19 pm »
I need to build a phase meter to the following specifications:

Frequency: 1 MHz to 60 MHz
Range: 0 degrees to 179.9 degrees
Resolution 0.1 degrees or better

I've come across one circuit that converts phase difference to a voltage using the AD 8302 and another which converts the phase difference to a pulse and the width of this pulse is then measured. However the analog circuit has questionable accuracy and the digital circuit has the problem of measuring pulses that are VERY narrow.

Does anyone have an alternative approach?
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 14700
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Precise Measurement of Phase Difference
« Reply #1 on: June 15, 2014, 06:35:01 pm »
XOR gate, in the 74LVC or better family.  Some high speed comparators if you're starting with an analog signal (say one of the ADCMP or LT "damn fast" series).

How much bandwidth do you need from the measurement?  As fast as possible (within a few cycles..?)?  Slow like DC (< 20Hz)?  Something intermediate (< 100kHz?)?  That determines the type of analog filter you need.

Then for accuracy, you need to estimate how much timing (jitter) and analog error you're getting over everything, but the resolution (i.e., smallest easily resolved difference, i.e., near the noise floor) should be better than you need.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2400
  • Country: de
Re: Precise Measurement of Phase Difference
« Reply #2 on: June 15, 2014, 06:54:24 pm »
Using an XOR gate would be a mixture of the two techniques above. The output would vary from a very narrow pulse at one end to a very wide pulse at the other and still leave me with the problem of measuring the width. Don't forget, a signal at 50 MHz with 50% duty cycle has a 10nS on time and a 10nS off time which is a very short period.

Fortunately measurement time is not an issue here, if it takes a few seconds for the result to be displayed I'm not going to worry.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #3 on: June 15, 2014, 07:20:05 pm »
I wouldn't favour the XOR gate method if you want to get fine resolution on the phase angle across such a wide input frequency range. Maybe it can be done but I'd be concerned about the finite performance of the integrator/filter after the XOR gate. You also need to square up the signal prior to measuring it.

Maybe a better (traditional) way would be to sample each signal down to a very low frequency IF (a few kHz?) and then drive each IF channel into a limiter and then measure the phase difference between the limited outputs.

i.e. create a low frequency alias of your signals using an agile sampling system that can change frequency to lock the alias at the target IF frequency. It should then be easy to measure the relative phase using various methods because the IF frequency is only a few kHz.

This system could be designed to work with very low level input RF signals eg sub 1mV.

« Last Edit: June 15, 2014, 07:29:05 pm by G0HZU »
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 1848
  • Country: sk
Re: Precise Measurement of Phase Difference
« Reply #4 on: June 15, 2014, 07:31:09 pm »
correct me if i'm wrong but...

XOR gate with low-pass filter => phase to voltage
XOR gate without low pass => phase to pulse width

considering NO difference in the input frequencies , just a phase difference for the 2 cases above.

so basically both methods were identified as not suitable in the very beginning ;)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 14700
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Precise Measurement of Phase Difference
« Reply #5 on: June 15, 2014, 07:37:36 pm »
What's wrong with an XOR?  Logic is logic.

0-180 degrees, give or take a few off each end due to phase reversal (the transfer function goes up, then down, over the full circle), as determined by the timing constraints of the logic used.

I don't see that downconversion is necessary.  Logic goes that fast, and I don't think you'll need ECL to do it.  You can if you want -- after reading a few datasheets, you may find you need to.  I don't know offhand.

If you want a more analog method, you can use a balanced mixer of any type, but mind that the input waveforms must be sharp and square to get a triangular (rather than sinusoidal) transfer function.  Usually, one port (the LO, say) is driven with a high enough amplitude (from an impedance matched source) so that its signal effectively acts as a square wave current source/sink, switching the diodes quickly and solidly; the other signal is lower amplitude, so that it gets switched to the output alternately, without affecting the switching itself (as it would if it were the same high amplitude).  So in this case, it must also be amplified, limited and clamped to yield a square wave, but at lower amplitude (say, two diodes back-to-back in parallel, before the signal enters the mixer).

Effectively, the convolution of the two waves is your transfer function; in radio, sin * sin = sin (read "*" as 'star' or 'convolved with') and sin * square = sin, so you normally don't need limiting on both ports; but to get a triangular transfer function, you need square * square.

Digital methods do the same, except you usually use a one-bit ADC (i.e., a comparator) to perform the limiting on both signals.  It's all equivalent, as it should be.

The mixer method probably has much better noise floor due to using far less circuitry in the signal path, but you'll have to tweak and adjust and calibrate it to get known performance over the whole range.

As for the final step, just analog lowpass filter it.  No need to count pulse widths, that would be silly.  Let the physics handle it for you.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #6 on: June 15, 2014, 07:47:25 pm »
Can you explain to me how the XOR gate will work if the angle to be measured is 0.2degree at 50MHz?

Also, what about relative duty cycle?

 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 1848
  • Country: sk
Re: Precise Measurement of Phase Difference
« Reply #7 on: June 15, 2014, 07:50:03 pm »
What's wrong with an XOR?  Logic is logic.

0-180 degrees, give or take a few off each end due to phase reversal (the transfer function goes up, then down, over the full circle), as determined by the timing constraints of the logic used.

I don't see that downconversion is necessary.  Logic goes that fast, and I don't think you'll need ECL to do it.  You can if you want -- after reading a few datasheets, you may find you need to.  I don't know offhand.

If you want a more analog method, you can use a balanced mixer of any type, but mind that the input waveforms must be sharp and square to get a triangular (rather than sinusoidal) transfer function.  Usually, one port (the LO, say) is driven with a high enough amplitude (from an impedance matched source) so that its signal effectively acts as a square wave current source/sink, switching the diodes quickly and solidly; the other signal is lower amplitude, so that it gets switched to the output alternately, without affecting the switching itself (as it would if it were the same high amplitude).  So in this case, it must also be amplified, limited and clamped to yield a square wave, but at lower amplitude (say, two diodes back-to-back in parallel, before the signal enters the mixer).

Effectively, the convolution of the two waves is your transfer function; in radio, sin * sin = sin (read "*" as 'star' or 'convolved with') and sin * square = sin, so you normally don't need limiting on both ports; but to get a triangular transfer function, you need square * square.

Digital methods do the same, except you usually use a one-bit ADC (i.e., a comparator) to perform the limiting on both signals.  It's all equivalent, as it should be.

The mixer method probably has much better noise floor due to using far less circuitry in the signal path, but you'll have to tweak and adjust and calibrate it to get known performance over the whole range.

As for the final step, just analog lowpass filter it.  No need to count pulse widths, that would be silly.  Let the physics handle it for you.

Tim

nothing is wrong with a xor gate ;) it's the simplest and most elegant approach if there is only a phase difference.

i was just mentioning thet the OP was discarding the phase to voltage because of accuracy and phase to pulse width because of difficult measurement of narrow pulses.

personally i would go for a xor gate with low pass filter - and fine tune it for the best results ;) but the 0,1 degree resolution might be hard to achieve.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 14700
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Precise Measurement of Phase Difference
« Reply #8 on: June 15, 2014, 07:59:49 pm »
The result will be a runt pulse; 0.2 degree is about 1/1000th of 180 degrees so, out of 20ns (50MHz), you'd need propagation delay within 20ps (as well as similar rise/fall time to register it with fidelity).

So yeah, probably is a good candidate for ECL or better.

You can offset one input or the other with transmission line or RLC delay to help resolve phase shifts near zero.  Of course, at the expense of phase shifts near 180 degrees.

Yes, duty cycle must be equal to use the XOR, and for that matter, it must be as close to 50% as possible to use as much of the full 180 degree range as possible.  Both inputs could be divided with T flip-flops, which not only cleans up the duty cycle, but relaxes the frequency requirement as well.  Interesting to note: dividing the frequency maintains the same time shift, which means the phase shift is halved.  So an XOR between T f/f's can resolve near 360 degrees.  Hey, problem solved ;D

Otherwise, a PFD like the "type 3" detector in a 'HC4046 could be constructed, to achieve near 360 degree range without duty sensitivity.  A few ns delay on one input would afford, say, 5-185 degree range (and then some) at the highest frequency, at the expense of needing a frequency dependent correction of course.

50:1 is quite a wide range, and I think it's possible to do all at once, but doing it in ranges might be a better option.  If you can tell us more about the application...

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #9 on: June 15, 2014, 09:26:02 pm »
I think the point I'm trying to make is that it won't be as simple as a 74LVC XOR gate and a filter :)

I can see a 'more complex' logic based phase detector circuit working up to a few tens of MHz but I'm not sure about getting it to work at 50MHz with (reliable) 0.1degee levels of performance.
Maybe it can be done but I'd also be worried about the influence of (unwanted?) harmonics on the original analogue signals because I'm guessing that these could influence the triggering point of the input circuits of either channel and cause offset errors.

Also, I think it would be better to dynamically manage the operation/type of the logic phase detector (based on phase angle) because you could then avoid awkward zones in the phase detector response.

 

Online Marco

  • Super Contributor
  • ***
  • Posts: 4619
  • Country: nl
Re: Precise Measurement of Phase Difference
« Reply #10 on: June 15, 2014, 10:01:29 pm »
How about you take A/2 and the 90 degree phase shifted A/2 (this is easy to do during divide by 2). If you XOR both of those with B/2 you always have one result which is not close to the transition, you still need very good jitter of course but rise/fall time are less important.
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 1848
  • Country: sk
Re: Precise Measurement of Phase Difference
« Reply #11 on: June 15, 2014, 10:05:49 pm »
btw... what is the application ? just for the sake of curiosity ;)
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #12 on: June 15, 2014, 10:18:31 pm »
Quote
btw... what is the application ? just for the sake of curiosity ;)

Yes, that would be useful to know :) I'm kind of assuming the worst in that the input signals are analogue and that the 0.1deg resolution means a fairly stable readout to 0.1degree right up to 60MHz.
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Precise Measurement of Phase Difference
« Reply #13 on: June 16, 2014, 06:45:48 pm »
0.1 deg at 60 MHz is something like 4.6 ps time difference. Reliable and repeatable measuring picosecond resolution time differences is not really fun. The first thing I would try to do is to negociate the 0.1 deg requirement. Maybe 10 deg will do?
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #14 on: June 16, 2014, 07:07:09 pm »
0.1 deg at 60 MHz is something like 4.6 ps time difference. Reliable and repeatable measuring picosecond resolution time differences is not really fun. The first thing I would try to do is to negociate the 0.1 deg requirement. Maybe 10 deg will do?

People were measuring relative phase to 0.1 degree resolution up to 1GHz in the early 1960s. But they didn't use an XOR gate phase detector to do this... They used the method I proposed in reply #3 :)



« Last Edit: June 16, 2014, 07:09:38 pm by G0HZU »
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #15 on: June 16, 2014, 07:12:55 pm »

However, if the XOR gate method is used for the 60MHz requirement, then an integrator/filter is typically fitted after the XOR phase detector so you then simply measure voltage (after the integrator) to determine phase angle. So you don't need to measure time intervals down to a few ps with this method and this point has already been made by other posters on this thread.

So very fine resolution should be possible with the XOR gate but I think it will require something more versatile than a simple XOR gate and an integrator to get reliable operation to 0.1degree over a large range of phase angles all the way up to 60MHz.


 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2400
  • Country: de
Re: Precise Measurement of Phase Difference
« Reply #16 on: June 16, 2014, 07:34:11 pm »
Experimentation continues and I have had mixed results. Phase detection using an XOR gate does work but, as mentioned, both inputs need to be an exact 50/50 mark space ratio for the technique to work. The best way of doing this is a divide by two but (surprise surprise) some logic families have different rise and fall times.

I did get one interesting suggestion off-board. Analog Devices do some DDS chips with dual outputs and the ability to program a phase difference between them. The suggestion was to phase lock channel one of the DDS to the first signal then vary the phase of the second DDS channel until it matched the second signal using an XOR to detect the difference. The measured phase difference is then the value programmed into the DDS chip. This method is very complicated but it does give 14-bit resolution over 360 degrees.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline 1design

  • Regular Contributor
  • *
  • Posts: 121
Re: Precise Measurement of Phase Difference
« Reply #17 on: June 16, 2014, 08:07:30 pm »
We consistently measure fs [femtosecond] range phase difference up to 3 GHz and with long term stability under 5 fs/24h with he ad8302. The noise at 3 GHz was around 10fs p-p (0.01°), so even at 60 MHz you should still get some decent results in the 0.1° range if you do it right. On the other hand you could multiply and look at the harmonics! The biggest issue you have to watch is AM/PM conversion of you signal is not amplitude controlled. Do not use classic VGAs as they have a strong AM/PM relation. The AD8302 has two internal log amps that act as compressors and reduce the AM/PM of the detector and because they are on the same die they are very symmetrical. I will try to find my article with the results and post it.

P.S.: Our IF BW was around 6 Hz with a very steep rolloff and the measurements where ratio metric.
« Last Edit: June 16, 2014, 08:20:00 pm by 1design »
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #18 on: June 16, 2014, 08:30:08 pm »
I haven't put much thought into this but I wondered if it would be possible to initially measure the frequency of the Channel A signal using a $4 PIC based counter chip and then program an AD9851 DDS to downmix each channel to an IF of about 20kHz and feed the baseband IF outputs A and B to a PC soundcard for processing in order to measure phase.

This would be a fairly cheap and simple system (if it works well enough)

I don't know what phase resolution you can get in DSP using a cheap soundcard though. I would hope it would be good unless the signal was very noisy...
« Last Edit: June 16, 2014, 08:34:31 pm by G0HZU »
 

Offline 1design

  • Regular Contributor
  • *
  • Posts: 121
Re: Precise Measurement of Phase Difference
« Reply #19 on: June 17, 2014, 10:27:01 am »
Here you go, figure 3 has the measurements that I described above:

http://accelconf.web.cern.ch/accelconf/pac2013/papers/thpma04.pdf

BR

P.S.: When using a sound card with 2 channels you need to take into consideration the sampling jitter of the card. Sound card are great for measuring phase noise, I wouldn't know if thie IF would be good enough for drift measurements.
 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1746
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: Precise Measurement of Phase Difference
« Reply #20 on: June 17, 2014, 01:58:56 pm »
I wouldn't favour the XOR gate method if you want to get fine resolution on the phase angle across such a wide input frequency range. Maybe it can be done but I'd be concerned about the finite performance of the integrator/filter after the XOR gate. You also need to square up the signal prior to measuring it.

Maybe a better (traditional) way would be to sample each signal down to a very low frequency IF (a few kHz?) and then drive each IF channel into a limiter and then measure the phase difference between the limited outputs.

i.e. create a low frequency alias of your signals using an agile sampling system that can change frequency to lock the alias at the target IF frequency. It should then be easy to measure the relative phase using various methods because the IF frequency is only a few kHz.

This system could be designed to work with very low level input RF signals eg sub 1mV.

Curious - what are the traditional ways that the mixing/down-conversion are done?  Traditional mixers?  Sampling detectors (like those used in a Tayloe detector)? Others?   And of course, I presume the phase delay of the RF and LO of the mixers needs to be precisely matched (or calibrated out)...
YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 2576
  • Country: gb
Re: Precise Measurement of Phase Difference
« Reply #21 on: June 17, 2014, 07:43:10 pm »
Hi W2AEW

The old way to do it in a 1GHz VVM was to use very fine sampling pulses a couple of hundred ps wide.
These were generated from an octave tuning VCO driving a fine pulse generator down at 1-2MHz. This creates a system where the wanted signals are sampled and each sample/hold circuit takes the form of a quad diode gate.

So the sampled/hold generated IF signal becomes a LF replica of the original signal that could be in the range 1MHz to 1GHz  and it also replicates the harmonic distortion of the original signal.

But in order for this old system to work the VCO has to phase lock the channel A IF signal to an onboard 20kHz reference and it has to avoid generating the 'image' 20kHz because this would invert the phase at the IF wrt the input signal. Not so good.

It's therefore quite a complex system but it works up to 1GHz and dates back to the early/mid 1960s :)

Note: the phase stability of this old system is so good you can use this type of meter to verify relative drift between high performance OCXOs. It's easily good enough to test/compare Rubidium or GPS based references because it maps across to something like a few parts in 10e-13 for frequency over several minutes. I believe they are still used today in some standards labs to long term log the drift of one reference against another by connecting the rear panel  'phase to dc' output to a plotter.
« Last Edit: June 17, 2014, 07:54:53 pm by G0HZU »
 

Offline Neganur

  • Supporter
  • ****
  • Posts: 1114
  • Country: fi
Re: Precise Measurement of Phase Difference
« Reply #22 on: June 19, 2014, 12:07:50 pm »


from http://www.scottyspectrumanalyzer.com/slim_PDM.html

Needs a 5V reference (accuracy depends on this), 0-5V output.
With minor modifications it will offer 0.1 degree accuracy with limitations described in the link.
("... has a "dead zone", data taken below 45 degrees and above 315 degrees is subject to greater error than the range between 45 and  315 degrees.")

This particular BOM is designed for 10.7 MHz IF, but the circuit will work up to 30 MHz.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf