---
title: "Project: an audio power amplifier"
heading: Twenty watts into a loudspeaker, cleanly and without melting
eyebrow: C6 · Lesson 55 · Project
xp: 80
---

::: hook
An audio power amplifier is the whole course in one box. An op amp provides gain and, through global feedback, linearity; a class AB output stage provides current; the supply rails and heat sinks are set by the power the loudspeaker needs. In this project you'll size the supply for 20 W into 8 Ω, work out what the output transistors dissipate and what heat sink keeps them safe, set the output stage's quiescent current by simulating it, and watch feedback clean up crossover distortion.
:::

::: play
- An op amp with a gain of 11 drives a class AB output stage into an 8 Ω load from ±15 V, with feedback taken from the speaker terminal. The output transistors are modeled with β = 1000, as Darlington pairs give.
- At 1 V peak in, the output swings 11 V peak: about 7.6 W. Distortion near zero is invisible, because the feedback loop drives the output stage through its dead zone.
- Push the input above about 1.1 V: the output clips near ±12 V, where the op amp's own output runs out of room below the rails.
:::
:::

```sim circuit
VIN in 0 sine 1 V 1k Hz                 @ 0,3 down 3
U1 in fb drv VSAT=14 GBW=1M             @ 1,2 flip
RA vcc b1 1.4k                          @ 6,-2 down 2
D1 b1 drv IS=1e-13                      @ 6,0 down 2
D2 drv b2 IS=1e-13                      @ 6,2 down 2
RB b2 vee 1.4k                          @ 6,4 down 2
Q3 vcc b1 out npn BF=1000 IS=1e-13      @ 7,0
Q4 vee b2 out pnp BF=1000 IS=1e-13      @ 7,4 flip
RL out 0 8                              @ 9,2 down 3
RF out fb 10k                           @ 8,6 left 7
RG fb 0 1k                              @ 1,6 down 2
VCC vcc 0 15                            @ 11,-2 down 4
VEE 0 vee 15                            @ 12,2 down 4
slider: VIN.amp 0.1..1.5 log
scope: v(in), v(out)
time: 0..3m s
```

::: predict
## A 20 W, 8 Ω amplifier needs what peak output voltage, and roughly what supply rails?

- [ ] 20 V peak, ±20 V
- [x] 17.9 V peak, about ±21 V
- [ ] 12.6 V peak, about ±15 V
- [ ] 40 V peak, ±45 V

::: reveal
17.9 V peak: $\sqrt{2PR_L} = \sqrt{320}$. The output stage can't reach the rails: the drivers and output transistors need a few volts of headroom, so about ±21 V. (12.6 V is the RMS value.)
:::
:::

::: nameit
## The design chain

