0
\$\begingroup\$

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:

enter image description here

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).

enter image description here

Up until around 30 kHz. Then it starts to look like usual capacitor discharge at the end of a half cycle (see picture below).

enter image description here

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. enter image description here

The updated outputs are in the picture below. The simulation was run with a 500Hz input. enter image description here

The following picture provides the output without the added 100k resistor and 3.3V supply.

enter image description here

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?
\$\endgroup\$
7
  • 2
    \$\begingroup\$ What supply voltages is your simulator applying to the op-amp power pins? An op-amp can (at best) pull the output down to the negative supply rail or up to the positive supply rail. If the negative supply rail is GND (0 V) then the output can't go lower than that. Try a split-rail power supply - say +12 V, -12 V. \$\endgroup\$
    – Transistor
    Jan 20, 2022 at 23:09
  • \$\begingroup\$ @Transistor thanks for the hint. I will edit my question :) But its VDD = 10V, VSS = GND \$\endgroup\$
    – eeemdee
    Jan 20, 2022 at 23:10
  • \$\begingroup\$ Comparators have open collector , you would see this in the datasheet. So it must have some pullup. It's not a very good design unless you told us it was for AGC and you expect it to track the minimum voltage not the peak for a very high f. No design can be properly analyzed without expectations or SPECS \$\endgroup\$ Jan 21, 2022 at 0:09
  • \$\begingroup\$ I deleted my answer due to my misunderstanding of what you want to know., \$\endgroup\$ Jan 21, 2022 at 0:25
  • \$\begingroup\$ All right. Thank you for your help so far. In my opinion (as far as the circuit diagrams show) its "only" a half wave rectifier. The output will be fed into a lp-filter, then an adc. For understanding what the comparator does: At the base of the output transistor will be applied a current such that the collector current, which in turn produces a voltage drop over the 100k and 100 resistors, will set the voltage between the 100k and 100 ohm. This voltage will then be the same as the voltage at the non-inverting input. Is that right? \$\endgroup\$
    – eeemdee
    Jan 21, 2022 at 0:32

1 Answer 1

1
\$\begingroup\$

An op-amp can (at best) pull the output down to the negative supply rail or up to the positive supply rail. If the negative supply rail is GND (0 V) then the output can't go lower than that.

Try a split-rail power supply - say +12 V, -12 V.

But it's VDD = 10 V, VSS = GND.

That's your problem then. The output can't go negative. The Falstad simulator may assume a split-rail power supply.

\$\endgroup\$
2
  • \$\begingroup\$ Falstad let's you choose any output swing for V+ and V- and offers unlimited current in the basic fast simulation. Otherwise Real Op AMp choices are limited to LM324 and 741. This circuit is unusual in that it makes an ideal Op Amp go unstable without compensation. \$\endgroup\$ Jan 20, 2022 at 23:43
  • \$\begingroup\$ @Transistor Please see my edited question :) \$\endgroup\$
    – eeemdee
    Jan 20, 2022 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.