Operational amplifiers (Op amps) Recall the basic two-port model for an amplifier. It has three components: input resistance, Ri, output resistance, Ro, and the voltage gain, A. v R o R i v d Av d v Also recall that the it is better for an amplifier to have large input resistance and small resistance in order to minimize the voltage divider effects at the input and output. R S R o v v S v R i v d Av d R L = [ R i R i R S A R L R L R o ] v s Voltage divider ratios go to 1 as Ri and Ro 0. EE 230 op amps 1
Ideal op amps An ideal operational amplifier (op amp) extends the notions of high input resistance and low output resistance to their extremes: Ri, Ro = 0. v i = 0 v d Av d v = Av s In practice, no real amplifier reaches these ideal extremes, but many come close close enough so that the ideal can be used a reasonable starting approximation. There are two important consequences of using the ideal resistance values: There will be no voltage divider effects at either the input or output. There is no current flowing in (or out) of the input terminals due to the effective open circuit at the input. EE 230 op amps 2
Op amp gain and feedback The third aspect of an ideal op amp is that the gain is very large so large that we can treat it as being effectively infinite. Of course, this idea leads to some obvious issues, since infinite gain means infinite output voltage. Unless the input voltage is zero this is the key. We use feedback to force the input voltage to be (nearly) zero. v d A v o = Av d v f β Recall feedback systems from EE 201. Using feedback, a sample a smallish fraction of the output (βvo) is fed back to the input. The amount fed back is vf = βvo. The sample is subtracted from the input, and the difference, vd = vi v f, becomes the input to the amplifier. The subtraction makes this negative feedback. (Positive feedback is also possible. It can be useful in some circumstances, but generally we avoid positive feedback.) The feedback factor β is a fraction, typically 0.01 < β < 1. EE 230 op amps 3
v d A v o = Av d v f β The output is the difference signal multiplied by A, which is the openloop gain of the amplifier. = A 1 Aβ The closed-loop gain of the system (amplifier feedback) is G = = A 1 Aβ The difference signal can be expressed as: v d = 1 Aβ EE 230 op amps 4
If the open-loop (or forward) gain of the amp, A, is very large (going to infinity) such that Aβ >> 1, then = A 1 Aβ 1 ( β ) G = 1 β v d = v f = 1 Aβ 0 We see two obvious consequences of having very large forward gain in a feedback arrangement: The closed-loop gain depends only on the properties of the feedback network. The specific value of the forward gain of the amp becomes irrelevant as long as the gain is big enough, the feedback network will determine the performance of the closedloop circuit. The difference voltage is forced to go to zero. The action of the feedback system causes the output voltage to adjust so that the fraction being fed back (vf) matches the input voltage. In the op amp, this means that v = v. This is sometimes called a virtual short. EE 230 op amps 5
Voltage divider feedback network In principle, there are many circuit configurations that could be used to feed back the output to the input. (The feedback network could even include an amplifier.) However, the most common feedback circuits are simple voltage dividers. Dividers easily provide a fraction of the output voltage for the feedback, and they can be made arbitrarily precise by choosing better resistors. (Resistors with 0.1% tolerance are relatively cheap and readily available.) R 2 v f Yes, it looks backwards, but that s the idea. v f = β = Choose your ratio. EE 230 op amps 6
Put the pieces together. v i = 0 R 2 v d Av d v v f R o 1 v source ideal amp feedback i = 0 v v d Av d v R 2 v f Drawn this way, the circuit looks a bit confusing, but it follows directly from the block diagram. G = = EE 230 op amps 7 = A 1 Aβ A 1 A
Forget feedback solve it as a circuit It is not necessary try to identify A and β and use the feedback formula. We can just solve this as a circuit. = v d v f = Av d R v f = 1 v R o 2 Putting it all together, G = = A 1 A Also, i = 0 v d = v f v v d Av d v R 2 v f = = 0 A 1 A Solving feedback amps as simple circuits will be the usual approach. EE 230 op amps 8
Power supplies and ground As we have seen previously, an amp needs one or more DC supplies in order to function. The extra power that is added to the signal when it is amplified comes from the DC supplies. Without them, the amp is just a dead element squatting in the middle of the circuit. We don t always show the supplies, but in a real circuit, they must be present. The common connection for the supplies becomes a convenient node to define as the ground in the circuit. Since all electronic circuits must have power supplies, the circuit ground will (almost) always be defined by one of the terminals of a DC source. This ground allows for some short-hand in the circuit diagrams. v Also, the output of a standard op amp is referenced to the power supply ground. (There are differential output amps, but they are specialty components.) standard 2-port ideal, with ground generic ideal op amp R o v v R i v d Av d v o v d Av d v v v EE 230 op amps 9 vo
We could include all of the power supplies and other sources explicitly. Then amp with voltage-divider feedback might look like this: / supplies single supply V S V S V S v o v i R1 These are kind of messy. EE 230 op amps 10
We rarely draw in the power supplies explicitly. (Except maybe in SPICE.) To simplify, we might indicate the presence of the sources (referenced to ground) by labeling the nodes where they are attached. / supplies single supply V S V S V S And most often, we even ignore the power supply connections, simplifying the circuit diagram further. (However, we must be aware of the power supplies being used, because they will affect the performance of the op amp. EE 230 op amps 11
Ideal op amp We will represent ideal op amps with the simple triangle component, with two inputs and a single output, all referenced to ground. v v vo v non-inverting input v_ inverting input As mentioned previously, we will not solve op-amp circuits by trying to identify the forward and feedback parts of the circuit. This is simply too difficult, except in the very simplest configurations. Instead we use 3 simple op-amp rules that come from the characteristics of an ideal op amp when used with negative feedback and solve the circuit directly. 1. i = i_ = 0 due to infinite input resistance 2. v = v_ due to infinite gain in a negative feedback config 3. no voltage dividers when cascading due to Ro = 0. Item 2 is sometimes referred to as the virtual short. EE 230 op amps 12
Non-inverting amplifier An input source is connected to the noninverting terminal and a simple voltage-divider feedback connects output to inverting terminal. Write a node equation at the inverting terminal. v = v i Apply the op-amp rules: v = v = vi (virtual short due to feedback) i = 0 (infinite input resistance) = = ( 1 ) G = = ( 1 ) Probably worth memorizing. EE 230 op amps 13
General approach for solving circuit with ideal op amps In principle, any of the 201 circuit analysis techniques are viable when solving op-amps. Because of the ground defined by the power supplies, the nodevoltage technique is almost always useful. Mesh currents might be used, but the fact that no current flows in the input leads can making finding useful meshes tricky. (Save mesh current for EE 303.) With multiple inputs, superposition may be useful. Voltage dividers are always useful. Because no current flows in the input leads, we can apply voltage dividers directly to the inputs. Usually, writing a node-voltage equation at the output is not useful, because we can t know the output current. Be careful with the idea of the virtual short (or virtual ground). It is NOT a true short circuit in regards to currents. Generally, write some NV equations at the inputs, set v = v and see what happens. EE 230 op amps 14
Inverting amplifier Non-inverting terminal connected to ground. Input source connected to the inverting terminal through resistor R1. Feedback resistor R2 connects output back to inverting terminal. vo Write a node equation at the inverting terminal. v = v Use the op-amp rules: i v = v = 0 (This is a virtual ground.) i = 0 = In this case, the β of the feedback network is not obvious. This will be in the case in most op-amp circuits. Fortunately, we can use simple circuit analysis to find gain, etc. = G = = Note the negative sign! Also worth memorizing. EE 230 op amps 15
Watch out of the input resistance (and other changes) It is important to note that even though the op amp is ideal, the combination of the op amp and the feedback network may not be ideal. As a case in point, consider the input resistance seen by the source in the non-inverting and inverting amps. ii = 0 ii 0! vo i i = v = Ri Using the op amp to best effect. R i = i i = Maybe not that big!! Generally, it is a good idea to keep the resistors used in op-amp circuits bigger than 1 kω. EE 230 op amps 16
Non-inverting with gain of 10 ( = 9 kω and = 1kΩ) Inverting with gain of 10 ( = 10 kω and = 1kΩ) EE 230 op amps 17
Don t panic if the feedback loop gets crazier. Use node voltage. At the inverting terminal: v At node x: = v i 1 k! ir1 10 k! 10 k! ir2 R 3 1 k! v x R 4 ir3 ir4 vo v v x = v x R 4 v x R 3 Apply the op-amp rules: v = v = 0 (Again, a virtual ground.) i = 0 Use the two equations to eliminate vx and solve for the gain: = v x = v x R 4 v x R 3 G = = ( R 4 R 4 R 3 ) Inserting resistor values: G = 120. Big gain without big resistors. EE 230 op amps 18
Summing amp Note: From this point on, we will apply the op amp rules at the outset. 1 2 3 R 3 R f At the inverting terminal: v = v = 0 (virtual ground). Write a node equation there. (Or use superposition.) 1 2 3 R 3 = R f = ( R f 1 R f 2 R f R 3 3 ) Note the negative sign. (Can follow with another amp with G = 1, if desired. The virtually grounded inverting terminal becomes a summing node. With proper choice of the resistor ratios, all sorts of interesting functions become possible, including a digital-to-analog converter (DAC), which we will see later. EE 230 op amps 19
Difference amp In many applications (often involving sensors) we need to amplify small differences between two inputs va and vb. Any voltage that is common to both inputs should be suppressed. (Let s start using the op-amp rules at the outset.) v b v a R 3 R 4 At the non-inverting input: v a v R 3 = v R 4 At the inverting input: v b v = v v = R 4 R 3 R 4 v a = ( 1 ) v v b v = v = ( 1 ) ( R 4 R 3 R 4 ) v a v b EE 230 op amps 20 if = R 4 R 3 = (v R a v b ) 1 Difference only!
The performance of the difference amp depends critically on the matching of the resistors. To see more clearly how the difference amp distinguishes between common and difference signals, we can express va and vb in those terms. va = vdif vcom vb = vcom = ( 1 ) ( R 4 R 3 R 4 ) (v dif v com) v com = ( 1 ) ( R 4 R 3 R 4 ) v dif ( 1 ) ( R 4 R 3 R 4 ) v com = G d v dif G c v com G d = ( 1 ) ( G c = ( 1 ) ( R 4 R 3 R 4 ) R 4 R 3 R 4 ) Difference-mode gain. Goes to R2 /R1 if R2 /R1 = R4 /R3. Common-mode gain. Goes to 0 if R2 /R1 = R4 /R3. EE 230 op amps 21
Common-mode rejection ratio A commonly used measure of how well the difference amp suppresses the common signal is the common-mode rejection ratio (CMRR). It is defined as the ratio of the difference-mode gain to the common-mode gain. CMRR = G d G c Inserting the two gain expressions from the previous page: CMRR = ( 1 ) ( ( 1 ) ( R 4 R 3 R 4 ) R 4 R 3 R 4 ) If all resistor ratios are perfectly matched, expect CMRR to be large. CMRR = 0. So we Suppose matching is not perfect. For example, if R2 /R1 = 10 and R4 /R3 = 9.9, then CMRR = 1089 a big number, but definitely not infinity! Often, CMRR is expressed using decibels. For example CMRR = 1089 = 60.7 db. EE 230 op amps 22
Unity gain buffer Non-inverting amp with R2 = 0 and R1. So G = 1, meaning vo = vi. This seems a bit dumb. What good is it? R S is R L v S L = 0 i R L v L = R S Simple voltage divider. v L = R Insert the buffer. Now, is = 0 and vi = v = L v R L R i v = vl. No voltage divider! The infinite S Unless RL >> RS, much of the voltage and power are lost in RS. input resistance and zero output resistance of the amp make this work. We can use the buffer anytime that we need to isolate two mismatched circuits. EE 230 op amps 23
A practical example We might like to use a potentiometer as voltage divider to reduce a voltage level, as in the case of making a volume control for an audio amp or to provide a reference voltage from a power supply. However, as soon as a load is attached to the divider, the voltage changes. Recall that the total resistance of the potentiometer is divided into two resistances by the wiper, RT = R1 R2. unloaded v 1 v 1 = R T loaded buffered v 1 R L v 1 R L v L v 1 = R L R L v L = v 1 = R T EE 230 op amps 24
Instrumentation amplifier Recall the difference amp: If the ratios are matched ( R4 /R3 = R2 /R1 ) then the circuit becomes a serviceable difference amp with vo = Gd (va vb) and high CMRR. v b v a R 3 R 4 But it could be better. First, the input resistances seen by va and vb depend on the values of R1 and R3, which might be smallish. Secondly, it might be nice to be able adjust the gain using a potentiometer, but that is difficult because of the requirement that ratios be matched. First improvement: add unitygain buffers to each input. The input resistances go to infinity (ideally) without changing the gain or the CMRR. v y v x EE 230 op amps 25 v b vb = vy va = vx v a
A second modification leads to the instrumentation amplifier. Add two matched resistors R 3 and a single resistor R 4 to turn the two input amps in pseudonon-inverting amps. We note some things based on the op amp rules. v y v = vy ir4 v = vx v x R 4 R 3 R 3 ir3x ir3y v b v a vr4 = vx vy ir3x = ir3y = ir4 i R4 = v x v y R 4 Now, put it all together. Use KVL, starting at node a. v a i R3x R 3 i R4 R 4 i R3y R 3 = v b v a v b = i R4 (2R 3 R 4 ) v a v b = ( 2R 3 R 4 1 ) ( v x v y) = ( ) ( v a v b ) (Still true!) R = 2 2R 3 1 ( ) ( R 4 ) ( v x v y) Still a difference amp. If R4 is a potentiometer, the gain is variable! EE 230 op amps 26
Integrating amplifier Consider an inverting amp with a capacitor as the feedback element. ir = ic (t) R i R i C v C C (t) (t) R v C = (t) R = C dv C (t) dt = C d (t) dt d = 1 RC (t) (0) (t) dt dv o = 1 RC t 0 (t ) dt (t) (0) = 1 RC (t) = 1 RC The output as a function of time is the integral over time of the input. t 0 t 0 (t ) dt (t ) dt (0) EE 230 op amps 27
C (t) R (t) (t) = 1 RC t 0 (t ) dt (0) If the input is a constant voltage, vi(t) = V1, then (t) = V 1 RC t (0) The output starts at whatever value it has t = 0, and then ramps in time with slope V1/RC. If V1 is positive, the output ramps down in time, and if V1 is negative, then the output ramps upward. If the input switches back and forth between two constant values (square wave), then the output ramps up and down correspondingly (sawtooth). V 1 (t) (t) t t V 2 t = 0 EE 230 op amps 28 t = 0
A practical concern with integrating amps: If there is a small, but constant, DC voltage at the input (and we will see later that most op-amps come with built-in DC error voltages at the inputs), then that voltage will be integrated forever and the output will go to infinity. (In reality, it will saturate at the power supply limit.) to infinity and beyond! C (t) v DC = 1 mv R vo (t) v DC RC t t This is a problem because at DC, the capacitor is an open circuit and the amplifier has essentially infinite DC gain. To make it better, put a resistor in parallel with the cap, >>. This limits the DC gain to R2 /R1. (t) C (t) EE 230 op amps 29
Differentiating amplifier Op amps can also differentiate. Switch resistor and capacitor. R (t) i C C i R (t) ic = ir vc = vi C dv C dt = R (t) = RC d dt However, differentiating amps are not used much. If there is noise at the input (characterized by random, fast variations), the differentiator tends to make it worse. The integrator, on the other hand, tends to average out the effects of noise. EE 230 op amps 30
Loading and cascading An ideal amp has an (ideal) dependent voltage source connected directly to the output with no output resistance. So the ideal amp will be able to source any amount of current, and it will not matter what load is attached. i o resistive loads diodes R D R L i o I o anything! In all cases: = ( 1 ) We will learn soon enough that this is a gross over-simplification. There is not unlimited current available, and we will have to be very careful about how our op amps are loaded. EE 230 op amps 31
Cascading amps Zero output resistance means that we can create the various types of circuits as building blocks for more complicated circuits. R4 R3 va vb = R5 vo1 inverting non-inverting R6 vo3 R2 = = EE 230 summing vo2 = R1 R7 op amps 32
20 k! R5 10 k! R2 R1 vs 1 k! vo1 vo2 8 k! summing 2 k! = = = =. want vo2 / vs. =.. Feedback loop around feedback loops!! = = EE 230 R3 R4 non-inverting. op amps 33
Study questions 1. Complete the algebra to find the gain of the circuit on slide 18. 2. In the buffered amp circuit described on slide 23, calculate the power delivered from the source and the power delivered to the load. Where is the extra power coming from? 3. As an alternative, use superposition to find the output voltage of the summing amp in terms of the inputs. 4. Do the algebra to show that the difference gain of the difference amp reduces to R2 /R1 if the resistors are properly matched. 5. As an alternative, use superposition to calculate the output of the difference amp. EE 230 op amps 34