1 00:00:00,000 --> 00:00:01,000 All right. Good morning, 2 00:00:01,000 --> 00:00:02,000 all. 3 00:00:09,000 --> 00:00:14,000 You have two handouts, lecture notes and an article on 4 00:00:14,000 --> 00:00:19,000 mixed signal chips. A mixed signal stands for 5 00:00:19,000 --> 00:00:27,000 circuits that have both analog and digital components to them. 6 00:00:27,000 --> 00:00:31,000 The reason I am giving you the handout is that Lab 4 and also 7 00:00:31,000 --> 00:00:36,000 your last homework involve designing and building a mixed 8 00:00:36,000 --> 00:00:39,000 signal circuit. It's a real fun exercise. 9 00:00:39,000 --> 00:00:44,000 And I just wanted to tell you that from past experience people 10 00:00:44,000 --> 00:00:49,000 who have taken 6.002 often view the last lab as the single most 11 00:00:49,000 --> 00:00:06,002 fun thing they did in all of 12 00:00:52,000 --> 00:00:56,000 So, as you go into Lab 4, you should be telling yourself 13 00:00:56,000 --> 00:00:59,000 I should be having fun, I should be having, 14 00:00:59,000 --> 00:01:05,000 I should be having fun. You have to positively psych 15 00:01:05,000 --> 00:01:08,000 yourself. Otherwise, it's going to go by. 16 00:01:08,000 --> 00:01:12,000 And then you're going to say boy, that was fun, 17 00:01:12,000 --> 00:01:16,000 I wish I had savored the moment as I was doing it. 18 00:01:16,000 --> 00:01:18,000 All right. Let's see. 19 00:01:18,000 --> 00:01:21,000 What do we do today? Today's lecture is actually 20 00:01:21,000 --> 00:01:24,000 going to be a fair amount of fun. 21 00:01:24,000 --> 00:01:30,000 We are going to blast through a bunch of fun things. 22 00:01:30,000 --> 00:01:34,000 And some things that you will be quite unprepared for. 23 00:01:34,000 --> 00:01:38,000 Until now, in the last two lectures with op amps we talked 24 00:01:38,000 --> 00:01:42,000 about negative feedback. That is applying some portion 25 00:01:42,000 --> 00:01:47,000 of the output voltage to the negative input so that I could 26 00:01:47,000 --> 00:01:50,000 control this high strung device, my op amp. 27 00:01:50,000 --> 00:01:55,000 Today, what we are going to do is try to get a handle on what 28 00:01:55,000 --> 00:01:59,000 happens if we use positive feedback. 29 00:01:59,000 --> 00:02:03,000 It's the usual curious child. You tell them to do this, 30 00:02:03,000 --> 00:02:06,000 and of course they're going to try to do this as well. 31 00:02:06,000 --> 00:02:11,000 And we are going to try to do that and see what happens and 32 00:02:11,000 --> 00:02:14,000 look to see if we can build some useful circuits. 33 00:02:14,000 --> 00:02:16,000 Today -- 34 00:02:28,000 --> 00:02:31,000 As motivation, let me do a quick review of a 35 00:02:31,000 --> 00:02:37,000 circuit that should now become affixed in your brains in a 36 00:02:37,000 --> 00:02:41,000 standard pattern. This is a circuit that gives 37 00:02:41,000 --> 00:02:44,000 you negative feedback. 38 00:02:56,000 --> 00:02:58,000 R1 and R2. 39 00:03:03,000 --> 00:03:07,000 And I apply a vIN. By now you should be able to 40 00:03:07,000 --> 00:03:11,000 look at this pattern. And this is your inverting 41 00:03:11,000 --> 00:03:15,000 amplifier pattern. So, you should be able to write 42 00:03:15,000 --> 00:03:20,000 down by inspection this is simply vIN or the minus vIN 43 00:03:20,000 --> 00:03:25,000 times R2 divided by R1. This is an amplifier whose gain 44 00:03:25,000 --> 00:03:30,000 is controlled by the ratio of R2 and R1. 45 00:03:30,000 --> 00:03:34,000 This is a negative feedback circuit because it is always fun 46 00:03:34,000 --> 00:03:37,000 to do the intuition thing and say that look, 47 00:03:37,000 --> 00:03:41,000 if this voltage tends to go more positive than I care then 48 00:03:41,000 --> 00:03:44,000 this negative input goes more positive than I care. 49 00:03:44,000 --> 00:03:48,000 If that goes more positive then the negative input v minus 50 00:03:48,000 --> 00:03:52,000 becomes more positive in the plus input which yanks the 51 00:03:52,000 --> 00:03:54,000 output down. So, there is a nice 52 00:03:54,000 --> 00:03:59,000 counteracting force that keeps the output stable. 53 00:03:59,000 --> 00:04:03,000 Let's look at this circuit. Being curious engineers, 54 00:04:03,000 --> 00:04:08,000 let's look at the opposite here where I give myself some 55 00:04:08,000 --> 00:04:12,000 positive feedback in this op amp. 56 00:04:24,000 --> 00:04:27,000 And it is going to be interesting to analyze this 57 00:04:27,000 --> 00:04:32,000 because what we find out on the face of it is not quite actually 58 00:04:32,000 --> 00:04:35,000 how it behaves. We are going to spend most of 59 00:04:35,000 --> 00:04:38,000 the lecture today on understanding the dynamics of 60 00:04:38,000 --> 00:04:42,000 circuits that look like this and to see if we can build some fun 61 00:04:42,000 --> 00:04:46,000 and interesting circuits and systems based on this kind of 62 00:04:46,000 --> 00:04:49,000 positive feedback. It is positive feedback because 63 00:04:49,000 --> 00:04:52,000 I am feeding back a portion of the output to the positive 64 00:04:52,000 --> 00:04:55,000 input. And you should be able to stare 65 00:04:55,000 --> 00:04:58,000 at this and already begin to intuit what should happen to 66 00:04:58,000 --> 00:05:01,000 this. Let's think about it. 67 00:05:01,000 --> 00:05:03,000 This is zero. Remember, with positive 68 00:05:03,000 --> 00:05:08,000 feedback, the famous v plus is equal to v minus method doesn't 69 00:05:08,000 --> 00:05:10,000 apply anymore. Let's apply very simple 70 00:05:10,000 --> 00:05:12,000 analyses. If this is zero, 71 00:05:12,000 --> 00:05:16,000 let's say for example that this output tends to go a little bit 72 00:05:16,000 --> 00:05:18,000 more positive. This output, 73 00:05:18,000 --> 00:05:20,000 due to some noise or perturbation, 74 00:05:20,000 --> 00:05:24,000 tends to go up a little bit. If that goes up a little bit 75 00:05:24,000 --> 00:05:28,000 then because of feedback this node tends to go up a little 76 00:05:28,000 --> 00:05:31,000 bit. If this node tends to go up a 77 00:05:31,000 --> 00:05:35,000 little bit this exacerbates the positive input here and this one 78 00:05:35,000 --> 00:05:38,000 goes cachunk, whacks into the positive rail. 79 00:05:38,000 --> 00:05:42,000 Let's take the other point of view and look at it intuitively. 80 00:05:42,000 --> 00:05:44,000 What if this one tries to droop a little bit? 81 00:05:44,000 --> 00:05:48,000 If it droops a little bit then the input at the plus terminal 82 00:05:48,000 --> 00:05:51,000 droops a little bit. If that tends to go down a 83 00:05:51,000 --> 00:05:55,000 little bit, that makes the output droop further and it goes 84 00:05:55,000 --> 00:05:59,000 and hits into the negative rail. I can see that this circuit 85 00:05:59,000 --> 00:06:02,000 wants to hammer into the positive rail or hammer into the 86 00:06:02,000 --> 00:06:05,000 negative rail because of the positive feedback. 87 00:06:05,000 --> 00:06:08,000 It is like if you give incredibly positive feedback all 88 00:06:08,000 --> 00:06:11,000 the time, and by positive feedback I mean feedback 89 00:06:11,000 --> 00:06:14,000 encouraging the child to do whatever the child is doing. 90 00:06:14,000 --> 00:06:17,000 It could be if he does bad stuff you give a lot of positive 91 00:06:17,000 --> 00:06:21,000 feedback or good stuff you give a lot of positive feedback then 92 00:06:21,000 --> 00:06:24,000 you are guaranteed to have a very good child or a very bad 93 00:06:24,000 --> 00:06:26,000 child. You are not going to have 94 00:06:26,000 --> 00:06:29,000 anybody in the middle. Same way here. 95 00:06:29,000 --> 00:06:33,000 By giving positive feedback you're going to drive this into 96 00:06:33,000 --> 00:06:37,000 the positive rail or drive this into the negative rail. 97 00:06:37,000 --> 00:06:40,000 Now, I am going to analyze this in two steps. 98 00:06:40,000 --> 00:06:44,000 First I am going to analyze this using a method you've seen 99 00:06:44,000 --> 00:06:49,000 before which is replace the op amp with its equivalent circuit 100 00:06:49,000 --> 00:06:52,000 and analyze it statically. And by analyzing it statically 101 00:06:52,000 --> 00:06:56,000 we are going to show that the simple static analysis will 102 00:06:56,000 --> 00:07:01,000 yield the following expression. I put this in quotes, 103 00:07:01,000 --> 00:07:04,000 well, for a reason you will see shortly. 104 00:07:04,000 --> 00:07:09,000 When I apply a plain and simple static analysis here is what I 105 00:07:09,000 --> 00:07:11,000 find. Let's go ahead with the 106 00:07:11,000 --> 00:07:15,000 analysis and see what is basically different about these 107 00:07:15,000 --> 00:07:17,000 two. And, first of all, 108 00:07:17,000 --> 00:07:22,000 I will confirm for you that our naive analysis we have seen so 109 00:07:22,000 --> 00:07:25,000 far will give rise to that expression. 110 00:07:25,000 --> 00:07:30,000 So, let's go ahead and analyze that circuit. 111 00:07:30,000 --> 00:07:38,000 And to analyze that circuit what I will do is replace the op 112 00:07:38,000 --> 00:07:46,000 amp with its equivalent circuit. If you remember the op amp is 113 00:07:46,000 --> 00:07:54,000 characterized by the following circuit, A times v+ minus v-, 114 00:07:54,000 --> 00:07:59,000 vOUT. This is the equivalent circuit 115 00:07:59,000 --> 00:08:04,000 of my op amp. And let me just impose that 116 00:08:04,000 --> 00:08:11,000 external circuit on this op amp. I have grounded my v- terminal. 117 00:08:11,000 --> 00:08:16,000 My v+ terminal goes through a resistor and a supply, 118 00:08:16,000 --> 00:08:20,000 the v into ground, it's the resistance R1. 119 00:08:20,000 --> 00:08:25,000 This terminal goes to the output through a resistor R2. 120 00:08:25,000 --> 00:08:30,000 So, this is the equivalent circuit. 121 00:08:30,000 --> 00:08:35,000 And I can apply the same good-old techniques I have 122 00:08:35,000 --> 00:08:42,000 learned about all through this course to this circuit and see 123 00:08:42,000 --> 00:08:45,000 what vOUT looks like. Very simply, 124 00:08:45,000 --> 00:08:51,000 vOUT is this expression here A times v+ minus v-. 125 00:08:51,000 --> 00:08:56,000 And because of my ground connection v- is zero. 126 00:08:56,000 --> 00:09:02,000 Then let me go ahead and replace v+ with the voltage that 127 00:09:02,000 --> 00:09:07,000 relates vOUT and vIN. What is v+? 128 00:09:07,000 --> 00:09:12,000 v+ is simply the current through this part of the 129 00:09:12,000 --> 00:09:18,000 circuit, the current flowing here times the resistance R1. 130 00:09:18,000 --> 00:09:22,000 That gives me the drop across R1. 131 00:09:22,000 --> 00:09:28,000 And to that I add vIN and that will give me V+. 132 00:09:28,000 --> 00:09:32,000 And then of course I multiply this by the gain here. 133 00:09:32,000 --> 00:09:35,000 So, let me write down that expression. 134 00:09:35,000 --> 00:09:40,000 The current through this is simply vOUT minus vIN. 135 00:09:40,000 --> 00:09:44,000 That is the voltage drop between these two points. 136 00:09:44,000 --> 00:09:48,000 I divide that by the resistance R1 plus R2. 137 00:09:48,000 --> 00:09:52,000 That gives me the current flowing through here. 138 00:09:52,000 --> 00:09:55,000 That times R1 is the drop across resistor R1. 139 00:09:55,000 --> 00:10:02,000 And to that I add vIN and that gives me the voltage v+. 140 00:10:02,000 --> 00:10:07,000 So, this is v+. That is simply vIN plus the 141 00:10:07,000 --> 00:10:14,000 drop across the resistance R1. Let me shuffle things around 142 00:10:14,000 --> 00:10:20,000 and put all the vOUT terms on this side here. 143 00:10:20,000 --> 00:10:28,000 I get a 1+ for that vOUT and let me move AR1 divided by R1 144 00:10:28,000 --> 00:10:36,000 plus R2 to the left-hand side. And I pick up a minus sign. 145 00:10:36,000 --> 00:10:40,000 So, I get AR1 divide by R1 plus R2. 146 00:10:40,000 --> 00:10:46,000 I pick up that. And on the left-hand sign I end 147 00:10:46,000 --> 00:10:53,000 up with vIN, and my vIN here is a function of the vIN that I 148 00:10:53,000 --> 00:10:57,000 have here. I have an A multiplying both 149 00:10:57,000 --> 00:11:03,000 the vINs. And then I get a one for this 150 00:11:03,000 --> 00:11:08,000 vIN here and there is a minus sign, so I get a minus R1 151 00:11:08,000 --> 00:11:13,000 divided by R1+R2. That is the expression that I 152 00:11:13,000 --> 00:11:17,000 have. Let me go ahead and simplify 153 00:11:17,000 --> 00:11:23,000 that a little further and move this whole thing down here. 154 00:11:23,000 --> 00:11:30,000 That gives me my expression as a function of vIN. 155 00:11:30,000 --> 00:11:33,000 What I will do is, let me continue here. 156 00:11:33,000 --> 00:11:37,000 vOUT=vIN A(1-R1/(R1+R2)). By the way, you may be 157 00:11:37,000 --> 00:11:42,000 wondering why I am going through so laboriously what is seemingly 158 00:11:42,000 --> 00:11:46,000 a very simple exercise. The reason I want to do is it I 159 00:11:46,000 --> 00:11:52,000 want to very carefully show you that the result produced by this 160 00:11:52,000 --> 00:11:55,000 exercise is exactly that. No magic here. 161 00:11:55,000 --> 00:11:58,000 No cheating. We are going to get exactly 162 00:11:58,000 --> 00:12:02,000 that. And then stare at it and say 163 00:12:02,000 --> 00:12:07,000 huh, how did that happen? And then we are going to try to 164 00:12:07,000 --> 00:12:11,000 figure out how it actually behaves following that. 165 00:12:11,000 --> 00:12:16,000 I divide this by 1-AR1/(R1+R2). And by now you should be 166 00:12:16,000 --> 00:12:22,000 familiar with the technique of ignoring small numbers when I 167 00:12:22,000 --> 00:12:27,000 have a big number next to it. So, AR1/(R1+R2) can be very 168 00:12:27,000 --> 00:12:32,000 much larger than one because A is very large. 169 00:12:32,000 --> 00:12:37,000 So, I can ignore my one there. And then what I am going to do 170 00:12:37,000 --> 00:12:42,000 is multiply the numerator and denominator by R1+R2. 171 00:12:42,000 --> 00:12:46,000 Oh, this A and this A is going to cancel out. 172 00:12:46,000 --> 00:12:50,000 This A and this A will then cancel out. 173 00:12:50,000 --> 00:12:54,000 And then I multiply the numerator and denominator by 174 00:12:54,000 --> 00:12:59,000 R1+R2, so this R1+R2 vanishes. I get R1+R2 here. 175 00:12:59,000 --> 00:13:06,000 R1+R2 minus R1 is simply R2. And then down here I get a R1 176 00:13:06,000 --> 00:13:11,000 and then I have a minus sign out there. 177 00:13:11,000 --> 00:13:18,000 Notice that vOUT we have found to be equal to vIN R2 divided by 178 00:13:18,000 --> 00:13:21,000 R1. That is not wrong. 179 00:13:21,000 --> 00:13:28,000 That is correct. Technically that is correct. 180 00:13:28,000 --> 00:13:32,000 But you will see in a few seconds that in practice that 181 00:13:32,000 --> 00:13:35,000 that's rarely what you are going to see happen. 182 00:13:35,000 --> 00:13:38,000 And we will try to understand why that is so. 183 00:13:38,000 --> 00:13:42,000 What we have done so far, if you stare at these two 184 00:13:42,000 --> 00:13:46,000 panels here, first of all, we know that the inverting 185 00:13:46,000 --> 00:13:50,000 amplifier has the expression for vOUT up there. 186 00:13:50,000 --> 00:13:54,000 And through this laborious exercise we have also shown that 187 00:13:54,000 --> 00:13:59,000 even with positive feedback, if I take a static view of the 188 00:13:59,000 --> 00:14:03,000 circuit -- If I take a snapshot of the 189 00:14:03,000 --> 00:14:06,000 circuit and simply analyze it as a static circuit, 190 00:14:06,000 --> 00:14:11,000 I get the same expression vOUT. But what we are going to do is 191 00:14:11,000 --> 00:14:16,000 when I explain to you that look, a small perturbation in vOUT is 192 00:14:16,000 --> 00:14:20,000 going to drive the op amp to the positive and negative rail, 193 00:14:20,000 --> 00:14:23,000 that is where the insight begins to show. 194 00:14:23,000 --> 00:14:28,000 That if everything were magical and I could somehow exactly keep 195 00:14:28,000 --> 00:14:32,000 things just so that will be true. 196 00:14:32,000 --> 00:14:35,000 I will be able to build that positive feedback circuit where 197 00:14:35,000 --> 00:14:38,000 the output is equal to R2/R1 vIN. 198 00:14:38,000 --> 00:14:42,000 But remember even the slightly amount of perturbation is going 199 00:14:42,000 --> 00:14:46,000 to send the op amp scurrying off to the positive rail or the 200 00:14:46,000 --> 00:14:48,000 negative rail. How do we analyze that? 201 00:14:48,000 --> 00:14:52,000 How do we analyze the behavior of a circuit that based on a 202 00:14:52,000 --> 00:14:56,000 small perturbation begins to move one place or another? 203 00:14:56,000 --> 00:15:00,000 We want to analyze the dynamics of the op amp. 204 00:15:00,000 --> 00:15:04,000 And to analyze the dynamics what I need to do is give you a 205 00:15:04,000 --> 00:15:08,000 slightly more detailed view of the operational amplifier. 206 00:15:08,000 --> 00:15:12,000 If the operational amplifier is not moving instantaneously 207 00:15:12,000 --> 00:15:16,000 between the plus and minus rail, I need to give you a more 208 00:15:16,000 --> 00:15:21,000 detailed model that encapsulates the behavior of the op amp. 209 00:15:21,000 --> 00:15:24,000 And so let me do that. If you want to study the 210 00:15:24,000 --> 00:15:30,000 dynamics of an op amp -- By dynamics I mean how an op 211 00:15:30,000 --> 00:15:38,000 amp moves as I perturb the input or the output and so on. 212 00:15:38,000 --> 00:15:46,000 To capture the dynamics of the op amp we build a slightly more 213 00:15:46,000 --> 00:15:51,000 involved circuit, so v+ and v-. 214 00:16:06,000 --> 00:16:10,000 This is what we've seen before, two terminals and dependent 215 00:16:10,000 --> 00:16:14,000 source that amplifies the difference input here by a large 216 00:16:14,000 --> 00:16:17,000 amount. Instead what we are going to do 217 00:16:17,000 --> 00:16:21,000 here is something slightly different and interpose the 218 00:16:21,000 --> 00:16:24,000 following circuit in the middle here. 219 00:16:24,000 --> 00:16:29,000 This is a model of the dynamics of an op amp. 220 00:16:29,000 --> 00:16:33,000 We are going to impose a small RC circuit in here. 221 00:16:33,000 --> 00:16:35,000 This is R. This is C. 222 00:16:35,000 --> 00:16:40,000 And I am going to call the voltage across the capacitor v*. 223 00:16:40,000 --> 00:16:45,000 Notice what I have done is rather than say this is Av+ 224 00:16:45,000 --> 00:16:50,000 minus v- I am breaking it apart in two dependent sources, 225 00:16:50,000 --> 00:16:55,000 the first dependent source, which is simply v+ minus v-, 226 00:16:55,000 --> 00:17:01,000 and there is a RC time constant surrounding it and then here I 227 00:17:01,000 --> 00:17:07,000 simply add on my gain Av*. Notice that if it turned out 228 00:17:07,000 --> 00:17:09,000 that the resistance here, for example, 229 00:17:09,000 --> 00:17:14,000 was zero then v+ minus v- would appear across v* and this would 230 00:17:14,000 --> 00:17:16,000 be A(v+ - v-), what you have seen before. 231 00:17:16,000 --> 00:17:20,000 It is always good to take a look at circuits and look at 232 00:17:20,000 --> 00:17:24,000 what happens when some component goes to an extreme value. 233 00:17:24,000 --> 00:17:29,000 This would give you your basic op amp circuit. 234 00:17:29,000 --> 00:17:33,000 What I would like to do next is analyze the following circuit to 235 00:17:33,000 --> 00:17:38,000 understand how positive and negative feedback work together. 236 00:17:38,000 --> 00:17:42,000 And by understanding that then be able to explain how a 237 00:17:42,000 --> 00:17:47,000 positive feedback circuit works or a negative feedback circuit 238 00:17:47,000 --> 00:17:49,000 works. Here is what I will do. 239 00:17:49,000 --> 00:17:54,000 This part simply corresponds to my positive feedback circuit, 240 00:17:54,000 --> 00:17:56,000 R2, R1. So, that is my positive 241 00:17:56,000 --> 00:18:00,000 feedback circuit. And I will do the same thing on 242 00:18:00,000 --> 00:18:02,000 this side. 243 00:18:09,000 --> 00:18:12,000 All I am doing is applying both a positive feedback through R2 244 00:18:12,000 --> 00:18:15,000 and R1 and negative feedback through R4 and R3 and 245 00:18:15,000 --> 00:18:19,000 representing the dynamics of the op amp and then standing back 246 00:18:19,000 --> 00:18:22,000 and ee, all right, let's see what happens to you. 247 00:18:22,000 --> 00:18:25,000 So, I am sticking positive feedback, negative feedback, 248 00:18:25,000 --> 00:18:30,000 the dynamics of the op amp here and let's see what happens. 249 00:18:30,000 --> 00:18:38,000 What I would like to do is impose this circuit on top of 250 00:18:38,000 --> 00:18:46,000 this op amp model. To save myself some effort, 251 00:18:46,000 --> 00:18:54,000 let me just go ahead and modify this circuit directly. 252 00:18:54,000 --> 00:19:02,000 I get an R2 here, an R1 here, and then up here I 253 00:19:02,000 --> 00:19:09,000 get an R4, R3 here. The math is going to be just a 254 00:19:09,000 --> 00:19:14,000 little bit grubby but the result is actually pretty spectacular. 255 00:19:14,000 --> 00:19:18,000 So, all I have done is replace the op amp with its internal 256 00:19:18,000 --> 00:19:21,000 circuit out here. And now we are going to take a 257 00:19:21,000 --> 00:19:26,000 look at what happens to op amp dynamics when there is a small 258 00:19:26,000 --> 00:19:29,000 perturbation. Let's develop an equation of 259 00:19:29,000 --> 00:19:33,000 this circuit containing a capacitor using techniques that 260 00:19:33,000 --> 00:19:38,000 we already know. Just to give you some insight 261 00:19:38,000 --> 00:19:42,000 into what you're going to see, notice that if I make a small 262 00:19:42,000 --> 00:19:46,000 perturbation in the voltage across the capacitor, 263 00:19:46,000 --> 00:19:50,000 let's say I make a small perturbation to the capacitor 264 00:19:50,000 --> 00:19:55,000 voltage let's say by applying some initial condition kind of 265 00:19:55,000 --> 00:19:59,000 thing onto the capacitor. Then let's say that the output 266 00:19:59,000 --> 00:20:03,000 changes to some value K. So, the change on the capacitor 267 00:20:03,000 --> 00:20:07,000 must have been K divided by A. And what you are going to see 268 00:20:07,000 --> 00:20:11,000 is what happens to the op amp when the initial condition on 269 00:20:11,000 --> 00:20:14,000 the capacitor is such that this output gets perturbed to the 270 00:20:14,000 --> 00:20:16,000 value K. Let's write an equation for 271 00:20:16,000 --> 00:20:19,000 this little circuit and see what happens. 272 00:20:19,000 --> 00:20:22,000 Recall our goal was to understand what happens when I 273 00:20:22,000 --> 00:20:24,000 perturbed the output a little bit. 274 00:20:24,000 --> 00:20:29,000 Here I perturbed the output such that its value goes to K. 275 00:20:29,000 --> 00:20:33,000 And I can perturb the output by changing what happens at the 276 00:20:33,000 --> 00:20:36,000 capacitor. Let me write the equation for 277 00:20:36,000 --> 00:20:41,000 this circuit now and then to understand what happens to this 278 00:20:41,000 --> 00:20:45,000 capacitor circuit if I let go after giving it a small 279 00:20:45,000 --> 00:20:48,000 perturbation. What I am going to do is let me 280 00:20:48,000 --> 00:20:53,000 start by writing the good old equation for this little circuit 281 00:20:53,000 --> 00:20:56,000 here. And that equation is simply the 282 00:20:56,000 --> 00:21:02,000 voltage here v+ minus v- equals the voltage across the RC. 283 00:21:02,000 --> 00:21:08,000 So, v+ minus v- will be equal to the voltage drop across the 284 00:21:08,000 --> 00:21:13,000 resistor plus that across the capacitor. 285 00:21:13,000 --> 00:21:17,000 The voltage across the capacitor is v*. 286 00:21:17,000 --> 00:21:24,000 The voltage across the resistor is the current through the 287 00:21:24,000 --> 00:21:31,000 capacitor C dv*/dt times R. So, v* plus RC dv/dt is equal 288 00:21:31,000 --> 00:21:37,000 to v+ minus v-. RC dv*/dt plus v* is v+ minus 289 00:21:37,000 --> 00:21:40,000 v-. You have done this millions of 290 00:21:40,000 --> 00:21:43,000 times before, but yet again. 291 00:21:43,000 --> 00:21:49,000 This voltage here is equal to the drop across these two, 292 00:21:49,000 --> 00:21:54,000 and the drop across these two is v*, the drop across C, 293 00:21:54,000 --> 00:22:00,000 plus the current through the capacitor C dv/dt times the 294 00:22:00,000 --> 00:22:05,000 resistance R. Or you can apply the node 295 00:22:05,000 --> 00:22:10,000 method as well and get the same expression. 296 00:22:10,000 --> 00:22:16,000 Now, we also know here that vO divided by A is v*. 297 00:22:16,000 --> 00:22:24,000 I can go ahead and replace this guy here, v* by vO divided by A. 298 00:22:24,000 --> 00:22:29,000 RC/A dvO/dt. Recall, I want the dynamics of 299 00:22:29,000 --> 00:22:35,000 vO so let me just get an expression in vO. 300 00:22:35,000 --> 00:22:43,000 So, I get vO divided by A plus v+ minus v- equals. 301 00:22:43,000 --> 00:22:51,000 Now, I want an expression in vO, an equation in vO, 302 00:22:51,000 --> 00:23:00,000 so I need to express v+ and v- in terms of vO. 303 00:23:00,000 --> 00:23:09,000 What are these expressions? The expression for v- is vO and 304 00:23:09,000 --> 00:23:16,000 this voltage divider, so it's vOR3/(R3+R4). 305 00:23:16,000 --> 00:23:25,000 And just for simplicity, let me call this some constant 306 00:23:25,000 --> 00:23:30,000 gamma minus. This is some fraction 307 00:23:30,000 --> 00:23:37,000 R3/(R3+R4). And let me call that fraction 308 00:23:37,000 --> 00:23:42,000 gamma minus. Similarly, v+ is vO R1/(R1+R2). 309 00:23:42,000 --> 00:23:45,000 And let me call that gamma plus. 310 00:23:45,000 --> 00:23:51,000 All I am doing is replacing v+ and v- in terms of vO. 311 00:23:51,000 --> 00:23:57,000 So, effectively, what I have here is v+ is some 312 00:23:57,000 --> 00:24:03,000 fraction of vO. That's the best intuitive way 313 00:24:03,000 --> 00:24:09,000 of thinking about it, some fraction of vO. 314 00:24:09,000 --> 00:24:14,000 And v- is some fraction of vO as well. 315 00:24:14,000 --> 00:24:21,000 And I just stick these. I now have an expression in vO. 316 00:24:21,000 --> 00:24:29,000 Don't get psyched by gamma plus and gamma minus. 317 00:24:29,000 --> 00:24:34,000 Simply read this as if it is an F1 and F2 if you would like. 318 00:24:34,000 --> 00:24:39,000 So, vO times some fraction minus vO times some other 319 00:24:39,000 --> 00:24:42,000 fraction. I am feeding back some fraction 320 00:24:42,000 --> 00:24:48,000 of the output to the positive and to the negative terminals. 321 00:24:48,000 --> 00:24:52,000 Then, just moving things around a little bit, 322 00:24:52,000 --> 00:24:55,000 dividing throughout by A divided by RC. 323 00:24:55,000 --> 00:25:00,000 So, I divided by A divided by RC. 324 00:25:00,000 --> 00:25:08,000 Plus vO divided by RC. And what I am going to do here 325 00:25:08,000 --> 00:25:15,000 in a second, vO gamma plus minus gamma minus. 326 00:25:15,000 --> 00:25:24,000 And I have multiplied by A divided by RC throughout. 327 00:25:24,000 --> 00:25:34,000 Finally, collecting all the vO terms I get vO times one divided 328 00:25:34,000 --> 00:25:42,000 by RC plus A divided by RC. I got a plus sign here so I 329 00:25:42,000 --> 00:25:47,000 will just reverse these two guys in there, gamma minus minus 330 00:25:47,000 --> 00:25:51,000 gamma plus equals zero. All I have done here is simply 331 00:25:51,000 --> 00:25:56,000 grunged through some math to express this equation in terms 332 00:25:56,000 --> 00:25:59,000 of vO. And just to make it even 333 00:25:59,000 --> 00:26:04,000 simpler, I will just replace this thing by one divided by T, 334 00:26:04,000 --> 00:26:09,000 much as we did for first order equations. 335 00:26:09,000 --> 00:26:19,000 What I end up with is dvO/dt+vO/T=0. 336 00:26:29,000 --> 00:26:33,000 Despite all the grubbiness, I end up with something that is 337 00:26:33,000 --> 00:26:36,000 very, very familiar to all of us. 338 00:26:36,000 --> 00:26:41,000 I went through a bunch of gyrations to substitute for v+, 339 00:26:41,000 --> 00:26:45,000 v- and v*, but at the end of the day I got the simple 340 00:26:45,000 --> 00:26:48,000 expression which was dvO/dt+vO/T=0. 341 00:26:48,000 --> 00:26:52,000 Where capital T is the time constant of the circuit, 342 00:26:52,000 --> 00:26:57,000 and the time constant of the circuit relates to the 343 00:26:57,000 --> 00:27:01,000 expression in there 1/RC+A/RC(gamma minus - gamma 344 00:27:01,000 --> 00:27:05,000 plus). The gamma minus and gamma plus 345 00:27:05,000 --> 00:27:09,000 are the respective portions of the output fed back to the 346 00:27:09,000 --> 00:27:12,000 negative input and the positive input. 347 00:27:12,000 --> 00:27:15,000 Now, as we all know, based on very simple intuition 348 00:27:15,000 --> 00:27:20,000 that we can completely predict the behavior of a first order of 349 00:27:20,000 --> 00:27:24,000 an RC circuit once we know what the initial condition of the 350 00:27:24,000 --> 00:27:28,000 capacitor is and once you know the time constant. 351 00:27:28,000 --> 00:27:32,000 That's it. We know, we are masters at the 352 00:27:32,000 --> 00:27:36,000 fact that the capacitor is going to behave like this. 353 00:27:36,000 --> 00:27:40,000 It is going to be exponential. And I do know that the time 354 00:27:40,000 --> 00:27:42,000 constant capital T. What's here? 355 00:27:42,000 --> 00:27:45,000 It is simply the initial condition. 356 00:27:45,000 --> 00:27:49,000 There is no drive input. I am not driving this with any 357 00:27:49,000 --> 00:27:52,000 input here. There is no input drive 358 00:27:52,000 --> 00:27:55,000 anywhere here. This is simply the natural 359 00:27:55,000 --> 00:27:58,000 dynamics of the system. And, recall, 360 00:27:58,000 --> 00:28:03,000 I start off with bumping the capacitor voltage such that the 361 00:28:03,000 --> 00:28:06,000 output starts off being K. That is it. 362 00:28:06,000 --> 00:28:10,000 You should be able to write down this expression and the 363 00:28:10,000 --> 00:28:14,000 form of the response simply based on this. 364 00:28:14,000 --> 00:28:18,000 So, this is what I bumped up the output to be by perturbing 365 00:28:18,000 --> 00:28:22,000 the capacitor voltage. My output response based on 366 00:28:22,000 --> 00:28:25,000 this equation is going to look like that. 367 00:28:25,000 --> 00:28:30,000 Let's try to understand what that means. 368 00:28:30,000 --> 00:28:32,000 It is actually quite a lot of fun. 369 00:28:32,000 --> 00:28:37,000 How do we plot that response? You all learned that the way to 370 00:28:37,000 --> 00:28:40,000 plot the response is plot the initial value, 371 00:28:40,000 --> 00:28:43,000 plot the final value, and go cachoock, 372 00:28:43,000 --> 00:28:45,000 right? It's pretty simple. 373 00:28:45,000 --> 00:28:48,000 I am going to start at K. I know that. 374 00:28:48,000 --> 00:28:53,000 I am going to start at K and I am going to go and find out what 375 00:28:53,000 --> 00:28:57,000 the steady state value is. Here is where the interesting 376 00:28:57,000 --> 00:29:01,000 stuff comes in. The final value on the 377 00:29:01,000 --> 00:29:06,000 capacitor depends a lot on whether T is positive or 378 00:29:06,000 --> 00:29:09,000 negative. In my RC circuits that I looked 379 00:29:09,000 --> 00:29:13,000 at what was T? In the very simple RC circuit 380 00:29:13,000 --> 00:29:18,000 we looked at what was capital T? What was the time constant? 381 00:29:18,000 --> 00:29:19,000 RC. This was RC. 382 00:29:19,000 --> 00:29:24,000 This was a positive quantity. When capital T is positive my 383 00:29:24,000 --> 00:29:27,000 output is going to look like this. 384 00:29:27,000 --> 00:29:33,000 When T is positive. And T is positive when this 385 00:29:33,000 --> 00:29:39,000 expression is positive. And if A is so large that I can 386 00:29:39,000 --> 00:29:43,000 ignore the 1/RC term, if A is very, 387 00:29:43,000 --> 00:29:50,000 very large and I can ignore the left-hand term here then T is 388 00:29:50,000 --> 00:29:57,000 positive when gamma minus is greater than gamma plus. 389 00:29:57,000 --> 00:30:00,000 So, when gamma minus is greater than gamma plus, 390 00:30:00,000 --> 00:30:04,000 I have a stable circuit, this is the good-old stuff we 391 00:30:04,000 --> 00:30:08,000 have seen before. Now things begin to make sense. 392 00:30:08,000 --> 00:30:11,000 Intuitively, what am I saying here? 393 00:30:11,000 --> 00:30:15,000 All the gammas and other pieces of crapola aside, 394 00:30:15,000 --> 00:30:18,000 what am I really saying here in English? 395 00:30:18,000 --> 00:30:22,000 What I am saying here is that if the portion of the output fed 396 00:30:22,000 --> 00:30:27,000 to the negative input is greater than that fed to the positive 397 00:30:27,000 --> 00:30:32,000 input then I have net negative feedback. 398 00:30:32,000 --> 00:30:36,000 I have net negative feedback. I am feeding the output back to 399 00:30:36,000 --> 00:30:39,000 both the positive and negative inputs. 400 00:30:39,000 --> 00:30:44,000 And if my negative input has a stronger effect then I am going 401 00:30:44,000 --> 00:30:49,000 to see the op amp output decay down to a value that I expect 402 00:30:49,000 --> 00:30:54,000 which is going to be zero. Notice that since I am not 403 00:30:54,000 --> 00:30:58,000 applying any input here, I expect the stable point for 404 00:30:58,000 --> 00:31:03,000 this to be output going to zero. I don't have any input there. 405 00:31:03,000 --> 00:31:06,000 Let's take a look at another situation. 406 00:31:06,000 --> 00:31:08,000 What happens when the opposite is true? 407 00:31:08,000 --> 00:31:12,000 What happens when gamma minus is less than gamma plus? 408 00:31:12,000 --> 00:31:15,000 When I feedback more, what happens when I do this, 409 00:31:15,000 --> 00:31:18,000 when gamma plus is greater than gamma minus? 410 00:31:18,000 --> 00:31:21,000 The opposite is true. This means that I am feeding 411 00:31:21,000 --> 00:31:25,000 back more to the positive input. A bigger proportion goes to the 412 00:31:25,000 --> 00:31:30,000 positive than the negative. What happens then? 413 00:31:30,000 --> 00:31:34,000 Then what happens is capital T becomes negative. 414 00:31:34,000 --> 00:31:39,000 We cannot see this happening on the RC circuit because capital T 415 00:31:39,000 --> 00:31:42,000 is equal to RC, but here we have a more 416 00:31:42,000 --> 00:31:47,000 complicated circuit and capital T can go negative. 417 00:31:47,000 --> 00:31:52,000 If capital T goes negative then this whole thing in the exponent 418 00:31:52,000 --> 00:31:56,000 there goes positive. If that goes positive what 419 00:31:56,000 --> 00:32:02,000 should the output look like? It should take off into 420 00:32:02,000 --> 00:32:05,000 never-never land. There we go. 421 00:32:05,000 --> 00:32:11,000 I start off at zero and a make a small perturbation, 422 00:32:11,000 --> 00:32:17,000 and the output should go as t divided by capital T. 423 00:32:17,000 --> 00:32:23,000 The dynamics of this it goes berserk, so it is net positive 424 00:32:23,000 --> 00:32:27,000 feedback. This is called a stable 425 00:32:27,000 --> 00:32:31,000 situation. This is unstable. 426 00:32:31,000 --> 00:32:36,000 What happens when capital T goes to infinity? 427 00:32:36,000 --> 00:32:41,000 When capital T goes to infinity, spend five seconds 428 00:32:41,000 --> 00:32:45,000 thinking about what it means physically. 429 00:32:45,000 --> 00:32:51,000 What does it mean for the time constant of an RC circuit to go 430 00:32:51,000 --> 00:32:56,000 to infinity? That means that your R and C 431 00:32:56,000 --> 00:33:00,000 are very, very, very large. 432 00:33:00,000 --> 00:33:03,000 That means that circuit is going to be very, 433 00:33:03,000 --> 00:33:05,000 very sluggish. Think elephant. 434 00:33:05,000 --> 00:33:08,000 A big time constant. I want to move a leg. 435 00:33:08,000 --> 00:33:11,000 It takes a while to do that. Think big. 436 00:33:11,000 --> 00:33:15,000 Big time constant. So, everything is going to 437 00:33:15,000 --> 00:33:18,000 happen really slowly. It's like moving in molasses. 438 00:33:18,000 --> 00:33:22,000 Big time constant. Everything is going to happen 439 00:33:22,000 --> 00:33:26,000 really, really slowly. If gamma minus is greater than 440 00:33:26,000 --> 00:33:30,000 gamma plus with a huge time constant it is going to look 441 00:33:30,000 --> 00:33:35,000 like this. And the output is going to look 442 00:33:35,000 --> 00:33:38,000 like this. I make T even larger. 443 00:33:38,000 --> 00:33:42,000 All right. It is going to like this. 444 00:33:47,000 --> 00:33:51,000 I make these so large that T tends to zero, 445 00:33:51,000 --> 00:33:57,000 T tends to infinity in which case I get this situation. 446 00:33:57,000 --> 00:34:00,000 The output goes dah. OK? 447 00:34:00,000 --> 00:34:02,000 Very slow. Very lethargic. 448 00:34:02,000 --> 00:34:06,000 Big time constant. T tends to infinity. 449 00:34:06,000 --> 00:34:10,000 And so if this is stable, this is unstable, 450 00:34:10,000 --> 00:34:13,000 this is called corresponding neutral. 451 00:34:13,000 --> 00:34:18,000 And there is a mechanical analog to all of this. 452 00:34:18,000 --> 00:34:23,000 You can show that this situation is akin to let's say I 453 00:34:23,000 --> 00:34:30,000 had a physical well of the sort and I had a ball in there. 454 00:34:30,000 --> 00:34:33,000 I let the ball go. Then the ball will come down 455 00:34:33,000 --> 00:34:36,000 here and settle down in a stable state. 456 00:34:36,000 --> 00:34:40,000 Any small perturbation of the ball will get it to come down 457 00:34:40,000 --> 00:34:44,000 and settle down here. The unstable situation is this 458 00:34:44,000 --> 00:34:49,000 situation where I have a ball sitting up here where any small 459 00:34:49,000 --> 00:34:54,000 perturbation will get it to zip down to a positive rail or to a 460 00:34:54,000 --> 00:34:57,000 negative rail. So, this is an unstable 461 00:34:57,000 --> 00:35:02,000 equilibrium situation. And exactly the reason we got 462 00:35:02,000 --> 00:35:06,000 this analysis in the static situation is that this can 463 00:35:06,000 --> 00:35:08,000 happen. If I do this circuit here and 464 00:35:08,000 --> 00:35:13,000 don't perturb it then I could get the output sitting at zero, 465 00:35:13,000 --> 00:35:17,000 but the slightest perturbation, boom, it is going to fall down 466 00:35:17,000 --> 00:35:20,000 or go up. What about the neutral 467 00:35:20,000 --> 00:35:23,000 equilibrium state? That can be modeled like a 468 00:35:23,000 --> 00:35:27,000 table top and the ball is here. It doesn't matter where you go. 469 00:35:27,000 --> 00:35:32,000 There you are. How many people saw the 470 00:35:32,000 --> 00:35:37,000 Buckaroo Bonzi thing? Possibly well before your time. 471 00:35:37,000 --> 00:35:39,000 OK. I have this table here. 472 00:35:39,000 --> 00:35:45,000 No matter what I do to it, it just goes and settles down 473 00:35:45,000 --> 00:35:49,000 where it is, and that is neutral equilibrium. 474 00:35:49,000 --> 00:35:55,000 But what this gives you is a fun view of the dynamics of the 475 00:35:55,000 --> 00:36:02,000 operational amplifier as I make small perturbations to it. 476 00:36:02,000 --> 00:36:06,000 And the even more interesting thing here is you have the tools 477 00:36:06,000 --> 00:36:11,000 based on your first order RC analysis to analyze the dynamics 478 00:36:11,000 --> 00:36:15,000 of a simple op amp circuit. OK, so much for theory. 479 00:36:15,000 --> 00:36:18,000 Now let's get to some action here. 480 00:36:18,000 --> 00:36:19,000 All right. Fine. 481 00:36:19,000 --> 00:36:22,000 That is really pretty, good and so on, 482 00:36:22,000 --> 00:36:26,000 but what can you do for me? What good does this property do 483 00:36:26,000 --> 00:36:30,000 for me? What can I build? 484 00:36:30,000 --> 00:36:34,000 What we will do is look at the op amp circuit and focus on the 485 00:36:34,000 --> 00:36:37,000 situation where I have net positive feedback. 486 00:36:37,000 --> 00:36:42,000 In particular just look at this circuit with R1 and R2 and send 487 00:36:42,000 --> 00:36:46,000 both to infinity. So, I have no negative feedback 488 00:36:46,000 --> 00:36:50,000 and I ground this terminal here and take a look at what happens 489 00:36:50,000 --> 00:36:55,000 to a circuit with positive feedback and see if I can build 490 00:36:55,000 --> 00:37:01,000 some interesting circuits. What you are going to do is 491 00:37:01,000 --> 00:37:06,000 build on a circuit called the basic comparator. 492 00:37:06,000 --> 00:37:11,000 What is that? If I have an op amp that looks 493 00:37:11,000 --> 00:37:18,000 like this, and remember a VS rail and minus VS supply there, 494 00:37:18,000 --> 00:37:23,000 this is v+, this is v-, I can build a very basic 495 00:37:23,000 --> 00:37:29,000 comparator by doing the following. 496 00:37:29,000 --> 00:37:34,000 All the circuits I am going to show you are going to build on 497 00:37:34,000 --> 00:37:39,000 this basic little circuit. What I am going to do is 498 00:37:39,000 --> 00:37:43,000 consider applying an input to the v- terminal, 499 00:37:43,000 --> 00:37:48,000 applying some sort of an input and taking a look at how the 500 00:37:48,000 --> 00:37:52,000 output behaves. So, I apply some input vIN. 501 00:37:52,000 --> 00:37:57,000 And if I just do that, if this is v+ minus v- here 502 00:37:57,000 --> 00:38:03,000 then I am going to get something that goes like this. 503 00:38:03,000 --> 00:38:09,000 That is when this is positive here then this guy is going to 504 00:38:09,000 --> 00:38:16,000 go to the VS rail and this guy is going to go to the minus VS 505 00:38:16,000 --> 00:38:19,000 rail. In terms of the, 506 00:38:19,000 --> 00:38:24,000 if I plot the same thing, in terms of vIN, 507 00:38:24,000 --> 00:38:29,000 and this is vOUT, if I plot the thing in terms of 508 00:38:29,000 --> 00:38:36,000 vIN then notice that as vIN increases this guy should go to 509 00:38:36,000 --> 00:38:42,000 a negative rail. So, in terms of vIN it looks 510 00:38:42,000 --> 00:38:45,000 like this. What this says is that as the 511 00:38:45,000 --> 00:38:50,000 input becomes more and more positive applied to v- then the 512 00:38:50,000 --> 00:38:55,000 output goes to minus VS, and if the input becomes more 513 00:38:55,000 --> 00:39:00,000 and more negative then the output goes to VS. 514 00:39:00,000 --> 00:39:05,000 This is what is called a very basic comparator circuit. 515 00:39:05,000 --> 00:39:10,000 It compares the two inputs and goes up if the input is in one 516 00:39:10,000 --> 00:39:16,000 direction and goes to the other rail if the input is in the 517 00:39:16,000 --> 00:39:21,000 opposite direction. So supposing I feed this- I can 518 00:39:21,000 --> 00:39:26,000 plot this is a function of time. Let's say I plot vIN. 519 00:39:26,000 --> 00:39:32,000 Let's say I feed some vIN here. Let me just call this. 520 00:39:32,000 --> 00:39:37,000 I feed some vIN to this circuit here, then what do you expect 521 00:39:37,000 --> 00:39:41,000 the output to look like, the output wave form? 522 00:39:41,000 --> 00:39:45,000 For all positive vINs the output is negative. 523 00:39:45,000 --> 00:39:50,000 So, my output vO is going to be negative as long as vIN is 524 00:39:50,000 --> 00:39:54,000 positive. And when vIN becomes negative 525 00:39:54,000 --> 00:39:59,000 this one shoots up and behaves like this. 526 00:39:59,000 --> 00:40:02,000 This is minus VS. That is plus VS. 527 00:40:02,000 --> 00:40:07,000 This is my input vIN. Then this guy is going to be my 528 00:40:07,000 --> 00:40:11,000 output. As vIN is positive output slams 529 00:40:11,000 --> 00:40:15,000 to the negative rail. When vIN becomes negative the 530 00:40:15,000 --> 00:40:19,000 output slams to the positive rail. 531 00:40:19,000 --> 00:40:24,000 So, that is quite nice. And so such a circuit is pretty 532 00:40:24,000 --> 00:40:28,000 useful to me. Let's say, for example, 533 00:40:28,000 --> 00:40:32,000 I want to build a little digital circuit that is fed ones 534 00:40:32,000 --> 00:40:34,000 and zeros. I can use a comparator to turn 535 00:40:34,000 --> 00:40:37,000 my vIN voltage into a sequence of ones and zeros. 536 00:40:37,000 --> 00:40:41,000 When vIN is positive I produce a zero and when vIN is negative 537 00:40:41,000 --> 00:40:44,000 I produce a one. I can get this one, 538 00:40:44,000 --> 00:40:48,000 zero, one, zero sequence coming out corresponding to the values 539 00:40:48,000 --> 00:40:50,000 of vIN being greater or less than zero. 540 00:40:50,000 --> 00:40:54,000 Now, one problem with something like this is that this circuit 541 00:40:54,000 --> 00:40:59,000 can be quite messy in the following situation. 542 00:40:59,000 --> 00:41:04,000 Suppose I superimpose a small amount of noise in vIN. 543 00:41:04,000 --> 00:41:08,000 In particular, let's say that I have some 544 00:41:08,000 --> 00:41:13,000 amount of noise on vIN. I get a bunch of noise sitting 545 00:41:13,000 --> 00:41:17,000 around here. What happens is that at this 546 00:41:17,000 --> 00:41:22,000 point where the value goes negative, I do bump up. 547 00:41:22,000 --> 00:41:30,000 But when for a second I have my input going above zero again -- 548 00:41:30,000 --> 00:41:34,000 -- this output comes down again and out here it goes up again. 549 00:41:34,000 --> 00:41:39,000 I get this nasty behavior at the point where the input is 550 00:41:39,000 --> 00:41:42,000 around zero. When the input is around zero, 551 00:41:42,000 --> 00:41:46,000 the input is meandering around zero because of noise, 552 00:41:46,000 --> 00:41:51,000 I get a huge amount of up and down glitches on the output. 553 00:41:51,000 --> 00:41:55,000 That's not very nice. And we will do a little circuit 554 00:41:55,000 --> 00:42:00,000 that attempts to fix that little problem. 555 00:42:00,000 --> 00:42:04,000 What we are going to do is use positive feedback. 556 00:42:04,000 --> 00:42:11,000 And I am going to build you a circuit that shows that we can 557 00:42:11,000 --> 00:42:15,000 eliminate this for small noise on the input. 558 00:42:15,000 --> 00:42:19,000 So, let's build the following circuit. 559 00:42:19,000 --> 00:42:23,000 So I still feed vi to the negative input, 560 00:42:23,000 --> 00:42:30,000 but this time around I give it some positive feedback. 561 00:42:30,000 --> 00:42:33,000 So, I give it some positive feedback. 562 00:42:33,000 --> 00:42:38,000 And what I am going to do is feedback a portion of vO to the 563 00:42:38,000 --> 00:42:42,000 positive input. This is positive feedback. 564 00:42:42,000 --> 00:42:47,000 And, in particular, let's assume that VS equals 12 565 00:42:47,000 --> 00:42:50,000 volts. And to the negative one I 566 00:42:50,000 --> 00:42:54,000 connect -VS. This guy is going to go between 567 00:42:54,000 --> 00:42:57,000 12 and -12. And correspondingly because 568 00:42:57,000 --> 00:43:05,000 these two are equal this one is going to go between 6 and -6. 569 00:43:05,000 --> 00:43:08,000 This is going to be a 12 or -12. 570 00:43:08,000 --> 00:43:12,000 Remember, the top rail and the bottom rail. 571 00:43:12,000 --> 00:43:16,000 And this one is going to be a +6 or -6. 572 00:43:16,000 --> 00:43:21,000 And let's understand how this circuit works when I apply an 573 00:43:21,000 --> 00:43:25,000 input vIN. Let's start by saying that 574 00:43:25,000 --> 00:43:30,000 assume my input is zero for a moment. 575 00:43:30,000 --> 00:43:35,000 And let's say my output starts off being 12 volts. 576 00:43:35,000 --> 00:43:40,000 The output is 12 volts then the input here is going to be 6 577 00:43:40,000 --> 00:43:44,000 volts. In this case v+ is going to be 578 00:43:44,000 --> 00:43:47,000 6 volts. The output is 12, 579 00:43:47,000 --> 00:43:52,000 v+ is going to be 6 volts. And my circuit is sitting out 580 00:43:52,000 --> 00:43:57,000 there doing nothing. Now, this started off being 581 00:43:57,000 --> 00:44:02,000 zero. Let's say vIN increases. 582 00:44:02,000 --> 00:44:05,000 As vIN begins to increase what happens? 583 00:44:05,000 --> 00:44:08,000 Well, nothing until vIN reaches 6 volts. 584 00:44:08,000 --> 00:44:11,000 Since this is 6, vIN has to go up to 6 volts, 585 00:44:11,000 --> 00:44:16,000 has to equal this voltage before I can flip the circuit. 586 00:44:16,000 --> 00:44:19,000 What happens when vIN is greater than 6 volts, 587 00:44:19,000 --> 00:44:24,000 if vIN goes above 6 then I have more voltage on a negative 588 00:44:24,000 --> 00:44:30,000 terminal than the positive so the op amp flips its state. 589 00:44:30,000 --> 00:44:36,000 And vO gets to -12 volts. When vi goes above 6, 590 00:44:36,000 --> 00:44:42,000 vO gets to 12 volts. And what does v+ go to? 591 00:44:42,000 --> 00:44:50,000 In this state v+ goes to half of -12 which is -6 volts. 592 00:44:50,000 --> 00:45:00,000 Now, this guy is sitting at -6 and this guy is sitting at -12. 593 00:45:00,000 --> 00:45:03,000 If this one keeps rising nothing happens, 594 00:45:03,000 --> 00:45:07,000 so output can stay at -12. So I am pretty safe. 595 00:45:07,000 --> 00:45:10,000 Then let's say v begins to come down. 596 00:45:10,000 --> 00:45:15,000 As v begins to come down, does anything happen when v 597 00:45:15,000 --> 00:45:19,000 gets to 6 again? If v is equal to 6 what 598 00:45:19,000 --> 00:45:22,000 happens? Nothing because this is at -6 599 00:45:22,000 --> 00:45:25,000 now. So, there is still a huge net 600 00:45:25,000 --> 00:45:30,000 negative voltage here from v+ to v-. 601 00:45:30,000 --> 00:45:36,000 And so therefore I sit at -12. Oh, well, I keep coming down 602 00:45:36,000 --> 00:45:42,000 until I reach -6. When I reach -6 here these two 603 00:45:42,000 --> 00:45:46,000 become equal. And what happens when this 604 00:45:46,000 --> 00:45:51,000 becomes less than -6? v- becomes less than -6. 605 00:45:51,000 --> 00:45:58,000 If this one goes below this voltage, this is -6 and this is 606 00:45:58,000 --> 00:46:02,000 -7. There is a net positive voltage 607 00:46:02,000 --> 00:46:06,000 between v+ and v-, so this output swings to the 608 00:46:06,000 --> 00:46:10,000 positive rail like so. We will spend a lot more time 609 00:46:10,000 --> 00:46:15,000 on this in the next few minutes to really hammer the point home. 610 00:46:15,000 --> 00:46:19,000 What is interesting about this is that even though the moment 611 00:46:19,000 --> 00:46:24,000 vi became more than 6, I swung to the positive rail, 612 00:46:24,000 --> 00:46:28,000 and then I had to go all the way back down to -6 before I 613 00:46:28,000 --> 00:46:34,000 could change state. I had to go way down before it 614 00:46:34,000 --> 00:46:39,000 could flip again. How can we make use of that? 615 00:46:39,000 --> 00:46:46,000 Well, let me draw you a little vi versus vO diagram and then 616 00:46:46,000 --> 00:46:50,000 talk about how that can be useful to us. 617 00:46:50,000 --> 00:46:55,000 This is vi, this is vO, this is zero. 618 00:46:55,000 --> 00:47:00,000 Let's say this is 12, -12, -6, +6. 619 00:47:00,000 --> 00:47:04,000 Let's plot that on the screen and see what it looks like. 620 00:47:04,000 --> 00:47:08,000 As I told you, the output was at 12 volts to 621 00:47:08,000 --> 00:47:11,000 begin with and my input was at zero. 622 00:47:11,000 --> 00:47:15,000 So, my input kept increasing. When the input hit +6 what 623 00:47:15,000 --> 00:47:20,000 happened to my output? My output swung down to -12. 624 00:47:20,000 --> 00:47:23,000 As the input kept increasing nothing happened. 625 00:47:23,000 --> 00:47:26,000 This was step one, this was step two, 626 00:47:26,000 --> 00:47:31,000 step three. My input kept increasing and 627 00:47:31,000 --> 00:47:36,000 output stayed at -12 volts. Then what I said was well, 628 00:47:36,000 --> 00:47:41,000 let's bring the input down. So, my input began to go down, 629 00:47:41,000 --> 00:47:44,000 step four, became more and more negative. 630 00:47:44,000 --> 00:47:47,000 Nothing happened until I reached -6. 631 00:47:47,000 --> 00:47:51,000 When I reached -6 I swung positive, step five. 632 00:47:51,000 --> 00:47:54,000 Again, one, two, three, four, 633 00:47:54,000 --> 00:47:56,000 five. I am going up here. 634 00:47:56,000 --> 00:48:01,000 It came up here. And nothing happens until I 635 00:48:01,000 --> 00:48:06,000 reach -6, but at -6 boom, I switch to the positive rail. 636 00:48:06,000 --> 00:48:10,000 And as I get more and more negative I stay there. 637 00:48:10,000 --> 00:48:13,000 Then again, as I start increasing again, 638 00:48:13,000 --> 00:48:16,000 nothing happens until I reach +6. 639 00:48:16,000 --> 00:48:19,000 Think of that as your seventh step. 640 00:48:19,000 --> 00:48:24,000 What is spectacular about this is that I seem to have a circuit 641 00:48:24,000 --> 00:48:30,000 that now has some knowledge of where it came. 642 00:48:30,000 --> 00:48:33,000 If it is coming from here it switches at +6, 643 00:48:33,000 --> 00:48:37,000 but if it is coming from here it switches at -6. 644 00:48:37,000 --> 00:48:42,000 So, there seems to be sort of a lag in the behavior of the 645 00:48:42,000 --> 00:48:46,000 circuit or some memory property in the circuit. 646 00:48:46,000 --> 00:48:50,000 This kind of behavior is called hysteresis. 647 00:48:50,000 --> 00:48:54,000 The word comes from magnetic circuits where, 648 00:48:54,000 --> 00:49:00,000 or rather elements that you're trying to magnetize. 649 00:49:00,000 --> 00:49:04,000 Where if you take a magnet and move it over a piece of metal it 650 00:49:04,000 --> 00:49:07,000 may leave some residual magnetism in it. 651 00:49:07,000 --> 00:49:11,000 And, in the same way, that is called hysteresis. 652 00:49:11,000 --> 00:49:14,000 Same way here. As the voltage increases it 653 00:49:14,000 --> 00:49:19,000 seems to leave some residual in the circuit so that it effects 654 00:49:19,000 --> 00:49:22,000 when it shifts. The good news with this is that 655 00:49:22,000 --> 00:49:27,000 now, if I take the same kind of noisy wave form that I had 656 00:49:27,000 --> 00:49:32,000 before and do this -- If this is vi then what is 657 00:49:32,000 --> 00:49:38,000 going to happen is for vO I am going to be negative at this 658 00:49:38,000 --> 00:49:42,000 point. Nothing happens here because I 659 00:49:42,000 --> 00:49:47,000 have to get to -6 or +6 before something happens. 660 00:49:47,000 --> 00:49:52,000 Out here I get to -6 and I switch state and go up to +12. 661 00:49:52,000 --> 00:49:58,000 And then this one comes up above -6 very slightly out 662 00:49:58,000 --> 00:50:01,000 there. Nothing happens because the 663 00:50:01,000 --> 00:50:05,000 next change will happen only when the input goes to +6. 664 00:50:05,000 --> 00:50:09,000 So, if eventually the input gets to +6 and then I am going 665 00:50:09,000 --> 00:50:13,000 to change state again. It is actually a really cool 666 00:50:13,000 --> 00:50:17,000 property and something that is completely non-obvious. 667 00:50:17,000 --> 00:50:20,000 In the last 30 seconds let me show you a quick demo. 668 00:50:20,000 --> 00:50:24,000 And, based on this property of hysteresis, I have actually 669 00:50:24,000 --> 00:50:29,000 built a little circuit. Let me do that first. 670 00:50:29,000 --> 00:50:34,000 Notice here that I am showing you the input on the X axis vi 671 00:50:34,000 --> 00:50:38,000 and vO on the Y axis. Notice how the output switches 672 00:50:38,000 --> 00:50:43,000 at +6 volts and switches at a -6 volts to +12 or -12. 673 00:50:43,000 --> 00:50:48,000 That's the hysteresis property. And we can actually use this 674 00:50:48,000 --> 00:50:53,000 property to build a clock circuit, which is on page 9, 675 00:50:53,000 --> 00:51:00,000 build an oscillator that sits there and oscillates by itself. 676 00:51:00,000 --> 00:51:03,000 And you will see details of that in recitation tomorrow.