TExcelTAD
Home › Analog Electronics: Diodes, Transistors & Op-Amps › Real Op-Amps: Gain-Bandwidth, Slew Rate and a SPICE Macro-Model

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):

A(jf)=A01+jf/fp,∣A∣≈A0fpf=GBWf(f≫fp)A(j f) = \frac{A_0}{1 + j f/f_p}, \qquad \lvert A \rvert \approx \frac{A_0 f_p}{f} = \frac{\text{GBW}}{f} \quad (f \gg f_p)

A0=105A_0 = 10^5 and fp=10 Hzf_p = 10\ \text{Hz} give a gain-bandwidth product GBW=A0fp=1 MHz\text{GBW} = A_0 f_p = 1\ \text{MHz}, also called the unity-gain frequency fTf_T: the open-loop gain falls to 1 at 1 MHz1\ \text{MHz}. Above fpf_p the gain times the frequency is constant.

-20 0 20 40 60 80 100 1 10 100 1k 10k 100k 1M 10M f (Hz) |A| (dB) open loop A(f) noise gain 100: f_CL = 10 kHz noise gain 10: f_CL = 100 kHz follower: f_CL = 1 MHz GBW = 1 MHz

Closed-loop bandwidth and the noise gain

Put A(jf)A(jf) into the finite-gain formula of The Ideal Op-Amp. With the noise gain 1/β=1+Rf/R11/\beta = 1 + R_f/R_1:

G(jf)=G01+jf/fCL,fCL=GBW1/β=GBW1+Rf/R1G(jf) = \frac{G_0}{1 + j f/f_\text{CL}}, \qquad f_\text{CL} = \frac{\text{GBW}}{1/\beta} = \frac{\text{GBW}}{1 + R_f/R_1}

The closed loop is itself a first-order low-pass; its −3 dB-3\ \text{dB} corner is where the closed-loop line meets the open-loop line in the figure. For a non-inverting amplifier G0=1/βG_0 = 1/\beta, so gain times bandwidth is the GBW. For an inverting amplifier of gain −10-10 the noise gain is 11, so fCL=1 MHz/11=90.9 kHzf_\text{CL} = 1\ \text{MHz}/11 = 90.9\ \text{kHz}, a little less than a gain-10 non-inverting stage. Need gain 100 at 50 kHz50\ \text{kHz}? One stage needs a GBW of at least 5 MHz5\ \text{MHz} (and more for low error at 50 kHz50\ \text{kHz}); two cascaded gain-10 stages each have 100 kHz100\ \text{kHz} of bandwidth (Multistage Amplifiers).

The step response of the closed loop is an exponential with time constant τ=1/(2πfCL)\tau = 1/(2\pi f_\text{CL}): settling to 1 % takes 4.6τ4.6\tau, to 0.01 %0.01\ \% (needed before a 12-bit ADC samples) 9.2τ9.2\tau.

Slew rate and full-power bandwidth

The compensation capacitor CcC_c is charged by the input stage, whose current is limited to its tail current ItailI_\text{tail}. However large the input step, the output can change no faster than

SR=ItailCc,typically 0.3 to 20 V/μs\text{SR} = \frac{I_\text{tail}}{C_c}, \qquad \text{typically } 0.3 \text{ to } 20\ \text{V}/\mu\text{s}

A sine Vpsin⁡2πftV_p \sin 2\pi f t has a maximum slope of 2πfVp2\pi f V_p. 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:

fFPBW=SR2πVpf_\text{FPBW} = \frac{\text{SR}}{2\pi V_p}

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 τ\tau once the remaining error is small.

Capacitive loads, briefly

The op-amp's open-loop output resistance ror_o (tens to hundreds of ohms) and a load capacitance CLC_L add a second pole at 1/(2πroCL)1/(2\pi r_o C_L) inside the loop. If it falls near fCLf_\text{CL} 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 −10-10 (R1=10 kΩR_1 = 10\ \text{k}\Omega, Rf=100 kΩR_f = 100\ \text{k}\Omega), op-amp with GBW=1 MHz\text{GBW} = 1\ \text{MHz} and SR=0.5 V/μs\text{SR} = 0.5\ \text{V}/\mu\text{s}, ±12 V\pm 12\ \text{V} supplies.

Find: fCLf_\text{CL}, the gain at 50 kHz50\ \text{kHz}, the full-power bandwidth for 5 V5\ \text{V} and 10 V10\ \text{V} peak, and the time to settle to 0.1 %0.1\ \% after a small step.

Solve:

