# 13.2 Op Amp Oscillators

## Positive Feedback and the Barkhausen Criterion

In earlier work, we examined the concept of negative feedback. Here, a portion of the output signal is sent back to the input and summed out of phase with the input signal. The difference between the two signals then, is what is amplified. The result is stability in the circuit response because the large open-loop gain effectively forces the difference signal to be very small. Something quite different happens if the feedback signal is summed in phase with the input signal, as shown in Figure 9.2.1 . In this case, the combined signal looks just like the output signal. As long as the open-loop gain of the amplifier is larger than the feedback factor, the signal can be constantly regenerated. This means that the signal source can be removed. In effect, the output of the circuit is used to create its own input. As long as power is maintained to the circuit, the output signal will continue practically forever. This self-perpetuating state is called oscillation. Oscillation will cease if the product of open loop gain and feedback factor falls below unity or if the feedback signal is not returned perfectly in phase (0 β or some integer multiple of 360 β ). This combination of factors is called the Barkhausen Oscillation Criterion. We may state this as follows:

In order to maintain self-oscillation, the closed-loop gain must be unity or greater, and the loop phase must be π 360 β , where π=0,1,2,3β¦

Note that when we examined linear amplifiers, we looked at this from the opposite end. Normally, you don’t want amplifiers to oscillate, and thus you try to guarantee that the Barkhausen Criterion is never met by setting appropriate gain and phase margins.

A good example of positive feedback is the βsquealβ sometimes heard from improperly adjusted public address systems. Basically, the microphone is constantly picking up the ambient room noise, which is then amplified and fed to the loudspeakers. If the amplifier gain is high enough or if the acoustic loss is low enough (i.e., the loudspeaker is physically close to the microphone), the signal that the microphone picks up from the loudspeaker can be greater than the ambient noise. The result is that the signal constantly grows in proper phase to maintain oscillation. The result is the familiar squealing sound. In order to stop the squeal, either the gain or the phase must be disrupted. Moving the microphone may change the relative phase, but it is usually easier to just reduce the volume a little. It is particularly interesting to listen to a system that is on the verge of oscillation. Either the gain or the phase is just not quite perfect, and the result is a rather irritating ringing sound, as the oscillation dies out after each word or phrase.

There are a couple of practical considerations to be aware of when designing oscillators. First of all, it is not necessary to provide a βstart-upβ signal source as seen in Figure 9.2.1 . Normally, there is enough energy in either the input noise level or possibly in a turn-on transient to get the oscillator started. Both the turn-on transient and the noise signal are broad spectrum signals, so the desired oscillation frequency is contained within either of them. The oscillation signal will start to increase as time progresses due to the closed-loop gain being greater than one. Eventually, the signal will reach a point where further level increases are impossible due to amplifier clipping. For a more controlled, low-distortion oscillator, it is desirable to have the gain start to roll off before clipping occurs. In other words, the closed-loop gain should fall back to exactly one. Finally, in order to minimize frequency drift over time, the feedback network should be selective. Frequencies either above or below the target frequency should see greater attenuation than the target frequency. Generally, the more selective (i.e., higher π ) this network is, the more stable and accurate the oscillation frequency will be. One simple solution is to use an π πΏπΆ tank circuit in the feedback network. Another possibility is to use a piezoelectric crystal. A block diagram of a practical oscillator is shown in Figure 9.2.2 .

## A Basic Oscillator

A real-world circuit that embodies all of the elements is shown in Figure 9.2.3 . This circuit is not particularly efficient or cost-effective, but it does illustrate the important points. Remember, in order to maintain oscillation the closed-loop gain of the oscillator circuit must be greater than 1, and the loop phase must be a multiple of 360 β .

