Oscillators: Barkhausen, Wien Bridge and Phase Shift
Every amplifier in this course so far was designed not to oscillate: Stability and Frequency Compensation was about keeping the loop away from . An oscillator does the opposite on purpose. It is an amplifier whose output is fed back to its input through a network that selects one frequency, with just enough gain that the signal at that frequency sustains itself. Audio test generators, the reference tone in a sensor bridge and the excitation for an LVDT are all built this way. This lesson covers the condition for oscillation, the two classic RC oscillators (Wien bridge and phase shift), and the part that textbooks rush and real designs live or die by: controlling the amplitude.
The loop picture
Cut the loop anywhere, inject a sinusoid, and follow it round: it comes back multiplied by the loop gain . With positive feedback the returned signal adds to what is there, so a sinusoid sustains itself at a frequency where
This is the Barkhausen criterion. It is the same condition as the closed-loop pole sitting exactly on the axis (Transfer Functions, Poles, Zeros and Stability): with slightly above 1 the poles move into the right half-plane and the amplitude grows as ; slightly below 1 it dies away.
Necessary, not sufficient. Barkhausen describes the steady state. A practical oscillator also needs:
- Start-up gain margin. Component tolerances and temperature move by a few percent, so design for to at switch-on. Exactly 1 on paper means "may not start" on the bench.
- An amplitude-limiting mechanism that pulls the effective loop gain back to exactly 1 at some amplitude. Without one, the signal grows until the op-amp clips at its rails, and the "sine" becomes a flattened wave with several percent distortion.
- A single frequency where the phase condition holds with . If the loop also satisfies it elsewhere (a parasitic pole in the amplifier, for example), the circuit may lock onto the wrong one.
Noise is the "input": thermal noise (Noise in Analog Circuits) and the switch-on transient contain every frequency, and the loop amplifies the one it selects.
The Wien-bridge oscillator
The Wien network is a series RC followed by a parallel RC. At low frequency the series capacitor blocks; at high frequency the shunt capacitor shorts the output. In between, at , its output is in phase with its input and exactly one third as large:
So a non-inverting amplifier (The Ideal Op-Amp) with gain satisfies Barkhausen, and the Wien network drives its input.
Amplitude control
Gain exactly 3 cannot be built, so the circuit above sets the small-signal gain above 3 and lets a nonlinearity pull it down as the amplitude grows:
- Diodes across part of (shown). At small amplitude the diodes are off and : the oscillation starts. As the swing grows, the voltage across approaches a diode drop and the diodes conduct for part of each cycle, shunting . The gain averaged over a cycle falls towards , and the amplitude settles where it is exactly 3. Cheap and robust; distortion of about 1 to 3 %, because the gain changes within each cycle.
- A thermistor or a small lamp. A lamp in place of (or an NTC thermistor in place of ) changes resistance with the rms current, averaged over many cycles, so the gain is constant within a cycle. Hewlett's HP 200A (1939), the first commercial Wien audio oscillator, used a lamp this way and was specified below about 1 % distortion; careful modern lamp- or AGC-stabilised designs reach 0.01 % or less. The price is slow settling ("bounce") after a frequency change.
- A JFET or an automatic gain control loop. Rectify the output, compare it with a reference, and use the error to set a JFET's channel resistance in the gain network (MOSFET and JFET). The amplitude becomes as accurate as the reference.
The RC phase-shift oscillator
Three RC sections in a ladder give of phase shift at one frequency; an inverting amplifier adds the other . For three equal sections of series and shunt , driven from a low impedance and lightly loaded,
The large attenuation (each section loads the one before it) means a high amplifier gain and more sensitivity to tolerances, so the phase-shift oscillator is used where cost matters more than purity, for example a simple tone or a lamp-flasher-style test signal.
Worked example
Given: a Wien-bridge oscillator with , , , , bridged by two antiparallel silicon diodes; op-amp on .
Find: the frequency, the start-up loop gain, and the loop gain once the diodes conduct fully.
Solve:
Check: the start-up gain is 27 % above 1, enough margin for 5 % parts; the fully limited gain is below 1, so an amplitude exists in between where the average is exactly 1. The two values bracket 1, which is the design rule for any limiting scheme.
In Python: the two feedback networks
import numpy as np
from scipy.optimize import brentq
R, C = 10e3, 16e-9
f0 = 1 / (2 * np.pi * R * C)
def wien_beta(f):
x = 2 * np.pi * f * R * C
return 1 / (3 + 1j * (x - 1 / x))
print(f"Wien: f0 = {f0:.1f} Hz")
for f in [0.5 * f0, f0, 2 * f0]:
b = wien_beta(f)
print(f" f = {f:7.1f} Hz |beta| = {abs(b):.4f} phase = {np.degrees(np.angle(b)):6.1f} deg")
# Phase-shift ladder: three C-series / R-shunt sections, ideal source in, open circuit out
def ladder(f):
Zc = 1 / (2j * np.pi * f * C)
M = np.eye(2, dtype=complex)
for _ in range(3):
M = M @ np.array([[1, Zc], [0, 1]]) @ np.array([[1, 0], [1 / R, 1]])
return 1 / M[0, 0] # Vout/Vin with the output open
f180 = brentq(lambda f: ladder(f).imag, 100, 2000)
print(f"Phase shift: f180 = {f180:.1f} Hz (formula {1 / (2 * np.pi * np.sqrt(6) * R * C):.1f} Hz)")
print(f" ladder gain = {ladder(f180).real:.5f} -> amplifier gain needed = {-1 / ladder(f180).real:.2f}")Wien: f0 = 994.7 Hz
f = 497.4 Hz |beta| = 0.2981 phase = 26.6 deg
f = 994.7 Hz |beta| = 0.3333 phase = 0.0 deg
f = 1989.4 Hz |beta| = 0.2981 phase = -26.6 deg
Phase shift: f180 = 406.1 Hz (formula 406.1 Hz)
ladder gain = -0.03448 -> amplifier gain needed = 29.00
The ladder is built from ABCD matrices, and brentq finds the frequency where its gain is purely real (negative). Both textbook numbers, and , come out of the numerics. The Wien phase is only an octave away, so the network is not very selective: the amplitude limiter, not the network, sets the distortion.
Interactive: the Wien network alone
This lab is the Wien network driven by a source standing in for the op-amp output (the op-amp itself is not in the netlist: the loop is open). Sweep the frequency and watch peak and pass through .
At the lab shows at : . Move away from and the peak value and the zero-phase frequency both shift: with unequal parts the required gain is no longer 3, which is why matched pairs (or a dual-gang potentiometer for a tunable oscillator) are used.
Cross-check with SPICE: watching it start
The op-amp is the course macro-model (a transconductance into , so and ), with its output limited to by an E-source table to stand for the rails. A initial charge on the series capacitor plays the part of noise. meas finds the time to reach , the frequency from ten cycles, and the settled peaks.
cat > wien.cir <<'EOF'
* Wien-bridge oscillator, R = 10k, C = 16n, diode amplitude control
.model DSIG D(Is=2.52n N=1.752 Rs=0.568 Cjo=4p M=0.4 Tt=20n BV=100 IBV=0.1u)
.subckt OA inp inn out
G1 0 n1 inp inn 1m
R1 n1 0 100meg
C1 n1 0 159.2p
E1 out 0 TABLE {v(n1)} = (-12,-12) (12,12)
.ends
X1 p n out OA
* frequency-selective (positive) feedback
R1 out a 10k
C1 a p 16n IC=0.01
R2 p 0 10k
C2 p 0 16n
* gain-setting (negative) feedback: 1 + (18k + 10k)/10k = 3.8 at small amplitude
Rg n 0 10k
Rf1 out m 18k
Rf2 m n 10k
D1 m n DSIG
D2 n m DSIG
.control
tran 2u 40m uic
meas tran tstart when v(out)=1 rise=1
meas tran t1 when v(out)=0 rise=20
meas tran t2 when v(out)=0 rise=30
let f = 10/(t2 - t1)
print f
meas tran vmax max v(out) from=30m to=40m
meas tran vmin min v(out) from=30m to=40m
.endc
.end
EOF
ngspice -b wien.cir 2>&1 | grep -E '^(f|vmax|vmin|tstart) +='tstart = 1.716386e-03
f = 9.878524e+02
vmax = 9.539861e+00 at= 3.428550e-02
vmin = -9.539860e+00 at= 3.377950e-02
The oscillation reaches after and settles at , well inside the rails: the diodes, not clipping, set the amplitude. The frequency is , 0.7 % below the ideal , because the op-amp's finite gain-bandwidth adds a little phase lag that the network must cancel slightly below . Change Rf1 to 15k (fully limited gain ) and the amplitude drops; change it to 22k and the limited gain can no longer hold the signal, which then grows into the rails.
Guided lab: build a 1 kHz Wien oscillator
Hand calculation. , start-up loop gain 1.27, limited gain 0.93.
Simulation. The Python table, the network lab and the SPICE start-up above.
What you would measure. Build it with a general-purpose op-amp on a current-limited bench supply (limit about per rail), 1 % resistors, two film capacitors and two 1N4148-class diodes. Watch the output on a scope: it should start within a few milliseconds and settle to roughly to (the exact value depends on the diodes' forward voltage and temperature). Expect within about of with 5 % capacitors, if you measure and match them. The scope's FFT should show the third harmonic about 30 dB below the fundamental (around 3 % distortion, compare the SPICE waveform); swapping the diodes for a small lamp in place of lowers it markedly.
Hazards and safe setup. Low voltage only; current-limit both rails and switch them on together. Never "test" an oscillator by touching high-impedance nodes: your body adds capacitance and hum, and the lesson you learn is misleading rather than dangerous. Electrolytic capacitors are unsuitable in the network (polarised, leaky, wide tolerance).
Pitfalls
- Designing for exactly. It will not start reliably, or it will stop when the room warms up.
- No limiter. The amplitude grows into the rails; the result is a clipped wave with poor distortion and a frequency that drifts with the supply.
- Ignoring the amplifier's bandwidth. At high frequencies the op-amp's own phase lag shifts and can stop oscillation; keep below about for a well-behaved Wien oscillator, or check in simulation.
- Loading the network. A low-impedance load on node or a heavy load on the output changes . Buffer the output if the next stage is not a high impedance.
Practice
- Choose for a 10 kHz Wien oscillator with .
- A phase-shift oscillator uses , . What frequency, and what inverting gain?
- Why does a lamp give lower distortion than diodes in the Wien gain network?
Answer
- ; use for .
- , gain (in practice about to for start-up margin).
- The lamp's resistance follows the rms current with a thermal time constant much longer than one cycle, so the gain is constant within each cycle and the waveform is not bent; diodes change the gain during each cycle.
Test yourself
The Barkhausen criterion for a sustained oscillation at is…
- : unit magnitude and zero (or ) phase
- with negative feedback
A Wien network with and has, at its centre frequency, a gain of…
- at
- at
- at
- at
Why is the Wien amplifier's small-signal gain set to about 3.8 instead of exactly 3?
- To raise the frequency
- To guarantee start-up despite tolerances; a limiter then reduces the effective gain to 3
- Because the op-amp needs gain 3.8 to be stable
- To lower the distortion
A three-section RC phase-shift oscillator needs an amplifier with a gain of about…