Need help deriving the transfer function of a phase shift oscillator

Thread Starter

lamchop

Joined May 22, 2019
1
Hi guys, I've been stuck for the past 2 hours trying to derive the transfer function for this phase shift oscillator. I can't seem to find any solution online or in my notes. It would be really appreciated if you could show me the steps required. Thanks in advance!

MOD:rotated and lightened your image.E

phase shift.jpg
 
Last edited by a moderator:

LvW

Joined Jun 13, 2013
1,752
There are two main steps:
1.) Exactly define what you need: "Transfer function"? I suppose, you mean "loop gain function", correct?
2.) Split the task into two parts: Passive and active.

(By the way - and for your information: In the document as referenced above, the shown opamp based circuits are wrong and do not work)
 
Last edited:

Andrei Suditu

Joined Jul 27, 2016
52
Each stage introduces a phase shift as in the oscilator name.
I too have oscilator assigment this week and i'm in trouble too,but after looking trough my courses you could try identifying Beta and alpha in the Brakhausen formula.
Their product should be 1.But they are complex entities so you could split them?
And then see the transfer function's magnitude and phase and get it this way?
I'll look trough my lab notes some more.
 

LvW

Joined Jun 13, 2013
1,752
.............
try identifying Beta and alpha in the Brakhausen formula.
Their product should be 1.But they are complex entities so you could split them?
And then see the transfer function's magnitude and phase and get it this way?
No - it is not necessary to consider magnitude and phase separately.
It is relatively simple:
The open-loop transfer function (loop gain LG) will have an imaginary numerator.
Hence, with the aim to get a real function (LG=1 is real) we have to set the real part of the denumerator equal to zero and solve for the angular frequency wo.
 

MrAl

Joined Jun 17, 2014
11,388
Hi guys, I've been stuck for the past 2 hours trying to derive the transfer function for this phase shift oscillator. I can't seem to find any solution online or in my notes. It would be really appreciated if you could show me the steps required. Thanks in advance!

MOD:rotated and lightened your image.E

View attachment 177939
Hello,

Is that the right circuit?

Usually this circuit has a resistor between the last cap and the inverting input.

Yes it looks like some of the links are not correct. They show a gain of 1 in the amplifier section but the total loop gain overall has to be 1 not just the amplifier itself.

You could do this a couple different ways. I think the easiest is to break the loop and calculate input to output then find out what you need to set the gain via R1 to in order to start and maintain oscillations. If R1 is too small the oscillations damp out, if R1 is too big the output saturates to some DC level and stays there forever, and this means that R1 must be one EXACT value which in theory is possible but in real life is not possible that's why other nonlinear components are often added to help maintain oscillations.
So in short one of the problems is to find the value of R1 that maintains oscillations at least in theory.

However, due to the missing resistor between the last cap and inverting input, i have to wonder if this circuit works right at all. Maybe it works, but not like a usual phase shift oscillator that has a phase shift that is divided evenly between the RC stages (60 degrees per RC pair).
 

LvW

Joined Jun 13, 2013
1,752
Hello,
.............
Is that the right circuit?
.....................
Usually this circuit has a resistor between the last cap and the inverting input.
.......................
Yes, I agree - usually there is another resistor in front of the inv. input.
However, this is really not necessary.
Perhaps it helps to explain the working principles of both alternatives:

* With such an additional resistor we have a third-order highpass followed by an inverter (gain of -29).
The highpass produces at a certain frequency wo the necessary phase shift of +180 deg (which gives - together with the inverter - a total phase shift of 0 deg, as required).

* In the shown circuit, the CR elements act as a second-order highpass (+90 deg at wo) followed by a differentiating (inverting) block which provides -90 deg, resulting again at at a total phase shift of 0 deg.

Therefore, both circuit alternatives allow to meet Barkhausens phase condition for oscillators. The magnitude condition (unity loop gain at w=wo) can be fulfilled by proper selection of the feedback resistor.
 

MrAl

Joined Jun 17, 2014
11,388
Yes, I agree - usually there is another resistor in front of the inv. input.
However, this is really not necessary.
Perhaps it helps to explain the working principles of both alternatives:

* With such an additional resistor we have a third-order highpass followed by an inverter (gain of -29).
The highpass produces at a certain frequency wo the necessary phase shift of +180 deg (which gives - together with the inverter - a total phase shift of 0 deg, as required).

* In the shown circuit, the CR elements act as a second-order highpass (+90 deg at wo) followed by a differentiating (inverting) block which provides -90 deg, resulting again at at a total phase shift of 0 deg.

