Instrumentation amplifier not amplifying? - Page 1
Forum section: electronics / beginners

author: torch
author_rank: Frequent Contributor
timestamp: March 18, 2016, 04:43:27 am
content: I'm trying to build an instrumentation amplifier from 3 high speed op amps, looking for a gain of around 10. I'm using the LM7171. The datasheet shows a typical schematic and elsewhere suggests bypass and filter cap values. Putting it all together, I came up with this:I assembled it and tested it by connecting the output of my arbitrary waveform generator to the V1 and V2 and a 100 ohm resistor for a load. The datasheet example had another 510 ohm resistor at R3 for a gain of 3. I used a 100ohm gain resistor which should theoretically produce a voltage gain of 11.The circuit works, (a bit noisy as yet) but has a gain of 1 -- tested at frequencies from 1kHz to 10mHz and supply voltages from 5.5/-5.5 to 15/-15v. Nothing increases except the current draw from the power supply. Probing at points A and B (ie: the inputs of the final op-amp) show the signal is about 1/2 of the input signal voltage.Can anyone see where it is that I've gone wrong?

author: slaterk93
author_rank: Newbie
timestamp: March 18, 2016, 05:32:42 am
content: I am also a beginner and not familiar with this circuit, but if V1 and V2 are hooked up to the same signal wouldn't Vin be 0? Just looking at the equations in the app notes.EDIT: after messing with the simulator I am more convinced. Try hooking up V1 to ground and the signal gen to V2

author: amspire
author_rank: Super Contributor
timestamp: March 18, 2016, 06:14:57 am
content: Quote from: torch on March 18, 2016, 04:43:27 amSounds like R3 is not connected correctly - with R3 taken out of the circuit, you get a gain of 1, and A and B will have half the input signal.

author: torch
author_rank: Frequent Contributor
timestamp: March 18, 2016, 12:37:48 pm
content: To clarify: when I say I connected the signal to V1 and V2, I mean that one was connected to the AWG signal wire and the other to the AWG ground wire. The output phase inverts 180° if I reverse the connections.I probed all the resistors to verify the values and connections, but I'll have another close look at R3, Thanks.What would be the expected behavior if one of the buffer amplifier op-amps had an internally disconnected inverting input?

author: mstoer
author_rank: Contributor
timestamp: March 18, 2016, 03:46:39 pm
content: I would also say there is something disconnected. The circuit should work, so it's more of a soldering issue. Did you start to probe connections? You can simulate the circuit in LTspice easily enough, there is even a model for the LM7171 to be downloaded. Then you'll know what to roughly expect at each of the nodes.

author: pelule
author_rank: Frequent Contributor
timestamp: March 18, 2016, 08:08:09 pm
content: Which voltages supply the circuit, means, are the levels both ~same, like +/-10V.This is not clear in you schematic.How close are the paired resistor values matched, 0.1%?The by TI given "reduced" formula for this "simple" instrumentation amplifier is correct only, if the pairs are matched close enough.If not, you need to use the full formula.You may want to simulated instead to overcome that.BRPeLuLe

author: danadak
author_rank: Super Contributor
timestamp: March 19, 2016, 12:39:18 am
content: Matching of the R's is everything in an IA, primary cause of reduced CMR.See attached analysis.https://www.dropbox.com/s/plck7e95v7pw33c/CMR%20Analysis%20IA.pdf?dl=0Regards, Dana.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2016, 03:32:49 am
content: Thanks for the tips guys. To answer your questions:Power supply is a Korad 5 amp per channel dual linear supply set to serial mode, so voltages are equal in magnitude. I have used this PS to power this type of opamp before with no problems. And the output is not clipped; it's just not amplified. I have found the LM7171 to be very tolerant of input voltage variations anyway. But for the record, I started off feeding it with 5.5v rail to rail and cranked it up in 0.2v steps to 30v rail to rail with no change. Actually, that's not quite true -- the current draw did climb slightly. From about 32mA to about 36mA, IIRC. I also tried feeding it a range of voltages with a TLE2426 rail splitter but that made no difference either.Resistors were hand-matched as close as possible from a selection of 1% 1/4 watt metal film. I forget the exact numbers, but at worst would have been within 1/2? for the 510? resistors, and 1? for the 1K values, so better than 0.1%. To put it another way, it's an order of magnitude worse than the bragging in the Linear Technology note that danadak posted, but an order of magnitude better than the 2% the same note is comparing to.I have verified the integrity of the solder joints by measuring the resistance from opamp pin to opamp pin. Twice. I have triple-checked the pin-outs to make sure I didn't mix something up (it's dead-bug wired over a copper clad board -- first time I've tried this, so I could easily have made a mistake there!)I've never used Spice (or any other simulator). I looked into it once, read a bunch of comments about the inaccuracy of simulations compared to the real world, and dropped it. Similarly, while I've heard the name Matlab, danadak's analysis attachment means nothing to me at first glance. I'll have another look to see if I can decypher it in the morning. (You guys have to understand that I'm an old smoke eater. Strong like a bull and smart like a freight train. I'm lucky if I can remember my own name when I wake up in the morning. Speak slowly and use small words!)

author: danadak
author_rank: Super Contributor
timestamp: March 19, 2016, 11:17:48 am
content: Spice is only as accurate as the models used in it, which are supplied by themanufacturers of the components. Its got a bad rap because many manufacturersprovide incomplete models to hide issues (like crossover distortion in CMOS R-ROpAmps at the input stage, a not very well discussed issue). And to hide IP. Butreal basic stuff its a nice confirmation, or not, of what you see on the bench andcan illuminate component tolerance performance change issues, noise.......The Matlab, as I did it, simply models an ideal OpAmp, with a closed loop feedbackfactor, and then numerically calculates what happens for various feedback factorsand Aol effects in the OpAmp being modeled. Think fancy calculator, nothing morein this case. Or do it by hand and blow away a lot of time in the algebra.Regards, Dana.

author: mstoer
author_rank: Contributor
timestamp: March 19, 2016, 12:44:38 pm
content: Quote from: torch on March 19, 2016, 03:32:49 amFor trouble shooting your circuit LTspice will be perfectly fine. Attached is a screenshot of your circuit using the LT1028 instead (since it is included in the package and I'd have to download the LM7171 model still). Gain of 11 on the output with 0.1V 1kHz sine input. It's worth learning to use it in my opinion.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2016, 01:27:28 pm
content: Since last night, I downloaded LTSpice, figured out how to draw a circuit, downloaded the LM7171 spice model from the TI website, drew my little amplifier and am currently stuck trying to get the TI model into LTSpice. I'm watching a video on the LT website, tried referencing the file in the drawing and tried copying the text into the drawing, butstill getting an error "Unknown subcircuit called in: xu2 n011 n009 n001 n007 n010 lm7171".Never mind. I just figured it out. PEBUAK. Have to call the device "LM7171A/NS".I notice that you actually connected V2 to ground, whereas I left it floating, connected to the AWG ground. That may explain some of my noise.Anyway, I'm off tobeat my head against the wall some morefigure out how to supply a signal to and check the output of the simulation.

author: mstoer
author_rank: Contributor
timestamp: March 19, 2016, 01:41:53 pm
content: You have to connect everything to something. I assume you connected the "ground/return" terminal of your AWG to V2 in the actual circuit.The same voltage source symbol that supplies power can be used to provide signal. You just use it's advanced settings (right click) to make a sine, etc waveform. Then put in a "tran 10m" spice statement to create a 10ms transient analysis (for a 1kHz waveform it's a few cycles). You can then probe around virtually and see what you might expect at different junctions.

author: amspire
author_rank: Super Contributor
timestamp: March 19, 2016, 01:46:59 pm
content: If the resistors are all connected correctly, then I think you will find you have the input opamps' negative inputs going to the opamps' outputs instead of the 510 ohm/100ohm junction. The 510 ohm and the 100ohm resistors are doing nothing useful at all.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2016, 02:20:47 pm
content: I made the connection between -input and outputwiththe resistor. No wires.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2016, 02:23:01 pm
content: Quote from: mstoer on March 19, 2016, 01:41:53 pmYes, that is correct.

author: amspire
author_rank: Super Contributor
timestamp: March 19, 2016, 02:33:35 pm
content: Quote from: torch on March 19, 2016, 02:20:47 pmNot sure what you mean. Which end of the 510 ohm resistors does the neg input connect to? I think it is the wrong end.

author: mstoer
author_rank: Contributor
timestamp: March 19, 2016, 03:27:37 pm
content: I read his statement as meaning he used the resistor leads to make a connection rather than use separate wires from the resistor to the device terminals. Seems fine to me. I'm still thinking it's a bad solder joint somewhere.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2016, 05:29:42 pm
content: Yes, I was trying to keep the lead lengths to a minimum. Here is the board:and here is the output (channel 2 is the source, in blue):I've gone over the joints with a soldering iron and a magnifying glass and probed the pins of the opamps to verify the resistances. I can't find a bad joint.

author: bobcat
author_rank: Regular Contributor
timestamp: March 19, 2016, 05:59:41 pm
content: Place a 1-10M ohm resistor from V2 to GND. You must have a reference point for the circuit.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2016, 08:24:51 pm
content: Quote from: bobcat on March 19, 2016, 05:59:41 pmNo difference. Connecting V2 to ground reduced the noise slightly. I also terminated V1 with a 50 ohm resistor to ground, but that just halved the signal without any appreciable effect on the noise.Right now I'm waiting on LT spice. The simulation has been running for 1/2 an hour and the status line advises "Transient Analysis 0.54% done." At this rate, it would be faster to build another physical circuit!

author: amspire
author_rank: Super Contributor
timestamp: March 19, 2016, 08:34:41 pm
content: Looking at the photo, I am still seeing the 100 ohm resistor going to the wrong ends of the 510 resistors. It looks like it is going to the opamp outputs which means it does nothing.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2016, 11:26:58 pm
content: Quote from: amspire on March 19, 2016, 08:34:41 pmSonofa...I think you put your finger on it. I'll change that as soon as the grandkids leave tonight.

author: torch
author_rank: Frequent Contributor
timestamp: March 20, 2016, 01:29:04 am
content: Amspire,-You were 100% correct. I had the 100? resistor across the outputs instead of the negative inputs and I did not see what you were driving at earlier. Thanks for your persistence. I switched it around and much of the noise is gone, plus it's actually amplifying the signal. Voila:It's still pretty ugly especially at lower input amplitude and higher frequency, but hopefully that will be further eased when it's properly housed, terminated and connected with some BNC cables instead of alligator clip leads (connecting V2 to the ground plane as mstoer showed in his schematic helped reduce the noise a bit too):Now here's the odd thing: LT spice is still churning away, showing 21.6% done (I don't know if it's always this slow, or just when you try and plug a competitor's product into the equation) but so far, over 6 cycles, it predicts a gain of 0. Actually, it looks like the output amplitude is even a touch less than the input.

author: DimitriP
author_rank: Super Contributor
timestamp: March 20, 2016, 01:46:42 am
content: QuoteYou've probably told it to run for "too long".Shot in the dark: Try changing the time parameter to 5m ( .tran 5m )

author: mstoer
author_rank: Contributor
timestamp: March 20, 2016, 03:35:08 am
content: torch, some models from other vendors don't always behave nicely in spice. They sometimes require some extra care in the spice solver. Go to the control panel and select "modified trap" for the integration method and "alternate" for the solver. For me if it takes longer than 1-2 min, I try different settings. I have a few problem circuits that use auto-zeroing (chopper stabilized) amps that require the extra treatment.When I think of an InAmp, I think of low noise, high CMR amps. The LM7171 is neither of these. It is a (somewhat) high speed, high current output amp. It might be that is is not suited for use as an InAmp. Something like an AD8671 (my workhorse) is what I would prefer. That isn't to say you can't clean that output up a bit.

author: amspire
author_rank: Super Contributor
timestamp: March 20, 2016, 04:37:00 am
content: The LM7171 data sheet says it is stable at gains of -1, or +2 (or more). I would try putting another pair of 1K resistors across R2 and R5 to increase the gain of the differential stage to 2. The LM7171 does not have great phase margin down near 0dB gain, so for this amplifier, the more gain, the more stable. If you need a gain of exactly 11, you could increase the 100 ohm resistor to compensate for the extra gain in the differential stage.

author: danadak
author_rank: Super Contributor
timestamp: March 20, 2016, 01:09:23 pm
content: You have what appears to be an oscillation at 50 Mhz according to your timebaseon scope shot. Very fast amps have to have very careful low L layout and excellentbypassing. Look carefully at bypass C specs, you should have a .01, 01 uF ceramicas well as bulk bypass, eg, 1 uF or greater. If you look at ceramic datasheets notall ceramics have good esr curves at RF.https://www.intersil.com/content/dam/Intersil/documents/an13/an1325.pdfhttp://cds.linear.com/docs/en/application-note/an47fa.pdfRegards, Dana.

author: torch
author_rank: Frequent Contributor
timestamp: March 20, 2016, 01:13:25 pm
content: After bumping the Windows priority up to "High" for LTSpice and leaving it run overnight, it was all the way up to about 75% done by morning. If I'm doing this right, the simulator shows negative gain (green line is V1, blue line is Vout):Quote from: mstoer on March 20, 2016, 03:35:08 am"Modified Trap" was already selected. "Alternate" made little difference. However, changing the "matrix compiler" to "Pseudo code" and "Default DC solve strategy" to "Noopiter" and "Skip Gmin Stepping" really sped things up -- a 5ms sec test took just a couple of minutes. I have no idea what those things do, but the output graph looks about the same as the overnight result.QuoteI was experimenting last night with different supply voltages, filter caps and termination and exploring the results with the scope probe. At -15/+15 supply, I accidentally shorted V1 and the adjacent negative rail pin. Apparently, that will kill the LM7171. So maybe I'll try the AD8671 next...

author: torch
author_rank: Frequent Contributor
timestamp: March 20, 2016, 01:48:55 pm
content: Quote from: danadak on March 20, 2016, 01:09:23 pmYes.QuoteFrom my limited understanding of reducing inductance, I tried to keep signal paths as short as possible and used metal film resistors. I understand that SMD resistors may be preferable to through-hole, but I have found tiny smd components do not play well with old eyes and shaky hands.The initial capacitor values were chosen from the TI spec sheet -- .01uF bypassing the chip pins, and 2.2uF bypassing the rails. TI did spec ceramic for the .01 and I used polyester film because a) that's what I had in that value and b)I understand they are more linear in response. Similarly, TI specified 2.2 tantalum caps and I used aluminium electrolytic at the rails because that's what I had. All that said, the power supply seems rock steady with no significant ripple.TI did not specify the type of feedback capacitor, merely advising "For the LM7171, a feedback capacitor of 2pF is recommended". I used a ceramic disk -- again, because that's what I have.QuoteGiven that I bought a grab-bag of various size capacitors from Radio Shack a few years back and later augmented that with a variety pack purchased on-line (don't remember exactly where from), I cannot characterize them better than the general construction type.

