Author Topic: Better peak detector circuit  (Read 2670 times)

0 Members and 1 Guest are viewing this topic.

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Better peak detector circuit
« on: February 01, 2016, 04:28:29 pm »
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.
 

Z80

  • Guest
Re: Better peak detector circuit
« Reply #1 on: February 01, 2016, 04:53:34 pm »
D2 gives the first amplifier a log response, R sets the overall loop gain.  Nothing too special here ?
 :palm:
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.
« Last Edit: February 01, 2016, 11:09:18 pm by Z80 »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14198
  • Country: de
Re: Better peak detector circuit
« Reply #2 on: February 01, 2016, 06:22:53 pm »
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.
 

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Re: Better peak detector circuit
« Reply #3 on: June 12, 2016, 01:32:09 pm »
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?
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Better peak detector circuit
« Reply #4 on: June 12, 2016, 03:16:18 pm »
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.
 
The following users thanked this post: nForce

Offline Chris Mr

  • Regular Contributor
  • *
  • Posts: 139
  • Country: gb
  • Where there's a will there's a way
Re: Better peak detector circuit
« Reply #5 on: June 12, 2016, 03:43:56 pm »
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 is
1. Make sure your two inputs are at the same voltage
2. 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 idea

As already pointed out, there is nothing to reset this circuit; but it is a peak detector  :-+
« Last Edit: June 12, 2016, 03:47:54 pm by Chris Mr »
 
The following users thanked this post: nForce

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Re: Better peak detector circuit
« Reply #6 on: June 12, 2016, 09:14:43 pm »
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.

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

Offline Chris Mr

  • Regular Contributor
  • *
  • Posts: 139
  • Country: gb
  • Where there's a will there's a way
Re: Better peak detector circuit
« Reply #7 on: June 13, 2016, 06:47:30 am »
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 is
1. Make sure your two inputs are at the same voltage
2. 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 idea

In 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.
« Last Edit: June 13, 2016, 12:52:49 pm by Chris Mr »
 
The following users thanked this post: nForce

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Re: Better peak detector circuit
« Reply #8 on: June 13, 2016, 12:45:04 pm »
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?
 

Offline Chris Mr

  • Regular Contributor
  • *
  • Posts: 139
  • Country: gb
  • Where there's a will there's a way
Re: Better peak detector circuit
« Reply #9 on: June 13, 2016, 01:20:05 pm »
I just edited that last tine because it mentioned the - input twice  :palm:

The 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 value  :-\

Let 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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf