Circuits that do a job, and the range they do it over

The gain that is exactly one

An oscillator is designed by making the loop gain one at the frequency where the phase is zero. The gain at which this circuit's poles reach the imaginary axis is 3.000000000000, bisected on the netlist — an equality, not a range. A gain three per cent high multiplies the envelope by 1.0987 every cycle and reaches the rails in 61 milliseconds; three per cent low divides it by the same factor. A one per cent resistor cannot hold the condition, and neither can any other component.

Assumes: What is left at crossover · Where the behaviour is written down

Thirteen fields of this collection have measured an element and found the frequency, amplitude or size at which its model stops being true. This one starts on circuits made of several of them at once — an oscillator, a supply, a regulator, a threshold, a bridge — and the question is the same asked of the whole rather than of a part. It is worth saying at the outset that the answer is almost never the worst of the parts. A regulator built from an amplifier that is flat to a megahertz is a voltage source to three kilohertz. A bridge built from four resistors of any accuracy at all is linear only near balance.

This essay is about the first of them, and about a design condition that cannot be met.

The closed-loop poles at a gain of 3.05The locus of the two poles as the amplifier's gain runs from 2.7 to 3.3. It crosses the imaginary axis at a gain of 3.000000 — bisected on the netlist, not quoted — and at 3.05 the real part is 2.500e+2 radians a second, which is an envelope multiplying by 1.17015 every cycle. The crosses are the closed form ω₀(k−3)/2 and they sit on the measured circles.0.9000.9501-0.20000.200real part of the pole, in units of ω₀ (1/RC)imaginary part, in units of ω₀ — the two poles are a conjugate pairthe imaginary axis: neither growing nor decayingk = 3.05 · grows ×1.1701 a cyclesolved, then checkedthe crossing is at k = 3.000000, and it is a point
Fig. 1 The two closed-loop poles of a Wien-bridge oscillator, as the amplifier’s gain runs from 2.7 to 3.3. The locus crosses the imaginary axis at one value of the gain and at no other. The slider is the gain, and the readout is the factor the envelope is multiplied by each cycle at that setting.

What the condition says

The circuit is the standard one: an amplifier with a non-inverting gain of k = 1 + Rf/Rg, and a positive-feedback network from its output back to its non-inverting input made of a resistor and capacitor in series feeding a resistor and capacitor in parallel. That network has a frequency at which its phase shift is zero, and at that frequency it passes exactly one third of what is put into it. Both of those are exact statements about the network, and neither of them depends on the amplifier.

So the loop gain at the zero-phase frequency is k/3, and the condition an oscillator is designed to meet is that this number equals one. That is the Barkhausen condition, and every textbook states it in the form it is stated in here: unity loop gain, zero phase.

The frequency comes out as

f0=12πRCf_0 = \frac{1}{2\pi RC}

which for the 10 kΩ and 10 nF used throughout this field is 1591.5 Hz.

The interesting quantity is not that frequency. It is the gain.

Where the poles are, and where they cross

The site’s usual route is available here without any new machinery. transferFunction recovers the characteristic polynomial by sampling the determinant on a circle and rooting it, so the closed-loop poles come out of the netlist rather than out of an algebraic rearrangement. Sweeping k and asking for them at each value gives the locus in the figure above.

Two poles, a conjugate pair, moving to the right as the gain rises. They reach the imaginary axis at a gain the bisection returns as 3.000000000000, which is not a coincidence and not an approximation. The characteristic equation of the ideal circuit is

s2+3kRCs+1(RC)2=0s^2 + \frac{3-k}{RC}s + \frac{1}{(RC)^2} = 0

so the real part of the pole is ω0(k3)/2\omega_0(k-3)/2 exactly and the imaginary part is ω01((k3)/2)2\omega_0\sqrt{1-((k-3)/2)^2}. Both closed forms are returned beside the measured pair in the figure — drawn as crosses on the measured circles — and neither is used to produce it. They agree to better than a part in 10910^9 at every gain on the slider.

