A positive peak detector circuit


by FOIWATER
Tags: circuit, peak, positive
FOIWATER
FOIWATER is offline
#19
Oct2-13, 07:28 AM
PF Gold
FOIWATER's Avatar
P: 369
Yeah meBigGuy I still have that issue, I am unsure how to address it.
I did the calculation for my maximum slew rate required for this circuit with an input waveform of 2.5sin(2pift)
and I only got about 7V/us for the highest frequency (500kHz)
But the AD829 is good for up to 50v/us so obviously there is an issue with the circuit.
I can't post the multisim file here its an invalid file type..
The previous post is still about where I am at. I have tried adding resistor capacitor arrangement with the 0.002uf cap, and also tried tampering with the opamp hysteresis by adding capacitors to the other inputs of the AD829 but the range is still getting me.

About the reset circuit, I am unsure how to do it any other way,

About the output of the opamp being grounded, should I include a emitter follower?

About the AD829 being used as a comparator, should I replace it with a comparator?
FOIWATER
FOIWATER is offline
#20
Oct2-13, 07:32 AM
PF Gold
FOIWATER's Avatar
P: 369
meBigGuy, do you have any suggestions for how I should monitor diode current during reset..
meBigGuy
meBigGuy is offline
#21
Oct2-13, 11:27 PM
P: 976
Quote Quote by FOIWATER View Post
meBigGuy, do you have any suggestions for how I should monitor diode current during reset..
I thought multisim would let you monitor currents. If not, you can insert a small resistor and measure the voltage across it.

I just thought of a problem with using an emitter follower, which is that when the input signal goes below the peak the opamp output goes to -5, and the peak voltage is on the emitter, back biasing it and possibly breaking it down. There are other ways to buffer the output, if that is what's needed.

As for the reset, we will see how much current is being drawn. You could put a series resistor in series with the discharge fet to limit the current. Or, you could disconnect it when you reset it (with a FET to ground that opens when you reset).

I see the slew of AD829 is 150V/us with a 500 ohm load , but short circuit current is only 32ma.

I think your slew rate is actually a bit higher than you calculated. The fast section of a sine wave is about 1/3 the period, so for a 500Khz that is 2uS/3 = ~700ns. 10V/700ns is 14V/uS.

14V/uS across .002uF (i = Cdv/dt) = .002uF*14V/uS = 28ma. I don't think the amp can drive its short circuit current actively (not sure) so it may be current limiting.

Try reducing the capacitor until the slew problem goes away. .001 might be low enough (just to test this theory).
meBigGuy
meBigGuy is offline
#22
Oct3-13, 12:17 AM
P: 976
Have you looked at using an LF398? It has a slow acquisition time, but that may not be an issue in track and hold. You can use a comparator to stop sampling when the input drops below the output.
FOIWATER
FOIWATER is offline
#23
Oct3-13, 02:43 PM
PF Gold
FOIWATER's Avatar
P: 369
You are right that reducing the capacitor solves the slew problem, however, it overcharges on the rising edge and picks up a positive peak detection which is inaccurate.

I will run a simulation and post back with the results you asked for tonight, I appreciate the help.
meBigGuy
meBigGuy is offline
#24
Oct3-13, 08:05 PM
P: 976
The over charging may be due to the lag caused by the resistance of the diodes, or maybe an effect of the diode biasing amp. Not sure.
skeptic2
skeptic2 is offline
#25
Oct3-13, 09:20 PM
P: 1,784
Attached is a circuit that could be a starting point. The circuit is not optimized and differs from yours in many ways. I'm sure it can be made simpler. However it does seem to work, at least with LTSPICE.

Included are the schematic, the netlist and a section of the plot. In the plot, the green trace is the 1 Vpk sinewave at 5 MHz and the blue trace is the peak voltage which is held for 0.1uS before it is reset. Despite its value of only 240pF, the capacitor's voltage doesn't seem to droop.
Attached Thumbnails
Peak Detector.jpg   Peak Detector Plot.jpg  
Attached Files
File Type: txt Peak Detector Netlist.txt (594 Bytes, 2 views)
FOIWATER
FOIWATER is offline
#26
Oct3-13, 10:59 PM
PF Gold
FOIWATER's Avatar
P: 369
meBigGuy - I am starting to think it's the diode as well...

Skeptic, nice job.....

Personally I am trying to get this to work with the AD829, since as meBigGuy stated previously the circuit shouldn't really be out of the range of this device.

Skeptic, what kind of waveforms do you get for voltages between 20mV, to about 2.5 volts? how about frequencies between 10kHz and 500kHz?

