C632 of 57
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C6 · Lesson 32 · Op-amp circuits lab

Common-mode rejection, filter design, meters and transimpedance compensation, in Python

Lessons 16 to 29 built a toolkit of op-amp circuits, each with design formulas. In this lab you'll turn the formulas into design functions and check the results the formulas only estimate: a difference amplifier's exact common-mode rejection with real resistor errors, the component values of multiple-feedback and Tow-Thomas filters, what an average-responding meter really reads for waveforms other than sines, and the exact feedback capacitor that flattens a transimpedance amplifier.

Play

  • The bars show what an average-responding meter, calibrated for sines, reads for a sine, a square and a triangle of the same peak, against their true RMS values.
  • For a sine the two agree, by design. For a square the meter reads 11% high; for a triangle, about 4% low.
  • Only a true-RMS meter reads all three correctly.

Predict

A difference amplifier with a gain of 10 is built from 0.1% resistors, and the worst-case formula 1+R2/R14ε gives a CMRR of 2750. If only the two resistors on the non-inverting side are off by 0.1%, in opposite directions, what's the CMRR?

Name it

Exact common-mode rejection

For a difference amplifier with R1 to the inverting input, R2 in feedback, and R3, R4 dividing the non-inverting input,

vo=R4R3+R4(1+R2R1)v2−R2R1v1.

With k=R4R3+R4(1+R2R1), the common-mode gain is k−R2R1, the differential gain 12(k+R2R1), and the CMRR is their ratio. Matched ratios make Acm zero.

Filter design functions

  • Multiple-feedback band-pass with equal capacitors C, center f0, quality Q and center gain −G: R3=Qπf0C, R1=R32G, and from the f0 formula, R2=1(2πf0C)2R3−1/R1.
  • Tow-Thomas: R=12πf0C, RQ=QR, Rin=RQG for band-pass gain G.

Meters

An average-responding meter rectifies, averages, and multiplies by π22 = 1.111 so a sine reads its RMS. For any other waveform the reading is 1.111 times the rectified average, not the RMS.

Transimpedance compensation

From lesson 24, Q=ba with a=RfCf+1ωu and b=Rf(Cf+Cin)ωu. Q falls steadily as Cf grows, so bisection on Cf finds the value that gives any Q, such as 0.707.

Worked example

A gain-10 difference amplifier (R1 = 10 kΩ, R2 = 100 kΩ) has its resistors off by 0.1% in the worst directions. Check the worst-case formula exactly.

Show the solution
  1. Worst directions. R1 and R4 low by 0.1%, R2 and R3 high.
  2. Exact gains. Then k=99.910.01+99.9(1+100.19.99)Acm=k−100.19.99=−0.0036 against Ad = 10.0.
  3. CMRR. The ratio is 2750, matching 114×0.001 to five digits.
  4. Why it matches. The formula's derivation is first order in ε, which at 0.1% is far more than enough.

Answer the exact worst-case CMRR is 2750, the same as the formula's to five digits.

Worked example

Design a multiple-feedback band-pass at 1 kHz with Q = 5 and a center gain of −5, using 10 nF capacitors.

Show the solution
  1. Feedback resistor. R3=5π×1kHz×10nF=159.2kΩ
  2. Input resistor. R1=R310=15.9kΩ
  3. Third resistor. The f0 formula, solved for R2 with R3 = 159,155 Ω and R1 = 15,915 Ω: R2=1(2πf0C)2R3−1/R1=1.77kΩ matching lesson 26.
  4. Why R2 is small. It sets f0 while the other two set Q and gain, and its value sinks as Q rises.

Answer R3 = 159.2 kΩ, R1 = 15.9 kΩ and R2 = 1.77 kΩ.

Worked example

An average-responding meter calibrated for sines measures a 1 V peak square wave and a 1 V peak triangle. What does it read, and what are the true RMS values?

Show the solution
  1. Square wave. Its rectified average is 1 V, so the meter reads 1.111 V. Its RMS is 1 V, so the reading is 11% high.
  2. Triangle. Its average is 0.5 V and the meter reads 0.555 V, against a true RMS of 0.577 V: 3.8% low.
  3. Sine. Its average is 0.637 V, and 0.637×1.111=0.707V its RMS exactly, which is the only case the calibration covers.

Answer the meter reads 1.111 V for the square (true RMS 1 V) and 0.555 V for the triangle (true RMS 0.577 V).

Check

Step 1. Write diff_cmrr(R1, R2, R3, R4) returning the exact CMRR (as a ratio) of a difference amplifier. Return float('inf') if the common-mode gain is exactly zero.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 2. Write mfb_bandpass(f0, Q, C, G) returning (R1, R2, R3) for a multiple-feedback band-pass with equal capacitors and center gain −G.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 3. Write tow_thomas(f0, Q, C, G) returning (R, RQ, Rin) for a Tow-Thomas band-pass with center gain G.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 4. Write meter(samples) returning (avg_abs, rms, reading) for one period of a waveform, where reading is an average-responding meter's: 1.111 times the rectified average, exactly π22.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 5. Write tia_cf(Rf, Cin, GBW, Q=0.7071) returning the feedback capacitor that gives the transimpedance amplifier the requested Q, by bisection between 0 and 100 pF.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

What's the worst-case CMRR of a difference amplifier with gain 10 built from 0.01% resistors?

Check

An average-responding meter calibrated for sines measures waveforms of 1 V peak.

(a)

What does it read for a square wave?

Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.

(b)

And for a triangle wave?

Explain why

Why does an average-responding meter misread a square wave?

Practice

Keep practicing

3 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.