At k = 3 itself the measured real part is 2.5×10132.5\times10^{-13} radians a second against an ω0\omega_0 of 10410^4, which is seventeen decimal places of zero. The arithmetic has no complaint about the condition. The circuit is another matter.

Two poles at ζ = 0.3, recovered from the matrix. The poles are at -477.5 ± j1518 hertz. Their distance from the origin is the natural frequency to six digits; the cosine of their angle from the negative real axis is the damping ratio. The step response beside them follows.
Fig. 2 The same object in the field that owns it. A conjugate pair recovered from the matrix, with the distance from the origin the natural frequency and the angle the damping. An oscillator is that picture with the pair pushed onto the vertical axis, where the damping is zero and the natural frequency is all there is.

Why an equality is not a specification

A pole on the imaginary axis is a solution that neither grows nor decays. It is the only condition under which a linear circuit sustains an oscillation of constant amplitude, and it holds on a set of gains containing exactly one point.

Every other boundary this collection has drawn has a safe side. An amplifier is one per cent low above 1.4 kHz, so stay below it. A small-signal model is one per cent optimistic above 7.3 mV, so drive it less. Even the volt-second boundary in the magnetics field, which cannot be respected by staying below anything, at least names a mechanism to remove.

This one has two unsafe sides and no interior. Either the poles are in the left half plane, in which case whatever starts the circuit dies away and the output is nothing at all, or they are in the right half plane, in which case the amplitude grows without bound until some part of the circuit stops behaving as it was modelled. There is no third case, and the width of the third case is zero.

How fast either failure arrives

The rate is worth having in numbers, because “unstable” and “damped” are qualitative words for something quantitative. The envelope is multiplied each cycle by

exp ⁣(2πσωd)\exp\!\left(\frac{2\pi\sigma}{\omega_d}\right)

and with σ=ω0(k3)/2\sigma = \omega_0(k-3)/2 and ωdω0\omega_d \approx \omega_0 that is very nearly eπ(k3)e^{\pi(k-3)}.

gain per cycle to a factor of 10⁴
3% high ×1.0987 98 cycles, 61 ms
0.3% high ×1.0095 977 cycles, 614 ms
3% low ÷1.0987 98 cycles, 61 ms

The gate holds two things about that table. The first is the arithmetic: a gain one per cent either side of three gives a factor of about nine per cent of envelope per cycle. The second is that the two directions are reciprocal to within a per cent — the growth at 3.03 times the decay at 2.97 is 1.0000 — so neither side of the condition is the forgiving one. A designer who aims slightly low gets silence and a designer who aims slightly high gets the rails, and both get there in about sixty milliseconds.

Sixty milliseconds is the number that makes this a real problem rather than a philosophical one. It is not a slow drift that a trimmer could chase; it is over before anybody has seen it.

A second-order step at ζ = 0.3. Overshoot measured off the curve is 37.2%, and it settles inside 2% after 1.12 ms. Inverting the standard relation on that overshoot returns a damping ratio of 0.300 against the 0.3 the components were built for.
Fig. 3 The transient field’s picture of the same quantity. A damping ratio of 0.3 rings and settles; the family it belongs to reaches this circuit at ζ = 0, where the ringing neither settles nor grows. Every step response in that field is a pole pair to the left of the axis, and an oscillator is what happens when the design asks for the pair to be on it.

What a real resistor delivers

The gain is set by two resistors, and it is worth asking what an ordinary pair of them can deliver.

A one per cent resistor pair sets k = 1 + Rf/Rg to about ±1.4% in the worst case, which puts the loop gain between 0.986 and 1.014 and the envelope between ÷1.045 and ×1.045 per cycle. A tenth of a per cent pair, which is a specialist part, still gives ±0.14% and ×1.0044 per cycle — a factor of ten thousand in about two thousand cycles, or 1.4 seconds.