To provide gain, a pair of inverting amplifiers is used. Note op amp 2 serves to buffer the output signal. As each stage produces a 180 β shift, the shift for the pair is 360 β . The product of the gains has to be larger than the loss produced by the frequency selecting network. This network is made up of π 3 , πΏ , and πΆ . Because the πΏπΆ combination produces an impedance peak at the resonant frequency, ππ , a minimum loss will occur there. Also, at resonance, the circuit is basically resistive, so no phase change occurs. Consequently, this circuit should oscillate at the fo set by πΏ and πΆ . This circuit can be easily tested in lab. For example, if you drop the gain of one of the op amp stages, there will not be enough system gain to over come the tank circuit’s loss, and thus, oscillation will cease. You can also verify the phase requirement by replacing one of the inverting amplifiers with a noninverting amplifier of equal gain. The resulting loop phase of 180 β will halt oscillation. This circuit does not include any form of automatic gain adjustment, so the output signal may be clipped. If properly chosen, the slew rate of the op amp may be used as the limit factor. (A 741 will work acceptably for ππ in the low kHz range). Although this circuit does work and points out the specifics, it is certainly not a top choice for an oscillator design based on op amps.

## Wien Bridge Oscillator

A relatively straightforward design useful for general-purpose work is the Wien bridge oscillator. This oscillator is far simpler than the generalized design shown in Figure 9.2.3 , and offers very good performance. The frequency selecting network is a simple lead/lag circuit, such as that shown in Figure 9.2.4 . This circuit is a frequency-sensitive voltage divider. It combines the response of both the simple lead and lag networks. Normally, both resistors are set to the same value. The same may be said for the two capacitors. At very low frequencies, the capacitive reactance is essentially infinite, and thus, the upper series capacitor appears as an open. Because of this, the output voltage is zero. Likewise, at very high frequencies the capacitive reactance approaches zero, and the lower shunt capacitor effectively shorts the output to ground. Again, the output voltage is zero. At some middle frequency the output voltage will be at a peak. This will be the preferred, or selected, frequency and will become the oscillation frequency so long as the proper phase relation is held. We need to determine the phase change at this point as well as the voltage divider ratio. These items are needed in order to guarantee that the Barkhausen conditions are met.

First, note that

where π1=π 1βπππΆ1 , and π2=π 2||βπππΆ2 .

Recalling that ππΆ=1/ππΆ , we find

So,

We can determine the desired frequency from the imaginary portion of Equation 9.2.1 .

(9.2.2)

Normally, πΆ1=πΆ2 and π 1=π 2 , so Equation 9.2.2 reduces to

(9.2.3)

To find the magnitude of the feedback factor, and thus the required forward gain of the op amp, we need to examine the real portion of Equation 9.2.1 .

Assuming that equal components are used, this reduces to

The end result is that the forward gain of the amplifier must have a gain of slightly over 3 and a phase of 0 β in order to maintain oscillation. It also means that the frequency of oscillation is fairly easy to set and can even be adjusted if potentiometers are used to replace the two resistors. The final circuit is shown in Figure 9.2.5 .

This circuit uses a combination of negative feedback and positive feedback to achieve oscillation. The positive feedback loop utilizes π π‘ and πΆ . The negative feedback loop utilizes π π and π π . π π must be approximately twice the size of π π . If it is smaller, the π΄π½ product will be less than unity and oscillation cannot be maintained. If the gain is significantly larger, excessive distortion may result. Indeed, some form of gain reduction at higher output voltages is desired for this circuit. One possibility is to replace π π with a lamp. As the signal amplitude increases across the lamp, its resistance increases, thus decreasing gain. At a certain point the lamp’s resistance will be just enough to produce an π΄π½ product of exactly 1. Another technique is shown in Figure 9.2.6 . Here an opposite approach is taken. Resistor π π is first broken into two parts, the smaller part, π π2 , is shunted by a pair of signal diodes. For lower amplitudes, the diodes are off and do not affect the circuit operation. At higher amplitudes, the diodes start to turn on, and thus start to short π π2 . If correctly implemented, this action is not instantaneous and does not produce clipping. It simply serves to reduce the gain at higher amplitudes.

Another way of drawing the Wien bridge oscillator is shown in Figure 9.2.7 . This form clearly shows the Wien bridge configuration. Note that the output of the bridge is the differential input voltage (i.e., error voltage). In operation, the bridge is balanced, and thus, the error voltage is zero.

Example 9.2.1

Determine the frequency of oscillation for the circuit of Figure 9.2.8 .

For other frequencies, either π or πΆ may be altered as required. Also, note that the forward gain works out to exactly 3, thus perfectly compensating the positive feedback factor of 1/3. In reality, component tolerances make this circuit impractical. To overcome this difficulty, a small resistor/diode combination may be placed in series with the 20 k Ξ© , as shown in Figure 9.2.6 . A typical resistor value would be about one-fourth to one-half the value of π π , or about 5 k Ξ© to 10 k Ξ© in this example. π π would be decreased slightly as well (or, π π might be increased).

