Precise Measurement of Phase Difference - Page 1
Forum section: electronics / testgear

author: German_EE
author_rank: Super Contributor
timestamp: June 15, 2014, 06:04:19 pm
content: I need to build a phase meter to the following specifications:Frequency: 1 MHz to 60 MHzRange: 0 degrees to 179.9 degreesResolution 0.1 degrees or betterI'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?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 15, 2014, 06:35:01 pm
content: 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

author: German_EE
author_rank: Super Contributor
timestamp: June 15, 2014, 06:54:24 pm
content: 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.

author: G0HZU
author_rank: Super Contributor
timestamp: June 15, 2014, 07:20:05 pm
content: 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.

author: rob77
author_rank: Super Contributor
timestamp: June 15, 2014, 07:31:09 pm
content: correct me if i'm wrong but...XOR gate with low-pass filter => phase to voltageXOR gate without low pass => phase to pulse widthconsidering 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

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 15, 2014, 07:37:36 pm
content: 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

author: G0HZU
author_rank: Super Contributor
timestamp: June 15, 2014, 07:47:25 pm
content: 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?

author: rob77
author_rank: Super Contributor
timestamp: June 15, 2014, 07:50:03 pm
content: Quote from: T3sl4co1l on June 15, 2014, 07:37:36 pmnothing is wrong with a xor gateit'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 resultsbut the 0,1 degree resolution might be hard to achieve.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 15, 2014, 07:59:49 pm
content: 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 solvedOtherwise, 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

author: G0HZU
author_rank: Super Contributor
timestamp: June 15, 2014, 09:26:02 pm
content: I think the point I'm trying to make is that it won't be as simple as a 74LVC XOR gate and a filterI 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.

author: Marco
author_rank: Super Contributor
timestamp: June 15, 2014, 10:01:29 pm
content: 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.

author: rob77
author_rank: Super Contributor
timestamp: June 15, 2014, 10:05:49 pm
content: btw... what is the application ? just for the sake of curiosity

author: G0HZU
author_rank: Super Contributor
timestamp: June 15, 2014, 10:18:31 pm
content: QuoteYes, that would be useful to knowI'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.

author: Bored@Work
author_rank: Super Contributor
timestamp: June 16, 2014, 06:45:48 pm
content: 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?

author: G0HZU
author_rank: Super Contributor
timestamp: June 16, 2014, 07:07:09 pm
content: Quote from: Bored@Work on June 16, 2014, 06:45:48 pmPeople were measuring relative phase to 0.1 degree resolutionup to 1GHzin 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

author: G0HZU
author_rank: Super Contributor
timestamp: June 16, 2014, 07:12:55 pm
content: 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.

author: German_EE
author_rank: Super Contributor
timestamp: June 16, 2014, 07:34:11 pm
content: 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.

author: 1design
author_rank: Regular Contributor
timestamp: June 16, 2014, 08:07:30 pm
content: We consistently measure fs  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.

author: G0HZU
author_rank: Super Contributor
timestamp: June 16, 2014, 08:30:08 pm
content: 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...

author: 1design
author_rank: Regular Contributor
timestamp: June 17, 2014, 10:27:01 am
content: Here you go, figure 3 has the measurements that I described above:http://accelconf.web.cern.ch/accelconf/pac2013/papers/thpma04.pdfBRP.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.

author: w2aew
author_rank: Super Contributor
timestamp: June 17, 2014, 01:58:56 pm
content: Quote from: G0HZU on June 15, 2014, 07:20:05 pmCurious - 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)...

author: G0HZU
author_rank: Super Contributor
timestamp: June 17, 2014, 07:43:10 pm
content: Hi W2AEWThe 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 1960sNote: 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.

author: Neganur
author_rank: Unknown
timestamp: June 19, 2014, 12:07:50 pm
content: fromhttp://www.scottyspectrumanalyzer.com/slim_PDM.htmlNeeds 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.