I'm having trouble to understand how this circuit operates exactly. The op amp is an LM339 from ST (datasheet link).
The circuit in question is as follows:
The op amp should be a comparator, but the circuit apparently also works with regular op amps. The supply voltage range goes from VDD = 10 V to VSS = GND.
From my understanding the op amp tries to set the voltage at its output pin (V_Out1
) in such a way that the inverting input equals the non-inverting input. The inverting input, which also equals V_Out2
, outputs the half rectified input signal, though. Maybe I still don't understand negative feedback correctly...
Also I'm quite confused by my simulation results. The picture of the circuit was generated via falstad.com/circuit applet. There if I input an input voltage with 10 Hz then V_Out2
= V_In+
. But if I simulate it in LTSpice V_Out2
will always be a half rectified signal (see picture below).
Up until around 30 kHz. Then it starts to look like usual capacitor discharge at the end of a half cycle (see picture below).
Basically my question is: Why and how does it work like that? And which simulation can I trust? I would assume LTSpice.
BIG EDIT BECAUSE I WAS STUPID
So I was using an incorrect op amp in my simulation with LTSpice. Because I used the wrong one, I chose to remove an apparently small but integral part of the circuit, because it seemed to work (eventhogh I didn't know why).
Below is the updated circuit diagram. Please ignore the 50kHz input, because I did an updated run with the correct op amp in LTSpice.
The updated outputs are in the picture below. The simulation was run with a 500Hz input.
The following picture provides the output without the added 100k resistor and 3.3V supply.
Now I totally get the half rectified input. The questions I have now are:
- Why does the circuit only work with the added 100k resistor and +3.3V supply?
- Somehow the frequency for which the circuit works got heavily reduced. Why?