Operational Amplifiers Electronics: Experimental techniques in the photon sciences Georg Wirth Institut für Laser Physik October 2012 Outline Basics • Complex impedance & the low pass-filter • The decibel scale and Bode plots Introduction General characteristics • Basic operation • The ideal op-amp The Concept of Feedback • Basic idea of feedback • The noninverting and inverting amplifier Circuit Examples • Summing and differential amplifier • Integrator and Differentiator • Nonlinear applications Real op-amps • Frequency Response and Slew Rate • Input Offset Voltage and Bias Current Grounding problems Georg Wirth, Institut für Laser-Physik 2 Complex impedance u(t), i(t) Sinusoidal signals u (t ) uˆ exp( jt ) i (t ) iˆ exp( jt ) voltage current t impedance • Z u (t ) Z exp(i ) i (t ) Capacities have to be charged first to have a certain voltage du dt 1 Z ( ) j C iC Im • Voltage drop over ohmic resistor is proportional to current uL Im Re Re 2 Georg Wirth, Institut für Laser-Physik Current change through coil induces voltage drop di dt Z ( ) jL u R i Z ( ) R Im • 3 2 Re The decibel scale • decibels (dB) measure the power (intensity) ratio on a logarithmic scale → transfer functions of consecutive elements can be “added”, e.g. gain of two amplifiers P G 10 log10 E PA • In electronics, the power of a signal is usually proportional to the squared field amplitude (e.g. P = u2 / R for an ohmic resistor) u E2 u G 10 log10 2 20 log10 E uA uA dB power amplitude • -20 -3 0 3 10 20 30 1/100 1/2 1 2 10 100 1000 1/10 1/√2 1 √2 √10 10 √1000 Suffix indicates fixed reference → absolute quantity – – – dBV → relative to 1 V (0 dBV = 1 V, 20 dBV = 10 V) dBm → relative to 1 mW (0 dBm = 1 mW, 30 dBm = 1W) dBc → power ratio to carrier (e.g. for sideband modulation) Georg Wirth, Institut für Laser-Physik 4 The low-pass filter • • Many physical systems show low-pass characteristic, i.e. they linearly transmit a signal with a certain time delay (PT1 element in controller theory) Exponential step response characteristic u : t 0 input signal step u E 0 0 : else uR R uE i du A u A 0 dt R u A (t ) u0 exp(t / ) with RC • • • for t 0 is iC iR 0 1 j C uE(t), uA(t) uA C t 0 The complex transfer function H(jω) relates the output uA(t) to the input uE(t) signal via a (magnitude) and a phase shift translate linear DE into frequency space via Laplace- / Fourier-transformation, transfer function is a fraction of polynomials poles and zero characterize transfer function (→ control theory) ohm' s law u E i Z R Z C u A i ZC transfer function H ( j ) uA 1 / j C 1 u E R 1 / jC 1 jRC 1 gain G ( ) H ( j ) phase ( ) arctanH ( j ) arctan Georg Wirth, Institut für Laser-Physik 1 ( / 0 ) 2 with 0 0 5 1 RC Bode plots • • Characterize transfer function by plotting magnitude (in dB) and phase on a log. frequency scale Polynomials appear as straight lines, poles and zeros can be seen as “kinks” DC gain -3dB at cut-off -20 dB / decade 1 gain G ( ) phase ( ) arctan 1 ( / 0 ) with 0 1 RC 0 cut - off Z R ZC output uA phase 2 1 0 RC 1 uE 2 arctan(1) / 4 Georg Wirth, Institut für Laser-Physik - π/4 6 Pros and Cons of op-amps Basic idea: + Use integrated circuit (black box – internal realization unknown) as a modular device to manipulate signals, so that behavior of the circuit is purely characterized by external elements. → – circuit symbol Why not use a transistor? Advantages of op-amps • Versatility - operation only determined by external surrounding circuit • No bias current needed to determine operation point • High input impedance, low output impedance • High intrinsic gain • Very linear and precise amplification over broad voltage an frequency range TO-99 (transistorsingle-outline) Disadvantages • higher noise due to multiple amplifier stages • lower cut-off-frequency than single-stage transistor amplifiers • Strong feedback over multiple amplifier stages causes non-linear distortions Georg Wirth, Institut für Laser-Physik SOIC-8 (small-outlineintegrated-circuit) CERDIP / PDIP (dual-inline-package) 7 Basic operation and wiring Typical pin assignment • inverting (-) and noninverting (+) input (2,3) • voltage difference uD = u+ - u- between inputs is amplified linearly by factor A0 (open-loop-gain) to output uA = A0∙( u+ - u- ) (6) • every potential is measured relatively to ground potential (usually GND or 0V) • two connections (4,7) for power supply V ± (usually ±15V) • no separate ground connection, output ground reference by uA = 0 for u+ - u- = 0 (for ideal op-amp) • usually two extra pins for external offset compensation (8,1) uA 10 V 2 A0 = 105 uD uD -100 µV u 100 µV linear Georg Wirth, Institut für Laser-Physik 3 saturation 8 7 + V- = 8 - 1 6 – 4 - u -10 V saturation + V+ = + uA The ideal op-amp Parameter Symbol Ideal Real (OP27) Input Impedance Differential-Mode zD ∞ 4 MΩ || ≤ 1 pF Input Impedance Common-Mode z+ , z- ∞ 2 GΩ || ≤ 1 pF Input Bias Current i+ , i- 0 ±15 nA Input Offset Voltage u0 0 30 µV Output Impedance zA 0 70 Ω Unity Gain Bandwidth f (A0 = -3 dB) ∞ 8 MHz Open-Loop-Gain A0 = duA/duD ∞ 106 = 120 dB Common-Mode Rejection Ratio A0 / duA/d(u+ + u-) ∞ 106 = 120 dB Slew rate max(duA/dt) ∞ 2.8 V/µs i + z uD u i ~ zD – zA z uA Georg Wirth, Institut für Laser-Physik u virtual GND real GND 9 Basic idea of feedback Problem • open-loop-gain A0 too high, input voltage range of ≤100 µV to small • amplification A not adjustable • gain A0 determined by device (and hence differs between various devices), instabilities Solution • • op-amp feed factor kF of output signal back into input signal experiences certain amplification / attenuation and phase shift while passing the loop, effect determined by phase difference at inputs input error output plant ± feedback controller Consequences • reduced gain, but improved linearity, frequency response, bandwidth and stability • more negative feedback results in less dependency on device parameters • in general, feedback can be frequency-dependant (equalizers and filters) or amplitude-dependant (logarithmic amplifiers or multipliers) The “golden rules” concerning op-amps 1. The output attempts to do whatever is necessary to make the voltage difference between the inputs zero (infinite open-loop-gain). 2. The inputs draws no current (infinite input impedance). Georg Wirth, Institut für Laser-Physik 10 The noninverting amplifier • realize controller by voltage divider R2-R1 , rising output voltage hinders input difference u+-u- R1 uA R1 R2 negative feedback u output signal R1 u A A0 (u u ) A0 (u E uA ) R1 R2 u closed- loop- gain 1 u R1 A A u E A0 R1 R2 ideal OP - Amp A • • + – uE R2 uA 1 R1 R1 R2 R 1 2 R1 R1 R1 R2 u R1 from feedback u A A0 (u u ) virtual short- circuit 1 R R2 u u u u 1 R1 0 A u u uE 0 • u because generally A0 >> A, the input voltage difference tends to zero (virtual short-circuit) (complies with 1st golden rule) high input impedance (1012Ω), low output impedance (101Ω) for R2 → 0 and R1 → ∞ the closed-loop-gain A → 1, op-amp works as buffer (voltage follower) Georg Wirth, Institut für Laser-Physik 11 + – u A uE The inverting amplifier • • connect input signal uE to lower end of feedback voltage divider R2-R1 assume input voltage uE = 1V , but no output uA = 0V – since noninverting input is connected to GND u+ = 0V, op-amp sees high input unbalance – this forces the output uA to go negative, until both input are on GND u+ = u- = 0V kirchhoff' s junction rule open loop gain u D u A A0 high op - amp impedance 0 i 0 uE uD u A uD z1 ( ) z 2 ( ) u A z1 • • z2 ( ) 0 i1 i2 i closed loop gain A( ) input impedance z E ( ) uE z1 ( ) u i1 u – + i2 uA u A z 2 u A z1 u E z 2 A0 A0 uA z2 z ( ) 2 uE z1 z 2 A0 z1 A0 z1 ( ) du E z1 ( ) diE frequency-dependant (but linear) feedback provides active filters, integrators, differentiators non-linear feedback allows to build amplitude-dependant devices, i.e. exponential or logarithmic amplifiers Georg Wirth, Institut für Laser-Physik 12 The summing amplifier Problem • summing currents is easy, but since all potentials are grounded, how to add potentials? Solution • take inverting amplifier and add currents in feedback loop • assume that high input impedance i- = 0 and virtual GND u+ ≈ u- = 0 kirchhoff' s junction rule Rn 0 i1 i2 in iF in u u u u 1 2 n A R1 R2 Rn RF R2 R1 i1 closed - loop - gain Georg Wirth, Institut für Laser-Physik R R1 R2 Rn uA RF u1 u2 un R 13 iF i2 u u u u A RF 1 2 n Rn R1 R2 assume equal inputs RF u2 u1 u u – + uA The differential amplifier Problem • measure voltage drop over some impedance, what if none of both connections has GND contact? Solution • use features from both inverting and noninverting amplifier virtual short - circuit u u u2 kirchhoff' s junction rule 0 i1 iN R uA N R1 insert u if R1 R2 and RP RN uA RP R2 RP RN u1 u u A u R1 RN R R 1 u1 1 N u2 R2 RP 1 R1 u u u1 u2 R2 – + RP RN u1 u2 R1 Caution • assume RN = α · R1 and thereby the closed-loop-gain A = - α, resistors have tolerance Δα CMRR A • • du A (1 ) d (u u ) error, if resistor values differ different input impedances require source with low output impedance better results with instrumentation amplifier Georg Wirth, Institut für Laser-Physik 14 uA The integrator – frequency response • • use inverting amplifier with RC-high-pass C2-R1 filter in feedback strong negative feedback for high frequencies (respectively weak feedback for low frequencies) results in low-pass-characteristic R3 use z1 ( ) R1 and z 2 ( ) (C2 R2 ) || R3 closed loop gain A( ) • • R3 (1 jR2C2 ) 1 j ( R2 R3 )C2 R z 2 ( ) 1 jR2C2 3 z1 ( ) R1 1 j ( R2 R3 )C2 missing feedback at ω = 0 makes circuit instable, insertion of bypass R3 limits feedback at low frequencies attenuation (|A| < 1) at high frequencies can be avoided by insertion of R2 lower limit A( 0) ADC 1 1 ADC 1 A(1 ) 2 2 2 ( R3 2 R3 R2 R2 ) C2 upper cut - off A( ) upper limit 2 A A( ) A Georg Wirth, Institut für Laser-Physik R1 u i1 u uE log A( ) R3 R1 lower cut - off 2 R2 ADC i3 C2 – i2 + uA integrating range R3 ( R3 2 R3 R2 R2 ) 2 R2 ( R2 R3 ) C2 2 2 R2 R3 R1 ( R2 R3 ) 20 dB/dec A 0 15 R2 log 1 2 The integrator – operating method closed loop gain A( ) kirchhoff' s R z 2 ( ) 1 jR2C2 3 z1 ( ) R1 1 j ( R2 R3 )C2 R3 0 i1 i2 i3 u d (u A u R 2 ) u A E C2 R1 dt R3 junction rule R2 Approximations • • for frequencies far above lower limit ω >> ω1 , current i3 = uA / R3 can be neglected (shortened by C2) for frequencies far beneath upper limit ω << ω2, impedance of C2-R2 is dominated by condensator, so the voltage change duR2/dt over R2 can be neglected u du 0 E C2 A R1 dt • • uE R1 u i1 u i3 – i2 + t 1 u A (t ) u E (t ) dt u A (0) R1C2 0 integration constant uA(0) = Q0 / C is determined by initial condensator charge and capacity input bias current i- and input offset voltage u0 result in additional condensator current u0 / R + i-, which changes output voltage by du A 1 u0 i dt C2 R • C2 i- = 1 µA results with C = 1 µF in a change of 1 V per second (offset compensation) Georg Wirth, Institut für Laser-Physik 16 uA The differentiator – frequency response • • swap condensator and resistor in integrator RC-low-pass filter R2-C1 delivers in high negative feedback for low frequencies, resulting in a high-pass characteristic use z1 ( ) R1 closed loop gain A( ) • • • 1 1 jR1C1 and z 2 ( ) R2 jC1 jC1 R2 z 2 ( ) jR2C1 z1 ( ) 1 jR1C1 C1 R1 at high frequencies ω, missing feedback makes circuit unstable HF noise is strongly amplified, circuit tends to oscillate due to phase delay of op-amp and feedback gain limiting at high frequencies can be achieved by insertion of R1 u i1 uE lower cut - off A( ) 1 1 upper cut - off 1 A A(2 ) 2 2 1 upper limit Georg Wirth, Institut für Laser-Physik i2 – + uA log A( ) differentiating range A( 0) ADC 0 lower limit u 1 R2 R1 C1 2 2 20 dB/dec 1 R1 R2 R1 C1 A( ) A R1 A 2 R2 R1 17 log 0 1 2 The differentiator – operating method closed loop gain A( ) kirchhoff' s z 2 ( ) jR2C1 z1 ( ) 1 jR1C1 0 i1 i2 junction rule C1 R2 d (u E u R1 ) u A dt R2 R1 i1 Approximation • • u u i2 – + for frequencies far beneath upper limit ω << ω2, impedance of R1-C1 is dominated by condensator, so the voltage change duR1/dt over R1 can be neglected 0 C1 • uE C1 du E u A dt R2 u A (t ) R2C1 du E dt differentiator is bias-stable, optional roll-off-condensator in feedback can reduce bandwidth (bandpass) capacitive input impedance draws current from source, problems possible at high frequencies Georg Wirth, Institut für Laser-Physik 18 uA The logarithmic amplifier Problem • measured signal has large dynamic range Idea • instead of linear characteristic curve iR = uR / R of a resistor, use exponential I-U-dependency of semiconductors • use collector current iC of a bipolar transistor iC iCS (T , uCE ) exp uBE uT iCS uT = kT/e • • • • C iC R uBE uT ln iC iCS uE 0 – + B E uA reverse leakage current thermal voltage since u A u BE , iC u E R u u A uT ln E iCS R (for u E 0) no error due to collector-base-current iCB, since uCB = 0, but temperature drift with appropriate transistor and op-amp with low bias-current, usually nine decades available swap resistor and transistor: exponential amplifier multiply / divide signals by taking logarithm, add / subtract, take exponential value Georg Wirth, Institut für Laser-Physik 19 The comparator Problem • device for comparison of two signals, which decides if voltage is below / above some threshold Solution • use op-amp without feedback to compare voltages (comparator) • because of high open-loop-gain, circuit is sensitive to small voltage differences uD and switches between saturated values -uAmax and uAmax • in saturation no virtual short-circuit between inputs, i.e. u+ ≠ u- u – uA u uA for u u u u A A max u A max for u u • • + uD u A max useful for regeneration of digital signals or as trigger special devices for fast applications uD uA uD u A max t saturation Georg Wirth, Institut für Laser-Physik 20 saturation The noninverting Schmitt trigger Problem • comparator has no well-defined output for small input signals uD ≈ 0 • different switching values for high and low state desired Solution • use positive feedback to create hysteresis for switching input • • u R4 uref R3 R4 u R2 R1 u u uE R3 uref + – uA R4 R2 u E u A R1 R2 assume high positive input uE, so that output is uAmax with falling input voltage uE, output uA remains unchanged until u+ = u- = 0 upper switching point u E ,on lower switching point u E ,off R4 R1 R2 uref u A max R2 R3 R4 R4 R1 R2 uref u A min R2 R3 R4 uA uD uA u A max u E ,on u E ,off Georg Wirth, Institut für Laser-Physik uE u A min t u E ,off 21 u E ,on The real op-amp • • • • • differential open-loop-gain A0 = duA/duD is usually not infinite -> error in approx. A0 = ∞ even with shortened inputs u+ - u- = 0, opamp amplifies common-mode voltage u+ + u-, usually expressed by ratio of differential open-loop-gain A0 to duA/d(u+ + u-) -> common-mode rejection ratio finite input impedance draws current from source, common-mode input impedance (input to GND) usually negligible, effect compensated if adjusted nonzero output impedance negligible, since decrease of output uA by output load is compensated by feedback transistors as well as resistors produce noise, which is amplified towards the output Georg Wirth, Institut für Laser-Physik 22 Parameter Symbol Ideal Real (OP27) Input Impedance Differential-Mode zD ∞ 4 MΩ || ≤ 1 pF Input Impedance Common-Mode z+ , z- ∞ 2 GΩ || ≤ 1 pF Input Bias Current i+ , i- 0 ±15 nA Input Offset Voltage u0 0 30 µV Output Impedance zA 0 70 Ω Unity Gain Bandwidth f (A0=-3 dB) ∞ 8 MHz Open-Loop-Gain A0 = duA/duD ∞ 106 = 120 dB Common-Mode Rejection Ratio A0 / duA/d(u+ + u-) ∞ 106 = 120 dB Slew rate max(duA/dt) ∞ 2.8 V/µs Real op-amps - frequency response • • • real op-amps are multi-stage transistor-amplifiers every single stage represents a low-pass filter with a particular cut-off-frequency ω, that reduces the gain by -20 db per decade and adds a certain phase shift of maximal φ = π/2 log A0 ( ) (subsequent stages usually have increasing bandwidths) if A0(ω) is open-loop-gain, and |kF| ≤ 1 is feedback factor, requirement for oscillation is (negative A0(ωC) input adds phase shift φ = π) k F ( ) A0 ( ) 1 • k F A0 1 arg k F A0 0,2 ,... -40 dB/dec -60 dB/dec log 1 to prevent oscillation at ωC, feedback factor has to be maximal kF ≤ 1 / A0(ωC) (signal gain in one loop passage must be smaller than one) 0 2 If an op-amp is not internally frequencycompensated (and by that not unity-gain stable), external frequency compensation or minimal closed-loop-gain is necessary. Georg Wirth, Institut für Laser-Physik -20 dB/dec 3 2 23 2 ωC 3 Comparison OP27 – OP37 OP27 (unity-gain stable) OP37 (not unity-gain stable) Georg Wirth, Institut für Laser-Physik 24 Bandwidth • frequency-compensated op amps can be regarded as 1st order low-pass ADC A0 ( ) 1 i ( 1 ) • + 1 Ri Ci Ri – for frequencies ω >> ω1 above cut-off, openloop gain is approximately Ci uE R2 A0 ( ) i (1 ADC ) 1 ADC gain- bandwidth- product R1 (unity - gain bandwidth) • • uA usually ADC is in the range of 120 dB, but cutoff frequency very low ω1 / 2 π = 10 Hz use closed-loop gain from noninverting amplifier with feedback factor kF = R1 / (R1 +R2) to calculate new frequency response 1 1 A0 ( ) u R1 A( ) A u E A0 ( ) R1 R2 1 k F A0 ( ) insert A0 ( ) for ω 1 A A 1 i ( 1) i (1 ) A for ω 1 1 R1 A (DC) closed- loop gain k F R1 R2 1 k F 1 ADC closed- loop cut - off frequency ADC log( A0(ω) ) A( ) Georg Wirth, Institut für Laser-Physik 25 log( A(ω) ) A = 1 / kF log 1 ω1´ Slew Rate amplitude-dependant distortion • • • • internal capacities and frequency compensation act as a low-pass, whose output for a unit-step input is a (more or less fast) exponential function output transistors and capacities need driving current from (previous) driving stage, whose output current is limited output change rate is limited to the slew rate SR = max(duA/dt) image sine-wave input signal u E u E max sin t • uA t frequency-dependant distortion du max A A( ) u E max dt uA slew rate limits amplitude of undistorted sine-wave output swing above some critical frequency (power bandwidth) u E max t SR Georg Wirth, Institut für Laser-Physik 26 Input offset voltage and bias current Offset voltage • • • • + output signal uA ≠ 0 even for no input signal u+ = u- = 0, due to unsymmetrical differentialamplifier at input (usually several µV) amplified towards output can be compensated by potentiometer at extra pins problem is temperature drift of usually 1 µV/°C V+ 2 3 - = 10k 7 + 8 1 6 – 4 - = V- + Bias current • input transistors need constant base- or gatecurrent for operation, which is delivered by power supply Bipolar Darlington FET R2 R1 100 nA 1 nA 1 pA – + uE • can be compensated by additional bias resistor RB RB RB R1 R2 R1 R2 Georg Wirth, Institut für Laser-Physik 27 uA Grounding problems Ground connections • • Conductive tracks have nonzero resistance, so flowing currents produce a voltage drop (ground shift) -> separate signal ground from consumer ground If possible, connect every device/component starlike to one common ground reference icon icon Ground loops • • • RF-signal need shielding to avoid crosstalk → use coaxial cables as waveguides Problem: DC-signals need two wires, i.e. a clear voltage reference (usually GND) → shielding provides conductor loop between two grounded casings Time-varying stray fields from transformers induce voltages / currents in loop → a 10 µT stray field of a 50 Hz transformer induces ~100 mV in a 10 m2 conductor loop Georg Wirth, Institut für Laser-Physik casing 1 ~ 28 casing 2 Avoiding ground loops powersupply photodiode controller oscilloscope optical table 1. 2. 3. 4. 5. 6. 7. AOMdriver AOM ADwin switchboard Don’t use shielding as conductor, i.e. signal path Isolate all casings from metal surfaces Use separate power supplies Power supplies don’t need a ground reference Use digital / analog isolators (e.g. ADUM524x and AD210) Measure signals differentially No oscilloscopes at unbuffered / source signals Georg Wirth, Institut für Laser-Physik RFamp 29 optical table References Control theory • G. v. Wichert, Grundlagen der Regelungstechnik (http://tams-www.informatik.unihamburg.de/lehre/2004ws/vorlesung/regelungstechnik/folien/Grundlagen%20der%20Regelungstec hnik_02.pdf) Electronics • U. Tietze, C. Schenk, E. Gamm: Halbleiter – Schaltungstechnik, Springer, Berlin 2002 • P. Horowitz, W. Hill: The Art of Electronics, Cambridge University Press 1989 • T. Matsuyama: Vorlesungsskript Elektronik 1 und 2, Hamburg 2005 Op-amp circuits • Ron Mancini: Op Amps for Everyone. Design Reference. 2 Auflage. Elsevier, Oxford 2003 (http://focus.ti.com/lit/an/slod006b/slod006b.pdf) • Walter G. Jung: OP AMP Applications. Firmenschrift Analog Devices, Norwood 2002 (http://www.analog.com/library/analogDialogue/archives/39-05/Op_Amp_Applications.zip) • Wikipedia (http://en.wikipedia.org/wiki/Operational_amplifier_applications) Datasheets / Manufacturers • http://www.datasheetcatalog.com • ANALOG DEVICES (http://www.analog.com) • Texas Instruments / Burr Brown / National Semiconductor (http://www.ti.com) Georg Wirth, Institut für Laser-Physik 30