Therefore, both circuit alternatives allow to meet Barkhausens phase condition for oscillators. The magnitude condition (unity loop gain at w=wo) can be fulfilled by proper selection of the feedback resistor.
Hello,

Ok great thanks for the additional info. I'll check it out without the extra resistor tomorrow. I had limited time to work on this today too much going on here and abroad :)
 

JoeJester

Joined Apr 26, 2005
4,390
(By the way - and for your information: In the document as referenced above, the shown opamp based circuits are wrong and do not work)

The linked document works fine. The Thread Starter's graphic is another story.

results from the linked document.

osc.png
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
One last comment, to get accurate transfer function, unless one uses ideal
OpAmp, that it also has a transfer impedance that has to be considered.
Most of these types of circuits use single pole compensated OpAmp, so not
two difficult to incorporate.

But anything above second order T(s) is tedious to handle.


Regards, Dana.
 

MrAl

Joined Jun 17, 2014
11,388
One last comment, to get accurate transfer function, unless one uses ideal
OpAmp, that it also has a transfer impedance that has to be considered.
Most of these types of circuits use single pole compensated OpAmp, so not
two difficult to incorporate.

But anything above second order T(s) is tedious to handle.


Regards, Dana.

Hi,

Yes, and with the third order passive part we would end up with a fourth order and that could be quite a handful depending on what we need to do with it. Plotting the transfer function should be easy though.

I'm going to look at the original circuit and see what i can find out.
 

MrAl

Joined Jun 17, 2014
11,388
Hello again,

Ok the original circuit has a different gain that's all.
The circuit with the extra resistor has to have R4=29*R.
The original circuit has to have R4=12*R.

Now again this is in pure theory, because a real circuit needs a non linear network addition to maintain oscillations due to component variation WHILE RUNNING.
 

LvW

Joined Jun 13, 2013
1,752
The linked document works fine. The Thread Starter's graphic is another story.
results from the linked document.
So - what do you think about the resistor (10k) between the inv. input and ground? It has absolutely no influence on the oscillation frequency.
More than that, the feedback resistor (290k) assumes that we have three identical C-R sections - but this is not the case (because the mentioned resistor has no influence).
On the other hand - you are right, the circuit as given in the ref. document works, but the feedback resistor should have a factor of 12 (rather than 29) as already mentioned by MrAl in his previous post.
(Insofar, the circuit and the dimensioning in the ref. paper are not OK)
 

MrAl

Joined Jun 17, 2014
11,388

JoeJester

Joined Apr 26, 2005
4,390
I see the TS hasn't returned as of this posting. I suspect they had gotten their answer elsewhere.

Mr AL, I looked at both the one from the tutorials and using the TS's values as well as the TS's schematic.

I know why the 290k is there, as that is the value to bring the output to unity after the attenuation of the three filters. I did find it interesting that TI's Application Report SLOA060 Sinewave Oscillators recommends a x27 gain amplifier. The output from the simulation does show flat topping of the signal indicating there is a slight over unity caused by the amplifier gain, so there should be a lower value feedback resistor. Depending on the opamp, x25 gain through x29 gain can work. Naturally you probably will have some frequency change due to the poles in the OPAMP. Tradeoffs are always present.

With respect to the TS's schematic, they just wanted a transfer function. Now LvW suggests that the last resistor is not necessary. However, paralleling a 2M input across that last resistor effectively doesn't change the amplitude (a few microvolts) and doesn't shift the phase of the signal. That reminds me of when we would call the bleeder resistor in a power supply as improves regulation. In this case it is very similiar. Without that resister, the phase shift is not normal and you almost triple the amplitude of the signal.

So, to say that the last resistor isn't needed would be incorrect. Of course if you just want a frequency out, without regards to any tolerances, then everything would be fine.
 

LvW

Joined Jun 13, 2013
1,752
So, to say that the last resistor isn't needed would be incorrect. Of course if you just want a frequency out, without regards to any tolerances, then everything would be fine.
JoeJester - I strongly disagree!
It is a simple task to show that (and why) three equal C-R sections cause a damping factor of 1/29 at a frequency where the phase shift is -180deg. Hence, a loop consisting of three working C-R sections and an amplifier (gain of -29) will satisfy the Barkhausen criterion.

