Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Oscillator with op amps

Status
Not open for further replies.

michalh

New Member
Hi, I have this circuit: **broken link removed**. It should be a phase-shift oscillator. I need two things:
  1. Derive a function for frequency with respect to value of R1
  2. Derive a stability condition (again with respect to R1)
I tried several steps like describing this with transfer function or using integrals...
Could someone tell me, what should I start with?
 
The problem seems to be mis-stated. This is a cascade of first order LPFs. R1 doesn't figure into that, as all it does is set the DC voltage gain.

If you wanted to use it as an oscillator, since the output is antiphase to the input (inverting op-amps) you need a total of 180deg of phase shift, or 60deg of phase shift in each LPF. For any 1st order LPF:

B(w)= -arctan(w/w0) (Where w0= 1/R2C -- the -3.0db cutoff frequency)
-60= -arctan(w/w0)
tan(-60)= -w/w0
-sqrt(3)= -w/w0
w= (w0)sqrt(3) (Where w is the oscillation frequency)

At that particular frequency, the voltage gain is -6.0db(v) (-18db(v) total through all three) So you'd need each op-amp to have a DC gain of 2 or better to have enough gain to sustain oscillation.
 
Hi,

Probably the simplest approach is to set all the parallel resistances equal and all the series resistors equal too. That gives us three identical stages with R1 being the input resistors and R2 being the resistors in parallel to the caps, and the capacitors can then all be called C1.

Doing this, i get the same value for the angular frequency w as Miles, which is:
w=sqrt(3)/(R2*C1)

And this also says that R1 is not included in the frequency calculation, at least not in a perfectly ideal circuit.

Knowing this, we can then calculate the exact value of R1 needed to sustain oscillations without saturating any stages, and this comes out to the simple:
R1=R2/2

So we could set the frequency with R2 and then set the required values of R1 using that simple calculation.

You should double check these results and any other results you see on the web in a circuit simulator program before using the circuit.
I did not get a chance to do this yet but may be able to do so soon.
 
Michalh,

How come are you using 3 op amps for a phase-shift oscillator? Just use 1 op amp and let a RC network change the phase by 180°. The RC network attenuates the signal by -1/29, so the op amp has to have a gain of -29 for the circuit to oscillate. Ask if you have any questions.

Michalh.JPG


Ratch
 
Thank you all for your responses.
I am sorry I forgot to write values of components. So, R2=R7=R9=10k, R6=R8=1k, C1=C2=C3=1n.
So it means, the second and the third op will have the same gain. And for all three ops the gain should be A=A1 * A2 * A3. And I need to set the gain A1 to some value (with R1) so the circuit will be oscillating.
A1 = -(R2/R1) * (1 / (1+jw*R2*C1))... If I describe every every op with this and multiply those three gains, I should get the frequency of the oscillator, isn't it so? But when I do so, it doesn't match the measurement. The data from measurement are like this: starting with R1 on value of 1M, I decreased its value, and the circuit started oscillating when R1 was about 120k. Then when I decreased the value of R1, frequency was lower, too.
Now, when I derive a function for frequency, it doesn't match the measurement in any case.

Miles Power: so the frequency derives from phase shift, ok. That means, w is the frequency, where every LP filter will have 60 degree phase shift, and with R1 I should set the right DC gain to start oscillations? But still, as I wrote, the frequency should change with R1. Why is that?

Ratchit: it would be much easier if I was dealing with this circuit but alas I'm not. I need the one I posted but I agree the one you posted would be better.
 
Hi,

Based on my reference design in my previous post, if you made all the R1, R6, and R8 equal to 1k it would mean that the gain would be off by a factor of 5^3 which would mean R1=125*1k=125k.
This result is based on all three stages and the reference design which has all equal resistors R1, R6, R8.

Analytically, the value for R1 is:
R1=R2^3/(8*R6^2)

where R6 is the same value as R8 and R1 is of course different.
This gives the same result for the values quoted, 125k for R1.

The above formula comes from the gains of the last two stages and what it takes to correct that with the first stage.

If you are seeing any constant output with manual adjustment of R1 then there may be some clipping in one of the amplifiers making it a non linear problem which isnt really what you want here even though that might be necessary for a real life circuit like this.
Check for clipping in any of the stages, and try to adjust the circuit for no clipping and see what happens. If you can keep it constant then it must mean something is still clipping and that's not the solution you want. You should not be able to adjust it manually, but rather see the output get larger, then start clipping, or else get smaller and smaller and then die out.
If there is any clipping it may change the calculation for the frequency too and it makes it a different problem altogether, so you wont be able to calculate it using linear techniques. If there is no clipping then you cant adjust it for a constant output, at least for very long.
What this all means is that this is mostly a theoretical problem not a practical one.