author: danadak
author_rank: Super Contributor
timestamp: March 20, 2016, 02:05:10 pm
content: Look at section 9.1.3 of datasheet (TI) , comments about absolute value ofFeedback R.http://www.ti.com/lit/ds/symlink/lm7171.pdfTo look at C effectiveness at RF a bridge is required.http://techdoc.kvindesland.no/radio/passivecomp/20061223155312558.pdfYou will be amazed just how crappy many ceramics are when you get intothe 10's of Mhz range expecting them to function as a bypass. I can attestto not having looked at datasheets on passives and having poor results whenworking at RF. Radio Shack grab bag components OK for generic low speed,low DC constraint type of work. Otherwise choose your passives with care.Lastly if your baseband signals are not RF, save yourself a lot of aggravationand use low speed OpAmps for the IA. Note this OpAmp does not have a CMRthat includes ground, at low Vsupply its quite poor, another reason to considerlower speed general class of OpAmps.Regards, Dana.

author: torch
author_rank: Frequent Contributor
timestamp: March 20, 2016, 09:32:48 pm
content: I was aiming for a high impedance amplifier with bandwidth up to at least 10MHz @ 10x amplitude. I picked the LM7171 because a) the unity gain is 200MHz, so the response should be pretty flat to 10MHz and b) I had some left over from another project (a little single-chip amplifier with 50ohm input impedance that works quite nicely).

author: danadak
author_rank: Super Contributor
timestamp: March 20, 2016, 09:51:08 pm
content: Then you picked right part, but if you want CMR out to 10 Mhz youwill most likely have to include AC trim to get it. What is your CMRgoal at 10 Mhz ?Rehards, Dana.

author: torch
author_rank: Frequent Contributor
timestamp: March 21, 2016, 12:02:21 am
content: As high as possibleI thought the CMRR was primarily a function of the op amp itself, provided external conditions and components were equal. What do you mean by "AC trim"? At a guess, I suspect it must be related to correcting any AC phase mis-match between the buffer stage outputs and the amplification stage inputs?

author: danadak
author_rank: Super Contributor
timestamp: March 21, 2016, 12:26:56 am
content: The CMR is set by external accuracy of matching feedback R'sand Aol and G. Attached is an analysis done in Matlab thatcan be used to evaluate component matching effects and AolOpAmp to OpAmp effects.I was referring to use of a C trimmer to take care of layout differencesand stray C affecting matching.Regards, Dana.

author: torch
author_rank: Frequent Contributor
timestamp: March 21, 2016, 07:39:00 am
content: That active compensation circuit looks intriguing. Almost too good to be true. I wonder what the downsides are?

author: danadak
author_rank: Super Contributor
timestamp: March 21, 2016, 10:04:35 am
content: It was done with a 400 Khz GBW OpAmp, trying to do this at 10 MhzI would guess is not a tea party. But then external trimming would possiblywork.Another approach is using a differential high speed A/D, but then youhave to convert back to analog, unless you are taking measurementsand digitizing the output already. This approach has effectively trimmedCMR due to the die matching and synchronicity of the samplers.http://www.analog.com/media/en/technical-documentation/data-sheets/AD7402.pdfRegards, Dana.

author: danadak
author_rank: Super Contributor
timestamp: March 21, 2016, 10:38:31 pm
content: I happened to come across this today, might be of interest -https://xellers.wordpress.com/electronics/1ghz-active-differential-probe/Regards, Dana.