The ultimate accuracy of ππ depends on the tolerances of π and πΆ . If 10% parts are used in production, a variance of about 20% is possible. Also, at higher frequencies, the op amp circuit will produce a moderate phase shift of its own. Thus, the assumption of a perfect noninverting amplifier is no longer valid, and some error in the output frequency will result. With extreme values in the positive feedback network, it is also possible that some shift of the output frequency may occur due to the capacitive and resistive loading effects of the op amp. Normally, this type of loading is not a problem, as the op amp’s input resistance is very high, and its input capacitance is quite low.

Example 9.2.2

Figure 9.2.9 shows an adjustable oscillator. Three sets of capacitors are used to change the frequency range, whereas a dual-gang potentiometer is used to adjust the frequency within a given range. Determine the maximum and minimum frequency of oscillation within each range.

First, note that the capacitors are spaced by decades. This means that the resulting frequency ranges will also change by factors of 10. The 0.1 π F capacitor will produce the lowest range, the 10 nF will produce a range 10 times higher, and the 1 nF range will be 10 times higher still. Thus, we only need to calculate the range produced by the 0.1 π F.

The maximum frequency of oscillation within a given range will occur with the lowest possible resistance. The minimum resistance is seen when the 10 k Ξ© pot is fully shorted, the result being 1.1 k Ξ© . Conversely, the minimum frequency will occur with the largest resistance. When the pot is fully in the circuit, the resulting sum is 11.1 k Ξ© . Note that a dual-gang potentiometer means that both units are connected to a common shaft; thus, both pots track in tandem.

For πππππππ’π with 0.1 π F:

For ππππ₯πππ’π with 0.1 π F:

For the 0.01 π F, the ranges would be 1.434 kHz to 14.47 kHz, and for the 0.001 π F, the ranges would be 14.34 kHz to 144.7 kHz. Note that each range picks up where the previous one left off. In this way, there are no βgapsβ, or unobtainable frequencies. For stable oscillation, this circuit must have a gain of 3. For low-level outputs, the diodes will not be active, and the forward gain will be

As the signal rises, the diodes begin to turn on, thus shunting the 2.2 k Ξ© resistor and dropping the gain back to exactly 3.

## Phase Shift Oscillator

Considering the Barkhausen Criterion, it should be possible to create an oscillator by using a simple phase shift network in the feedback path. For example, if the circuit uses an inverting amplifier (-180 β shift), a feedback network with an additional 180 β shift should create oscillation.

The only other requirement is that the gain of the inverting amplifier be greater than the loss produced by the feedback network. This is illustrated in Figure 9.2.10 . The feedback network can be as simple as three cascaded lead networks. The lead networks will produce a combined phase shift of 180 β at only one frequency. This will become the frequency of oscillation. In general, the feedback network will look something like the circuit of Figure 9.2.11 . This form of π πΆ layout is usually referred to as a ladder network.

There are many ways in which π and πΆ may be set in order to create the desired 180 β shift. Perhaps the most obvious scheme is to set each stage for a 60 β shift. The components are determined by finding a combination that produces a 60 β shift at the desired frequency. In order to avoid loading effects, each stage must be set to higher and higher impedances. For example, π 2 might be set to 10 times the value of π 1 , and π 3 set to 10 times the value of π 2 . The capacitors would see a corresponding decrease. Because the tangent of the phase shift yields the ratio of ππΆ to π , at our desired 60 β we find

Using this in the general reactance formula produces

(9.2.4)

Likewise, a look at the magnitude shows the approximate loss per stage of

Because there are three stages, the total loss for the feedback network would be 0.125. Therefore, the inverting amplifier needs a gain of 8 in order to set the π΄π½ product to unity. Remember, these results are approximate and depend on minimum interstage loading. A more exacting analysis will follow shortly.

Example 9.2.3

Determine the frequency of oscillation in Figure 9.2.12 .

