element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • 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
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • 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
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Transistors: Phase-Shift Sine Wave Oscillator
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jc2048
  • Date Created: 19 Jul 2018 8:05 PM Date Created
  • Views 1766 views
  • Likes 10 likes
  • Comments 18 comments
  • sine wave
  • oscillator
  • circuit design
  • transistors
Related
Recommended

Transistors: Phase-Shift Sine Wave Oscillator

jc2048
jc2048
19 Jul 2018

Introduction

 

More oscillators!

 

At some point, for reasons I can't remember now, I tried simulating some simple sinewave oscillators. Here's one of them. This one uses a single transistor to provide the gain and a series of RC elements to provide the phase shift. The original circuit might have been from one of Graf's collections of circuits (I borrowed the Oscillators one from the library last year), though it's a fairly common circuit and you'll find it reproduced elsewhere. Books tend to simply present it as being a sine-wave oscillator along with a formula for determining the frequency from the values of the RC elements. In this blog, I'm going to use the simulator to look at it in a bit more detail and see how good it is at producing a sine wave.

 

Basic Circuit

 

Here's the basic circuit as it's usually presented. The original had a 3k3 resistor for the collector load, but I changed that for a 2k2 (the transistor I'm using evidently has a much higher hFE than what was used originally in that circuit).

 

image

 

Here is the output waveform from running a transient test on the circuit

 

image

As you can see, the output sine wave isn't all that good a shape. A sine wave can have a modest amount of harmonic distortion and still look quite reasonable to the eye so, if we can see that it actually looks poor, it really is.

 

How Does it Work?

 

The transistor is configured as a common-emitter amplifier. We say the emitter is common because the input is applied between the emitter and base and the output is between the collector and emitter (as the transistor has three legs, one always has to be shared by input and output). The common-emitter configuration gives us voltage gain - it amplifies the signal at the base - and it also inverts the signal, giving a 180 degree phase shift. The output signal is fed back through three RC networks to the input. At some frequency, the delay through those elements will result in another 180 degrees of phase shift (nominally 60 degrees for each RC pair) and we meet the conditions for oscillation from positive feedback (360 degrees of phase shift around the loop and enough gain to balance the losses).

 

That's kind of an ideal picture where we might imagine the transistor makes a good (linear) amplifier, the gain works to just balance the losses, and we'd see nice sine waves all around the loop. The reality is much different.

 

At start-up, the signal will build (it initially comes from noise generated by the power being applied). After a few cycles, it limits because it has grown to be almost the same, peak-to-peak, as the supply voltage. At the top end, it slows just short of the rail (giving quite a soft top) because of the very non-linear characteristic of the base as the voltage there reduces. It's also the case that each RC stage loads the previous one, with the last one working into the very non-linear load that the transistor represents, so any idea that we get a nice, neat 60 degree phase shift from each stage flies out the window. It's very messy and a simulator approach rather than an analytical one makes a lot of sense. 

 

Further Investigation

 

Here's the circuit as I extended the scope of the simulation, with test meters to measure the waveforms at various points. I included an initial condition of 0V at the transistor base to ensure that it started properly [needing something extra to kick an oscillator into life is common with simulation - this one sits sulking with its output at 4.3V if you don't give it a bit of encouragement].

 

image

 

Here are the waveforms

 

image

Looking at those waveforms, you can see that the reality is miles (kilometers, if you prefer) away from the ideal. For large signals, the single-transistor common-emitter amplifier is very poor in its linearity [I ought to do a 'Transistors' blog on it, really] and the signal out is very different in shape to the signal at the base that generates it. We also have a situation where the transistor input is loading the RC networks, so they don't really filter the output signal in the way you might expect.

 

It's occured to me that one interesting way to think about what is happening is that we have an analog computer that's solving the problem of: 'what waveform do we need at the output so that, fed round the circuit and amplified by the transistor, it results in a perfect copy of itself?' The waveform we see on the 'scope is a solution to that problem (I say 'a' rather that 'the' because it's possible that there might be more than one solution - in fact there is, because a bit more thought shows that there's a static dc level that is also a solution, though whether that would actually happen in reality - as opposed to the simulator, where it's the natural solution - is a different matter).

 

Breadboard

 

Here it is built on a breadboard. You can see how simple it is.

 

image

 