fCL=1 MHz11=90.9 kHz,∣G(50 kHz)∣=101+(50/90.9)2=8.76fFPBW=0.5 V/μs2π⋅5 V=15.9 kHz,0.5 V/μs2π⋅10 V=7.96 kHzτ=12π⋅90.9 kHz=1.75 μs,t0.1 %=τln⁡1000=6.9τ=12.1 μs\begin{aligned} f_\text{CL} &= \frac{1\ \text{MHz}}{11} = 90.9\ \text{kHz}, \qquad \lvert G(50\ \text{kHz}) \rvert = \frac{10}{\sqrt{1 + (50/90.9)^2}} = 8.76 \\ f_\text{FPBW} &= \frac{0.5\ \text{V}/\mu\text{s}}{2\pi \cdot 5\ \text{V}} = 15.9\ \text{kHz}, \qquad \frac{0.5\ \text{V}/\mu\text{s}}{2\pi \cdot 10\ \text{V}} = 7.96\ \text{kHz} \\ \tau &= \frac{1}{2\pi \cdot 90.9\ \text{kHz}} = 1.75\ \mu\text{s}, \qquad t_{0.1\,\%} = \tau \ln 1000 = 6.9 \tau = 12.1\ \mu\text{s} \end{aligned}

Check: a 5 V5\ \text{V} peak sine at 20 kHz20\ \text{kHz} is inside the small-signal bandwidth but above 15.9 kHz15.9\ \text{kHz}, so it would be slew-limited: small-signal and large-signal limits are different questions.

In Python: bandwidth, slew and settling

python · try it yourself
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.

inp inn vd senses vd G1 gm vd, 1 mS n1 R1 100 MOhm C1 159.2 pF + - E1 vout = v(n1) out A0 = gm R1 = 1e5, fp = 1/(2 pi R1 C1) = 10 Hz, GBW = A0 fp = 1 MHz
  1. Gain. G1 0 n1 inp inn 1m is a voltage-controlled current source: it pushes gmvd=1 mS⋅vdg_m v_d = 1\ \text{mS} \cdot v_d into node n1. With R1 n1 0 100meg the DC gain is A0=gmR1=105A_0 = g_m R_1 = 10^5.
  2. Dominant pole. C1 n1 0 159.2p across R1R_1 gives fp=1/(2πR1C1)=10.0 Hzf_p = 1/(2\pi R_1 C_1) = 10.0\ \text{Hz}, so GBW=A0fp=gm/(2πC1)=1 MHz\text{GBW} = A_0 f_p = g_m/(2\pi C_1) = 1\ \text{MHz}. Note that GBW depends only on gmg_m and C1C_1, like the real op-amp's gm1/Ccg_{m1}/C_c.
  3. Output. E1 out 0 n1 0 1 copies n1 to the output with zero output resistance, so loads do not disturb the pole.
  4. Slew rate. Replace the linear G1 by a table that saturates: G1 0 n1 TABLE {v(inp,inn)} = (-79.6m,-79.6u) (79.6m,79.6u). The current into C1C_1 can never exceed 79.6 μA79.6\ \mu\text{A}, so dv/dt≤79.6 μA/159.2 pF=0.5 V/μsdv/dt \le 79.6\ \mu\text{A}/159.2\ \text{pF} = 0.5\ \text{V}/\mu\text{s}; for small inputs the slope is still 1 mS1\ \text{mS}.
  5. Output swing. E1 out 0 TABLE {v(n1)} = (-11,-11) (11,11) clamps the output at ±11 V\pm 11\ \text{V}, the swing of a classic op-amp on ±12 V\pm 12\ \text{V}. (Node n1 itself is not clamped, so this simple model recovers from overload more slowly than a real part.)
  6. DC errors go outside or inside the subcircuit as sources: a series Vos in the inp lead 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 1 V1\ \text{V} input step (a 10 V10\ \text{V} output step) to the model with slew limit and clamps, OAS. Both subcircuits go into one library file.

bash · try it yourself
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 20.00 dB20.00\ \text{dB} at 100 Hz100\ \text{Hz} and a −3 dB-3\ \text{dB} corner at 99.95 kHz99.95\ \text{kHz}, the 100 kHz100\ \text{kHz} the noise gain of 10 predicts; at 1 MHz1\ \text{MHz} the gain is 0 dB0\ \text{dB}, on the open-loop line. The step rises from 10 % to 90 % at 0.499 V/μs0.499\ \text{V}/\mu\text{s}, the slew rate, and reaches 9.99 V9.99\ \text{V} (0.1 %) 28.3 μs28.3\ \mu\text{s} 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 20 kHz20\ \text{kHz} with 1 V1\ \text{V} peak in:

-+voutRfRinvinslew-rate limitedideal gain10.00 V/VfCL (-3 dB)100 kHz|A(f)| linear9.806 V/Vout pk wanted9.81 Vrail limit+/-11.00 V2 pi f Vpk needs1.232 V/usSR available0.50 V/ussupply+/-12.0 V-100100T/2T3T/22TVf = 20.0 kHz+VS-VSvinvoutideal gain x vin