The theoretical value for R1 is 125k, so if you go under 125k the output will eventually grow too large and clip, and if you go above 125k the output will eventually grow too small. When it clips however it may deceive you into thinking that it is somehow working but it wont be working the way you want it to work, which is stable yet not clipping.
This is based on ideal op amps so there may be some difference with a real circuit with real op amps.
 
Last edited:
michalh,

"A1 = -(R2/R1) * (1 / (1+jw*R2*C1))... If I describe every every op with this and multiply those three gains, I should get the frequency of the oscillator, isn't it so?"

No, that is not the way to determine the frequency of oscillation. The feedback loop has to be 360° or 0° in order to obtain the maximum positive feedback. That occurs when each inverting op amp has a phase shift of -120°, which occurs at about 21 kHz with the values given. The total gain of the 3 op amps has to be 1, but each op amp is a little less that 10, for a total of over 900. Unfortunately, R1 is a phase determining component, plus it determines the amplification of the first op amp. Therefore, I would use an approximate 1000:1 voltage divider positioned after the third op amp to reduce the amplification to the input down to 1.

Ratch
 
Miles Power: so the frequency derives from phase shift, ok. That means, w is the frequency, where every LP filter will have 60 degree phase shift, and with R1 I should set the right DC gain to start oscillations? But still, as I wrote, the frequency should change with R1. Why is that?

Welcome to the real world of circuit design.

The frequency of any oscillator is determined by having enough gain, and that frequency for which the loop phase shift is 360deg (or some multiple thereof). The calcs I showed in the OP make certain simplifying assumptions:

*) The op-amps are perfect (Avol= INF; the (-) input is actual ground; there is no device or stray capacitance)

*) C1,R2 are the only contributions to loop phase shift

*) No device or stray capacitance

*) The op-amps don't clip

*) The op-amps aren't slew limited

*) The circuit is immune to loading effects

None of this applies in the real world, and there are seldom any preliminary designs that don't require empirical adjustments before finalization. You mention an R1 value of 125K. That is way too large! Especially if your R2 is 10K. Given that 10K and 0.1nF, your frequency should be ~27.57KHz. You didn't say how you built this particular circuit. That frequency is sufficiently high, especially when combined with a 125K resistor (1.0nF has Xc= 5.77K at 27.57KHz) for stray capacitance effects to come into play. That would especially be the case if you're using a solderless prototyping board.

There is enough stray phase shift there to throw off the practical results. You also have the effect that loading has on frequency, as whatever load you connect becomes part of the phase determining components of the loop. Any free running oscillator works best with light loading, and output buffering to isolate it from the load it drives.
 
Michalh,

How come are you using 3 op amps for a phase-shift oscillator? Just use 1 op amp and let a RC network change the phase by 180°. The RC network attenuates the signal by -1/29, so the op amp has to have a gain of -29 for the circuit to oscillate. Ask if you have any questions.

View attachment 85080

Ratch


Hi there Ratch,

I think you need to look at your circuit again and go over the equation for the frequency and required gain. I think it is an interesting circuit in addition to the circuit we are looking at so it's worth looking at.

Looking at your result it appears that to calculate the frequency and gain you simply broke the feedback from the output to the resistor R4, which is not the correct way of doing it. That's normally the correct way to do it but only when the output is isolated from the input with respect to current. In other words, if there is input impedance then that must be reflected onto the output before doing any open loop frequency or gain analysis. Another way of looking at it is that it would be correct to simply break the feedback if there happened to be a voltage follower gain stage (gain=1) between the output and R4. Since that is not the case, we must reflect R4 to the output after we break the feedback connection.

After breaking the feedback and adding R4 in parallel to the output terminal, we get an entirely different result for both frequency and gain. For example, with all R's except R5 equal to 10k and all C's equal to 0.1uf, we require that R5=560k which is 56 times higher than R4. In fact, for any R where all four R's except R5 are equal, the required value of R5 is very simple:
R5=56*R4

and again that is when the other R's are also equal to R4.

So take another look and see what you find. Keep in mind that the frequency equation will be different also.
 
Last edited:
MrAl,

