# Help in creating a Phase detector

Discussion in 'General Electronics Chat' started by c1rcu1ts, Feb 16, 2016.

1. ### c1rcu1ts Thread Starter Member

Oct 19, 2013
62
0
Hello all,

I require some assistance in creating a phase detector circuit or find an IC (even better option) capable of measuring the phase difference of 3 different waveforms. The three waveforms would be sine, square and triangle. The frequency that they would be operated to would be of the order of MHz. it should ideally read frequencies in the range 1-10MHz but i do not mind decreasing the bandwidth.

I was curious if any experienced person knows an IC similar to the AD8302 but mainly with functionality of phase detection. The other features makes this IC too expensive especially when i just want to use the phase detection functionality of the IC.

I think i found an idea where a wave could be converted into a TTL signal. From this, it could be passed through an XOR gate. The duration that "logic 1 or high" is output and compared to the periodic time, this would determine the phase difference.
The problem with applying this logic to my circuitry is that i do not know how to convert. Can someone point me in a direction?

2. ### Picbuster Member

Dec 2, 2013
373
50
is the phase shift constant for the 3 signals?
max time to produce the answers and the interval?
accuracy wanted?

3. ### c1rcu1ts Thread Starter Member

Oct 19, 2013
62
0
Hello Picbuster,

The signals would be fully periodic and appear as normal waves. For example, the sine wave would not be rectified or anything and would instead follow the formula Asin(wt). It should be noted that the waves may be distorted

No, the phase shift is not constant. In fact, i do not know what the phase would be. I would be measuring two different signals, but always of the same type. Example, always one sinusoid compared to another sinusoid, one square compared to aanother square.

Max time to produce the answer would be about 30 seconds. (i mostly care if i could get the phase. i put 30 seconds as a timeframe that would be good to try and aim for.)

The accuracy i want is as much as possible.

4. ### Picbuster Member

Dec 2, 2013
373
50
one way of doing this is to
remove the DC component.*
feed the signal into a smith trigger* (* take a capacitor)
Result is a sq wave.
Care full you measure on an edge introducing an error.
If all amplitudes are the same you might consider an opamp forced in saturation to create a sq wave.
(gain x1000> vdd)
Then use a high speed counter #1 start the clock at the up going signal(1)
Stop it at signal(2)
Do the same with counter #2, signal (1) and stop at signal 3

now you have one sample. feed this into a pic parallel serial.
repeat process.
Take n samples and average. output via display/usb/ serial or ????

5. ### c1rcu1ts Thread Starter Member

Oct 19, 2013
62
0
I read up on what you said about the schmitt trigger and simulated the circuit. I believe it works for sine waves so far (see image attached). The arrangement of the oscilloscopes corresponds to the arrangement of the oscilloscope screens to the right.

The circuits works by converting the signals into square waves and then sends it into a XOR gate. The duration that the XOR is high would give the duration that the signals are out of phase.

It could be seen that the time that the time that the XOR outputs the signal for is about 250ms. The period of the waveforms are 1000ms. 250/1000 = 0.25 and 0.25 times 360 equals the 90 degrees phase shift.

My new question is that, can you suggest me a XOR gate IC to use please. THe Vpk inputs should not be high (about less than 1V).

By the way, i would be sending the waveform from the XOR into an arduino analog input to get the signal into my computer for further processing.

Thanks.

File size:
625.1 KB
Views:
4