Current Sources and Current Mirrors
Open the schematic of any op-amp and you will find few resistors and many transistors in pairs, gates or bases tied together. Those pairs are current mirrors: they copy one reference current to wherever it is needed, as tail currents, bias currents and loads. A resistor is a poor current source (its current changes with every volt across it) and a poor load (a large value needs a large supply). A transistor in its active region carries a current that hardly depends on its output voltage, so it is both a good current source and a load of tens or hundreds of kilohms. This lesson builds the basic mirror in bipolar and MOS form, measures its error and output resistance, and then improves it: Widlar, Wilson and cascode mirrors, and the active load.
The basic mirror
Q1 is diode-connected (collector tied to base). The reference current through sets its , and Q2, with the same and (if matched) the same saturation current , carries the same collector current. With ,
Two errors remain. Base current: must also feed both bases, , so is low by about (1 % at ). Early effect: Q2's current rises with its own , so the mirror is exact only when , and the output resistance is
at with . The MOS version is the same picture with M1 diode-connected; the gate draws no current, so the error disappears, the output resistance is , and transistor sizes scale the copy: . That ratio is the main way IC designers make many currents from one reference.
Better mirrors
| Mirror | Idea | Error | |
|---|---|---|---|
| basic | same (or ) | plus Early | |
| with emitter resistors | in both emitters | as basic | about |
| Widlar | in Q2 only: small from a sensible | as basic | about |
| Wilson | a third transistor feeds back the output current | about | |
| cascode | a second mirror stacked on top | small | about (MOS), (BJT) |
The Widlar mirror solves a practical problem: a bias from would need a reference resistor, large on a chip. Put a resistor in Q2's emitter only; the two transistors now differ in by , which must appear across :
The equation is transcendental: given it gives directly; given it needs iteration. The emitter resistor also degenerates Q2 and raises its output resistance. The cascode mirror applies the idea of Multistage Amplifiers and the Cascode: a second transistor holds the copying transistor's drain still.
Worked example
Given: , , QN transistors (, , at 1 mA).
Find: ; of the basic mirror at ; its output resistance; and for a Widlar mirror giving .
Solve:
Check: the base-current error () and the Early effect at () are of opposite sign; at the output would be . The Widlar resistor is about one hundredth of the a basic mirror would need.
In Python: errors and the Widlar equation
import math
from scipy.optimize import brentq
VT, VA = 25.85e-3, 100.0
for beta in (200, 50):
simple = 1 / (1 + 2 / beta)
wilson = 1 / (1 + 2 / (beta * (beta + 2)))
print(f"beta = {beta:3d}: IO/IREF simple {simple:.4f}, Wilson {wilson:.5f}")
IO = 1e-3
print(f"Rout simple = VA/IO = {VA/IO/1e3:.0f} kOhm, Wilson ~ beta*ro/2 = {200*VA/IO/2/1e6:.0f} MOhm")
# Widlar: IO * RE = VT ln(IREF / IO)
IREF, IO = 1e-3, 10e-6
RE = VT * math.log(IREF / IO) / IO
print(f"Widlar for 10 uA from 1 mA: RE = {RE/1e3:.2f} kOhm (a basic mirror would need RREF = {(12 - 0.65)/IO/1e6:.2f} MOhm)")
for RE in (1e3, 5e3, 11.9e3):
IO = brentq(lambda i: i * RE - VT * math.log(IREF / i), 1e-9, IREF)
print(f" RE = {RE/1e3:5.1f} kOhm -> IO = {IO*1e6:6.1f} uA")beta = 200: IO/IREF simple 0.9901, Wilson 0.99995
beta = 50: IO/IREF simple 0.9615, Wilson 0.99923
Rout simple = VA/IO = 100 kOhm, Wilson ~ beta*ro/2 = 10 MOhm
Widlar for 10 uA from 1 mA: RE = 11.90 kOhm (a basic mirror would need RREF = 1.13 MOhm)
RE = 1.0 kOhm -> IO = 69.1 uA
RE = 5.0 kOhm -> IO = 20.2 uA
RE = 11.9 kOhm -> IO = 10.0 uA
The Widlar current depends only logarithmically on , so it is also less sensitive to the supply voltage than a basic mirror.
Cross-check with SPICE: against the output voltage
Three mirrors share one deck: the basic and Widlar BJT mirrors run from the same reference, and a MOS mirror with ( at ). The output voltage sources are swept and the output current read at three voltages.
cat > mirror.cir <<'EOF'
* Current mirrors from a 12 V supply: basic BJT, Widlar BJT and MOS
.model QN NPN(Is=1e-14 Bf=200 Vaf=100 Br=2 Rb=10 Cje=10p Cjc=4p Tf=0.4n)
.model MN NMOS(Level=1 Vto=1 Kp=2m Lambda=0.02)
VCC vcc 0 12
RREF vcc b 11.3k
Q1 b b 0 QN
Q2 c2 b 0 QN
VO2 c2 0 DC 6
Q3 c3 b e3 QN
RE e3 0 11.9k
VO3 c3 0 DC 6
RREFM vcc g 10k
M1 g g 0 0 MN W=1u L=1u
M2 d2 g 0 0 MN W=1u L=1u
VOM d2 0 DC 6
.control
op
let iref = (12 - v(b)) / 11.3k
let io_widlar = -i(vo3)
print v(b) iref io_widlar
dc VO2 0.2 12 0.1
let io_bjt = -i(vo2)
meas dc io_at_1v find io_bjt at=1
meas dc io_at_6v find io_bjt at=6
meas dc io_at_11v find io_bjt at=11
dc VOM 0.2 12 0.1
let io_mos = -i(vom)
meas dc iom_at_2v find io_mos at=2
meas dc iom_at_6v find io_mos at=6
meas dc iom_at_11v find io_mos at=11
.endc
.end
EOF
ngspice -b mirror.cir 2>&1 | grep -E '^(v\(|i\(|[a-z0-9_]+ +=)'v(b) = 6.550118e-01
iref = 1.003981e-03
io_widlar = 1.005420e-05
io_at_1v = 9.974228e-04
io_at_6v = 1.047122e-03
io_at_11v = 1.096822e-03
iom_at_2v = 1.002188e-03
iom_at_6v = 1.079280e-03
iom_at_11v = 1.175644e-03
The basic BJT mirror gives at , as computed, and rises over : . The Widlar output is . The MOS mirror is exact at and rises over , , close to : the course's MOSFET is a worse current source than its BJT.
The active load
Replace a CE stage's collector resistor by a PNP mirror and the small-signal load becomes the mirror's . The gain is
For : , , (QP, ), so . A resistor load giving the same gain would need carrying : a drop. Such a high-gain node has a very high output resistance, so it must drive a buffer, and its DC level is set by the two current sources fighting each other: in practice it is defined by an overall feedback loop, as in every op-amp.
The lab holds the small-signal model of this stage (a VCCS for the NPN, two resistors for the two ; no transistors): in gives . Slide RO2 down to to see what a resistor load would give.
Guided lab: build and test a mirror
Hand calculation. , to as goes from 1 to 11 V.
Simulation. The SPICE sweep above.
What you would measure. Use two NPNs from the same reel, thermally coupled (glued together or touching): discrete parts are not matched like on-chip pairs, and a difference of alone gives an 8 % current error (). Feed the output from a second current-limited supply channel through a sense resistor and step the output voltage from 1 to 11 V; read from the drop with a -digit meter. Expect within about of (matching) and a slope of roughly (depends on your transistor's , often 50 to 150 V). Then add in one emitter and check the Widlar current, around .
Hazards and safe setup. supplies limited to . Never connect the output node directly to a supply without the sense resistor and limit: a mistake that saturates Q2 with a hard source can overheat it.
Pitfalls
- Unmatched discrete transistors. On a chip the two devices sit microns apart; on a breadboard they can differ by 10 % or more. Use a matched pair or emitter resistors with .
- Temperature gradients. falls about ; 1 K between the two transistors gives about 8 % error.
- Saturating the output transistor. Below about (BJT) or (MOS) the copy fails: every mirror has a compliance voltage.
- Forgetting the base currents of many outputs. Ten outputs from one reference cost ; add a beta helper (an emitter follower that supplies the bases).
Practice
- A MOS mirror copies to a transistor with three times the . What is (ignore )?
- A Widlar mirror has and . Start from and do one iteration of .
- A CE stage with an active load has , , . Find the gain.
Answer
- .
- ; it has converged (SciPy gives ).
- .
Test yourself
In a basic BJT mirror with , the output current is low by about…
The output resistance of a basic mirror at with is…
What does the Widlar mirror make easy?
- Very large currents
- Small output currents without a huge reference resistor
- Perfect matching
- Zero output resistance
Replacing a CE stage's collector resistor by a current-mirror load mainly…
- reduces the gain
- raises the gain to about
- lowers the output resistance
- removes the need for bias