Real Op-Amps: Gain-Bandwidth, Slew Rate and a SPICE Macro-Model
You build a gain-of-100 audio preamp from a cheap op-amp, and it sounds dull: the treble is gone. You lower the gain to 10 and the treble returns, but now a loud passage sounds harsh, and the scope shows sine waves turning into triangles. Both faults are dynamic limits of the op-amp. The first is the gain-bandwidth product: the op-amp's open-loop gain falls with frequency, so the closed-loop bandwidth shrinks as the gain rises. The second is the slew rate: the output cannot change faster than a fixed number of volts per microsecond, whatever the gain. This lesson derives both, shows how to predict settling time, touches on capacitive loads, and builds the op-amp macro-model that the SPICE decks of this course use, one element at a time.
The open-loop response
Inside a general-purpose op-amp a small compensation capacitor creates one dominant low-frequency pole (Stability and Compensation explains why it is put there on purpose):
and give a gain-bandwidth product , also called the unity-gain frequency : the open-loop gain falls to 1 at . Above the gain times the frequency is constant.
Closed-loop bandwidth and the noise gain
Put into the finite-gain formula of The Ideal Op-Amp. With the noise gain :
The closed loop is itself a first-order low-pass; its corner is where the closed-loop line meets the open-loop line in the figure. For a non-inverting amplifier , so gain times bandwidth is the GBW. For an inverting amplifier of gain the noise gain is 11, so , a little less than a gain-10 non-inverting stage. Need gain 100 at ? One stage needs a GBW of at least (and more for low error at ); two cascaded gain-10 stages each have of bandwidth (Multistage Amplifiers).
The step response of the closed loop is an exponential with time constant : settling to 1 % takes , to (needed before a 12-bit ADC samples) .
Slew rate and full-power bandwidth
The compensation capacitor is charged by the input stage, whose current is limited to its tail current . However large the input step, the output can change no faster than
A sine has a maximum slope of . If that exceeds the slew rate, the output becomes a triangle with a lower amplitude. The full-power bandwidth is the highest frequency at which a full-swing sine is undistorted:
Slew rate is a large-signal limit; GBW is a small-signal limit. Check both. A step response is slew-limited at first (a straight ramp at SR), then settles exponentially with the small-signal once the remaining error is small.
Capacitive loads, briefly
The op-amp's open-loop output resistance (tens to hundreds of ohms) and a load capacitance add a second pole at inside the loop. If it falls near the phase margin collapses and the output rings, worst of all in a follower, which has the highest loop gain. The usual fix is a small isolation resistor (tens of ohms) between the output and the capacitive load, with feedback taken before it, or a part specified for "unlimited" capacitive load.
Worked example
Given: an inverting amplifier of gain (, ), op-amp with and , supplies.
Find: , the gain at , the full-power bandwidth for and peak, and the time to settle to after a small step.
Solve:
Check: a peak sine at is inside the small-signal bandwidth but above , so it would be slew-limited: small-signal and large-signal limits are different questions.
In Python: bandwidth, slew and settling
import numpy as np
GBW, SR = 1e6, 0.5e6 # Hz, V/s
for ng in [1, 2, 11, 101]:
fcl = GBW / ng
tau = 1 / (2 * np.pi * fcl)
print(f"noise gain {ng:4d}: f_CL = {fcl/1e3:7.1f} kHz, tau = {tau*1e6:6.2f} us,"
f" 0.01 % settling {9.21*tau*1e6:6.1f} us")
for vp in [1, 5, 10]:
print(f"full-power bandwidth at {vp:2d} V peak: {SR/(2*np.pi*vp)/1e3:6.2f} kHz")
# a 10 V output step of a gain-10 (non-inverting) stage: slew, then exponential
tau = 1 / (2 * np.pi * GBW / 10)
v_lin = SR * tau # error at which the exponential slope equals SR
t_slew = (10 - v_lin) / SR
t_exp = tau * np.log(v_lin / 0.01)
print(f"step 0 -> 10 V: slew {t_slew*1e6:.1f} us, then {t_exp*1e6:.1f} us"
f" to 0.1 %: about {(t_slew + t_exp)*1e6:.1f} us")noise gain 1: f_CL = 1000.0 kHz, tau = 0.16 us, 0.01 % settling 1.5 us
noise gain 2: f_CL = 500.0 kHz, tau = 0.32 us, 0.01 % settling 2.9 us
noise gain 11: f_CL = 90.9 kHz, tau = 1.75 us, 0.01 % settling 16.1 us
noise gain 101: f_CL = 9.9 kHz, tau = 16.07 us, 0.01 % settling 148.0 us
full-power bandwidth at 1 V peak: 79.58 kHz
full-power bandwidth at 5 V peak: 15.92 kHz
full-power bandwidth at 10 V peak: 7.96 kHz
step 0 -> 10 V: slew 18.4 us, then 7.0 us to 0.1 %: about 25.4 us
Building the macro-model
The SPICE decks in this course use a macro-model: a few ideal elements that reproduce the op-amp's behaviour at the terminals, without its transistors. It runs fast and every parameter is visible.
- Gain.
G1 0 n1 inp inn 1mis a voltage-controlled current source: it pushes into noden1. WithR1 n1 0 100megthe DC gain is . - Dominant pole.
C1 n1 0 159.2pacross gives , so . Note that GBW depends only on and , like the real op-amp's . - Output.
E1 out 0 n1 0 1copiesn1to the output with zero output resistance, so loads do not disturb the pole. - Slew rate. Replace the linear
G1by a table that saturates:G1 0 n1 TABLE {v(inp,inn)} = (-79.6m,-79.6u) (79.6m,79.6u). The current into can never exceed , so ; for small inputs the slope is still . - Output swing.
E1 out 0 TABLE {v(n1)} = (-11,-11) (11,11)clamps the output at , the swing of a classic op-amp on . (Noden1itself is not clamped, so this simple model recovers from overload more slowly than a real part.) - DC errors go outside or inside the subcircuit as sources: a series
Vosin theinplead and current sources from each input to ground for the bias currents, as in Real Op-Amps: DC Errors.
Vendor macro-models add input capacitance, a second pole, noise sources and supply currents, but the structure is the same.
SPICE: the gain-10 amplifier, small and large signal
The first deck sweeps a non-inverting gain-10 stage with the linear model OA; the second applies a input step (a output step) to the model with slew limit and clamps, OAS. Both subcircuits go into one library file.
cat > oa.lib <<'EOF'
* op-amp macro-models written for this course
* OA: A0 = 1e5 (G1 * R1), dominant pole 10 Hz (R1 C1), GBW = 1 MHz, ideal output (E1)
.subckt OA inp inn out
G1 0 n1 inp inn 1m
R1 n1 0 100meg
C1 n1 0 159.2p
E1 out 0 n1 0 1
.ends
* OAS: the same plus a slew limit (G1 current capped at 79.6 uA -> 0.5 V/us)
* and an output clamped at +/-11 V
.subckt OAS inp inn out
G1 0 n1 TABLE {v(inp,inn)} = (-79.6m,-79.6u) (79.6m,79.6u)
R1 n1 0 100meg
C1 n1 0 159.2p
E1 out 0 TABLE {v(n1)} = (-11,-11) (11,11)
.ends
EOF
cat > ac.cir <<'EOF'
* non-inverting gain 10: AC sweep
.include oa.lib
Vin in 0 AC 1
X1 in n out OA
R1 n 0 10k
Rf out n 90k
.control
ac dec 50 10 10meg
meas ac g0 find vdb(out) at=100
meas ac f3db when vdb(out)=16.99 fall=1
meas ac g1m find vdb(out) at=1meg
.endc
.end
EOF
ngspice -b ac.cir 2>&1 | grep -E '^(g0|f3db|g1m)'
cat > sr.cir <<'EOF'
* non-inverting gain 10: 1 V input step, slew-limited op-amp
.include oa.lib
Vin in 0 PULSE(0 1 1u 1n 1n 50u 100u)
X1 in n out OAS
R1 n 0 10k
Rf out n 90k
.control
tran 0.02u 40u
meas tran t10 when v(out)=1 rise=1
meas tran t90 when v(out)=9 rise=1
let sr = 8/(t90-t10)/1e6
print sr
meas tran t01 when v(out)=9.99 rise=1
.endc
.end
EOF
ngspice -b sr.cir 2>&1 | grep -E '^(t10|t90|sr|t01)'g0 = 1.999913e+01
f3db = 9.995478e+04
g1m = -4.565663e-02
t10 = 3.000165e-06
t90 = 1.901974e-05
sr = 4.993890e-01
t01 = 2.932349e-05
The AC sweep gives at and a corner at , the the noise gain of 10 predicts; at the gain is , on the open-loop line. The step rises from 10 % to 90 % at , the slew rate, and reaches (0.1 %) after the step: a little longer than the Python estimate, because the real hand-over from slewing to linear settling is gradual.
Interactive: small-signal and slew limits together
The ee-op-amp lab integrates a single-pole op-amp with a symmetric slew limit and hard clipping. Set it up as the gain-10 non-inverting stage at with peak in:
The lab shows and a small-signal gain of , but the output would need against : the status reads "slew-rate limited" and the output is a triangle of only peak. Lower to : the output becomes a sine of peak, limited only by the falling gain. Raise SR to to fix the original signal, or GBW to see move.
Guided lab: measure GBW and slew rate
Hand calculation. Non-inverting gain 11 (, ) with a op-amp: . A square into a follower: the edges are ramps of slope SR; with the middle 80 % () takes .
Simulation. The decks above (change OA's C1 and OAS's table to match your op-amp's datasheet GBW and SR) and the lab.
What you would measure. General-purpose op-amp on a current-limited supply ( limit) with decoupling at the pins. GBW: drive peak (small, to avoid slewing) and sweep the generator until the output falls to of its low-frequency value; . Expect the datasheet typical value (GBW is not tightly controlled). SR: set the op-amp as a follower, drive a square of , and measure the slope of the output edges with scope cursors over the middle 80 %; compare rising and falling edges, which often differ. Use a 10× probe; a 1× probe's capacitance can make the follower ring.
Hazards and safe setup. current-limited; inputs within the rails; supply on before the generator.
Pitfalls
- Computing bandwidth from the signal gain of an inverting amplifier. Use the noise gain .
- Checking only GBW. A circuit inside its bandwidth can still be slew-limited at large amplitude.
- Expecting the full-power bandwidth to be a point. It is where a full-swing sine starts to distort.
- Driving cables or large capacitors directly from a follower. Add an isolation resistor.
- Trusting a macro-model outside its scope. This one has no input capacitance, noise or supply current, and its overload recovery is not realistic.
Practice
- An op-amp has . What is the bandwidth of an inverting amplifier with gain ?
- A DAC buffer must deliver a peak sine at . What slew rate is needed, with a factor 2 of margin?
- How long does a follower with need to settle to after a small step?
Answer
- Noise gain ; .
- ; with margin about .
- ; .
Test yourself
An op-amp with is used in a non-inverting amplifier with gain 20. Its closed-loop bandwidth is about…
The slew rate of an internally compensated op-amp is set mainly by…
- the supply voltage
- the input stage's maximum current charging the compensation capacitor
- the feedback resistors
- the load resistance
With , the full-power bandwidth for a peak output is about…
In the macro-model, what sets the gain-bandwidth product?
- alone
- and :
- the output source E1
- the clamp table