Feedback and loop gain
Wrap an amplifier in negative feedback, measure its loop gain, and predict the closed-loop gain error, bandwidth and output impedance from it.
- Lesson
- E6.2
- Time
- 30 min
- Runs on
- ngspice
- Check
- 5 questions
A buffer feeds a signal between 0.8 and 1.0 V to a 12-bit converter, whose step is 1.8 V/4096 = 0.44 mV. Built on the five-transistor OTA of E5.3, its error drifted from −1.28 mV to −3.11 mV across that range. The same buffer built on the two-stage op-amp stayed within 0.18 mV.
- OTA-A buffer
- OPA-B buffer
- Input 800 mVOTA-A buffer = -1.279 mV · OPA-B buffer = -176.9 µV
At 0.8 V the OTA-A buffer is 1.28 mV low, the OPA-B buffer 0.18 mV low.
- Input 1 VOTA-A buffer = -3.114 mV · OPA-B buffer = -142.5 µV
At 1.0 V the OTA-A buffer is 3.11 mV low. The error grew by 1.83 mV over 200 mV: the output moves only 0.991 of each input change. OPA-B is 0.14 mV low.
Read the plot as a table
| Input | OTA-A buffer | OPA-B buffer |
|---|---|---|
| 800 mV | -1.279 mV | -176.9 µV |
| 850 mV | -1.724 mV | -141.6 µV |
| 900 mV | -2.166 mV | -131.8 µV |
| 950 mV | -2.624 mV | -133.3 µV |
| 1 V | -3.114 mV | -142.5 µV |
Measured on ngspice 42, a DC sweep in 1 mV steps.
Both are the same loop, with the output wired back to the − input; what differs is how much gain goes around it.
The loop and its gain
- The input arrives
vin reaches the input of the amplifier. In an op-amp the difference is taken by the input pair itself: + minus −.
- The amplifier multiplies
The amplifier makes vout = A times the difference. For OTA-A, A = 136.7.
- A fraction comes back
The feedback network returns β·vout to the − input. A signal that goes once around the loop is multiplied by A and by β: the loop gain T = Aβ.
- The loop settles
vout = A(vin − βvout), so vout/vin = A/(1 + T). A buffer has β = 1 and T = A.
Read the diagram as text
- Input: the signal to copy
- Difference: input minus β × output
- Amplifier A: output = A × difference
- Output: what the load sees
- Feedback β: returns β × output
- Input → Difference: input
- Difference → Amplifier A: difference
- Amplifier A → Output: output
- Output → Feedback β: sample
- Feedback β → Difference: β × output
In the buffer of the hook, the feedback network is a wire: β = 1.
Solve the loop and the closed-loop gain is A/(1 + T). Write it as (1/β)·T/(1 + T). When T is large, the gain is 1/β, set by the feedback network alone. What is left over is the gain error, 1/(1 + T): it depends on the loop gain, not on A alone.
The feedback is negative: the returned fraction is subtracted, so an output that rises too far shrinks the difference and pulls itself back down. Positive feedback would add instead and drive the output to a rail, which the comparator of E8 does on purpose.
A buffer has β = 1, so T = A. With OTA-A, T = 136.7 and the error should be 1/137.7 = 0.73 %. With OPA-B, T = 11019 and the error falls to 0.009 %, which is why op-amp designers chase DC gain.
Gain error is 1/(1 + T)
Measure it. Each open-loop gain comes from the inductor bench of E5. A 1 TH inductor from the output to the − input and 1 F from there to ground close the loop for DC, so the bias is right. The AC signal sees an open loop. The gain-of-two loop is opened the same way at M1's gate, and v(tk) at the divider is T itself.
| Circuit | Loop gain T | A/(1 + T) · 1/β | Measured gain | Error |
|---|---|---|---|---|
| OTA-A buffer | 136.7 (42.7 dB) | 0.99274 | cl_ota = 9.910593e-01 | 0.89 % |
| OPA-B buffer | 11019 (80.8 dB) | 0.99991 | cl_buf = 1.000058e+00 | +0.006 % |
| OPA-B, gain of two, 20 kΩ + 20 kΩ | 768.9 | 1.99740 | cl_two = 1.997700e+00 | 0.115 % |
Measured at 10 Hz on ngspice 42. Error is 1 − measured/(1/β).
The OTA-A buffer misses its prediction by 0.17 %. In a buffer both inputs move with the signal, so the OTA also sees a common-mode input. Its common-mode gain Acm = −0.233 (E5.2) adds to the output: vout/vin = (A + Acm)/(1 + A) = 0.99104, against 0.99106 measured. The same term pushes OPA-B's buffer a hair above 1.
The gain-of-two amplifier shows a second effect. Its 40 kΩ of feedback resistors hang on the output, and OPA-B's second stage has a high output resistance. The open-loop gain falls from 11019 to 1538 (63.7 dB), so T = 1538 × 0.5 = 769. A feedback network that loads the output cuts A, and with it T.
What the loop buys: bandwidth and impedance
- open loop A
- buffer
- Frequency 1 kHzopen loop A = 42.71 dB · buffer = -0.07801 dB
At 1 kHz the open-loop gain is 42.7 dB (136.7). The buffer gives −0.08 dB: 0.991.
- Frequency 188 kHzopen loop A = 39.7 dB · buffer = -0.07821 dB
The open-loop gain is 3 dB down at 188 kHz. The buffer has not moved: its loop gain is still 97.
- Frequency 25.54 MHzopen loop A = -0.004288 dB · buffer = -2.792 dB
The open-loop gain reaches 1 at 25.5 MHz. Here T = 1 and the loop runs out of gain.
- Frequency 27.38 MHzopen loop A = -0.617 dB · buffer = -3.089 dB
The buffer is 3 dB down at 27.4 MHz, 146 times the open-loop bandwidth. It traded 42.7 dB of gain for that bandwidth.
Read the plot as a table
| Frequency | open loop A | buffer |
|---|---|---|
| 10 Hz | 42.71 dB | -0.07801 dB |
| 100 Hz | 42.71 dB | -0.07801 dB |
| 1 kHz | 42.71 dB | -0.07801 dB |
| 10 kHz | 42.7 dB | -0.07801 dB |
| 100 kHz | 41.63 dB | -0.07806 dB |
| 188 kHz | 39.7 dB | -0.07821 dB |
| 1 MHz | 28.04 dB | -0.08367 dB |
| 10 MHz | 8.185 dB | -0.6122 dB |
| 25.54 MHz | -0.004288 dB | -2.792 dB |
| 27.38 MHz | -0.617 dB | -3.089 dB |
| 100 MHz | -12.57 dB | -12.61 dB |
| 1 GHz | -38.63 dB | -40.2 dB |
Measured on ngspice 42, 50 points per decade.
Bandwidth. The loop holds the gain at 1/β for as long as T stays large. Above the open-loop pole A falls as 1/f, and the closed loop ends near the frequency where T = 1. For a buffer that is fu; for a loop with β < 1 it is about β·fu. Gain is traded for bandwidth, with the gain-bandwidth product as the exchange rate.
Impedance. Push 1 A of AC into the output and read the voltage: at 1 kHz OTA-A alone shows 841.7 kΩ, the ro2 ‖ ro4 of its output. As a buffer it shows 6.10 kΩ, and the ratio of the two is 137.9, which is 1 + T: the loop sees any change at the output and corrects it.
Desensitivity. The loop also holds the gain when A moves. Heat the lab's gain-of-two amplifier to 125 °C: T falls by 15.9 %, and the closed-loop gain moves by 0.020 %. The prediction, 15.9 %/(1 + T), is 0.021 %.
27 °C
.lib sky130 tt
* (default temperature, 27 C)
XH in hn oh vdd opa
RFH oh hn 20k
RGH hn ref 20k
t_two = 7.689262e+02, cl_two = 1.997700e+00
125 °C
.lib sky130 tt
.temp 125
XH in hn oh vdd opa
RFH oh hn 20k
RGH hn ref 20k
t_two = 6.465233e+02, cl_two = 1.997303e+00: T −15.9 %, gain −0.020 %.
The lab netlist at two temperatures, measured on ngspice 42.
Feedback costs one thing. A has phase shift, and near fu the returning signal arrives late. If it arrives a full half-cycle late, the loop rings or oscillates: E6.3 measures how late is too late.
Asked in interviews
What is loop gain?
The gain a signal sees going once around the loop, T = Aβ. Break the loop where it does not change the bias or the loading, inject a signal, and see what comes back.
What is the gain error of a buffer with 60 dB of open-loop gain?
T = 1000, so the gain is 1000/1001 and the error 1/(1 + T) ≈ 0.1 %. A real buffer adds the common-mode gain: OTA-A's 0.73 % became 0.89 %.
What does feedback do to output impedance?
Voltage feedback divides it by 1 + T: OTA-A's 841.7 kΩ fell to 6.10 kΩ as a buffer. The effect fades with frequency as T falls.
Try it
Run the netlist and predict cl_two from t_two before you read it: 2·T/(1 + T). Open Plots to see all five gains against frequency.
Now add .temp 125 under the .lib line and run again: a_opa and t_two fall, cl_two barely moves. Then change both 20 k resistors to 200k, in both copies: the load on the output shrinks, a_loaded rises toward a_opa, and the error falls.
Run the netlist to draw its plots here.
a_opa = 1.101886e+04 cl_buf = 1.000058e+00 a_loaded = 1.537852e+03 t_two = 7.689262e+02 cl_two = 1.997700e+00Check yourself
Remember
- The loop gain T = Aβ is the gain once around the loop; the closed-loop gain is (1/β)·T/(1 + T).
- The gain error is 1/(1 + T): 0.73 % for OTA-A as a buffer (0.89 % measured, with its common-mode gain), 0.009 % for OPA-B.
- A feedback network that loads the output lowers A and T: 40 kΩ cut OPA-B's gain from 11019 to 1538.
- Feedback divides output impedance by 1 + T (841.7 kΩ to 6.10 kΩ) and changes in A by 1 + T (15.9 % to 0.020 %).
- The closed loop ends near the frequency where T = 1: the buffer reached 27.4 MHz from a 188 kHz open-loop pole.