Peak detector is not working when voltage is changed

analogcapacitoroperational-amplifiersimulation

I am trying to design a peak detector in Multisim simulation tool. I have designed buffered peak detector to get peak voltage of sine signal. The designed circuit is working when signal voltage is constant, for example when signal voltage changes from 1V to 0.5V then it is giving 2V as peak detector output. The designed circuit as shown below.
Circuit design for peak detector
In the above circuit I am using switch to change the voltage of sine wave from 1V to 0.5V. I am using one more switch to clip negative cycle of sine wave, then i am using buffered peak detector to get maximum voltage.

When i apply 1V sine wave it is working perfectly and giving peak voltage as DC. The problem is when I change signal voltage from 1V to 0.5V then also it is giving 1V as peak. ANy one suggest me what mistake i am doing. I want to design peak detector that will give max voltage even there is voltage variations.
I am trying to attach Multisim file but it is not possible for me. I don't know how to attach file so i have added image.

Best Answer

So let me see if I understand this. You give it a peak of 1.0v and it detects it correctly. Then you back it off to 0.5v and it still reports a 1.0v peak. What's the problem? 0.5v is not the peak if the voltage also goes up to 1.0v.

I suspect that what you want is to detect a peak "over some amount of time", and not a peak "over an infinite amount of time".

If I am following your schematics correctly, you need some way to discharge C1 so that it can detect the next pulse. There are several ways to do that.

One way is to have a transistor/MOSFET/relay actually short C1 to GND. Then have some circuit that will periodically trip that.

Another way is to simply put a resistor in parallel with C1. This resistor would cause the peak value to decay over time. Change the value of the resistor to change how fast it decays. If the resistor is connected to GND then the decay will be a somewhat inverse-square curve. Use a constant current source to make it more linear.