Here's the 'scope trace of the output. On the breadboard, my transistor has a different gain to the one in the simulator and that has moved the dc operating point of the output slightly lower. As a consequence, the limiting is at the bottom, as the transistor runs into saturation, rather than at the top.

 

 

image

 

Here's the result if I get the oscilloscope to do an FFT of that waveform

 

 

image

 

That gives us a better idea of just how poor a sine wave it is. Ideally, there would just be the fundamental (half a division in from the left-hand edge), but as it is there seems to be every harmonic possible in addition (except, curiously, for the 8th harmonic - perhaps they take it in turns to have the day off).

 

Well, I think that's enough experimenting with this. There may well be other uses for the circuit, but if you want a good quality sine wave then it either needs considerable improvement (several transistors, with feedback around them to linearise the response, would be a good start) or you'd need to consider something else, maybe a Wien bridge oscillator. Here's an interesting application note (page 29 onwards) that will help if you ever want to try for one with a really, really low distortion figure [this must rank as one of the best application notes ever written]:

 

http://www.analog.com/media/en/technical-documentation/application-notes/an43f.pdf

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 4 years ago +5
    Hi Jon, Excellent blog post and detail : ) It is always fun seeing your oscillators and sound generators. The technique you mention about breaking the loop and pretending that the oscillator has an input…
  • jc2048
    jc2048 over 4 years ago in reply to shabaz +5
    In case it's of interest to anybody, I did try having a look at the open-loop response whilst I was doing the blog but didn't publish it because I'm not altogether clear about the results. On the surface…
  • mcb1
    mcb1 over 4 years ago +4
    Nice work on both simulation and real world. In my mind adding RC filters to a sinewave that will be amplified is going to create filtering of the signal at certain frequencies. Applying the RC filtering…
  • shabaz
    shabaz over 4 years ago in reply to jc2048

    Hi Jon,

     

    I think you're spot on, when you close the path, the frequency has shifted due to the input and output impedances being different, changing the response. The situation is much easier if the input and the output have the same impedance, which is usually 50 ohms for RF circuits of course, but could be any value for an oscillator. (This is why some convenient oscillators can be made from MMIC amplifiers, they are already intended for 50 ohms input and output). Then, you should see the frequency at the value you see in your plot (or only a very slight shift). Otherwise, it is very hard to design the behaviour I think, unless the input and output impedances are the same (although some books don't discuss this for various oscillator topologies like colpitts etc, and instead have experience-derived rules with not much more info, like "lower capacitor must be 1/10th the value of the upper capacitor" etc.. and such rules only seem to work for limited circumstances. Also some buffer is good on the output for when you come to using the signal.

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

    Cheers

    Yes there seems to be a whole lot of things.

     

    Personally I always look at simulators (the weather models) and wonder if they were able to factor in all the nuances that cause the real world, or just make it do something they think is right.

    If I recall correctly. the early days of the nuclear winter theory forgot that large temperature variations between the south and north hemispheres would alter the weather patterns, and therefore radiation predictions were all wrong ... (at least that's the way I recall it)

     

    Thankfully us mortals minions have you to show us some more tricks.

    I think that I've forgotten more than I remember, but who knows ... maybe as get even more older I'll remember the early stuff and forget the new stuff. image

     

    Mark

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

    The 'Measurement Amplitude' seems to be like setting the range on a meter - it doesn't seem to change the results if I change it to 10V, but I presume that if you picked the wrong manual range you might not be able to measure at all or, going the other way, have very poor resolution on the measurement. I just leave it set to 'auto' on the basis that it can probably pick the range better than I can. The documentation is just short snippets in a help file and doesn't go into any real detail, so it's difficult to tell for sure.

     

    It certainly doesn't set the input generator level for the bode plot directly. It's possible to do frequency response measurements on something like an op-amp (where the open-loop gain could be over 100,000) so the stimulus level must be very small. Possibly it works backwards and iterates to a level that will keep the output nicely within the measurement range. I would think this was something inherent in the spice code so I might be able to find some better documentation (the GUI is fronting the open-source SPICE code that all these kind of simulators use - people do code their own additions to it, but I'd think that something like this would be generic).

     

    When I said that I changed the output impedance of the generator, in effect I was doing that with a resistor (though I actually did it just by entering a parameter in the list for the component rather than with a separate component). The problem here, though, is knowing the output impedance of the transistor gain block. If the gain were coming from an op amp, with negative feedback round it to set the gain, that feedback would also ensure that the output impedance was very low (to the extent that it would be very little different to having a zero-ohm generator in its place). So the open-loop technique would appear to work much better if the gain block is closer to the ideal [and, incidently, if we break the loop immediately after the gain block to take advantage of that]. But if the gain block is a long way from ideal, then the results are going to be wrong.

     

    Inherent capacitances and inductances are down to the quality of the component model, not the simulator. If the model for a component includes them, then they are being simulated. The simulator can't possibly know anything about true parasitics, though, because they derive from 3-d structures in space and the representation of the circuit doesn't include that information and couldn't simulate with it if it did (you're trying to solve Maxwell's equations which necessitates a very different approach to the one taken with SPICE simulation). The one exception might be if the simulator is closely coupled with a pcb layout package - there's no reason why the layout package couldn't include a capacitance figure to the reference plane for each net that's a track, though I don't know if it's ever actually done (the situation of a track above a reference plane on a board is quite constrained physically and a simple model can determine the capacitance fairly accurately).

     

    There's nothing to stop you including parasitic components in your circuit to be simulated (guesswork of values won't show exactly what happens, but it can give an indication of what the kind of effects of having the parasitic element are). For instance, it's quite easy to determine the inductance of a length of wire from a simple formula and then model the supply wires to a board along with the components at the input and something to represent the board decoupling and see how it behaves. Hopefully, you'd realise that if you place the wires close together there would be mutual coupling between them, which you could then model as well. You'd then have the basis for determining whether there was any merit in keeping a supply wire and its return close to each other or not. It wouldn't give answers that would match any measurements, but it would tell you something useful for all that. [Guessing a rough value for the parasitic capacitance at the switching node of a boost converter and simulating with it is interesting too, particularly if you want to investigate the various approaches to dealing with the problems it leads to.]

     

    You can choose to do multiple simulations whilst stepping individual parameters of a part, if you want - I haven't done that very much, but it would be useful for checking a design over the range of hFE values you might get with a transistor for instance. It's also possible to work with temperature, but I haven't looked into that that so far (semiconductor models include temperature). I probably ought to because it's important for discrete designs.

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

    Certainly is puzzling.

     

    Question (from the ignorant here) ...

    If you added a resistance in series to simulate the feedback resistor that might have been used.

     

    Also under the measurement it has a Range of 1v.

    Does this imply it uses 1v to do the simulation?

     

    We know there is somewhere around 8v p-p to play with.

     

    I'm picking that in the real world, there are component variances, parasitic capacitance and device capacitance to contend with and change things.

    Simulation can probably mimic or add these but do these free tools include  that when you choose components?

     

     

    Still interesting, so please keep posting.

     

    Mark

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

    In case it's of interest to anybody, I did try having a  look at the open-loop response whilst I was doing the blog but didn't publish it because I'm not altogether clear about the results.

     

    On the surface, doing it is quite simple. With the feedback being ac coupled via C1, there are no complications of the kind that crop up when the feedback path also sets the biasing in some way and I can drive the input and read the voltage at the output like this

     

    image

     

    that gives a Bode plot like this

     

    image

     

    The frequency where the phase is zero (really 360 degrees in the circuit, but the software reports it as 0, not that it matters) is 341Hz. The magnitude plot shows that there's sufficient voltage gain at that point to support oscillation. But that disagrees quite markedly with the frequency of oscillation from doing a transient response in the closed-loop case, which is 238Hz.

     

    I can see two obvious problems with the open-loop method. Firstly, the simulator determines the response with a very small signal (I'm not clear how small), so the situation isn't anything like the same as with large signals where the circuit is far less linear and the waveforms are no longer sine waves.

     

    The other potential problem, which I haven't really thought through too well, is that the generator has zero output impedance and the meter has infinite input resistance and that doesn't model the situation when the loop is closed. I've tried experimenting with increasing the output impedance of the generator and adding loading at the meter, and they do pull the zero-degree frequency in the direction of the transient response figure. Question then is, is there a clever way of arranging things so that we can do the open-loop measurement but the impedances work out right without us having to know what they actually are?

     

    Anyway, it's obvious that this needs a degree of caution.

     

    Presumably with rf circuits, using frequency-selective networks designed for 50 ohms, the situation would be much better controlled.

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
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 © 2023 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube