Electronic – Op amp rectifier : transfer function and output impedance

impedanceoperational-amplifieroutputrectifier

I'm working on an EE student project which uses a rectifier to keep the peak value of a sine wave.
You can find a PSpice pic of the schematics below (Ve is the input (1kHz), Vs is the output).

Op amp rectifier:

I really have problems to analyse this pic. It is quite easy when I replace the diode by a short (and forget about the capacitor for now), then I just have Vs = (2+R3/10k)Ve (the potentiometer R3 gives a variable gain) by considering the op amp is ideal. Until now, it is okay.

When Ve is positive, the diode is on and the upper relation between Ve and Vs is correct, knowing that the 0.6V voltage drop accross the diode is compensated by the op amp.
When Ve is negative, the diode is off and the op-amp saturates at -Vsat behind the diode.
Until now, is it correct ?

Everything becomes more complicated when we put on the capacitor. It works perfectly to keep the peak value but I don't understand everything yet.
When the diode is on, the time constant should be very small, isn't it ? The output impedance of the op amp should be near zero, so the time constant tc = RC is very small, right ?

And when the diode is off, all resistors in the feedback loop (R1, R2 and R3) come in the time constant and tc becomes high, isn't it ?
Well, then why isn't the capacitor just following the signal when it is positive ? And stay at zero when it is down ?
I'm sure I'm missing something simple, but I don't know what…

And, when the time comes to find the total transfer function Vs/Ve (for both cases when the diode is on and off), I'm completely lost.
Just the same when it comes to find output impedance…

Hope I expressed myself clearly (and my English wasn't too bad).
Any help would be greatly appreciated.

Best Answer

With the diode shorted, this is just a ordinary non-inverting amplifier. Note that R2 and R3 together form a single resistance, just that it's adjustable from 10 kΩ to 110 kΩ. This provides variable voltage gain from 2x to 12x.

With the diode, everything will be normal as long as the opamp is trying to drive the output higher than it is. The opamp output is actually the diode drop higher than the output at Vs. Due to the feedback, the opamp tries to drive the left side of the diode to whatever it takes to get the desired Vs.

When the Ve input goes lower, the opamp will again try to do whatever it takes on the left side of D1 to make Vs be Ve times the gain. However, in this case it won't succeed. All it can do is slam the output as low as it goes. Since the diode won't conduct, the output is effectively only tied to ground via R1, R2, and R3 in series. If the low input voltage persists, that series resistance will discharge the cap. The waveform will be a exponential decay towards ground with a time constant of (R1 + R2 + R3)*C.

The net effect is that the positive peaks of Ve are followed on Vs with some amplification. In between the input peaks, Vs will decay towards 0. This is sometimes called a "detector" circuit, and the amount of decay between the peaks is intended to be small compared to the value of the peaks themselves. When the input signal is AC coupled, the net result is a voltage proportional to the input amplitude.

You could make a basic detector with just a diode biased properly, but the input and output would be off from each other by the diode drop. This circuit uses the opamp to compensate for the diode drop.