There is no resistor tolerance on any manufacturer’s list that makes this circuit work. Nor would a tighter one help, because the amplifier’s own gain, the resistors’ temperature coefficients and their ageing all move the same number. A one part per million per kelvin difference between the two resistors, over ten kelvin, is a hundredth of a per cent of gain, and a hundredth of a per cent of gain is a factor of a thousand in three thousand cycles.

Two of those three sentences are usually where a designer would look for relief, and the collection has measured both. The tolerance that is not on any part separates the worst case from the spread: four one per cent resistors have a worst case of one per cent that does not improve however many parts are added, and a measured population spread of 0.29 of a per cent that shrinks as one over the root of the count. Neither number helps here, and the reason is worth stating because it is the one place this essay’s boundary differs in kind from a tolerance problem. A spread is useful when the specification is a band, since most units land inside it. The specification here is a point, and no unit lands on a point — so the fraction of units that oscillate at constant amplitude is zero for every tolerance in the catalogue, not merely small for the loose ones.

The temperature term is the other half, and the edges that move with the room is the collection’s account of what it does to a boundary generally: every number in this collection is quoted at one temperature, most of them are functions of it, and the condition attached to them is usually left off. A gain condition is unusual in that the temperature enters through a difference of two coefficients rather than through a coefficient, so a pair of resistors from one batch on one substrate is far better than the individual specification suggests — which is the same argument what matching does about temperature makes about a transistor pair, where the residual after matching is exact and drifts at 3 333 parts per million per kelvin because it is proportional to absolute temperature. Matching turns the problem from a tolerance into a smaller tolerance. It does not turn a point into a band.

The instruments field has a figure about a component tolerance too tight to buy, and it is worth looking at beside this one because it is the easy version of the same problem.

The closed-loop poles at a gain of 2.95. The locus of the two poles as the amplifier's gain runs from 2.7 to 3.3. It crosses the imaginary axis at a gain of 3.000000 — bisected on the netlist, not quoted — and at 2.95 the real part is -2.500e+2 radians a second, which is an envelope multiplying by 0.85459 every cycle. The crosses are the closed form ω₀(k−3)/2 and they sit on the measured circles.
Fig. 4 A gain of 2.95, below the condition. The pole pair sits at σ = −2.500×10² rad/s and the envelope shrinks by 0.85459 a cycle — a real resistor delivers a gain that is not exactly three, and what a gain slightly below the condition delivers is not a small oscillation but no oscillation at all.

The condition is a statement about a loop

It is worth connecting this to the machinery the feedback field already built, because the two are the same thing looked at from opposite ends.

That field’s subject is a loop designed to be stable, and its measure is how far from instability it is: the phase margin, the gain margin, the distance of the Nyquist locus from the critical point. An oscillator is the same loop with those margins set to zero deliberately.

The closed-loop poles at a gain of 3.00. The locus of the two poles as the amplifier's gain runs from 2.7 to 3.3. It crosses the imaginary axis at a gain of 3.000000 — bisected on the netlist, not quoted — and at 3.00 the real part is -2.524e-13 radians a second, which is an envelope multiplying by 1.00000 every cycle. The crosses are the closed form ω₀(k−3)/2 and they sit on the measured circles.
Fig. 5 Exactly three, which is the condition. The real part is −2.524×10⁻¹³ rad/s — zero to the last bits of a double — and the envelope multiplier is 1.00000. The condition is a statement about a loop and this is what it looks like when it is met exactly: a pole pair on the imaginary axis, which is a set of measure zero and therefore a thing no circuit is ever in.

The middle of the family is the case the condition is written about, and it is worth pausing on because it is the only one of the four that no built circuit occupies.

