Lab 4.3 — Op-Amp Clipping

Course 2 syllabus · Module 4 · Prev: « Lab 4.2 · Next: Lab 4.4 »

Goal

Deliberately overdrive the amplifier from Lab 4.2 until its output slams into the supply rails, and study clipping — the most common real-world nonlinearity in an analog signal chain. You will map the actual rail-to-rail output swing of the MCP6002, compute the largest input a given gain can handle before distortion, and build the intuition that a clipped sine is no longer one frequency: it has grown harmonics. This is essential defensive knowledge for a DSP front end — a clipped input silently corrupts everything downstream of the ADC, and no amount of digital filtering can undo it. You’ll forward-reference the FFT lab to see those harmonics quantitatively.

Equipment & parts

  • WANPTEK supply at 5.0 V, current-limited.
  • MCP6002 dual op-amp with 0.1 µF decoupling, wired as the non-inverting amp from Lab 4.2 (mid-rail biased).
  • Siglent SDS1104X-E scope + two 10× probes (we’ll use FFT math here too).
  • Signal source: the MCP4725 DAC (Lab 3.3) generating a mid-rail sine whose amplitude you can raise. (The probe-comp square wave is unsuitable — it’s already a “clipped” shape.)
  • Resistors for gain (e.g. \(R_f = 9.1\text{ kΩ}, R_g = 1\text{ kΩ}\), \(G \approx 10\)) plus the 100 kΩ/100 kΩ mid-rail divider.
  • Breadboard + jumpers.

Safety & don’t-break-it

  • Clipping does not damage the MCP6002. Its rail-to-rail output stage simply saturates near a rail — the op-amp is happy. This lab is about signal integrity, not part protection.
  • But keep the input inside the rails. Overdriving means raising the input amplitude; make sure the input pin never goes below 0 V or above 5 V. With mid-rail bias, an input beyond 2.5 V amplitude will violate the common-mode range and can cause phase reversal (the output jumps to the wrong rail) — recognize it, don’t fear it, but keep the DAC output within 0–5 V regardless.
  • ESD handling of the bare DIP (body only, power off to insert) as in Labs 4.1–4.2.
  • Common grounds for DAC, scope, and supply.

Background

A real op-amp output can only swing between its supply rails — actually to within a small \(V_\text{sat}\) of each rail. For the rail-to-rail MCP6002 on a 0–5 V supply, the output can reach roughly \(V_\text{OL} \approx 0.02\text{–}0.1\text{ V}\) above VSS and \(V_\text{OH} \approx 4.9\text{–}4.98\text{ V}\) below VDD, depending on load current (heavier load → the output falls further short of the rails). Call the usable peaks \(V_\text{OH}\) and \(V_\text{OL}\).

For a mid-rail-biased amplifier of gain \(G\) with a sine input of amplitude \(A_\text{in}\), the ideal output is a sine of amplitude \(G\,A_\text{in}\) riding on 2.5 V. It stays undistorted only while its peaks fit inside the swing window:

\[ 2.5\text{ V} + G\,A_\text{in} \le V_\text{OH} \qquad\text{and}\qquad 2.5\text{ V} - G\,A_\text{in} \ge V_\text{OL}. \]

The maximum undistorted output amplitude is therefore set by the nearer rail:

\[ V_\text{out,max} = \min\big(V_\text{OH} - 2.5\text{ V},\ 2.5\text{ V} - V_\text{OL}\big), \]

and the corresponding maximum input amplitude before clipping is \(A_\text{in,max} = V_\text{out,max}/G\). Push \(A_\text{in}\) past that and the sine’s top and bottom flatten against the rails — the output is clipped.

Why clipping breeds harmonics. A pure sine has energy at exactly one frequency \(f_0\). Flattening its peaks makes it approach a square wave, and a symmetric clipped/square wave has a Fourier series containing only odd harmonics \(f_0, 3f_0, 5f_0, \dots\) with amplitudes falling roughly as \(1/n\):

\[ x_\text{square}(t) = \frac{4}{\pi}\sum_{k=0}^{\infty}\frac{1}{2k+1}\sin\big((2k+1)\,2\pi f_0 t\big). \]

So clipping is spectral spreading: it dumps energy into harmonics that weren’t in the input. If those harmonics later land above the Nyquist frequency of your ADC, they alias back as in-band garbage — the reason a front-end that clips is unrecoverable. In Lab 6.3 you’ll measure these harmonic amplitudes and confirm the odd-harmonic, \(1/n\) structure.

