opamp not cooperating - Page 1
Forum section: electronics / beginners

author: JWoodrell
author_rank: Contributor
timestamp: March 11, 2015, 01:18:47 am
content: hey guys, i figured I would ask on here because I don't have enough experience with op amps to figure out where my issue is.I asked here before when I started this project, and got good advice, so I'm back with more questions.ok what I am trying to do is take in a DC voltage 23 to 28 volts and turn that into a 3 to 8 volt output.so it is essentially input - 20 volts = output.I attached the circuit I builtthe op amp is a UA741the inputs of the op amp see 9.5 ish - 12 voltsthe opamp is powered with +15V and 0Vbut the problem I am getting is there as much as .4 volts difference in the output between circuits if I swap one to the next.my question is it is an issue with me not driving the op amp correctly, or something else like maybe resistor tolerances (they are from the same strip so i thought they should be pretty close to each other?thank you.

author: AndreasF
author_rank: Frequent Contributor
timestamp: March 11, 2015, 07:07:46 am
content: (disclaimer: opamp noob myself, so maybe wait for better advice)Not sure about the resistors, but why don't you adjust the output of the LM317 to 20 Volts and then use a unity gain differential amplifier configuration (i.e. all resistors the same value)?What about the offset adjust pins on the opamp?

author: Rerouter
author_rank: Super Contributor
timestamp: March 11, 2015, 07:48:20 am
content: simpler solution would be to use a negative 20V regulator upside down, (its not obvious to most beginners, but you dont always have to use ground as your reference point)so say you had a 7920, ground terminal to V+, Input pin to Ground, and output pin as out output, with a resistor between output and V+ just to give it a little bit of load,

author: Zero999
author_rank: Super Contributor
timestamp: March 11, 2015, 09:48:24 am
content: Quote from: JWoodrell on March 11, 2015, 01:18:47 amWhat do you mean?Do you mean you've built two of them and they give slightly different output voltages, given the same input voltage?If so, then it's to be expected and is actually very good, given the tolerance of the LM317.

author: Andy Watson
author_rank: Super Contributor
timestamp: March 11, 2015, 10:32:24 am
content: A 741 is not the best when working near the supply rails, however, your design appears to allow plenty of headroom - it should be ok. (Actually, 741 is not the best - full stop). I can't see any markings on the 741 - is it genuine?Have you measured the +15V? The LM317 sends its own operating current through the output pin - if your circuit consumes less than this bias current the voltage would not be regulated. I think it needs about 10mA load to guarantee regulation.

author: JWoodrell
author_rank: Contributor
timestamp: March 11, 2015, 04:35:17 pm
content: Yeah I built 10 of them, and the output voltage was different between them by 0.4V.I will try the negative regulator idea, that sounds much better, if i can get it to work like i need

author: Rog520
author_rank: Regular Contributor
timestamp: March 11, 2015, 04:46:01 pm
content: High precision is difficult to obtain from difference amplifiers that are built using discrete resistors. Monolithic amps use laser-trimmer resistors that have something on the order of 0.05% tolerance or better. Also, the 741 is not really a precision op-amp. You have a lot of loose variables there between that op-amp and the resistors that could be causing the variation. I'd try to use a monolithic difference amp or in-amp than will handle your voltage differential (TI makes some suitable ones in their INA series).

author: tszaboo
author_rank: Super Contributor
timestamp: March 11, 2015, 04:54:29 pm
content: This works as expected. 5% error due to the LM317, 1% per resistor, 10mV for your bias current, few millivolt for your offset voltage. 5% error with 1970's style general purpose components is probably right.How can the resistors come from the same strip if they are not the same value?

author: dannyf
author_rank: Super Contributor
timestamp: March 11, 2015, 06:26:53 pm
content: QuoteIt has to be the first opamp in the history of humanity that has its own will,

author: Seekonk
author_rank: Super Contributor
timestamp: March 11, 2015, 09:42:58 pm
content: As an alternative. I think just a LM431 amplified zener with a 40K/10K divider feeding into a 1K resistor would work better than the op amp regulator combination. Near perfect subtractor of 20V.

author: dannyf
author_rank: Super Contributor
timestamp: March 11, 2015, 10:53:20 pm
content: QuoteNo idea what that meant.But if you work out the math, you will find that 20v or less, the circuit should output a low signal - the actual output depends on the opamp used. For rail to rail, it will be fairly close to 0v; otherwise, it is going to be around 1v.After that, it goes up with the input signal linearly.

author: JWoodrell
author_rank: Contributor
timestamp: March 12, 2015, 12:05:30 am
content: The output does track linearly with the input.But the .4 volt difference, say the input was 25 volts, one board would put out 4.7v, another would put out 5.1v, others would be 4.85v, or 4.9v, and a few were actually close to 5v.But after reading your feedback here, I think i understand better where the issues are coming from on the variation. I will continue working with it.Thank you for all the help, and working with someone new to a lot of this

author: IanB
author_rank: Super Contributor
timestamp: March 12, 2015, 12:20:29 am
content: Quote from: JWoodrell on March 11, 2015, 01:18:47 amI'm no expert, so don't take this as authoritative advice, but:If you merely want to subtract 20 volts from the input, can you not simply derive an accurate 20 V rail (e.g. use your LM317), and then take the difference between the two voltages, buffered if necessary?Your illustrated circuit seems to involve more resistors than really needed to do this job.

author: TerminalJack505
author_rank: Super Contributor
timestamp: March 12, 2015, 04:33:39 am
content: +/-400mV is 2% accuracy so it might just be a matter of putting a manual adjustment on your LM317. As someone else mentioned, be mindful that LM317s require a minimum current. Otherwise, they can act pretty squirrely.Using a TL431, like Seekonk suggested gives good results in the simulator. Even has pretty decent bandwidth. (If the simulator can be trusted.)

author: Seekonk
author_rank: Super Contributor
timestamp: March 12, 2015, 08:35:47 am
content: If I remember the original thread correctly, this circuit was to monitor a 24V battery.

author: JWoodrell
author_rank: Contributor
timestamp: March 12, 2015, 09:34:52 am
content: yes it is for an automated cart that is powered from two 12v batteries. (28v charged - 23v empty) so its PLC can look at its voltage level and determine when it needs to go to the recharging station rather than continue running around the factory floor.the PLC has a 0-10v analog input card, and I wanted to give it more dynamic measurement range than just a resistor divider.the board actually lives in a "6mm relay base" which is why it has the 5 legs like it does, its looks kind of slick when its installed. (although I have to account for an additional 0.7v drop from the diode that is built into the base, it is a fixed number that I can account for.) this also kind of puts a size restraints on the final board (although it can get larger vertically if i need)

author: tszaboo
author_rank: Super Contributor
timestamp: March 12, 2015, 03:14:43 pm
content: You could configure a TL431 to subtract 20V from your supply voltage. Just move the current limit resistor from the top to the bottom, and then you only need a voltage follower if you want to have a driven output.

author: Seekonk
author_rank: Super Contributor
timestamp: March 12, 2015, 09:05:46 pm
content: Don't really need a voltage follower. The TL431 will supply as much current as needed, more than enough for a PLC input. R1 + R2 should total about 100K as they will continue to supply current when battery voltage drops to near 20V. That small offset only occurs near zero (20V) at that point the batteries have gone south and it doesn't matter. It is the duty of every engineer to convince the customer that a bug is actually a feature. Like 4-20ma sensors, this circuit always has some minimal voltage to show that it is connected. Software could show sense wire disconnected.