However, I am sure you will agree that the last resistor R is not "active" if it is in parallel to both opamp input nodes.
Hence, the circuit must be redesigned. And this redesign consists in reducing the feedback resistor correspondingly. Because we don`t still have a three-C-R- oscillator with gain but a two-C-R-oscillator with a differentiator. That's all.
That means: We have a working oscillator without a third resistor.
How can you say that it would be "incorrect" to state that "the last resistor isn't needed " ?

Further comment: You speak about "2 MegOhm paralleling" of the last resistor. This is simply wrong! This may apply to a non-inverting opamp configuration - however, in our case, we look into the inverting terminal that is connected to the fedback loop.
 
Last edited:

MrAl

Joined Jun 17, 2014
11,388
I see the TS hasn't returned as of this posting. I suspect they had gotten their answer elsewhere.

Mr AL, I looked at both the one from the tutorials and using the TS's values as well as the TS's schematic.

I know why the 290k is there, as that is the value to bring the output to unity after the attenuation of the three filters. I did find it interesting that TI's Application Report SLOA060 Sinewave Oscillators recommends a x27 gain amplifier. The output from the simulation does show flat topping of the signal indicating there is a slight over unity caused by the amplifier gain, so there should be a lower value feedback resistor. Depending on the opamp, x25 gain through x29 gain can work. Naturally you probably will have some frequency change due to the poles in the OPAMP. Tradeoffs are always present.

With respect to the TS's schematic, they just wanted a transfer function. Now LvW suggests that the last resistor is not necessary. However, paralleling a 2M input across that last resistor effectively doesn't change the amplitude (a few microvolts) and doesn't shift the phase of the signal. That reminds me of when we would call the bleeder resistor in a power supply as improves regulation. In this case it is very similiar. Without that resister, the phase shift is not normal and you almost triple the amplitude of the signal.

So, to say that the last resistor isn't needed would be incorrect. Of course if you just want a frequency out, without regards to any tolerances, then everything would be fine.

Hi Joe,

As LvW says, that value of 290k works with the resistor values that are all 10k, but only if that last R resistor is placed in series with that last capacitor. The way it stands now, that resistor of 290k really has to be 120k.

One way to analyze this is to break the feedback loop and then calculate the transfer function input to output. Then solve for w for a phase shift of 0 degrees. Then solve for the feedback resistor using a gain of 1. This procedure provides both the frequency and the feedback resistor value.
For R values all 10k one circuit requires 290k but the with with that last R to ground requires 120k.

Try it and see.

Note that with simulators we have to watch out a little here, because if the output clips that creates a reduction in gain, but normally we want a sine wave out of these kinds of oscillators not a square wave or flat topped sine wave. That's the real catch.
Also, if there is no clipping (with infinite output op amps) the output may slowly creep up to a very very high amplitude or very very low amplitude.
 

JoeJester

Joined Apr 26, 2005
4,390
LVW, I do realize it's three section filter that attenuates the signal which has to be amplified for oscillation. The example on the tutorial stated the output was 6.5 kHz. Ok, I don't know what you expect, but when someone states it's 6.5 kHz I expect it to be within 5000 parts per million of 6.5 kHz. You might not, and that is fine. Yes, I do know there are poles in the op amp that can and do affect the output frequency.

Mr Al, I agree the simulators can be finicky. I did break out the sections from the circuit to view the outputs of each section when the source was 6.5 kHz to observe the phase shift and attenuation. I also know about the need for some initial conditions, charge on capacitors when working with some oscillating circuits. Getting it to a sine was was always the objective and getting it within some semblance close to 6.5 kHz is always nice as well.
 

LvW

Joined Jun 13, 2013
1,752
LVW, I do realize it's three section filter that attenuates the signal which has to be amplified for oscillation. The example on the tutorial stated the output was 6.5 kHz. Ok, I don't know what you expect, but when someone states it's 6.5 kHz I expect it to be within 5000 parts per million of 6.5 kHz. You might not, and that is fine. Yes, I do know there are poles in the op amp that can and do affect the output frequency.
.
JoeJester, thank you for your reply.
However, I did not mention a frequency of 6.5 kHz at all - so, you did not meet the point. More than that, I did not mention a possible influence of the real opamp on the frequency.
My only point was your sentence "....to say that the last resistor isn't needed would be incorrect..."

I repeat: Yes, the last resistor in the diagram (ref. document) is not needed, because - as we all know - the inverting terminal is (nearly) at "virtual ground" potential and any resistor between this terminal and ground doese not influence the gain of the stage.
More than that, the selection of the feedback resistor assumes that this resistor would be an active part of the feedback network - and this is wrong!
That was my point and nothing else!
( I am aware that such a resistor can produce a certain kind of external frequency compensation in case of an opamp that is not unity gain stable - but that is a complete other story.)

EDIT: You are asking me what I expect? Well the shown circuit would oscillate at app. 9.2 kHz with heavy amplitude clipping due to the wrong feedback resistor. The frequency as given in the ref. document (6.5 kHz) belongs to another circuit.
Before writing a such a reply as you did - didn`t you check the validity and correctness of the technical content before?.
 
Last edited:
Top