Procedure

Part A — Establish the linear baseline.

  1. Build/confirm the Lab 4.2 non-inverting amp at \(G \approx 10\) (\(R_f = 9.1\) kΩ, \(R_g = 1\) kΩ), mid-rail biased. Decouple, power on at 5 V.
  2. DAC → 1 kHz sine, small amplitude (e.g. 0.1 Vpp, so output ≈ 1 Vpp). Scope CH1 = input, CH2 = output, both DC-coupled. Confirm a clean sine centered on 2.5 V. Note the gain (≈10) from Vpp ratio.

Part B — Find the clipping threshold.

  1. Slowly raise the DAC sine amplitude. Watch CH2. Note the input amplitude at which the output peaks just begin to flatten — first at one rail (whichever the bias is closer to; ideally symmetric at 2.5 V). Record the output peak voltages \(V_\text{OH}\) (top flat) and \(V_\text{OL}\) (bottom flat).
  2. Compare the observed onset to the predicted \(A_\text{in,max} = V_\text{out,max}/G\).

Part C — Full clipping and the swing map.

  1. Raise the amplitude further until the output is a clearly clipped, near-square wave. Use scope cursors to read the exact top and bottom flat levels — these are the true \(V_\text{OH}\) and \(V_\text{OL}\) of the MCP6002 under your load. Note how close to 5 V and 0 V they get (“rail-to-rail” ≠ exactly the rail).
  2. Optional: add a 1 kΩ load from OUTA to mid-rail and repeat — heavier load makes \(V_\text{OH}\)/\(V_\text{OL}\) fall further short of the rails (output-current limit), shrinking the undistorted window.

Part D — See the harmonics (FFT preview).

  1. With the output clipped, switch the scope to FFT math on CH2 (Math → FFT, window = Hanning, set the span so \(f_0\) and several harmonics are visible). Observe peaks at \(f_0, 3f_0, 5f_0, \dots\)
  2. Reduce the amplitude back to the linear region and watch the harmonics collapse into the noise floor — a live demonstration that distortion = harmonics.

Deliverable & expected results

A bench note (docs/lab-4-3.md) with the measured swing limits, the clipping-onset amplitude, and an FFT screenshot of the clipped output annotated with the harmonic frequencies.

Quantity Predicted Measured
Output high rail \(V_\text{OH}\) (light load) ≈ 4.95 V
Output low rail \(V_\text{OL}\) (light load) ≈ 0.05 V
Max undistorted output amplitude \(V_\text{out,max}\) ≈ 2.45 V
Max input amplitude before clip, \(G=10\) ≈ 0.245 V
Harmonics present when clipped odd: \(f_0, 3f_0, 5f_0,\dots\)

(Predicted rails assume ~50 mV saturation; use your measured values for the real window.)

Analysis & reconciliation

Back out the true saturation voltages from the flat-top/bottom cursor readings and recompute \(V_\text{out,max}\) and \(A_\text{in,max}\); they should match the observed clipping onset within a few percent. If clipping is asymmetric (top clips before bottom or vice-versa), your bias point isn’t exactly mid-rail — measure VB and explain the offset (divider tolerance, input bias current through the 100 kΩ). In the FFT, confirm the harmonics are predominantly odd and that the 3rd harmonic is the largest of them; a strong even harmonic content signals asymmetric clipping (unequal top/bottom), consistent with a bias offset. Tie it back to sampling: name the lowest harmonic that would exceed a nominal ADC Nyquist (say \(f_s/2\) for \(f_s\) you’ll pick in Module 5) and note that it would alias — the concrete reason clipping upstream of the converter is fatal.

Going further

  • Drop the gain to \(G = 2\) and find the new (larger) undistorted input range — clipping onset scales as \(1/G\), connecting this lab back to the gain–bandwidth trade of Lab 4.2.
  • Feed a two-tone input (sum of two sines from the DAC) and clip it: the FFT now shows intermodulation products (sums/differences of the tones), not just harmonics — the more insidious form of nonlinear distortion.
  • Quantify THD (total harmonic distortion): from the FFT, THD \(= \sqrt{\sum_{n\ge2} V_n^2}\,/\,V_1\). Watch it rise from ~0% (clean) to tens of percent (hard-clipped) as you sweep amplitude.
  • Everything here reappears in Lab 6.3, where the STM32 computes the same spectrum in real time.