# Circuit to produce variable phase shift up to 180 degrees of a square signal

Discussion in 'The Projects Forum' started by mleka, Aug 2, 2010.

1. ### mleka Thread Starter Member

May 27, 2008
15
0
I have built 1 simple square wave generator circuit using a 555 timer and wanted to add another circuit to be able to shift the signal as necessary to bring two signals in phase. I have another 555 timer circuit that generates same square waves and wanted signals to be used in phase with each other. These circuits generate signals in the range of 0.15Hz to 800KHz. I needed a phase shift circuit that can take the signal of FG1 (frequency generator 1) and shift it by 180 degrees max to be in phase with the FG2. Kind of like this

SQIN____|-----|____|-----|

OUT__|-----|____|-----|____

The idea is to mechanically control the phase shift through 1or 2 variable resistor(s). Any idea how to do this. I have searched in the internet and only came up with 1 circuit which could not understand...Any help would be appreciated. I would settle for less phase shift (up to 90degrees)if it is simple solution.

2. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
I don't know of any "simple" circuits that will do what you want. My thinking involves some kind of an analog or digital delay line that takes one of the signals in and delays it for some fixed amount of time up to and including one half a cycle or 180 degrees. With two independent signal sources, even if you could get them in phase momentarily you can't keep them in phase unless the phase error can adjust the frequency of one of the sources thereby phase locking one signal source to the other. One or two resistors ain't gonna do jack for ya

3. ### tom66 Senior Member

May 9, 2009
2,613
214
I'm thinking of a phase locked loop and some kind of adjustable phase shift oscillator, but I wouldn't know how to implement this. The problem is, any phase shift I can imagine is affected by frequency...

4. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Give this a try:

File size:
24.3 KB
Views:
1,045
5. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
A phase locked loop is a useful circuit for controlling a VCO and generating a higher frequency or a lower frequency than that of a reference frequency. The OPs problem is that he wants a circuit that takes two independent sources and attempts to line them up so that they have the same phase. This also requires the two frequencies to be harmonically related. We used to do this with sine wave oscillators using a scope in XY mode to produce Lissajous figures.

http://en.wikipedia.org/wiki/Lissajous_curve

It can be difficult to make a stable display, with simple oscillators, as anyone who has tried this will attest.

If I understand the problem correctly this is kinda like nailing jelly to a tree. In order for this to work both sources must have the identical frequency. An error measured in parts per billion just won't work for very long. Next you need a variable delay so you can apply it to one of the signals and match up the edges. Small frequency errors will require that this process be repeated continuously.

6. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
So Sgt. Wookie's RC delay is going to have a very sensitive response around 0 degrees and pretty insensitive response toward 180 degrees. This is due to the exponential charging and discharging of the capacitor; unless there is some cleverness that I missed. I think choosing a linear pot for this application would be suboptimal. I'm not sure if an audio taper would be an improvement because I can't remember which way they go.

7. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Yes, it certainly isn't optimal, and it will have to be adjusted for each change of frequency. However, it's pretty simple to build.

Another method might be to use a looped shift register, or series of shift registers, inverting the last output bit to the D in bit, and clocking the registers at some multiple of the desired output frequency. Multiple D-type FF's could also be used.

8. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
Yeah. That would be like a digital delay line; essentially a long shift register. To get the right granularity, as you get with an analog delay line, you need quite a few stages and a high frequency clock. That's not a simple circuit by any means. I'd be interested to find out if the simple threshold adjustment on the LM555's meets the OPs needs.

9. ### mleka Thread Starter Member

May 27, 2008
15
0
Thanks for your responses. I do appreciate taking the time to look into this.
Looking at the circuit posted from SgtWookie:
I do am not quite sure if I understand it correctly. Would this be good for certain frequency only and have to adjusted for other frequencies? If so what would I need to adjust? If it requires changing capacitors values that would not be practical.

Maybe I do not need this circuit after all. Let me explain a bit what I have and why I thought that having something like this would be helpful. I have made 3FG in one box and have a main switch for all 3 of them. Then each of them has a switch of their own. I want to be able to generate different frequencies in phase with each other. For example, if FG1 = 10Hz then FG2=100 Hz and FG3 = 1KHz and all of them must be in phase. Should they be in the phase if I start all FG's with the main switch on? Forgive me for the limited knowledge in circuitry as I am a Mechanical Engineer and still trying to learn. It is something that I really enjoy...
Any feedback is appreciated.

10. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
In the circuit that I posted, the outputs from both 555 timers will be roughly symmetrical (~= 50% duty cycle), except for the first clock right after power has been applied. Out2 will always be delayed from Out1, depending on the setting of VR2.

VR1 adjusts the frequency or PRT (PRT=1/freq) at Out1. VR2 adjusts the delay time. The delay time is independent of the frequency of Out1. If the delay time exceeds PRT/2, OUT2 will no longer toggle.

As far as your 10Hz/100Hz/1kHz requirement, that would be duck soup to do cascading some /10 counters with shift registers. It would be even easier to do in a microcontroller, as you wouldn't have to re-wire the circuit to change frequencies/ratios/whatever - just feed it some new numbers via switches, serial port, or reprogramming.

Last edited: Aug 5, 2010
11. ### mleka Thread Starter Member

May 27, 2008
15
0
Thanks for the response. It is really tricky to have such circuit. Because my duty cycle is also variable that particular solution would not meet this criteria. I have seen a circuit somewhere about this. I will search for it and post it here so we can discuss it.

12. ### mleka Thread Starter Member

May 27, 2008
15
0
I can not quite understand all of it because of how it is made...any feedback would be appreciated...

File size:
42.5 KB
Views:
144
13. ### JoeJester AAC Fanatic!

Apr 26, 2005
3,402
1,225
According to the 74HC123 data sheet:

It will be difficult to shift variable signals 180 degrees using the 'HC123.

They are good when you have multiple triggers for the same event .... like using a lighning detector's output to trigger an alarm.

14. ### mleka Thread Starter Member

May 27, 2008
15
0
It is ok if it is not possible to shift to 180degrees. I would be happy with small shifts of phase angles. In terms of time maybe from 0.000001s to 0.1s? Can we look at this from the delay time of signal only...

15. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
I think you are completely missing the point of a monostable multi-vibrator also known as a one-shot. The leading edge of a one-shot is always synchronous with a trigger event with some small finite delay usually measured in nanoseconds. The trailing edge is determined by the RC components and is not related to any clock or the trigger. This part will not help you achieve phase shifting of any signal by any stretch of the imagination.

You should be looking at an analog delay line if such a thing still exists

Last edited: Aug 4, 2010
16. ### mleka Thread Starter Member

May 27, 2008
15
0
Thanks for your direction, is appreciated. My limited knowledge shows quite clearly. I will search some more...