Figure 9.2.12 graphically points up the major problem with the β60 β per stageβ concept. In order to prevent loading, the final resistors must be very high. In this case a feedback resistor of 8 M Ξ© is required. It is possible to simplify the circuit somewhat by omitting the 1 M Ξ© and connecting the 100 k Ξ© directly to the op amp as shown in Figure 9.2.13 . This saves one part and does allow the feedback resistor to be dropped in value, but the resulting component spread is still not ideal.

If we accept the loading effect, we can simplify things a bit by making each resistor and capacitor the same size, as shown in Figure 9.2.14 . With these values, we can be assured that the resulting frequency will no longer be 919 Hz, as Equation 9.2.4 is no longer valid. Also, it is quite likely that the loss produced by the network will no longer be 0.125.

We need to determine the general input/output (π0/π3) ratio of the ladder network, and from this, find the gain and frequency relations for a net phase shift of -180 β . One technique involves the use of simultaneous loop equations. Because all resistors and capacitors are equal in this variation, we will be able to simplify our equations readily. By inspection, the three loop equations are (from left to right):

(9.2.5)

(9.2.6)

(9.2.7)

Also, note that

(9.2.8)

We now have expressions for π0 and π3 , however, π0 is in terms of πΌ1 and πΌ2 , and π3 is in terms of πΌ3 . Write πΌ1 and πΌ2 in terms of πΌ3 so that we can substitute these back into Equation 9.2.5 . Rewriting Equation 9.2.7 yields an expression for πΌ2

(9.2.9)

For πΌ1 , rewrite Equation 9.2.6

(9.2.10)

Substituting Equation 9.2.9 into Equation 9.2.10 yields

(9.2.11)

Thus, π0 may be rewritten as

(9.2.12)

Equation 9.2.12 may be simplified to

(9.2.13)

The input/output expression is simplified as follows.

(9.2.14)

(9.2.15)

At this point, we are nearly done with the general equation. All that is left is to substitute 1/πππΆ in place of ππΆ . Remember, π2=β1

(9.2.16)

This Equation contains both real and imaginary terms. For this Equation to be satisfied, the imaginary components (6/πππΆπ and 1/ππ3πΆ3π 3) must sum to zero, and the real components must similarly sum to zero (as there are only two terms, their magnitudes must be equal). We can use these facts to find both the gain and the frequency.

(9.2.17)

(9.2.18)

(9.2.19)

For the gain, we solve Equation 9.2.16 in terms of the voltage ratio and zero the imaginary terms, because the result must be real.

(9.2.20)

Substituting Equation 9.2.17 into Equation 9.2.20 yields

(9.2.21)

(9.2.22)

The gain of the ladder network is π3/π0 , or the reciprocal of Equation 9.2.22 , or

(9.2.23)

The loss produced will be 1/29. This has the disadvantage of requiring a forward gain of 29 instead of 8 (as in the previous form). This disadvantage is minor compared to the advantage of reasonable component values.

Example 9.2.4

Determine a value for π π in Figure 9.2.15 in order to maintain oscillation. Also determine the oscillation frequency.

Of course, the higher standard value will be used. Also, in order to control the gain at higher levels, a diode/resistor combination (as used in the Wien bridge circuits) should be placed in series with π π . Without a gain limiting circuit, excessive distortion may occur.

## Computer Simulation

In order to verify Equations 9.2.3 and 9.2.19 , the gain and phase responses of the feedback networks of Figures 9.2.13 and 9.2.15 are found in Figure 9.2.16 . These graphs were obtained via the standard Multisim route. Note that the phase for both circuits hits -180 β very close to the predicted frequencies. The equal value network prediction is very accurate, whereas the staggered network prediction is off by only a few percent. Once the phase exceeds -180 β , the Multisim grapher wraps it back to +180 β , so it is very easy to see this frequency. Likewise, the gain response agrees with the derivations for attenuation at the oscillation frequency. It can be very instructive to analyze these circuits for the gain and phase response at each stage as well.

## Square/Triangle Function Generator

Besides generating sine waves, op amp circuits may be employed to generate other wave shapes such as ramps, triangle waves, or pulses. Generally speaking, squareand pulse-type waveforms may be derived from other sources through the use of a comparator. For example, a square wave may be derived from a sine wave by passing it through a comparator, such as those seen in Chapter Seven. Linear waveforms such as triangles and ramps may be derived from the charge/discharge action of a capacitor. As you may recall from basic circuit theory, the voltage across a capacitor will rise linearly if it is driven by a constant current source. One way of achieving this linear rise is with the circuit of Figure 9.2.17 .