1. **Peak output:** $\hat V_o = \sqrt{2PR_L}$; **peak current** $\hat I = \hat V_o/R_L$.
2. **Rails:** $V_{CC} = \hat V_o$ + headroom (2 to 4 V for the driver and output transistors' drops).
3. **Losses** (class B approximations, lesson 42): $P_S = \frac{2V_{CC}\hat V_o}{\pi R_L}$, and each transistor's worst case $\frac{V_{CC}^2}{\pi^2R_L}$, reached at $\hat V_o = 2V_{CC}/\pi$, not at full power.
4. **Heat sink:** for each transistor, $\theta_{SA} \le \frac{T_{J,\max} - T_A}{P_D} - \theta_{JC} - \theta_{CS}$ (junction to case, case to sink through the insulating pad, sink to air).
5. **Quiescent current and base drive:** enough quiescent current to keep both output transistors conducting through zero, tens of milliamps, set by the bias network and stabilized against temperature (lesson 42). The bias network must also supply the peak base current, $\hat I/\beta$, even near the top of the swing where little voltage is left across it; that's why power stages use Darlington pairs or a driver stage, raising the effective β into the thousands.
6. **Feedback:** the op amp's gain $1 + R_F/R_G$ sets the overall gain; its loop gain divides the output stage's distortion and output resistance.

## Global feedback against crossover distortion

Without feedback, a class B stage's output stalls while its input crosses the ±0.6 V dead zone. Inside a feedback loop, the op amp sees the output lag behind and drives the stage's input quickly across the dead zone, reducing the distortion by the loop gain at that frequency. That works well at low frequencies and less well at high ones, where the loop gain is smaller, which is why good amplifiers still bias their output stages into class AB.
:::

::: example
## Size the supply and the heat sinks for 20 W into 8 Ω, with 3 V of headroom, $T_{J,\max}$ = 150 °C, 40 °C inside the cabinet, $\theta_{JC}$ = 1.5 °C/W and a 0.5 °C/W pad.

::: solution
1. **Supply.** $\hat V_o$ = 17.9 V, and 3 V of headroom makes ±20.9 V: use ±21 V.
2. **Full power.** $P_S$ = 29.9 W, the transistors share 9.9 W, and η = 67%.
3. **Worst case per transistor.**
   $$\begin{aligned} P_D &= \frac{21^2}{\pi^2 \times 8} \\ &= 5.59\ \text{W} \end{aligned}$$
4. **Heat sink.** The junction may rise 110 °C over the cabinet, and the case and pad take 2 °C/W, so each needs
   $$\begin{aligned} \theta_{SA} &\le \frac{110}{5.59} - 2 \\ &= 17.7\ \text{°C/W} \end{aligned}$$

**Answer:** a ±21 V supply, and a heat sink of 17.7 °C/W or better for each transistor.
:::
:::

::: example
## Why use 1.4 kΩ for $R_A$ and $R_B$ in the sim?

::: solution
1. **Bias current.** They carry about
   $$\frac{15 - 0.7}{1.4\ \text{k}} \approx 10\ \text{mA}$$
   through the bias diodes, which set the output transistors' quiescent current.
2. **Idle current.** With the diodes' $I_S$ equal to the transistors', each output transistor idles near 10 mA.
3. **Drive at the peak.** At the 11 V peak there's still
   $$\frac{15 - 11.7}{1.4\ \text{k}} = 2.4\ \text{mA}$$
   left for the base, enough for 1.4 A with β = 1000.
4. **With a single transistor.** With its β of 50, the output would clip near 3 V.

**Answer:** 1.4 kΩ sets about 10 mA through the bias diodes, so the outputs idle near 10 mA, and still leaves 2.4 mA of base drive at the 11 V peak.
:::
:::

::: check
given: P = 5 | 20 | 100; RL = 4 | 8
answer: sqrt(2*P*RL)
unit: V
tolerance: 0.5%

## What peak output voltage delivers {P} W into {RL} Ω?

::: right
Right. $\sqrt{2PR_L}$ = {answer}.
:::

::: misses
- [sqrt(P*RL)] That's the RMS voltage; the peak is √2 times it.
- [any] Not yet. $P = \hat V_o^2/(2R_L)$.
:::
:::

::: check
given: P = 5 | 20 | 100; RL = 4 | 8
answer: sqrt(2*P*RL)/RL
unit: A
tolerance: 0.5%

## What peak current does that output ({P} W into {RL} Ω) demand?

::: right
Right. $\hat V_o/R_L$ = {answer}.
:::

::: misses
- [any] Not yet. Peak voltage over the load.
:::
:::

::: check
given: Pd = 2 | 8 | 20; TJ = 125 | 150; TA = 25 | 45; jc = 0.7 | 2; cs = 0.2 | 0.5
answer: (TJ - TA)/Pd - jc - cs
unit: °C/W
tolerance: 0.5%

## A transistor dissipates {Pd} W; its junction may reach {TJ} °C at {TA} °C ambient, with $\theta_{JC}$ = {jc} and $\theta_{CS}$ = {cs} °C/W. What is the largest heat-sink rating it can use?

::: right
Right. $\frac{T_J - T_A}{P_D} - \theta_{JC} - \theta_{CS}$ = {answer}.
:::

::: misses
- [(TJ - TA)/Pd] That's the total; the junction-to-case and pad resistances come out of it.
- [any] Not yet. The resistances in series add up to $(T_J - T_A)/P_D$.
:::
:::

::: check
kind: python

## Write `amp_design(P, RL, head=3.0)` returning the rail voltage $V_{CC}$, and `losses(VCC, RL, Vo)` returning `(PL, PS, PD_each, PD_worst_each)` for a class B stage.

```python starter
import math

def amp_design(P, RL, head=3.0):
    return math.sqrt(P * RL) + head

def losses(VCC, RL, Vo):
    PL = Vo ** 2 / RL
    return PL, PL, 0.0, 0.0
```

```python solution
import math

def amp_design(P, RL, head=3.0):
    return math.sqrt(2 * P * RL) + head

def losses(VCC, RL, Vo):
    PL = Vo ** 2 / (2 * RL)
    PS = 2 * VCC * Vo / (math.pi * RL)
    return PL, PS, (PS - PL) / 2, VCC ** 2 / (math.pi ** 2 * RL)
```

```python tests
import math
assert abs(amp_design(20, 8) - 20.88854381999832) < 1e-9, "20 W into 8 ohms needs 17.9 V peak plus 3 V of headroom."
assert abs(amp_design(100, 4, head=4) - (math.sqrt(800) + 4)) < 1e-9, "Use the given headroom."
cases = [((21, 8, 17.888543819998318), (20.0, 29.894026823521436, 4.947013411760716, 5.58533024828387)),
         ((30, 4, 20.0), (50.0, 95.4929658551372, 22.7464829275686, 22.797266319526)),
         ((15, 8, 5.0), (1.5625, 5.968310365946075, 2.2029051829730375, 2.84965828994075))]
for args, want in cases:
    got = losses(*args)
    for g, w, name in zip(got, want, ("PL", "PS", "PD_each", "PD_worst_each")):
        assert abs(g - w) <= 1e-9 * abs(w), f"For {args}: {name} should be {w:.4f} W, got {g:.4f} W."
```

::: right
Right. In the second case the transistors are near their worst dissipation at nearly full output: on low-impedance loads the heat sinks have to be large.
:::
:::

::: check
kind: design
choose: RA
goal: dc(i(Q3)) = 20m ± 15%
solution: RA = 716

## The lower bias resistor $R_B$ is already set. Choose the upper one, $R_A$, so the NPN output transistor idles at 20 mA.

```sim circuit
VIN in 0 0                              @ 0,2 down 3
RA vcc b1 1.4k                          @ 2,-2 down 2
D1 b1 in IS=1e-13                       @ 2,0 down 2
D2 in b2 IS=1e-13                       @ 2,2 down 2
RB b2 vee 716                           @ 2,4 down 2
Q3 vcc b1 out npn BF=1000 IS=1e-13      @ 3,0
Q4 vee b2 out pnp BF=1000 IS=1e-13      @ 3,4 flip
RL out 0 8                              @ 5,2 down 3
VCC vcc 0 15                            @ 7,-2 down 4
VEE 0 vee 15                            @ 8,2 down 4
meter: i(Q3), i(Q4)
```

::: right
Right. About 720 Ω: $\frac{15 - 0.67}{0.02}$, putting 20 mA through the diode, and so through the matched transistor; with β = 1000 its base takes only 20 µA.
:::
:::

::: explain
## Why does a power amplifier's output stage need both a heat sink and a quiescent current, which itself adds heat?

::: model
The output transistors waste power whenever they carry current with voltage across them, most of all at moderate output levels, so they need a heat sink sized for that worst case to keep their junctions below the safe limit. The quiescent current adds a little more heat even at idle, but without it the stage has a dead zone around zero where neither transistor conducts, producing crossover distortion that's most audible in quiet passages. A small quiescent current, tens of milliamps, keeps both transistors conducting through zero at a cost of a watt or so, which is a good trade, as long as the bias is stabilized so the current can't run away as the transistors warm.
:::
:::

::: practice

::: check
given: Vo = 10 | 30; head = 2 | 4
answer: Vo + head
unit: V
tolerance: 0.5%

## An amplifier must swing {Vo} V peak with {head} V of headroom. What rail does it need?

::: misses
- [any] Peak plus headroom.
:::
:::

::: check
given: VCC = 15 | 30; RL = 4 | 8
answer: 2*VCC/pi
unit: V
tolerance: 0.5%

## At what output peak are the transistors of a ±{VCC} V class B stage hottest?

::: misses
- [any] $2V_{CC}/\pi$.
:::
:::

::: check
given: Rf = 10 | 47; Rg = 1 | 2.2
answer: 1 + Rf/Rg
tolerance: 0.5%

## What gain does an amplifier with $R_F$ = {Rf} kΩ and $R_G$ = {Rg} kΩ set?

::: misses
- [any] $1 + R_F/R_G$.
:::
:::
:::
