op amp summing not working

Thread Starter

hhsting

Joined Apr 25, 2024
395
I want to add V1 and V2 in the schematic below using an op amp. I only have a 12.5VDC and 0 VDC power supply. When I take the output at U1 below, I do not get V1 + V2. Why? How do I correct it? I do not have -12.5VDC. Attached .asc as well.


1765926294053.png
 

Attachments

Last edited by a moderator:

WBahn

Joined Mar 31, 2012
32,704
I don't know what you expect the output to be. If you power the opamp from bipolar rails, the output would be -3 V. But if you insist on making the negative supply rail 0 V, how reasonable is it to expect the output to be correct? It's going as low as it can.

Do you understand how this configuration implements a summing function?
 

Thread Starter

hhsting

Joined Apr 25, 2024
395
I don't know what you expect the output to be. If you power the opamp from bipolar rails, the output would be -3 V. But if you insist on making the negative supply rail 0 V, how reasonable is it to expect the output to be correct? It's going as low as it can.

Do you understand how this configuration implements a summing function?
Ah yes i see it cant go lower than 0V but expected output is negative. Thanks. So what can I do to add v1 and v2?
 

WBahn

Joined Mar 31, 2012
32,704
Ah yes i see it cant go lower than 0V but expected output is negative. Thanks. So what can I do to add v1 and v2?
Provide a negative power rail.

If you don't want the polarity inversion, then you can either invert the inputs or the output, but either approach is going to entail having that negative rail.

If you must only have a single supply, then you can bias your inputs and output accordingly. You will need to decide how you deal with that bias in the final result.
 

Thread Starter

hhsting

Joined Apr 25, 2024
395
Provide a negative power rail.

If you don't want the polarity inversion, then you can either invert the inputs or the output, but either approach is going to entail having that negative rail.

If you must only have a single supply, then you can bias your inputs and output accordingly. You will need to decide how you deal with that bias in the final result.
In the schematic V1 is taken from charging battery positive side whose voltage goes up as it charges. V2 is a node between series resistor between 12.5V supply. Its parital circuit shown. V2. Is not real voltage supply you see. However i do need to add those voltages. I cant get negative rail from wall mounted 120V adapter that converts to 12vdc.
 

WBahn

Joined Mar 31, 2012
32,704
In the schematic V1 is taken from charging battery positive side whose voltage goes up as it charges. V2 is a node between series resistor between 12.5V supply. Its parital circuit shown. V2. Is not real voltage supply you see. However i do need to add those voltages. I cant get negative rail from wall mounted 120V adapter that converts to 12vdc.
I have no idea what it means for a node to be "between series resistor between 12.5 V supply."

Could you provide a more details sketch of your actual application?

What is the purpose of adding these two voltages together?

How accurate does the resulting sum need to be?

What is the range of voltages that need to be summed?
 

MrChips

Joined Oct 2, 2009
34,628
You don't need a negative voltage. What you need is a reference voltage that is split between the V+ and V- pins of the op amp. You can create a split power supply using two resistors. Or you can use two resistors followed by a unity gain buffer.

1765935148249.png
 

WBahn

Joined Mar 31, 2012
32,704
Whether it is feasible for him to do that depends on how his supply and this battery he is interacting with have to be connected. He is likely to still have to deal with bias offsets. But it depends on what he needs and is actually trying to do and, as is so often the case, that seems to be some deep hidden secret.
 

Thread Starter

hhsting

Joined Apr 25, 2024
395
I have no idea what it means for a node to be "between series resistor between 12.5 V supply."

Could you provide a more details sketch of your actual application?

What is the purpose of adding these two voltages together?

How accurate does the resulting sum need to be?

What is the range of voltages that need to be summed?
Let me explain from scratch. You already know that I am building circuit to turn my landscape light on and off from this forum: ambient temperature problem | All About Circuits

You all were very helpful in that thread and I have the hardware including TL431AB that Danco recommended. Then I thought it would be nice to have backup power when main power goes off. So then I researched and wanted to install one of this battery which is rechargeable. Now being rechargeable I wanted to build a charger circuit that can be tied into my previous circuit for that battery. Here is the battery specs and links:

1766015286709.png

Rechargeable Lithium-ion 9V battery 600mAh | EBL

Now I started this circuit below using op amp. Based on the battery spec I need to have 100mA current, charger must stop at 8.4V. In order to do this in the circuit below V2 is my rechargeable battery, v1 is my primary source. Op amp U1 is responsible to cut circuit off when battery voltage reaches 8.4V. Resistor R1 must have 1V drop, current thru R1 must be 100mA and in order to do this I used Op amp U2. Notice U2 + terminal has V3 which is 1V and notice it adds V2 so that at positive terminal I get V3 + V2. I would get V3 from junction between two resistors in series connected to voltage supply V1 12.5V. Thus I need op amp summer summing voltage V2 + V3.

1766015753383.png