The closed-loop poles at a gain of 3.20. The locus of the two poles as the amplifier's gain runs from 2.7 to 3.3. It crosses the imaginary axis at a gain of 3.000000 — bisected on the netlist, not quoted — and at 3.20 the real part is 1.000e+3 radians a second, which is an envelope multiplying by 1.88040 every cycle. The crosses are the closed form ω₀(k−3)/2 and they sit on the measured circles.
Fig. 6 Three point two: σ = +1.000×10³ rad/s, ×1.88040 a cycle. The pair has crossed into the right half plane and the amplitude grows without bound in this model, which is the sense in which “the gain is exactly one” is not a design target — it is a boundary between two behaviours neither of which is an oscillator.
The closed-loop poles at a gain of 3.40. The locus of the two poles as the amplifier's gain runs from 2.7 to 3.3. It crosses the imaginary axis at a gain of 3.000000 — bisected on the netlist, not quoted — and at 3.40 the real part is 2.000e+3 radians a second, which is an envelope multiplying by 3.60582 every cycle. The crosses are the closed form ω₀(k−3)/2 and they sit on the measured circles.
Fig. 7 Three point four: σ = +2.000×10³ rad/s, ×3.60582 a cycle. Across the four gains the real part runs −250, −2.5×10⁻¹³, +1,000 and +2,000 rad/s and the per-cycle multiplier 0.855, 1.000, 1.880 and 3.606. What actually happens in a built oscillator is none of these: a limiter moves the gain to the condition, and where it settles is the subject of the rung above.

The feedback field also carries the case that shows the condition is not a matter of “enough gain” or “too much”.

What actually happens

Nothing in the above says an oscillator cannot be built. Oscillators are among the most common circuits there are, and they work.

What they are not is linear. The circuit that runs is one whose gain is deliberately set above three, so that the poles are in the right half plane and any disturbance grows, together with a mechanism that reduces the gain as the amplitude rises. The amplitude settles where the gain averaged over a cycle has been pulled back to exactly three — not by a resistor holding a ratio, but by a nonlinear element whose effective gain depends on how hard it is driven.

That is the next essay, and it needs machinery this collection did not have: a netlist with a nonlinearity in it, stepped forward in time. The two halves existed separately — a linear network marched by the trapezoidal rule, and a nonlinear network solved by Newton’s method at one instant — and an oscillator is the first circuit here that needs both at once, because its frequency comes from the linear half and its amplitude from the nonlinear half.

The oscillator that has no such condition

This field builds a second oscillator out of entirely different parts, and the comparison is the clearest way to see what the condition above actually costs.

The period a delay lengthens feeds a comparator’s output back through a resistor to the capacitor on its own input. Its frequency is a charging exponential — 2RCln((1+β)/(1β))2RC\ln((1+\beta)/(1-\beta)), exact — and its amplitude is the comparator’s output levels, exactly, with no dynamics at all. The condition for it to oscillate is that the loop gain exceed one, and a comparator’s gain exceeds one by three or four orders of magnitude, so the condition is met by anything. Everything difficult about the Wien bridge is trivial there, and what is difficult there is the period: a comparator that responds fifty nanoseconds late does not add fifty nanoseconds to each half cycle but 4/(1+β)4/(1+\beta) times the delay to the period, 2.65 times rather than 2.

That is the trade this whole essay is about, stated in another circuit. An equality can be met only by a mechanism that holds it; an inequality can be met by margin. The Wien bridge buys a nearly sinusoidal output and pays for it with a condition of measure zero and a nonlinearity to enforce it; the relaxation oscillator buys robustness and pays for it with a waveform that is a triangle and a square and a period set by whatever the comparator’s delay happens to be.

And the threshold that makes the second one work is itself measured rather than assumed. Two thresholds because there is a floor finds that a comparator with one threshold watching a slow signal cross it changes its mind 22.7 times on average, because there is noise under the signal and no threshold is ever crossed once, and that the hysteresis needed to stop it is a multiple of the noise’s own standard deviation — 3.57 of them — and not a voltage. So the second oscillator’s easy condition is bought with a second design quantity that the first one does not have.

Three things this essay does not settle