In essence, this circuit is an inverting amplifier with a capacitor taking the place of π π . The input resistor, π , turns the applied input voltage into a current. Because the current into the op amp itself is negligible, this current flows directly into capacitor πΆ . As in a normal inverting amplifier, the output voltage is equal to the voltage across the feedback element, though inverted. The relationship between the capacitor current and voltage is

(9.2.24)

(9.2.25)

As expected, a fast rise can be created by either a small capacitor or a large current. (As a side note, this circuit is called an integrator and will be examined in greater detail in the next chapter.)

By choosing appropriate values for π
and πΆ , the π_{ππ’π‘}ramp may be set at a desired rate. The polarity of the ramp’s slope is determined by the direction of the input current; a positive source will produce a negative going ramp and vice versa. If the polarity of the input changes at a certain rate, the output ramp will change direction in tandem. The net effect is a triangle wave. A simple way to generate the alternating input polarity is to drive π
with a square wave. As the square wave changes from plus to minus, the ramp changes direction. This is shown in Figure 9.2.18 .

So, we are now able to generate a triangle wave. The only problem is that a square wave source is needed. How do we produce the square source? As mentioned earlier, a square wave may be derived by passing an AC signal through a comparator. Logically then, we should be able to pass the output triangle wave into a comparator in order to create the needed square wave. The resulting circuit is shown in Figure 9.2.19 . A comparator with hysteresis is used to turn the triangle into a square wave. The square then drives the ramp circuit. The circuit produces two simultaneous outputs: a square wave that swings to Β± saturation and a triangle wave that swings to the upper and lower comparator thresholds. This is shown in Figure 9.2.20 . The thresholds may be determined from the equations presented in Chapter Seven. In order to determine the output frequency, the V/s rate of the ramp is determined from Equation 9.2.24 . Knowing the peak-to-peak swing of the triangle is πupper thresβπlower thres , the period of the wave may be found. The output frequency is the reciprocal of the period.

Example 9.2.5

Determine the output frequency and amplitudes for the circuit of Figure 9.2.21 . Use ππ ππ‘=Β±13π .

First, note that the comparator always swings between +ππ ππ‘ and βππ ππ‘ . Now, determine the upper and lower thresholds for the comparator.

The lower threshold will be -6.5 V. We now know that the triangle wave output will be 13 V peak-to-peak. From this we may determine the output period.

Because the ramp generator is driven by a square wave with an amplitude of ππ ππ‘ , Equation 9.2.24 may be rewritten as

The time required to produce the 13 V peak-to-peak swing is

This represents one half-cycle of the output wave. To go from +6.5 V to -6.5 V and back will require 660 π s. Therefore, the output frequency is

The resulting frequency of Example 9.2.5 may be adjusted by changing either the 33 k Ξ© resistor or the 10 nF capacitor. Changing the comparator’s resistors can alter the thresholds, and thus alter the frequency, but this is generally not recommended, as a change in output amplitude will occur as well. By combining steps, the above process may be reduced to a single equation:

(9.2.26)

where πππ is the difference between ππ’πππππ‘βπππ and ππππ€πππ‘βπππ . Note that if π 3 is 4 times larger than π 2 in the comparator, Equation 9.2.26 reduces to

and the peak triangle wave amplitude is one-fourth of ππ ππ‘ .

Generally, circuits such as this are used for lower frequency work. For clean square waves, very fast op amps are required. Finally, for lower impedance loads, the outputs should be buffered with voltage followers.

## Computer Simulation

The Multisim simulation for the signal generator of Example 9.2.5 is shown in Figure 9.2.22 . The square and triangle outputs are plotted together so that the switching action can be seen. Note how each wave is derived form the other. The output plot is delayed 5 milliseconds in order to guarantee a plot of the steady state output. Failure to delay the plotting times will result in a graph of the initial turn-on transients. It may take many milliseconds before the waveforms finally stabilize, depending on the desired frequency of oscillation and the initial circuit conditions. Finally, note the sharp rising and falling edges of the square wave. This is due to the moderately fast slew rate of the LF411 op amp chosen. Had a slower device such as the 741 been used, the quality of the output waveforms would have suffered.