Of course I could use parallel diode to get 0.7V drop R1 but that drop would change significantly with temperature. I used Op amp because they don't vary much with temperature.

Should anyone have any better ideas for the charger circuit for the type of battery spec I put please feel free to share here. Please no ready made modules, ICs, micro controller etc. Only discrete components transistor, resistors, diodes, capacitors, inductors I was short on budget last project and it is same project I have.
 

Attachments

MrChips

Joined Oct 2, 2009
34,628
This does not make any sense. It is a typical X,Y problem. You are trying to solve problem X but the real problem is problem Y.

You want to charge a battery with 100 mA constant current and stop charging when the battery voltage reaches 8.4 V. That is problem Y. It has nothing to do with problem X.
 

Thread Starter

hhsting

Joined Apr 25, 2024
395
This does not make any sense. It is a typical X,Y problem. You are trying to solve problem X but the real problem is problem Y.

You want to charge a battery with 100 mA constant current and stop charging when the battery voltage reaches 8.4 V. That is problem Y. It has nothing to do with problem X.
sorry buddy to confuse everyone. However problem Y charging relates to Problem X summing voltage because summing voltage is needed to keep 100mA constant for Problem Y.
 

MrChips

Joined Oct 2, 2009
34,628
sorry buddy to confuse everyone. However problem Y charging relates to Problem X summing voltage because summing voltage is needed to keep 100mA constant for Problem Y.
I don't see how you came to that conclusion. You can build a 100 mA constant current source without using a summing amplifier.

1766091038428.png
 

Thread Starter

hhsting

Joined Apr 25, 2024
395
I don't see how you came to that conclusion. You can build a 100 mA constant current source without using a summing amplifier.

View attachment 360763
In your schematic, my Rload is my battery I suppose. Battery has fixed internal resistance I think. You realize I need to sink the 100mA current into the battery not out of the battery. So voltage between at Out terminal always has to be greater than the battery voltage. Thats the only way it can charge. What would be the voltage at Out terminal? Is it constant? Is it varying? If it is varying then is it greater than battery voltage all the time? Keep in mind battery voltage also increase as it charges.
 
Last edited:

WBahn

Joined Mar 31, 2012
32,704
In your schematic, my Rload is my battery I suppose. You realize I need to sink the 100mA current into the battery not out of the battery. So voltage between R1 and Rload always has to be greater than the battery voltage. Thats the only way it can charge. What would be the voltage between R1 and Rload? Is it constant? Is it varying? If it is varying then is it greater than battery voltage all the time? Keep in mind battery voltage also increase as it charges.
The output voltage of the regulator will be whatever it needs to be, subject to being no more than Vin less the dropout voltage, in order to make the programmed current flow through R1 (and, hence, into the load).

If the load is the battery, then the voltage between R1 and Rload will simply be the battery terminal voltage.

This will give you a constant current charging current, but it will not prevent overcharging. That requires some additional circuitry, which could be as simple as a transistor and voltage divider that will shunt the 100 mA around the battery.
 

Thread Starter

hhsting

Joined Apr 25, 2024
395
The output voltage of the regulator will be whatever it needs to be, subject to being no more than Vin less the dropout voltage, in order to make the programmed current flow through R1 (and, hence, into the load).

If the load is the battery, then the voltage between R1 and Rload will simply be the battery terminal voltage.

This will give you a constant current charging current, but it will not prevent overcharging. That requires some additional circuitry, which could be as simple as a transistor and voltage divider that will shunt the 100 mA around the battery.
I meant what would be voltage at out terminal of lm317. See edited previous post. Will it adjust itself so that current sinks into battery?
 

WBahn

Joined Mar 31, 2012
32,704
I meant what would be voltage at out terminal of lm317. See edited previous post. Will it adjust itself so that current sinks into battery?
How the regulator works is it adjusts the output voltage so that there is a 1.25 V difference between Vout and Vadjust. So the output voltage will me 1.25 V higher than the battery terminal voltage. If R1 is a 12.5 Ω resistor, this will result in 100 mA flowing into the battery.

You might spend some time reviewing the LM317 data sheet. It contains several example circuits, including a few battery charger circuits.
 

Thread Starter

hhsting

Joined Apr 25, 2024
395
How the regulator works is it adjusts the output voltage so that there is a 1.25 V difference between Vout and Vadjust. So the output voltage will me 1.25 V higher than the battery terminal voltage. If R1 is a 12.5 Ω resistor, this will result in 100 mA flowing into the battery.

You might spend some time reviewing the LM317 data sheet. It contains several example circuits, including a few battery charger circuits.
Any where cheap I can get LM317?
 

WBahn

Joined Mar 31, 2012
32,704
Any where cheap I can get LM317?
I have no idea what sources you have access to for electronic components. But wherever you get parts from, they almost certainly have LM317 regulators -- they are very ubiquitious.

You also have Amazon and Digikey as options.
 
Top