The lab shows fCL=100.0 kHzf_\text{CL} = 100.0\ \text{kHz} and a small-signal gain of 9.8069.806, but the output would need 1.232 V/μs1.232\ \text{V}/\mu\text{s} against 0.50.5: the status reads "slew-rate limited" and the output is a triangle of only 6.045 V6.045\ \text{V} peak. Lower VinV_\text{in} to 0.3 V0.3\ \text{V}: the output becomes a sine of 2.942 V2.942\ \text{V} peak, limited only by the falling gain. Raise SR to 2 V/μs2\ \text{V}/\mu\text{s} to fix the original signal, or GBW to see fCLf_\text{CL} move.

Guided lab: measure GBW and slew rate

Hand calculation. Non-inverting gain 11 (R1=10 kΩR_1 = 10\ \text{k}\Omega, Rf=100 kΩR_f = 100\ \text{k}\Omega) with a 1 MHz1\ \text{MHz} op-amp: fCL=90.9 kHzf_\text{CL} = 90.9\ \text{kHz}. A ±5 V\pm 5\ \text{V} square into a follower: the edges are ramps of slope SR; with 0.5 V/μs0.5\ \text{V}/\mu\text{s} the middle 80 % (8 V8\ \text{V}) takes 16 μs16\ \mu\text{s}.

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 ±12 V\pm 12\ \text{V} current-limited supply (50 mA50\ \text{mA} limit) with 100 nF100\ \text{nF} decoupling at the pins. GBW: drive 50 mV50\ \text{mV} peak (small, to avoid slewing) and sweep the generator until the output falls to 0.7070.707 of its low-frequency value; GBW≈11f−3dB\text{GBW} \approx 11 f_{-3\text{dB}}. Expect the datasheet typical value ±30 %\pm 30\ \% (GBW is not tightly controlled). SR: set the op-amp as a follower, drive a 10 kHz10\ \text{kHz} square of ±5 V\pm 5\ \text{V}, 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. ±12 V\pm 12\ \text{V} 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 1+Rf/R11 + R_f/R_1.
  • Checking only GBW. A circuit inside its bandwidth can still be slew-limited at large amplitude.
  • Expecting the full-power bandwidth to be a −3 dB-3\ \text{dB} 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

  1. An op-amp has GBW=10 MHz\text{GBW} = 10\ \text{MHz}. What is the bandwidth of an inverting amplifier with gain −4-4?
  2. A DAC buffer must deliver a 3 V3\ \text{V} peak sine at 100 kHz100\ \text{kHz}. What slew rate is needed, with a factor 2 of margin?
  3. How long does a follower with GBW=1 MHz\text{GBW} = 1\ \text{MHz} need to settle to 0.01 %0.01\ \% after a small step?
Answer
  1. Noise gain 1+4=51 + 4 = 5; 10 MHz/5=2 MHz10\ \text{MHz}/5 = 2\ \text{MHz}.
  2. 2π⋅100 kHz⋅3 V=1.88 V/μs2\pi \cdot 100\ \text{kHz} \cdot 3\ \text{V} = 1.88\ \text{V}/\mu\text{s}; with margin about 3.8 V/μs3.8\ \text{V}/\mu\text{s}.
  3. τ=1/(2π⋅1 MHz)=0.159 μs\tau = 1/(2\pi \cdot 1\ \text{MHz}) = 0.159\ \mu\text{s}; 9.2τ=1.47 μs9.2\tau = 1.47\ \mu\text{s}.

Test yourself

An op-amp with GBW=1 MHz\text{GBW} = 1\ \text{MHz} is used in a non-inverting amplifier with gain 20. Its closed-loop bandwidth is about…

  1. 20 MHz20\ \text{MHz}
  2. 1 MHz1\ \text{MHz}
  3. 50 kHz50\ \text{kHz}
  4. 20 kHz20\ \text{kHz}

The slew rate of an internally compensated op-amp is set mainly by…

  1. the supply voltage
  2. the input stage's maximum current charging the compensation capacitor
  3. the feedback resistors
  4. the load resistance

With SR=0.5 V/μs\text{SR} = 0.5\ \text{V}/\mu\text{s}, the full-power bandwidth for a 10 V10\ \text{V} peak output is about…

  1. 80 kHz80\ \text{kHz}
  2. 50 kHz50\ \text{kHz}
  3. 8 kHz8\ \text{kHz}
  4. 800 Hz800\ \text{Hz}

In the macro-model, what sets the gain-bandwidth product?

  1. R1R_1 alone
  2. gmg_m and C1C_1: GBW=gm/(2πC1)\text{GBW} = g_m/(2\pi C_1)
  3. the output source E1
  4. the clamp table