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

C6 · Lesson 48 · Comparators and oscillators

Op amps without negative feedback

Take away the negative feedback and an op amp becomes a decision-maker: its output slams to one rail or the other depending on which input is higher. That's a comparator, the boundary between the analog world and the digital one. Add positive feedback and it gains memory, switching at two different thresholds so that noise can't make it chatter. Add a capacitor that it charges and discharges, and it oscillates on its own.

Play

  • A relaxation oscillator: the op amp's output charges C through R; the output switches whenever the capacitor's voltage crosses a threshold set by the divider on the + input.
  • Watch the capacitor's voltage on the scope. Between what two levels does it swing?
  • Change R or C. How does the period change? (A tiny step source starts it, as electrical noise would.)

Predict

In the oscillator above, the divider feeds half the output back to the + input, and the output swings between +10 V and −10 V. Between what levels does the capacitor swing?

Name it

Comparators and positive feedback

Comparator. With no feedback, vout=+Vsat when v+>v− and −Vsat otherwise. If the input is noisy near the threshold, the output chatters, switching several times on each crossing.

Schmitt trigger. Feed a fraction β of the output back to the + input. The threshold then depends on the output's state:

Vth±=±βVsathysteresis=2βVsat

(for an inverting Schmitt with the reference at 0). Once the output switches, the threshold jumps away from the input, so small noise can't switch it back. Digital inputs of microcontrollers use Schmitt triggers for exactly this (C2.26).

Relaxation oscillator. An inverting Schmitt trigger whose input is a capacitor charged from its own output through R. The capacitor heads toward ±Vsat but turns round at ±βVsat:

T=2RCln⁡1+β1−β

which is 2.2RC for β = ½. The output is a square wave; the capacitor's voltage is a train of exponential segments.

In practice. Dedicated comparator chips switch in nanoseconds and have outputs made for logic; op amps used as comparators are slower, limited by their slew rate. The 555 timer is a pair of comparators and a flip-flop built for oscillators and timers. Relaxation oscillators aren't precise (their period depends on R, C and the thresholds); clocks use crystals.

A slow sine with a little fast noise feeds a plain comparator (U1) and a Schmitt trigger (U2) whose thresholds are ±0.5 V. The comparator chatters at each crossing; the Schmitt trigger switches once.

Worked example

A Schmitt trigger on a ±12 V op amp feeds back through 100 kΩ, with 10 kΩ to ground. What are its thresholds?

Show the solution
  1. Feedback fraction. β=10110
  2. Thresholds. β×12 V gives ±1.09 V, so the hysteresis is 2.18 V: noise smaller than that can't make it chatter.

Answer the thresholds are ±1.09 V, 2.18 V of hysteresis.

Worked example

A relaxation oscillator uses R = 10 kΩ, C = 100 nF and β = 0.5. What is its frequency?

Show the solution
  1. Period. T=2RCln⁡1.50.5=2×1ms×1.10=2.20ms
  2. Frequency. f=12.20ms=455Hz

Answer the oscillator runs at 455 Hz.

Worked example

A ±12 V Schmitt trigger must clean a signal that carries 0.3 V of peak noise. With 10 kΩ from the non-inverting input to ground, what feedback resistor gives enough hysteresis?

Show the solution
  1. Hysteresis needed. The noise can swing the input 0.6 V peak to peak, so the hysteresis, 2βVsat, must be at least 0.6 V: β≥0.624=0.025
  2. Feedback resistor. With 10 kΩ to ground, 1010+Rf=0.025 gives Rf = 390 kΩ.
  3. With less. A noisy edge crosses the threshold several times and the output chatters.

Answer a 390 kΩ feedback resistor gives enough hysteresis.

Check

A Schmitt trigger feeds back β = 0.2 of its ±5 V output. What's its upper threshold?

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

Check

Same Schmitt trigger: β = 0.2, ±5 V. How wide is its hysteresis?

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

Check

A relaxation oscillator has R = 47 kΩ, C = 10 nF and β = ½. What's its period?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

A relaxation oscillator has R = 10 kΩ, C = 10 nF and β = 0.8. What's its period?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

Why does a Schmitt trigger switch cleanly on a noisy signal while a plain comparator chatters?

Check

A ±12 V Schmitt trigger must reject 0.1 V of peak noise, with 10 kΩ to ground at its non-inverting input.

(a)

What β does it need?

(b)

What feedback resistor?

Write units the way you normally would: 1.5 kΩ, 1500 Ω and 0.0015 MΩ are the same answer.

Check

A relaxation oscillator has R, C and feedback fraction b.

Step 1

What's its period?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

How does a relaxation oscillator keep oscillating without any input signal?

Practice

Keep practicing

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