These are the limits I have set for myself, Are they (in your opinion) attainable?
FOIWATER
FOIWATER is offline
#27
Oct4-13, 09:23 AM
PF Gold
FOIWATER's Avatar
P: 369
I have added the BJT for current gain, it did not reduce the slew rate problem exactly,
I also replaced the AD829 with a LM311 comparator.
notice the pics attatched, the low voltage low frequency is still overcharging, while for high frequencies it is undercharging.

I also built this circuit and scoped it.

What a mess!
Attached Thumbnails
highvoltagehighfrequency.jpg   lowvoltagelowfrequency.jpg  
meBigGuy
meBigGuy is offline
#28
Oct5-13, 12:06 AM
P: 976
1. In the high frequency plot you can see that when the discharge FET turns off it dumps negative charge into the capacitor (through gate-drain junction).
The discharge FET comparator needs to be biased such that it can turn off slowly before the 0 crossing (or use a FET with less gate-drain capacitance). You need to slow down the switching signal. A way to test it is to add a capacitor on the output of the comparator to slow it down. Also, if you probe the gate and drain at the same time you will see the similarity.

2. The low frequency plot is trying to reach 5V, but it can't get there because there are 3 diode drops. Try only driving to 2.5V and see what it does. BTW, the same spike at the 0 crossover will be there in low frequency mode, but you just don't see it.



3. Replace the second diode with the emitter follower. 1 diode, 1 emitter follower (which is a diode).

4. The feedback *has* to go to the capacitor. That's a must. If the leakage is too much, then you have a problem and need to change to a cmos opamp. That in itself may be the reason an AD829 is not a good choice. But, if we can get the emitter follower to work you can increase the capacitor.
FOIWATER
FOIWATER is offline
#29
Oct6-13, 10:08 PM
PF Gold
FOIWATER's Avatar
P: 369
OK I got rid of the 2nd diode, I see it isn't necessary not sure what I was thinking,

With the emitter follower I get some, weird waveforms lol

I will post in the AM. Thanks for the feedback.

What do you mean about the feedback having to go to the cap?
meBigGuy
meBigGuy is offline
#30
Oct7-13, 12:36 AM
P: 976
The feedback to the input op-amp has to come from the storage cap not the base of the follower. The goal is for the voltage across the cap to equal the input voltage.

There is another approach to this that eliminates the reset FET. Look at the LF398. You need logic to determine when to sample though. Open the switch when the input drops below the output. Once the input crosses 0 you just close the switch.

As with any sample and hold you always have to deal with charge injection when you switch the FET (as you saw)
FOIWATER
FOIWATER is offline
#31
Nov9-13, 10:31 AM
PF Gold
FOIWATER's Avatar
P: 369
For anyone interested, the attached circuit performs to spec, uses both an AD829 and LM318 with the same basic config as discussed.

Any one have any possible improvements?

(The main drawback I was not considering was compensation caps for the op amps, which I got from the data sheets)
Attached Thumbnails
project.png  
meBigGuy
meBigGuy is offline
#32
Nov10-13, 05:09 PM
P: 976
Looks pretty cool. Post some waveforms.

Are you saying the 829 compensation solved the slew rate problems?
I have questions (curiosity).
Why the resistor in series with the main storage capacitor?
What does R5 do? (looks like it is just across the supply)?
What does C6 do? How did you choose that?
FOIWATER
FOIWATER is offline
#33
Nov11-13, 11:13 AM
PF Gold
FOIWATER's Avatar
P: 369
Ill take some pictures of the oscilloscope I have made the circuit it works, pretty decently. Perfectly in the simulator but, yeah.
Yeah there is absolutely no slew rate problems with this circuit what so ever. but notice it is being driven at unity gain. The 829 is one of the fewer than 5% of op amps without unity gain compensation. As such it requires external capacitors to ensure it doesn't go unstable. (the stair-casing we saw earlier at unity gain). Usually the compensation capacitor is placed from pin 5 to ground but it worked really good here.. I am still trying to find out why by looking at ad's blog this helped a lot http://www.analog.com/library/analog...e_loading.html

R5 is actually a resistor on the output of the 829 which shifts the pole of the op amp due to the internal capacitor. It allows for higher bandwidth

R5 just keeps the simulator happy. adds no real effect when breadboarded. Just something I picked up from using multisim
FOIWATER
FOIWATER is offline
#34
Nov11-13, 11:15 AM
PF Gold
FOIWATER's Avatar
P: 369
(also R5 is not connected to the positive rail, it's from the pins to the negative rail I know it looks like it is though)


Register to reply

Related Discussions
Circuit Analysis of a Positive Offset Clamping Diode Circuit Engineering, Comp Sci, & Technology Homework 6
op-amp circuit peak current and swtiched circuit transient Engineering, Comp Sci, & Technology Homework 7
peak detector..how does it work? Electrical Engineering 0
Help, RLC Circuit Problem - Peak Current At Resonance Introductory Physics Homework 1
Peak Detector Electrical Engineering 1