Feb 27, 2011

Oscillators

There are literally dozens of types of oscillators in existence so it would be impossible to sufficiently discuss them all in single blog entry. I lack the time, enthusiasm, and knowledge of all the different variations to cover them in the depth they deserve. Originally, I had intended to cover harmonic, LC, and quartz crystal oscillators in this post. However, after starting to write about Wein-bridge (harmonic) oscillators I felt that even covering those three would be too much for one post. Therefore, I will focus my attention on the classic Wein-bridge oscillator and reserve LC and quartz crystals for the future.

The simulation I ran in my last blog entry used an AC source to emulate the oscillator in the comparator circuit. In reality, oscillators are very similar to AC sources but not quite the same thing. An oscillator is a device that produces an AC waveform, which does not necessarily always mean a sine wave. What’s cool about oscillators is that they are actually “controlled chaos” devices. In any circuit system, stability is a high priority. You want your design to be able to adapt to constant variations in circuit parameters such that the application itself maintains its intended performance. Oscillators, however, are the result of amplifiers that have been intentionally driven towards instability to produce a predictable result.

In order for oscillators to maintain oscillations, they need to meet two criteria:
  
  1. The gain of the oscillator must be greater than or equal to unity.
  2. The phase shift from the output back to the inputs must be zero degrees.

These two constraints are known as the Barkhausen stability criterion after Heinrich Georg Barkhausen, a German physicist who made large contributions to control theory and electromagnetics. 

Let’s take a look at what I mean with the classic Wein-bridge oscillator. Wein-bridge oscillators are very easy to design and can sustain oscillation frequencies up to 1MHz assuming a high-frequency op-amp is not used in the design. They are popular in the market because they can produce low-noise and achieve very small total harmonic distortion (THD). I have seen designs with a THD of less than 1 percent.

As you can see in Figure 1, the oscillator has two feedback paths from the output of the op-amp back to the positive (+) and negative (-) input terminals. The positive feedback path creates the oscillations while the negative path controls the gain of the system. The oscillator in Figure 1 was designed for an oscillation frequency of 2kHz.

Figure 1. Wein-bridge oscillator schematic

It’s important to notice that there are no input signals at either the non-inverting (+) or inverting (-) pins of the op-amp (however there are rail voltages to supply power). These types of oscillators are, essentially, able to create something out of nothing because they amplify ambient noise signals to start to oscillations. The op-amp itself generates small noise signals from the operation of the internal transistors. Those signals travel through the feedback loop of the oscillator over and over gradually gaining in amplitude after each pass. Figure 2 illustrates how the oscillator produces a very small signal for the first 15ms or so and then starts to build up until the loop can sustain oscillation.


Figure 2. Output waveform of Wein-bridge Oscillator

To verify the oscillation frequency, we can look at the fast Fourier transform (FFT) of the loop. FFTs are a discrete representation of the harmonic content of a system. Figure 3 shows a clear spike at 2.0000kHz, where the oscillation frequency should occur. The FFT confirms that this loop oscillates as it was designed. There are two final important points I want to point out about this design.


Figure 3. FFT of Wein-bridge oscillator

First, Figure 2 shows the oscillations as they occur in the simulation, but you may notice that the peaks of the waveform are flat rather than a smooth curve. This is because the signal is “clipping”. The output waveform of the op-amp can never achieve a higher voltage than is powering the op-amp. When the circuit gain pushes the output waveform beyond the voltage used to power the op-amp, we say it is “clipped”. If you look closely, you will see that voltage of the oscillation levels off at 15V and -15V, the voltages powering the op-amp. It is in the nature of oscillations to increase in magnitude if they are not controlled. This design lacks any form of amplitude stabilization circuitry because I was going for demonstration of concept in this blog entry. With a couple of diodes, you could limit the peak voltage of the oscillation and keep it away from the rail voltages at both extremes of the sine wave.

Second, often times these oscillators are designed so that white noise is introduced into the system when power is supplied to start the oscillations quickly. The waveform in this simulation did not reach steady-state until about 25ms from the time power was applied. For humans, 25ms seems inconsequential but in the realm of computers and integrated circuits 25ms is an eternity. This design would be impractical for many applications but more complex versions can be found in many types of active filter and radio platforms today.

For one last proof, Figure 4 shows how this oscillator design satisfies the Barkhausen criteria. As you can see from the picture, the input (red) voltage waveform is in phase (meaning there is a 0 degree phase shift from input to output) with the output voltage waveform (green). Also, the red waveform’s amplitude is lower than the green meaning that the gain of the system is greater than one. Therefore, this oscillator meets both Barkhausen criteria.

Figure 4. Input (red) and output (green) waveforms of Wein-bridge oscillator

I will do another blog in the future on LC and quartz crystal oscillators. They generate the same result but in different ways than the Wein-bridge. Hopefully, this entry has revealed some of the design considerations required to produce oscillations that are so critical to the ever expanding array of electronics in the world today. Next up, pulse-width modulation!

1 comments:

Noah said...

The whole something from nothing idea is really neat.
Nice pictures too.

Post a Comment