Which nonlinearity. The choice of amplitude-limiting mechanism is a design decision with consequences all through the rest of the ladder. The amplitude nothing linear predicts settles where two diodes across the feedback resistor stop the growth — 858 millivolts, a number no pole, no transfer function and no bias point contains — and what the limiter charges for prices it, with the amplitude going as the 0.11 power of the excess gain and the distortion as the 0.74, so the same slider that buys purity costs start-up time at a measured exchange rate.

Whether the frequency is 1/2πRC. It is not, and by more than the arithmetic in this essay would suggest. The frequency that is not the formula finds two separate reasons and only one of them can be bought off: with a perfect amplifier the circuit runs 0.771 per cent low because the limiter’s harmonics are part of the waveform whose period is being measured, and with a real one it runs lower still by an amount inversely proportional to the gain–bandwidth product. The two are equal at a ratio of 578, above which a faster amplifier buys nothing.

What starts it. This essay’s figure marches from a millivolt on one capacitor because something has to be there. In a real circuit that something is the Johnson noise of the resistors, and the floor a resistor sets is where the size of it is established: a kilohm at room temperature produces 4.00 nanovolts per root hertz, because it is warm rather than because of anything about how it was made, and it is the first boundary in this collection that bounds a model from below — gain does not help, because gain amplifies it too. A 10 kΩ resistor in a kilohertz of bandwidth is about 400 nanovolts, and an envelope multiplying by 1.0987 a cycle takes 148 cycles to bring that to a volt — 93 milliseconds. An oscillator’s start-up transient is a noise voltage amplified for a tenth of a second, which is a pleasing thing for a collection with a noise field to be able to say.

The same floor bounds the circuit at the other end of its life, and a floor and a ceiling is the essay that measures both at once: 4.00 nanovolts per root hertz at the bottom, one per cent of harmonic distortion at 1.03 millivolts at the top, and 66.3 decibels of range between them in a ten-kilohertz measurement. An oscillator is the one circuit in this collection that starts at the bottom of that range and is designed to end at the top of it, and the whole of this ladder is about what happens in between.

Why the condition is stated anyway

Given all of the above, it is fair to ask why the Barkhausen condition is taught as a design rule when no circuit can be built to satisfy it.

The answer is that it is not a design rule; it is a boundary, and it is the most useful one in this essay. It says exactly where the transition is, which side of it produces growth, and — through the closed form for the pole’s real part — how fast. A design that wants an oscillation puts the gain a controlled distance on the growing side and adds something to bring it back; a design that wants an amplifier puts it a controlled distance on the other side. The condition is what “distance” is measured from.

Read that way it is the same kind of object as everything else here. edge-map puts four of this site’s boundaries on one axis; this one belongs on a different axis, since its variable is a dimensionless gain rather than a frequency, and it is sharper than any of them.

The measurement, stated plainly

The gate holds four claims about this circuit, and between them they are the essay.

The crossing is at three. Bisected on the real part of the dominant pole, computed from the netlist’s own determinant: 3.000000000000.

The measured pole is the closed form, at every gain. Both the real and imaginary parts, over seven gains from 2.8 to 3.3, agreeing to better than a part in 10910^9.

At exactly three the real part is zero to the arithmetic’s floor. 2.5×10132.5\times10^{-13} radians a second on an ω0\omega_0 of 10410^4.

A one per cent error in the gain is nine per cent of envelope a cycle, in either direction, and the two directions are reciprocal to a per cent.

The last one is the essay’s argument in a line. The first three establish that the condition is exact; the fourth establishes that exactness is precisely the problem.

Part 1 on oscillator

One argument about Oscillator, and one of 5 essays on it so far, each part numbered by how much of the idea it assumes. What sits either side of it:

What links here

Essays that reach for this one mid-argument — the half of a link its own author cannot write down, the 8 sharing most with it of 14.

What this makes readable

Essays that name this one as a prerequisite.

The objects named here

The third axis, after the field and the idea: the things themselves, and every essay that touches each one.

Barkhausen criterionComponent toleranceLoop gainPolesStabilityWien bridge