-
Notifications
You must be signed in to change notification settings - Fork 716
Description
The correct way to wire an ideal opamp buffer has the voltage input going into the opamp's (+) terminal and the opamp's output fed back into its (-) terminal, like:
This configuration is unconditionally stable, and the output traces the input correctly.
However, if I incorrectly wire the ideal opamp buffer with the opamp's (-) and (+) terminals reversed:
then I get some really curious behavior in the simulator upon a fresh reset: The opamp's output amazingly is able to perfectly track the input! I suppose in theory with infinite gain and absolutely zero external noise that this is possible. It would be analogous to a ball on the top of a hill, and like a metastable flipflop it could theoretically remain in such a state indefinitely... Of course if I open and close that switch, then the opamp's output correctly gets thrown into either its maximum positive or negative output:
However I still think something is wrong with the circuitjs simulation, because circuitjs's ideal opamp is simulated with only 100k gain, not infinite, and if I inspect the smallest decimal digits, when an input of 1V is applied, then the opamp's output is 1.001,001,001 volts. But the problem is that while it might make sense for the output voltage to start a little higher than 1 volts upon reset, however, that output voltage shouldn't remain at that voltage. Instead, the voltage at subsequent timesteps should exponentially move further and further away from 1 volts, such that the output quickly hits the positive rail.
I'll of course leave it up to the circuitjs maintainers to decide if this behavior of an reverse-wired opamp buffer is something that needs to be changed or if it should just be accepted as the type of funny glitches to be expected of a simulator. But I worry a bit for instance that a student (or someone who doesn't fully understand opamps or know that simulators might lie) might incorrectly wire up the opamp buffer like this and be misled by circuitjs.