Better peak detector circuit - Page 1
Forum section: electronics / beginners

author: nForce
author_rank: Frequent Contributor
timestamp: February 01, 2016, 04:28:29 pm
content: Hi, I have watched youtube video from EEVblog, about peak detectors.But I have found another circuit which is a little different. Can someone explain, here why is output of an op amp U2, connected to the inverting input of an op amp U1, and why is the diode D2, parallel to it.Thank you.

author: Unknown
author_rank: Unknown
timestamp: February 01, 2016, 04:53:34 pm
content: D2 gives the first amplifier a log response, R sets the overall loop gain. Nothing too special here ?Ok I take that back, having a proper look at it, that is a precision rectifier circuit, although the configuration being non inverting is not the usual way it is shown. The resistor sets the loop gain (in the inverting configuration in conjunction with an input resistor) and to remove the drop of the rectifier diode which is the purpose of using the first op amp. The second opamp is just a buffer for the sample capacitor. D2, not sure in this configuration, in the standard setup it shunts the unused half cycle. Out of curiosity I ran the circuit shown in LTspice and it works with unity gain.

author: Kleinstein
author_rank: Super Contributor
timestamp: February 01, 2016, 06:22:53 pm
content: D2 pevents the first OP from going all the way to negative saturation at the output. This helps the OP to recover faster. It has nothing to do with a log response.The second OP is just a buffer for the capacitor, so one can read the voltage without discharging the capacitor. With having the feedback for the 1st OP from the second OP, the voltage drop at D1 is compensated.

author: nForce
author_rank: Frequent Contributor
timestamp: June 12, 2016, 01:32:09 pm
content: May I ask, why do we put there a resistor R?Because the voltage follower does not have a resistor in negative feedback. What would happen if we have a voltage follower with just one resistor in feedback?

author: Audioguru
author_rank: Super Contributor
timestamp: June 12, 2016, 03:16:18 pm
content: Opamp U2 is missing an important bias resistor on its (+) input to set its reference voltage (probably at 0V).Resistor R sets the voltage gain of U1 at 1 so that U1 does not have a voltage gain of 200,000 or more. U1 has negative feedback from U2 so that it can cancel the voltage lost by D1.

author: Chris Mr
author_rank: Regular Contributor
timestamp: June 12, 2016, 03:43:56 pm
content: There are only two things that can happen.Either the + input of U1 is more than or equal to the output of U2 or it's less.If the + input of U1 is a higher voltage than the output of U2, making U1 - input more than the + input, the output of U1 has to go positive until the output of U2, via diode D1, increases to the point where it matches the + input to U1 via U2 and R. U2 is a high impedance buffer so does not affect (in an ideal world) the voltage stored on C.As soon as the + input of U1 is more negative than its - input its output will go low, and via D2 will pull down its - input using R to keep the - input pulled high. In other words, the output of U1 will track the input but be 1 diode drop lower because of D2.So at the point where the + input goes from being ever so slightly lower than Vout to being ever so slightly higher the output of U1 jumps two diode drops to compensate.It's a simple but purposeful life being an op-amp, all you have to do is1. Make sure your two inputs are at the same voltage2. If they're not the same then move your output in the direction of the highest voltage input (+ or -) until something happens to make 1. true.3. Don't worry if you hit the end stop of the power supply, you have the right ideaAs already pointed out, there is nothing to reset this circuit; but it is a peak detector

author: nForce
author_rank: Frequent Contributor
timestamp: June 12, 2016, 09:14:43 pm
content: Quote from: Audioguru on June 12, 2016, 03:16:18 pmSorry i am a beginner, and I still don't understand.If we had used the resistor R in negative feedback loop so that the op amp does not have 100000x gain. Why does voltage follower have a feedback loop with no resistor.And what would happen if it had just one resistor? (Not two)

author: Chris Mr
author_rank: Regular Contributor
timestamp: June 13, 2016, 06:47:30 am
content: U2 is arranged to have zero gain - its output is connected to its inverting input - so the output voltage of U2 is the same as its non-inverting input.The only thing that can change the output voltage of U2 is when the non-inverting input changes.It's a simple but purposeful life being an op-amp, all you have to do is1. Make sure your two inputs are at the same voltage2. If they're not the same then move your output in the direction of the highest voltage input (+ or -) until something happens to make 1. true.3. Don't worry if you hit the end stop of the power supply, you have the right ideaIn 2. above, if the highest of the two voltages on the inputs (+/-) is the - input the output goes negative. If the highest input voltage is on the + input the output goes positive.Hope that helps.

author: nForce
author_rank: Frequent Contributor
timestamp: June 13, 2016, 12:45:04 pm
content: Maybe I wasn't clear enouqh.I am not testing this circuit in real life. I am analyzing different combinations of circuits with pencil and paper. Only the theory for now.Did you test a voltage follower with only one resistor in feedback? What does it do in real scenario?

author: Chris Mr
author_rank: Regular Contributor
timestamp: June 13, 2016, 01:20:05 pm
content: I just edited that last tine because it mentioned the - input twiceThe follower here has no resistor, or rather it's a wire link which is very low resistance.If you put a resistor in the follower feedback path (from U2 - input to U2 output) then the whole thing does something completely different. Then you add gain so the output has to move when the input stage follows the input voltage - when it goes lower than the stored value. It'll be pretty useless as a peak detector as the lowest voltage it outputs will be the positive valueLet me go through it with an extra resistor in the U2 follower stage.Lets start with the input to the whole thing being made instantly more positive than the voltage stored on the capacitor and that U2 was stable with its two inputs the same voltage - so the resistor R in the diagram biases the input to U1 to be lower than the input causing U1 output to go up, which increases the voltage on the capacitor via the diode from U1 output to the capacitor. Now U2 hasn't got both inputs the same so it tries to compensate by..rule 2. Highest input voltage pin is the + input so output goes high.Now U2 output has to go to the capacitor voltage for 1. to be true - which it will. At this point it doesn't seem much different..The other case is when the input to the whole thing is lower than the voltage on the capacitor. In this case the output of U1 will go low until it makes the U1 feedback diode conduct, at which point the - input will match the + input (of U1), BUT....drum roll....Because the two inputs to U1 are now the same >and lower than the stored voltage< the original R is connected to the store voltage on U2 (because U2 has to obey rule 1 to make its inputs the same voltage) so poor old U2 has to make its output go high to compensate. In other words, at this point, the inputs to U2 are such that the + input is the highest and so the output will go high; and that means higher than the stored voltage.I hope that doesn't sound like an alien language