Op Amp Input Buffer - Page 1
Forum section: electronics / projects

author: andyturk
author_rank: Frequent Contributor
timestamp: January 22, 2013, 10:05:22 am
content: As part of a toy oscilloscope project, I dug out LTSpice to play around with an input buffer design that will convert a +/- 15V signal to something a microcontroller ADC can deal with. Op amps are the obvious choice and TI'sResistor Calcmakes it easy to find resistors for getting the right combination of offset and gain. This circuit doesn't use any gain, but the offset calculation was helpful.I've attached the simulation file, but here's what it looks like:The op amp has three resistors that map -15V -> +15V to 0.050 -> 3.250 with an input impedance of 1M ohms. That's the plan, anyway.The test signal is a full-scale 500KHz sine wave:The first order of business was to see if the resistor values from TI's calculator did the right thing:Sure enough, TI's resistor values pushed the signal into positive territory and attenuated it to fit the ADC's range.I was initially expecting to use a split supply op amp like most of the other toy oscilloscope designs. However, the resistor network moves the signal above zero before it ever gets to the op amp, so (I think) a single ended amp should work. Not having to build a negative supply rail would definitely be a plus.The next step was to try a "real" op amp in the simulation. TheMCP624seems like a candidate, but there's no LTSpice model for it, so I picked a part from the LT catalog that seemed fairly similar:LTC6240.Unfortunately, this is where things went pear shaped. The output of the ideal op amp is shown below in blue, and the LTC6240's is green. Each op amp is amplifying the same signal, and each op amp has the same input network, yet the outputs differ significantly in amplitude. There's some phase shift too. What's up with that?The LTC6240's output is nowhere near its limits. At least, the datasheet says it's a "rail to rail" product and needs only 30mV of headroom at no load (there isn't any in this simulation). As a check, I bumped the positive supply up to 5V to see if that moved the output. Nope.After some head scratching and datasheet reading, I thought that the high input impedance of the buffer circuit would make it easy for any small disturbance near the op amp's input to throw off the result. What kind of disturbance? Maybe input capacitance…I don't know that much about op amps to start with and that I might have to go inside that nice clean triangle on the schematic was a little worrying. A quick trip to Google showed that Cin is usually just a small capacitance between one of the op amp inputs and ground. Not too scary after all.Since LTSpice was handy, I copied the first "ideal" circuit and threw in a capacitor between the non-inverting input and ground. The datasheet said the LTC6240 has about 3pf.How'd it compare to the LTC6240? Pretty gosh darned close. It seems like the input capacitance of the op amp accounts for nearly all the distortion:Here's another plot comparing the two on a 500kHz square wave (which is fairly mangled at this point):In retrospect, it almost seems obvious. The 1M input resistor and a 3pf capacitor to ground form a low-pass RC filter with a cutoff frequency of about 53kHz. That's gonna mess with a 500kHz signal in a big way. The other offsetting resistors undoubtedly have some effect too, but I'm not sure how to calculate that (a case for Dr. Thévenin?)This has been an interesting excursion into LTSpice and op amp theory, but at the end of the day, I'm not any closer to coming up with an input section for my toy oscilloscope. 3pf isn't exactly a lot of capacitance and finding an op amp with zero input capacitance seems unlikely. On the other hand, everyone seems to build these things with JFET op amps. Do they have some special way of getting around this problem?How do you keep a high-impedance input from tripping over the capacitance built into the amplifier?

author: rbola35618
author_rank: Frequent Contributor
timestamp: January 28, 2013, 03:54:30 pm
content: You use the 10X scope circuit to get around the input capacitance of the op amp. The pole is the combination of the 215k in parrallel with 247K which gives you a Rth of 120Kohms. The time constanct is then 120Kohm*3pF = 361ps.You now divide the time constant by the 1meg resistor. 361ps/imegohms = 0.361pF. So you put a 0.361pf across the 1meg to cancel the pole. What you are really done is introduce a zero (1meg-0.361pF) to cancel the pole (120K*3pF)You can't find a 0.361pf at the store so what you do is work backward. Set the zero capacitor first and solve to see what capacitor you would put in parrallel with the 3pfFor example, assume 2.2pF across the 1 meg. 2.2u/120khims = 18.33pF So you put a 15.33pf in parrralel with the 3 pFRobert

author: andyturk
author_rank: Frequent Contributor
timestamp: January 30, 2013, 04:20:40 pm
content: Robert,Many thanks for taking a look at this. I'm still digesting your response though, since the whole poles and zeros thing is still a little mystifying at the moment.I have continued to work on the circuit and have another iteration that I think is better than my first attempt. I'm sure it can be improved even more, but I feel confident enough to go ahead and build this one:This one goes back to a split supply with 2.5V either side of ground. The output is a positive signal from 0V to 2.048V, with 1.024V representing an input of 0V. Input is +/-20V.The input section is based on some other circuits I found on the web. There's a 10X resistor divider for DC and an equivalent capacitor divider for AC. DC input impedance is 1M and there's about 20pf of "residual" capacitance on the input, which I gather is typical for these things.My naive understanding is that the capacitor divider basically swamps the input capacitance from the op amp. It took several test runs in LTSpice to come up with the 20.26pf for C5. Mouser doesn't carry 20.26pf caps, but I can build one from a trimmer.The LTC6088 is a stand-in for the op amp I plan to use: MCP602X. Both have roughly 7V/usec slew rates and similar headroom requirements.This circuit keeps the signal bipolar through the amplifier and then offsets the output with a divider to VREF. It seemed easier to separate the offset generation from the input because of the need to compensate the output. Without the low-pass filter on the output, there was a lot of overshoot. This one seems to simulate fairly well with sharp corners and no ringing:A 20V square wave input:comes out looking like this:It's not perfect, but seems good enough for "toy" purposes. The amp is capable of a 7V/usec slew rate, but LTSpice says the overall circuit is only doing about 4V/usec. I'm not sure how to improve the slew rate, but I'll be happy if it works this well in actual practice. The max ADC rate is 2.4M samples/sec, and figuring on a 10x oversampling requirement that gives a bandwidth of 240kHz, and 4V/usec ought to be good enough there.The frequency response looks pretty flat throughout the useful range:I haven't watched your op amp tutorials yet, but that's next on the to-do list.

author: rbola35618
author_rank: Frequent Contributor
timestamp: January 30, 2013, 06:20:22 pm
content: Hi Andy,You did exactly what I did in my response. The pole is composed of the 100k*(3pF+180pF). When you multiply that you get 18.3us. You now divide that time constant, to get a zero, (18.3us) by the 909K and you will get the required 20.13pF.Just keep in mind that you are setting the time constant of the zero (909k and 20.13pF) equal to the time constant of the (100k and 183 pF) so that they cancel each out as your LTPSICE simulation prove that does indeed cancel each other.Great job in figuring out.Robert