If an accurate triangle wave is not needed, and only a square wave is required, the circuit of Figure 9.2.19 may be reduced to a single op amp stage. This is shown in Figure 9.2.23 . This circuit is, in essence, a comparator. Resistors π 1 and π 2 form the positive feedback portion and set the effective comparator trip point, or threshold. The measurement signal is the voltage across the capacitor. The potentials of interest are shown in Figure 9.2.24 . If the output is at positive saturation, the noninverting input will see a percentage of this, depending on the voltage divider produced by π 1 and π 2 . This potential is ππ’πππππ‘βπππ . Because the output is at positive saturation, the capacitor πΆ , will be charging towards it. Because it is charging through resistor π , the waveform is an exponential type. Once the capacitor voltage reaches ππ’πππππ‘βπππ , the noninverting input will no longer be greater than the inverting input, and the device will change to the negative state. At this point, πΆ will reverse its course and move towards negative saturation. At the lower threshold, the op amp will again change state, and the process repeats. In order to determine the frequency of oscillation, we need to find how long it takes the capacitor to charge between the two threshold points. Normally the circuit will be powered from equal magnitude supplies, and therefore +ππ ππ‘=βππ ππ‘ and ππ’πππππ‘βπππ =ππππ€πππ‘βπππ . By inspection,

(9.2.27)

The capacitor voltage is

(9.2.28)

where ππ is the total potential applied to the capacitor. Because the capacitor will start at one threshold and attempt to charge to the opposite saturation limit, this is

(9.2.29)

Combining Equation 9.2.27 , Equation 9.2.28 , and Equation 9.2.29 yields

(9.2.30)

At the point where the comparator changes state,

(9.2.31)

Combining Equation 9.2.30 and Equation 9.2.31 produces

[1β\epsilon^{\frac{βt}{RC}} = \frac{2 V_{thres}}{V_{sat} + V_{thres}} \]

[1β\epsilon^{\frac{βt}{RC}} = \frac{2 V_{sat} \frac{R_1}{R_1+ R_2}}{V_{sat}\left( 1+ \frac{R_1}{R_1+ R_2} \right)} \]

[1β\epsilon^{\frac{βt}{RC}} = \frac{2 R_1}{2 R_1+R_2} \]

[\epsilon^{\frac{βt}{RC}} = \frac{R_2}{2 R_1+R_2} \]

[\frac{βt}{RC} = \ln \left( \frac{R_2}{2 R_1+R_2} \right) \]

[t = RC \ln \left( \frac{2 R_1+ R_2}{R_2} \right) \]

This represents the charge time of the capacitor. One period requires two such traverses, so we may say

(9.2.32)

We can transform Equation 9.2.32 into βnicerβ forms by choosing values for π 1 and π 2 such that the log term turns into a convenient number, such as 1 or 0.5. For example, if we set π 1=0.859π 2 , the log term is unity, and consequently Equation 9.2.32 becomes ππ=1/2π πΆ

Example 9.2.6

Design a 2 kHz square wave generator using the circuit of Figure 9.2.23 . For convenience, set π 1=0.859π 2 . If π 1 is arbitrarily set to 10 k Ξ© , then

In order to set the oscillation frequency, π is arbitrarily set to 10 k Ξ© , and πΆ is then determined.

## Computer Simulation

A simulation of the square wave generator of Example 9.2.6 is shown in Figure 9.2.25 . In order to graphically illustrate the importance of the op amp having sufficient bandwidth and slew rate, the simulation is run twice, once using the moderately fast LF411 and a second time using the much slower 741.

Both the output and capacitor voltages are plotted from the Transient Analysis. Using the LF411, the output waveform is very crisp with sharp rising and falling edges. The capacitor voltage appears exactly as it should. The resulting frequency is just a little lower than the 2 kHz target. In contrast, the 741 plots show some problems. First, the square wave has noticeable slew rate limiting on the transitions. Second, due to the slewing problems, the capacitor voltage waveshape appears distorted (note the excessive rounding of the peaks). These effects combine to produce a frequency about 15 percent lower than the target, or about 1.7 kHz. The end result is a lackluster output waveform.