How to Analyze Interacting Op-Amps? - Page 1
Forum section: electronics / beginners

author: MajorEE
author_rank: Contributor
timestamp: July 14, 2025, 12:00:50 am
content: I have created a simple variable resistance simulator to be used as a programmable resistance calibrator. How would you approach numerical nodal analysis of this system?I attempted an analysis but I am not sure how to translate this into the results I expect.VC = VA * (R2/(R1+R2))VE = VC * (-R4/R3)VA = (I1 * RX) + VETheory of operation--- A current source is applied to the input resistor, RX. This current source would be an external device such as a DMM. This current across a resistance generates a voltage which is then measured to calculate a resistance.- Op-Amp U1 provides the initial gain, Op-Amp U2 inverts the output. By changing the gain resistances either with a potentiometer, or with a MDAC system the equivalent resistance can be changed.- Op-Amp U2 outputs a negative voltage thereby reducing the equivalent voltage generated at node VA.In this simulation the resistance seen looking into node VA is 2.997 Ohms. This makes sense since the gain of the inversion stage is 1, and the gain of U1 is R2/(R1+R2)=999E-6 -> 999E-6*3000 = 2.997 Ohms.Can anyone provide guidance?Thanks kindly!

author: Benta
author_rank: Super Contributor
timestamp: July 14, 2025, 12:29:19 am
content: I'd be interested in seeing this circuit in practice. With the values used, U1 has to output around 3 kV.

author: MajorEE
author_rank: Contributor
timestamp: July 14, 2025, 03:09:54 am
content: LTSpice simulation attached.

author: Ian.M
author_rank: Super Contributor
timestamp: July 14, 2025, 04:25:15 am
content: Before I download that, and assuming U1 and U2 are ideal OPAMPs, lets do a 'back of the envelope' analysis. I1 (1mA) flowing through RX (3K) develops 3V across it. U1 is configured as a non-inverting amplifier, gain 1001, and U2 as an inverting amplifier gain-10-0.1, booth referenced to ground. Therefore the total gain is -100.1 from VA to VE. VA is thus 3V/(100.1+1) which is approx 29.7mV and VB approx -2.97V.However in the real world you'd need some expensive and special power OPAMPs to realise this as VC is 1001 times VA, i.e. approx 29.7V, giving nearly 0.3A through R3 and R4. Also the high loop gain and internal phase shift of the OPAMPs most likely will result in oscillation.After downloading the sim, I note you've changed the resistors that set the gain of both OPAMPs, reducing the gain of U1 to 1.5 and U2 to -1. You are also stepping RX. Also, you've forgotten to power the OPAMPs!Quote from: Benta on July 14, 2025, 12:29:19 amPlease explain your reasoning!Edit: corrected typo for U2 gain (original circuit).

author: MajorEE
author_rank: Contributor
timestamp: July 14, 2025, 04:46:45 am
content: I agree with many of the points noted. Particularly that the op amp is listed as not powered, gain is unachievable, etc.I am not concerned with the specific values, but the analysis of the circuit. Notably because the model uses one of the ideal op-amp models that does not need a voltage source supplied.There are many particular things you could pick apart on this circuit. It is simply a tool to share the most basic configuration to achieve the end result. It is missing compensation, input voltage clamping, other protection mechanisms and so forth. This is far from being an end product. I am looking at this as simply two op-amps with an interdependence between them.If you analyze it purely on the gain equations it comes very close to acting as a "resistance divider", that is RX/system gain = Output R.I am hoping to understand how others would approach the analysis of this system to determine the various transfer functions. Perhaps I should have simply left the values out of this schematic. I hope you folks understand the spirit of the question, and not focus too much about the absolute values provided even though I do understand why they are important (i.e. rail limitations and so forth). For instance, I am starting to think that we could separate out each component, consider the op-amp their own voltage source then perform a loop analysis.I believe some of you folks may have a clever trick for analyzing such a system, and that is what I hope to understand, then I will do my best to learn something. Hopefully then be capable of providing a detailed explanation write up so that others may learn from what we collectively share.Thanks kindly.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 14, 2025, 04:56:17 pm
content: Quote from: Ian.M on July 14, 2025, 04:25:15 amAlmost.(Nitpicking: Resistors are usually in kilo's not in Kelvin)VB would be the same as VA, but if VA is 30mV, then VC is around 30V, and VE around -3V.Quote from: Ian.M on July 14, 2025, 04:25:15 amYes, that pretty much makes it non-functional.Also, when setting up simulations, never build the whole circuit in one go, but always build it in sections and test each section.For example:1). Place the 1mA current source, and the 3k RX to GND. Verify this works (Sounds silly but it builds confidence).2). Add U1. Verify the opamp works. (That would have caught the open opamp power supply).3). Add U2, but without the feedback to RX, verify the results are sensible.4). Connect U2 to RXBy taking small baby steps, faults are much easier to diagnose, and correct.I don't use LTSpice but sometimes use ngSpice with KiCad (I simply refuse to learn another schematic editor), and ngSpice is not as well pre-configured. It's quite common you have to go find or modify models yourself, some models don't work at all, pinouts are often wrong and have to be remapped (LTSpice does not care much about pinouts, but KiCad always uses pinouts of real parts). These pitfalls make it pretty much mandatory that you build up the simulation in small steps. You simply can't assume that even a BJT works without tinkering a bit with it. After a while you of course get familiar with the sort of problems and how to fix them, and you also build up a library of known good symbols and models. But you don't have that when you first start. And that is why there are a few big threads on the KiCad forum with 30-odd simulation examples that are known to work. If you start with a working example, change something, and then it does not work anymore, then you can be pretty confident that it is "that something" that broke the simulation.