I guess I did not emphasize that the phase shift network should not be loaded. Adding a buffer such as a noninverting unity-gain op amp should take care of that problem. High input impedance, low output impedance is what we want. I also did not mention that there should be some nonlinear control for the op amp amplification regulation. Otherwise, I stand by that circuit as shown below. Anyway, thanks for pointing out that problem.
Michalh.JPG


Ratch
 
Hi Ratch,

Well it's just that your original circuit was so nice in that it only required the one op amp, and now you're adding another amplifier stage which kinda messes it up a little. All we have to do is add the output resistance and come up with the new formula for frequency, and that new formula is not that much more complicated.
The output can then be taken from the output of the first stage op amp.

It's common to omit the non linearity worries when dealing with pure theory, but we cant omit the loading of the output by the first stage. All we have to do is change the formulas a little and we're good to go with only one op amp.
 
MrAl,

The frequency formula for one amp is sqrt(2)*(sqrt(R4*(3*R4+2R))/(R4*R*C)). Notice that when R4>>R, then it reduces to the formula given in the schemat. The amplification required for one op amp is (-5*R^2*omega^2*C^2*R4-R^3*omega^2*C^2+3*R+R4)/R4 . As you can see, it is much more complicated to manipulate the components to get what is desired. Besides, running the load and the frequency determining network on just one op amp might not be a good idea.

Ratch
 
H again Ratch,

I think you have the frequency calculation right for the original circuit now, once simplified a little, however you can see from my diagram that it's not very much more difficult to work with especially if we make R1=R2=R3=R (an assumption all along) and also R4=R. It's just as simple as before just that we now have a slightly more complicated frequency calculation if we dont make R4=R also. With R4=R it's just a different constant in the frequency calculation.

Also, your 'new' circuit requires a resistor value of R5=29k not R5=28k. I think that was just a slight oversight though.

I have included a diagram with all the necessary corrections for both circuits.
As usual we assume that C1=C2=C3=C.

We always have to keep in mind that although these are theoretically sound circuits they need some sort of gain stabilization in the real world.
 

Attachments

  • PhaseShiftOcsillators-1.gif
    PhaseShiftOcsillators-1.gif
    103 KB · Views: 340
Last edited:
H again Ratch,

I think you have the frequency calculation right for the original circuit now, once simplified a little, however you can see from my diagram that it's not very much more difficult to work with especially if we make R1=R2=R3=R (an assumption all along) and also R4=R. It's just as simple as before just that we now have a slightly more complicated frequency calculation if we dont make R4=R also. With R4=R it's just a different constant in the frequency calculation.

Yes, the general frequency equation is
MrAl1.JPG


And the general gain equation is
MrAl2.JPG


When R4 is substituted for Rout, then the frequency becomes sqrt(10)/R*C, and the gain becomes -56 as you have noted.

Also, your 'new' circuit requires a resistor value of R5=29k not R5=28k. I think that was just a slight oversight though.

I did correct that resistor when I posted my second schemat.

I have included a diagram with all the necessary corrections for both circuits.
As usual we assume that C1=C2=C3=C.

We always have to keep in mind that although these are theoretically sound circuits they need some sort of gain stabilization in the real world.

I mentioned last time that I did not think it a good idea to use the same output to feed the network and the load. In addition, the network acts as a low-pass filter to remove the harmonics caused by the nonlinearity required to stabilize the amplification of the op amp. So instead of taking the output where the harmonic distortion has been multiplied by 56 times at the op amp output, it is better to take it where it has been filtered at the network output. I can calculate the attenuation of the harmonics by the network if you wish.

Ratch
 
Hello again,

That's good that you changed the resistor to 29k. There are no nonliniarities in this circuit because it is a theoretical one with an exact gain that keeps the circuit perfectly stable.
Yes, you mentioned that you "dont think it's a good idea to use the first op amp as the output". But it's still a circuit and it's a matter of application or theory in the real world, not a matter of pure opinion. In other words, one circuit is created with one op amp, another circuit is created when there is an additional gain of 1 buffer at the output.
If we were going to collect opinions, then i would offer mine that the 'old' circuit op amp stage requires too much gain, period, and the 'new' circuit still requires too much gain in the op amp stage, period. Instead put some of the gain in the first stage and some of the gain in the last stage, or go back to the original circuit.

