element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Op Amps: Simulating a Two-Phase Oscillator
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jc2048
  • Date Created: 9 Aug 2018 10:34 PM Date Created
  • Views 3080 views
  • Likes 10 likes
  • Comments 8 comments
  • bode plot
  • simulation
  • analog design
  • closed-loop
  • open-loop
  • op amps
Related
Recommended

Op Amps: Simulating a Two-Phase Oscillator

jc2048
jc2048
9 Aug 2018

Introduction

 

Even more oscillators!

 

At some point, for reasons I can't remember now, I tried simulating some simple sine wave

oscillators. At the time they all got left in the simulator's default save directory which is where

I've been retrieving them from.

 

The last blog looked at a very simple and, to be honest, not very good single-transistor design

Transistors: Phase-Shift Sine Wave Oscillator

 

This one, in contrast, uses op-amps to provide the gain and produces a somewhat better

sine wave out. As with the previous blog the circuit came from a book, though I've taken it and

adapted it for 5V single-supply operation using just the very cheapest-of-cheap quad op-amps. This

one has an interesting feature in that it produces two sine waves rather than one. The two are in

quadrature (90 degrees apart) - that naturally results from part of the circuit functioning as an

integrator, something which I'll look at later.

 

I found this oscillator in the IC Op-Amp Cookbook by Walter Jung [1]. It obviously wasn't original to

him, another slightly different version appears in a later book by Scott Hamilton [2] and he gives

references for it that go back to the 1950s.

 

Here's the circuit as Jung published it

 

image

 

I reduced the resistor values by a factor of about ten, increased the capacitors by a factor of ten,

and used an op amp to generate an artificial ground to get the following circuit that I built on a

breadboard and will then be the basis for simulating the circuit.

 

image

I should say that, although it does work, in some ways it's something of a fragile design and it's

quite easy to choose values that won't start to oscillate on a breadboard, sometimes even when the

simulation shows that it does, so some care is needed with it.

 

Breadboard

 

Here it is built on a breadboard

 

image

 

here are the 'scope traces showing the sine waves at the outputs of U2 (blue trace) and U3 (yellow trace)

 

image

 

and here is an FFT of the blue trace (U2 output)

 

image

 

so, just the fundamental and a small amount of third harmonic before we're into the 'scope's noise.

Maybe a couple of percent THD. Not too bad, though nothing like the performance of a good Wien-bridge

oscillator circuit.

 

How Does It Work ?

 

U1 is generating an artificial ground midway between 0V and 5V (ie at 2.5V). It works simply as a

buffer (a voltage follower) with the voltage derived from a potential divider made up of R4 and R5.

The input impedance is very high (simply that of the non-inverting input of the op amp) and hardly

loads the divider at all. In contrast, the output impedance is very low. Although the open-loop

output of the op-amp might be a figure like hundred ohms or so, the negative feedback reduces that to

well under an ohm as long as the device has plenty of gain (it does) and  we're operating within the

capabilities of the op amp, i.e. within its output voltage range and within its ability to sink and

source current.

 

That then means we effectively have a circuit operating on a +2.5/-2.5 supply with a ground in the

middle in a very similar way to if we genuinely had a dual-rail supply.

 

The heart of the oscillator is U2 and U3, and it's this section of the diagram we need to look at to

understand how the oscillator works.

 

U3 functions as an inverter and an integrator. The inverter gives us 180 degrees of phase shift over

a fairly wide range. The integrator gives 90 degrees, again over a fair range. It's this stage that

gives us the two sinewaves 90 degrees apart.

 

U2 has two RC networks. Each will result in a phase variation with frequency and it's this variation

that determines the frequency of oscillation. When each results in a phase shift of approximately 45

degrees, the total round the loop will be 90 degrees for the U2 stage and a further 270 for the U3

stage, giving a net 360 degrees right round the loop, which is what we require for sustained

oscillation.

 

