Fast precision rectifier/absolute-peak-detector - Page 1
Forum section: electronics / projects

author: Eliminateur
author_rank: Regular Contributor
timestamp: February 28, 2011, 08:10:23 pm
content: Hello again,this time i'm racking my brains on another module of my bigger project and i turn to you guys as i've hit a larger brick wall than before.I need to measure ripple in a DC line and also monitor large spikes(overvoltage/undervoltage).for the spike part, i was thinking of a windows comparator using 2 opamps/comparators and a flip/flop/scr output to stay latched(so that the uC can read it and i don't miss the pulse, i could also use an interrupt pin as well but i'm pin constrained), nothing fancy, it needs to catch large and or fast spikes of several volts outside norm.Dc input would be AC coupled to rectifier, i'm expecting a freq from 0 to 150kHz in the ripple, and also asymmetric ripple.now... for the ripple part, my initial idea was to use a precision rectifier followed by a peak-detector, then input that to my ADC and done with it..., as a side note, i think it would also catch the spikes i mentioned before... i think....I've been trying to find example circuits of fast precision rectifiers but come up short, the examples i've seen(TI sboa68.pdf for example) show problems in the negative cycle, or totally fail in high frequencies.I've also come across a peak detector circuit using LM393, but it appears it only works for the positive cycle(i would have to put this after the precision rect output)http://www.discovercircuits.com/PDF-FILES/peakdet1.pdfso.. i'm kind of baffled in this part, looks like the "perfect" device would be an absolute peak-detector..Also, how do i AC couple in a 0 to 150kH< range without compromising the signal?, a lowpass RC filter with 150kHz~ cutoff?refs i've seen:http://sound.westhost.com/appnotes/an001.htmhttp://www.analog.com/static/imported-files/application_notes/AN-573.pdfhttp://ecelab.com/circuit-window-comp.htmhttp://www.analog.com/static/imported-files/application_notes/130445851AB109.pdfhttp://www.electronics.dit.ie/staff/ypanarin/Lecture%20Notes/K235-1/7%20Precision%20Rectifiers.pdfand TI sboa68.pdf can't find the url

author: Simon
author_rank: Unknown
timestamp: February 28, 2011, 08:35:34 pm
content: for the spike detection you could use just a comparator that detects anything over a certain voltage and then sets some sort of holding circuit.What exactly are you trying to achive for the ripple ? if your just trying to check the ripple stays under a certain voltage you could AC decouple the voltage with a capacitor and rectify the ripple and smooth it and measure it with a comparator. Now sure how you would do both neg and pos, you may have to mirror everything and use a dual supply although someone else might be able to advise on how to keep it all on the positive side of the rail

author: EEVblog
author_rank: Unknown
timestamp: March 01, 2011, 06:19:34 am
content: For a fast (20MHz) full wave precision rectifier, try the AD8036:http://www.analog.com/static/imported-files/data_sheets/AD8036_8037.pdfSee the app note.Mentioned in blog #38Dave.

author: scrat
author_rank: Frequent Contributor
timestamp: March 01, 2011, 11:11:59 am
content: Of course, since AC voltage at 0Hz is a contraddiction itself, perfect AC coupling in the 0-150kHz range is not possible.If you need to monitor very low-frequenc noise and DC error too, and the DC has a fixed known value, you could reproduce it (with a good voltage reference) and subtract to center the measuring range around zero. Low-pass filtering couldbe then added, if needed.If you don't need precise time response (i.e. you can accept some delay between the spike or noise amplitude change and its detection), you can use >1 order low-pass filters to effectively limit bandwidth at the desired value. If possible (enough high sampling rate), I'd consider digital filtering as an option, too.

author: tecman
author_rank: Frequent Contributor
timestamp: March 01, 2011, 02:34:54 pm
content: What you need is a precision rectifier, followed by a peak detector. There are quite a few op-amps fast enough to make a fast precision rectifier. Problem will be one of dynamic range. You are trying to measure ripple, and large spikes. The amplitude of the spikes will define the allowable gain of the rectifier. The limit may be that the amplitude of the ripple may be too small to effectively measure. You may need a log amp to cover the range, followed by the rectifier-peak detector.Paul

author: Eliminateur
author_rank: Regular Contributor
timestamp: March 01, 2011, 07:16:45 pm
content: thanks for the advice, i had compltely skipped your mention of that part in that vid when i watched it originally.Very nice device, i ran a quick simulation and seems to work, now to try and get one of those(and they're dip as well, hooray!), i won't be needing the 20Mhz as the ripple will probably be below 1Mhz, but it can't hurt either.What i do notice is that if i try to AC couple the input, it adds quite the offset to the input after the decoupling cap, does the AD8036 requires a low-impedance input to work?Quote from: EEVblog on March 01, 2011, 06:19:34 amscrat, actually it won't go down to 0Hz, i think the lowest freqs will be around 20 to 50Hz.It isn't viable to build a reference value and a diference amplifier as the voltages are high and the values are nominal, thus there can be variations which would be problematic to differentiate.Time response is not of the essence as long as it outputs the peak.tecman, the large spikes(under/over) will better be handled by a dedicated window comparator, i rather not dwelve into logarithmic amps and dynamic range issues as i need the best of both world in as simple package as possible.What's the best way to AC couple the input signal?, a simple CR highpass filter?, or a buffered highpass with an opamp(but that can distortion the original ripple if i'm not careful about the amp) to provide low impedance to the AD8036?

author: scrat
author_rank: Frequent Contributor
timestamp: March 02, 2011, 02:28:06 am
content: Since the opamp is powered by dual voltage, I see no problem in simply adding a series cap at the input, having 1/(2*pi*Rg*C) << lowest frequency.

author: Eliminateur
author_rank: Regular Contributor
timestamp: March 04, 2011, 01:49:49 am
content: to narrow down on the design i'll block it this way(and since i have no idea about the clipping on the input of the AD8036):Active sallen-key highpass filter with 20Hz cutoff based on OP277 or LM310 follower -> AD8036 precision rectifier -> peak-hold/peak-detector -> [possibly x2/x3 opamp] -> ADC inputthe problem i'm having is the response of the peak-hold/detector in a wide range of frequencies, i've built this circuithttp://www.discovercircuits.com/DJ-Circuits/peakdet1.htmbut behaves quite poorly below ~1Khz, and i can dispense of the 2nd LM393 in that circuit as well as i don't need large current capabilities.the gain stage is because the resulting rectified peaks will be very small (around 100mV~) and that's 10~codes in the 10bit ADC, but maybe i won't need it...so back to the peak detector, is there any other "fancier" solution(not clock sampled/holdfed, as i need it to be continuous) for wideband peak-holding?

author: scrat
author_rank: Frequent Contributor
timestamp: March 04, 2011, 02:20:58 am
content: I think the only solution is to lower down the peak detector output "filter" corner.However, very low pass filtering the AD8036 output should make the peak detector not necessary.

author: Eliminateur
author_rank: Regular Contributor
timestamp: March 04, 2011, 02:26:15 am
content: the peak detector is to get a stable DC input for the ADC and to have a stable "worse-case" sampling which is what i'm after.the simple rectified output is too "variable" and i could be missing small very transient spikes in softwareof course i could do this in software with max/min, but the microcontroller is already busy with other stuff running and i can't be sampling fast enough to depend on software max/min(and i'd rather not).i could also use a very-large time constant RC network after the AD8036, but that would skip fast spikes...., even an active one...