I originally mentioned that your original calculation was not correct for the given circuit but was really for a circuit with a non inverting buffer with gain of 1 that isolates the output from the input current wise, but i did not mean we have to use an op amp with gain of 1 just so that we get away with being able to calculate it that way, that was just to illustrate what happens when the input is not reflected to the output (an equivalent network). If you really wish to add that last stage you dont do it just so you can calculate it easier and not just so you also get a buffer for the output stage, you add the stage to the entire design procedure which then means it can fit in to meet other requirements and/or fit without any limitations we might naturally have. That means the gain should be divided up between the two stages now so we can meet the gain requirement and also get a decent output level. So scratch the gain of 1 and go to a gain that makes more sense for the entire design if you must insist on using another op amp.
 
MrAl,
As I pointed out before, taking the feedback before the phase change network increases the harmonic distortion because the distortion gets amplified and bypasses the low-pass filter action of the phase change network. No need to divide up the gain because one op amp is more than capable of providing a gain of 29 if not loaded down. A noninverting op amp provides isolation, and only needs a wire for the feedback branch. Usually, more than one op amp is available in one package at nominal cost.

Back in the tube days, there used to be a trick the teacher could pull on a student. Since tubes as a rule don't have the high amplifications that op amps do, the teacher could give the student a tube with a mu 25 to 28. The student would struggle futilily trying to make the circuit work. Only after it was pointed out to the student that he should have checked the tube manual, and was gives a proper tube, was the endeavour successful.

Ratch
 
Hello again,


The point is not if an op amp *can* have a gain of 29, the point is *should* the op amp stage have a gain of 29.
We sure well know that we can set an op amp stage gain to 29 for the purpose of amplification, but with that gain comes the gain bandwidth limitation of GBW/29. Why would we want to do that when we could get away with an op amp stage gain of GBW/5.4 instead. Doesnt make sense.

Redraw the circuit such that the gain of 1 op amp buffer appears at the far left of the drawing instead of the far right. You'll see what happens.

Remember that i told you the main reason i told you about the gain of 1 buffer was because your original equations appeared *as if* there was a gain of 1 buffer in between the output and input. I didnt really mean that you should do that. Also think about what op amp output requirements it takes to get a 1vrms output with a passive network that attenuates by 1/29. If you want to address any practical issues then why just address one and not as many as you can think of.

After we look at it redrawn that way we'll find that it is still not as practical as another topology that uses similar components.
 
MrAl,
Spreading out the gain among the two amplifiers will allow the oscillator to work at a higher frequency. Making the buffer amp amplify at 29 or higher, and making the first amplifier feeding the network amplify at 1, will assure the output voltage can go from rail to rail. It will also increase the harmonic rejection even higher.

Ratch
 
Hi Ratch,


This gets interesting when we consider the practical aspects of the circuit.

It seems you want to use the gain of 29 amp to saturate in both directions, and use that as a gain limiter. That might not be a bad idea in theory, but we'd also have to look into the recovery time of the op amp to make sure it can recover in a reasonable time as not all op amps can do that very well and that would severely limit the upper frequency limit of the circuit. But let's assume that it can for now.

Then it's not too bad of an idea to use the op amp as a limiter as well as the gain stage. It will work as a limiter by pinning the output in either direction and that of course limits the gain. But that is true of any gain the op amp stage might have. It does not take a gain of 29 or any other constant gain to force the output to saturate in either direction, it takes a combination of gain plus the input level has to be high enough to force the output stage all the way up (or down) to one of the rails. Thus a gain of around 5.4 in both stages would still saturate the output and we'd still get the limiting action in the second stage.

We'd then also get a more useful output, although it might not be good enough anyway. For example, for a 1vrms output signal out of the gain of 1 stage we'd have to have the second stage output around 40 volts peak (80 volts peak to peak). Still with the dual gain of 5.4 setup the output of the second stage being plus and minus around 12v (saturated) the output of the first stage gain amp (5.4 gain) would be around 1.6 volts rms. That might be useful. To get a higher more useful output voltage we might change the gains to higher for the first and lower for the second, but then we're back to the unbalanced GBW utilization issue of the op amps.

Im sure you already know some of this stuff i've just included more things that seem pertinent to the design for completeness.

We still have other things to consider though that will have an impact.
 
Last edited:
MrAl,

Why are you talking about "saturation"? If a nice sine wave is desired, saturation is the last thing I desire. I would want the feedback nonlinearity to gradually limit the amplitude to just below the rail voltage. Like the light bulb does in a Wien-bridge oscillator.

There are lots of ways to arrange the amplifiers and phase-shift network to give the highest frequency, lowest distorion, greatest amplification, etc. They all involve compromises.

Ratch
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top