The Simulation

 

If I set the simulator going for a transient analysis, it generates these waveforms

 

image

 

That predicts a frequency of oscillation of 709Hz. That's quite a long way from the physical circuit

which measured 783Hz. Some of that will be down to component variation, the capacitors are probably

only 10%, but there are other effects making things difficult for us which we'll see in a moment with

an open-loop approach.

 

Right. So how do I look at this open-loop? The way I'm doing it here is an experiment and I'm a

little unsure about it, so don't take this as a tutorial. It seems to give plausible results, so is

worth looking at.

 

Here is the circuit reworked. (Note that I've swapped around the voltage meters, so don't go by the

previous circuit when you look at the Bode plots.)

 

image

What I've done is to insert ridiculously large values of inductors and capacitors to modify the circuit so

that at dc the loop is closed and the simulator can find the dc operating points that it needs prior

to doing the Bode plots, but at ac the loop is open and driven by the generator with the response

through to each meter being measured without the loop being closed and oscillating. (I'd love to be

able to claim credit for thinking of this, but actually I stole the idea from a TI document on

simulating the feedback of an op amp [3].)

 

Here's the phase plot

 

image

 

That clearly shows the integrator working nicely, keeping VM1 and VM2 90 degrees apart (up to about 10kHz).

We can also see the way that the two frequency selective networks vary with frequency. The point at

which VM3 reaches 45 degrees is 690Hz, which isn't too far off the closed-loop simulation oscillation

frequency of 709Hz. Above 10kHz, VM3 and VM4 start to diverge. The op amp is trying to drive C1/R1 so

that the non-inverting input matches the inverting input; 10kHz is the point where it can no longer

manage that, presumably because of slew rate limitations. This plot is for a very small signal, so

those effects will manifest themselves much more in the closed-loop simulation with its larger voltage

swings and that is probably part of the reason for the difference in predicted frequency of

oscillation between the two. The other factors that confuse things a bit are that the op amps have a

small delay, slew rate limitations give some delay, and the mechanism for limiting the amplitude - the

diodes and resistor - modify the phase slightly, so all-in-all the oscillation point won't be exactly

at the 45 degree point.

 

Now here's the magnitude plot (gain relative to the generator at the input)

 

image

 

This shows the way the RC networks roll off (the 'knee' comes where the phase is transitioning

between the low frequency and high frequency values). At the 45 degree point, the gain of the RC

network is one over root two down, but the effect of the action of U2 is that the networks counter

each other to give a gain out of unity at that point. The integrator gain has also fallen to unity at

that frequency, and that results in a gain of one round the loop at the oscillation frequency.

 

Actually, at the oscillation frequency, the integrator gain is a fraction above unity and the RC

networks a fraction below, so the frequency isn't quite where the two meet, though it's close.

 

Because it's all so finely balanced, if we had all the RC networks the same, there would be a real

possibility that it wouldn't start up, so to deal with that I made R24 23k rather than 22k. That has

this effect on the breadboard circuit:

 

with R24=22k

 

image

 

now with R24=23k

 

image

 

That all makes predicting the precise frequency of oscillation from the open-loop response somewhat

complicated even though the criteria for oscillation is quite simple (unity gain and 360 degrees

phase shift).

 

I hope that was of some interest. It's taken me a bit further along the road to understanding

simulation, so I'm benefiting from all this, even if it is a bit of a struggle to understand at

times.

 

[1] IC Op-Amp Cookbook by Walter Jung. Howard W. Sams & Co. First edition 1974.
[2] An Analog Electronics Companion by Scott Hamilton. CUP. First edition 2003.
[3] Analog Engineer's Pocket Reference. TI. See page 50. https://www.ti.com/seclit/ml/slyw038b/slyw038b.pdf

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 7 years ago +4
    Hi Jon, Thanks again for an interesting presentation. The one idea that clicked with my less advanced knowledge was that I can take a simple resistive voltage divider and use an op amp to produce a low…
  • jc2048
    jc2048 over 7 years ago in reply to shabaz +4
    I'm still a bit unsure of it as a technique, but it does seem to produce reasonable results. One thing that gave me a bit more confidence is that Hamilton analyses a similar circuit using a different technique…
  • three-phase
    three-phase over 7 years ago +4
    Interesting blog, thanks for posting. The audio engineers may not like the output generated, but us power engineers will take 2% THD every day of the week. Kind regards
Parents
  • shabaz
    shabaz over 7 years ago

    Hi Jon,

     

    Excellent and really valuable information : )

    That is a neat trick to break the circuit for AC but not for DC, it is new to me, so I'm happy you discovered during your reading!

    According to one of Randy Rhea's books (he doesn't discuss such op amp based oscillators, but the general theory should be the same) he suggests that a good characteristic is to have the maximum phase change slope (i.e. gradient) near the oscillation frequency i.e. 360 deg phase shift location, and your bode plot shows that, so this explains why you're getting an excellent sine wave. (Just for completion, the other characteristic is a gain peak near the frequency too).

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago in reply to shabaz

    I'm still a bit unsure of it as a technique, but it does seem to produce reasonable results. One thing that gave me a bit more confidence is that Hamilton analyses a similar circuit using a different technique (he splits the circuit into two parts - the frequency selective stage and the integrator - anaylses each separately and then combines the responses) and gets more or less similar results.

     

    TI just have a single inductor and a single capacitor for the case of analysing the resistive feedback of an op amp circuit. In this case I found I also needed 1T inductors across the capacitors in the circuit to set the dc conditions or the simulator would get in a real muddle doing the phase and magnitude plots.

     

    To anyone reading, this is subject to the same caveat as in the previous post - I've split the loop at the output of an op amp as that is a naturally low impedance point and the driving generator will more or less match it. Splitting at a higher impedance point in the loop will lead to errors because the generator won't be matching to the circuit in the same way as the closed-loop circuit would.

     

    The sine wave isn't THAT good. Audio people would turn their noses up at it. That 3rd harmonic is only 40dB down, so one part in a hundred which is a couple of percent THD. That's because the phase slope is only first order and there's no 'Q' peaking to the gain, so the frequency selectivity is quite poor. The Wien bridge is far better in both respects. I might have a go at that next because it would be an interesting contrast to this one (and Hamilton looks at it in his book in some detail so I'd have material that I can check my results against).

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • jc2048
    jc2048 over 7 years ago in reply to shabaz

    I'm still a bit unsure of it as a technique, but it does seem to produce reasonable results. One thing that gave me a bit more confidence is that Hamilton analyses a similar circuit using a different technique (he splits the circuit into two parts - the frequency selective stage and the integrator - anaylses each separately and then combines the responses) and gets more or less similar results.

     

    TI just have a single inductor and a single capacitor for the case of analysing the resistive feedback of an op amp circuit. In this case I found I also needed 1T inductors across the capacitors in the circuit to set the dc conditions or the simulator would get in a real muddle doing the phase and magnitude plots.

     

    To anyone reading, this is subject to the same caveat as in the previous post - I've split the loop at the output of an op amp as that is a naturally low impedance point and the driving generator will more or less match it. Splitting at a higher impedance point in the loop will lead to errors because the generator won't be matching to the circuit in the same way as the closed-loop circuit would.

     

    The sine wave isn't THAT good. Audio people would turn their noses up at it. That 3rd harmonic is only 40dB down, so one part in a hundred which is a couple of percent THD. That's because the phase slope is only first order and there's no 'Q' peaking to the gain, so the frequency selectivity is quite poor. The Wien bridge is far better in both respects. I might have a go at that next because it would be an interesting contrast to this one (and Hamilton looks at it in his book in some detail so I'd have material that I can check my results against).

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube