Reply by John Larkin December 30, 20232023-12-30
On Sat, 30 Dec 2023 05:48:47 GMT, Jan Panteltje <alien@comet.invalid>
wrote:

>On a sunny day (Fri, 29 Dec 2023 13:11:46 -0800) it happened John Larkin ><jl@997PotHill.com> wrote in <heduoid3ajbkf7blifo5pm91rj5g77cutv@4ax.com>: > >>On Fri, 29 Dec 2023 11:10:05 -0800 (PST), Fred Bloggs >><bloggs.fredbloggs.fred@gmail.com> wrote: >> >>>On Thursday, December 28, 2023 at 8:11:07?PM UTC-5, Klaus Kragelund wrote: >>>> Hi >>>> >>>> I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. >>>> >>>> I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. >>>> >>>> Figure 7-23 of this datasheet has a classic peak detector: >>>> >>>> >>>> https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.co >>>> m%252Flit%252Fgpn%252Flmc6482 >>>> >>>> But for a 2MHz signal, I would need a very fast opamp. >>>> >>>> I have done simple peak detection, with a diode, and a sample capacitor, followed with an opamp, but nothing is really good. >>>> >>>> In this case I have 95k/5k resistor to bring the voltage down to 24V, since then the simple diode drop won't matter much. But >>>> 30V opamps are slooooow, so no real good option. >>>> >>>> I tried using an emitter follower, but it has a funny peak where the base voltage is higher than the peak voltage, and also >>>> has potential to die due to Veb voltage. >>>> >>>> One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an >>>> FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly >>>> complicated. >>>> >>>> Any favorite peak detector? >>> >>>Does the peak measurement have to be single-shot or it can it take several cycles? If you want single-shot, it's going to be >>>pricey. Something like the OPA615 will do it. If you can work with an integrated measurement, it will be 1/3 the cost, something >>>like the sampling comparator works well many times. >> >>Buffer, peak rectify, calibrate against a good scope. >> > >Voltage divider followed by a simple analog video ADC gives >you 8 bit accuracy digital output for digital processing. >Plenty of analog video opamps available too to make a fast peak detector. >It is almost audio so low.... >Yes I know, some audiophiles can hear 2 MHz...
>Just a voltage divider, diode, capacitor to ground like an AM detector >into his slow ADC is the simplest, no opamp needed!
The numbers might get awkward. And the power dissipation.
>Need to know more about the application. >
Yes.
Reply by John Larkin December 30, 20232023-12-30
On Fri, 29 Dec 2023 21:45:41 -0800 (PST), whit3rd <whit3rd@gmail.com>
wrote:

>On Friday, December 29, 2023 at 5:05:07?PM UTC-8, Klaus Kragelund wrote: >> On Friday 29 December 2023 at 03:38:56 UTC+1, John Larkin wrote: >> > On Thu, 28 Dec 2023 17:11:03 -0800 (PST), Klaus Kragelund >> > <klaus.k...@gmail.com> wrote: >> > >> > >Hi >> > > >> > >I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. >> > > >> > >I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. > >> > >One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly complicated. >> > > >> > >Any favorite peak detector? >> > What's the pulse reprate? >> 100kHz >> > >> > Target accuracy? >> I would like 5%, but may be difficult > >Sounds dead easy to me; just use a diode-capacitor and when the peak is past, the capacitor IS your peak hold >value;
500 volt diode?
>as long as the event can generate an interrupt to make the ADC do its cycle, that gives you most of >ten microseconds to reset the capacitor before the next peak. >Heck, you could use a calibrated current sink on the hold capacitor and a comparator with 5MHz clock >will resolve about 3% (32 periods full scale) in six of your available 10 us; only takes a counter/timer instead of >the full ADC function. Faster clock would also work...
Reply by Jan Panteltje December 30, 20232023-12-30
On a sunny day (Fri, 29 Dec 2023 13:11:46 -0800) it happened John Larkin
<jl@997PotHill.com> wrote in <heduoid3ajbkf7blifo5pm91rj5g77cutv@4ax.com>:

>On Fri, 29 Dec 2023 11:10:05 -0800 (PST), Fred Bloggs ><bloggs.fredbloggs.fred@gmail.com> wrote: > >>On Thursday, December 28, 2023 at 8:11:07?PM UTC-5, Klaus Kragelund wrote: >>> Hi >>> >>> I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. >>> >>> I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. >>> >>> Figure 7-23 of this datasheet has a classic peak detector: >>> >>> >>> https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.co >>> m%252Flit%252Fgpn%252Flmc6482 >>> >>> But for a 2MHz signal, I would need a very fast opamp. >>> >>> I have done simple peak detection, with a diode, and a sample capacitor, followed with an opamp, but nothing is really good. >>> >>> In this case I have 95k/5k resistor to bring the voltage down to 24V, since then the simple diode drop won't matter much. But >>> 30V opamps are slooooow, so no real good option. >>> >>> I tried using an emitter follower, but it has a funny peak where the base voltage is higher than the peak voltage, and also >>> has potential to die due to Veb voltage. >>> >>> One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an >>> FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly >>> complicated. >>> >>> Any favorite peak detector? >> >>Does the peak measurement have to be single-shot or it can it take several cycles? If you want single-shot, it's going to be >>pricey. Something like the OPA615 will do it. If you can work with an integrated measurement, it will be 1/3 the cost, something >>like the sampling comparator works well many times. > >Buffer, peak rectify, calibrate against a good scope. >
Voltage divider followed by a simple analog video ADC gives you 8 bit accuracy digital output for digital processing. Plenty of analog video opamps available too to make a fast peak detector. It is almost audio so low.... Yes I know, some audiophiles can hear 2 MHz... Just a voltage divider, diode, capacitor to ground like an AM detector into his slow ADC is the simplest, no opamp needed! Need to know more about the application.
Reply by whit3rd December 30, 20232023-12-30
On Friday, December 29, 2023 at 5:05:07&#8239;PM UTC-8, Klaus Kragelund wrote:
> On Friday 29 December 2023 at 03:38:56 UTC+1, John Larkin wrote: > > On Thu, 28 Dec 2023 17:11:03 -0800 (PST), Klaus Kragelund > > <klaus.k...@gmail.com> wrote: > > > > >Hi > > > > > >I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. > > > > > >I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak.
> > >One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly complicated. > > > > > >Any favorite peak detector? > > What's the pulse reprate? > 100kHz > > > > Target accuracy? > I would like 5%, but may be difficult
Sounds dead easy to me; just use a diode-capacitor and when the peak is past, the capacitor IS your peak hold value; as long as the event can generate an interrupt to make the ADC do its cycle, that gives you most of ten microseconds to reset the capacitor before the next peak. Heck, you could use a calibrated current sink on the hold capacitor and a comparator with 5MHz clock will resolve about 3% (32 periods full scale) in six of your available 10 us; only takes a counter/timer instead of the full ADC function. Faster clock would also work...
Reply by Klaus Kragelund December 29, 20232023-12-29
On Friday 29 December 2023 at 17:28:24 UTC+1, John Larkin wrote:
> On Fri, 29 Dec 2023 08:11:43 +0000, piglet <erichp...@hotmail.com> > wrote: > >On 29/12/2023 01:25, Lasse Langwadt Christensen wrote: > >> fredag den 29. december 2023 kl. 02.11.07 UTC+1 skrev Klaus Kragelund: > >>> Hi > >>> > >>> I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. > >>> > >>> I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. > >>> > >>> Figure 7-23 of this datasheet has a classic peak detector: > >>> > >>> https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Flmc6482 > >>> > >>> But for a 2MHz signal, I would need a very fast opamp. > >>> > >>> I have done simple peak detection, with a diode, and a sample capacitor, followed with an opamp, but nothing is really good. > >>> In this case I have 95k/5k resistor to bring the voltage down to 24V, since then the simple diode drop won't matter much. But 30V opamps are slooooow, so no real good option. > >>> > >>> I tried using an emitter follower, but it has a funny peak where the base voltage is higher than the peak voltage, and also has potential to die due to Veb voltage. > >>> > >>> One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly complicated. > >>> > >>> Any favorite peak detector? > >> > >> https://www.analog.com/en/design-notes/peak-detectors-gain-in-speed-performance.html ? > > > >Instead of op-amp use a comparator, they are often much faster? > > > >piglet > > > One could divide down and use a comparator. Basicaslly slowly tease > the other input of the comparator until it's tripping about half the > time. > > If his ADC sample time is fast, he could random or equivalent-time > sample to find the peak. Just make the ADC clock async to the HV > pulse. >
The STM32 needs to aquire the signal right after S/H. But I could add my own sample/hold. Well, that's what I have been doing actually so far.
> Here's the monitor pickoff from my Pockels Cell driver. The pulse is > about 1400v 7ns, sort of half-sine. Could have used a BUF602. > > https://www.dropbox.com/scl/fi/8s5xexx4n9i1eyhgxtps8/T850_Pickoff.jpg?rlkey=bsq2uemyy9ijdruiq6lqnwdw0&raw=1 > > https://www.dropbox.com/scl/fi/rfoqchosbazddbql8smut/DSC02778.JPG?rlkey=wm0k2ys2917n8krscptwvss9p&raw=1
Reply by Klaus Kragelund December 29, 20232023-12-29
On Friday 29 December 2023 at 09:11:49 UTC+1, piglet wrote:
> On 29/12/2023 01:25, Lasse Langwadt Christensen wrote: > > fredag den 29. december 2023 kl. 02.11.07 UTC+1 skrev Klaus Kragelund: > >> Hi > >> > >> I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. > >> > >> I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. > >> > >> Figure 7-23 of this datasheet has a classic peak detector: > >> > >> https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Flmc6482 > >> > >> But for a 2MHz signal, I would need a very fast opamp. > >> > >> I have done simple peak detection, with a diode, and a sample capacitor, followed with an opamp, but nothing is really good. > >> In this case I have 95k/5k resistor to bring the voltage down to 24V, since then the simple diode drop won't matter much. But 30V opamps are slooooow, so no real good option. > >> > >> I tried using an emitter follower, but it has a funny peak where the base voltage is higher than the peak voltage, and also has potential to die due to Veb voltage. > >> > >> One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly complicated. > >> > >> Any favorite peak detector? > > > > https://www.analog.com/en/design-notes/peak-detectors-gain-in-speed-performance.html ? > Instead of op-amp use a comparator, they are often much faster? >
Ideally I would like to know the peak almost on a cycle to cycle basis, comparator waveform build-up will take many cycles to complete. Would be cool though, since I can then show the exact waveform
Reply by Klaus Kragelund December 29, 20232023-12-29
On Friday 29 December 2023 at 06:10:44 UTC+1, whit3rd wrote:
> On Thursday, December 28, 2023 at 5:11:07&#8239;PM UTC-8, Klaus Kragelund wrote: > > Hi > > > > I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. > > > > I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. > > > > Figure 7-23 of this datasheet has a classic peak detector: > > > > https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Flmc6482 > > > > But for a 2MHz signal, I would need a very fast opamp. > That's a variant on the Wilkinson D/A converter's peak detector; charge a capacitor in the op-amp-as-follower > way, through a diode, and when peak occurs, suddenly the op amp tries to reverse the current > through that diode (and dives fast, making a nice edge). > > It doesn't need to be an op amp follower, a simple fast transistor can fit that role too. > Especially since you have 500V to play with; it'd be normal to use a capacitive divider > and maybe just a MOSFET without much gate sensitivity. > Reset after the peak is gonna take some current sink to discharge the capacitor, and a bit of dead time > before you reenergize the input.
Capacitive divider could be very nice for fast response
Reply by Klaus Kragelund December 29, 20232023-12-29
On Friday 29 December 2023 at 03:38:56 UTC+1, John Larkin wrote:
> On Thu, 28 Dec 2023 17:11:03 -0800 (PST), Klaus Kragelund > <klaus.k...@gmail.com> wrote: > > >Hi > > > >I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. > > > >I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. > > > >Figure 7-23 of this datasheet has a classic peak detector: > > > >https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Flmc6482 > > > >But for a 2MHz signal, I would need a very fast opamp. > > > >I have done simple peak detection, with a diode, and a sample capacitor, followed with an opamp, but nothing is really good. > >In this case I have 95k/5k resistor to bring the voltage down to 24V, since then the simple diode drop won't matter much. But 30V opamps are slooooow, so no real good option. > > > >I tried using an emitter follower, but it has a funny peak where the base voltage is higher than the peak voltage, and also has potential to die due to Veb voltage. > > > >One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly complicated. > > > >Any favorite peak detector? > What's the pulse reprate?
100kHz
> > Target accuracy?
I would like 5%, but may be difficult
> > ADC full-scale voltage?
3.3V
Reply by John Larkin December 29, 20232023-12-29
On Fri, 29 Dec 2023 13:49:34 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>fredag den 29. december 2023 kl. 22.10.27 UTC+1 skrev John Larkin: >> On Fri, 29 Dec 2023 19:49:01 +0000, piglet <erichp...@hotmail.com> >> wrote: >> >> >On 29/12/2023 16:27, John Larkin wrote: >> >> On Fri, 29 Dec 2023 08:11:43 +0000, piglet <erichp...@hotmail.com> >> >> wrote: >> >> >> >>> On 29/12/2023 01:25, Lasse Langwadt Christensen wrote: >> >>>> fredag den 29. december 2023 kl. 02.11.07 UTC+1 skrev Klaus Kragelund: >> >>>>> Hi >> >>>>> >> >>>>> I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. >> >>>>> >> >>>>> I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. >> >>>>> >> >>>>> Figure 7-23 of this datasheet has a classic peak detector: >> >>>>> >> >>>>> https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Flmc6482 >> >>>>> >> >>>>> But for a 2MHz signal, I would need a very fast opamp. >> >>>>> >> >>>>> I have done simple peak detection, with a diode, and a sample capacitor, followed with an opamp, but nothing is really good. >> >>>>> In this case I have 95k/5k resistor to bring the voltage down to 24V, since then the simple diode drop won't matter much. But 30V opamps are slooooow, so no real good option. >> >>>>> >> >>>>> I tried using an emitter follower, but it has a funny peak where the base voltage is higher than the peak voltage, and also has potential to die due to Veb voltage. >> >>>>> >> >>>>> One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly complicated. >> >>>>> >> >>>>> Any favorite peak detector? >> >>>> >> >>>> https://www.analog.com/en/design-notes/peak-detectors-gain-in-speed-performance.html ? >> >>> >> >>> Instead of op-amp use a comparator, they are often much faster? >> >>> >> >>> piglet >> >>> >> >> >> >> One could divide down and use a comparator. Basicaslly slowly tease >> >> the other input of the comparator until it's tripping about half the >> >> time. >> >> >> >> If his ADC sample time is fast, he could random or equivalent-time >> >> sample to find the peak. Just make the ADC clock async to the HV >> >> pulse. >> >> >> >> Here's the monitor pickoff from my Pockels Cell driver. The pulse is >> >> about 1400v 7ns, sort of half-sine. Could have used a BUF602. >> >> >> >> https://www.dropbox.com/scl/fi/8s5xexx4n9i1eyhgxtps8/T850_Pickoff.jpg?rlkey=bsq2uemyy9ijdruiq6lqnwdw0&raw=1 >> >> >> >> https://www.dropbox.com/scl/fi/rfoqchosbazddbql8smut/DSC02778.JPG?rlkey=wm0k2ys2917n8krscptwvss9p&raw=1 >> >> >> >> >> >> >> >> >> >> >> > >> >I meant just use comp in place of op-amp in the classic peak hold >> >circuit. For negative going peaks an open drain comparator makes for >> >very low parts count :) >> > >> >Here is what I meant, it gets progressively more accurate at slower dv/dt: >> > >> >Version 4 >> >SHEET 1 880 680 >> >WIRE 16 -32 -416 -32 >> >WIRE -512 32 -512 0 >> >WIRE 16 32 16 -32 >> >WIRE 480 48 64 48 >> >WIRE 128 128 128 96 >> >WIRE 64 144 64 48 >> >WIRE 96 144 64 144 >> >WIRE -512 160 -512 112 >> >WIRE 256 160 160 160 >> >WIRE 384 160 320 160 >> >WIRE 480 160 480 48 >> >WIRE 480 160 384 160 >> >WIRE -416 176 -416 -32 >> >WIRE 16 176 16 112 >> >WIRE 96 176 16 176 >> >WIRE 480 192 480 160 >> >WIRE 16 208 16 176 >> >WIRE 384 208 384 160 >> >WIRE -416 320 -416 256 >> >WIRE 16 320 16 288 >> >WIRE 128 320 128 192 >> >WIRE 384 320 384 272 >> >WIRE 480 320 480 272 >> >FLAG -416 320 0 >> >FLAG -512 160 0 >> >FLAG 128 320 0 >> >FLAG 16 320 0 >> >FLAG 384 320 0 >> >FLAG 480 320 0 >> >FLAG 128 96 P5 >> >FLAG -512 0 P5 >> >FLAG 480 48 OUT >> >SYMBOL Comparators\\LT1720 128 96 R0 >> >SYMATTR InstName U1 >> >SYMBOL cap 368 208 R0 >> >SYMATTR InstName C1 >> >SYMATTR Value 470p >> >SYMBOL voltage -512 16 R0 >> >WINDOW 123 0 0 Left 0 >> >WINDOW 39 0 0 Left 0 >> >SYMATTR InstName V1 >> >SYMATTR Value 5 >> >SYMBOL voltage -416 160 R0 >> >WINDOW 123 0 0 Left 0 >> >WINDOW 39 0 0 Left 0 >> >SYMATTR InstName V2 >> >SYMATTR Value SINE(0 500 2meg 0 0 0 0.5) >> >SYMBOL res 32 128 R180 >> >WINDOW 0 36 76 Left 2 >> >WINDOW 3 36 40 Left 2 >> >SYMATTR InstName R1 >> >SYMATTR Value 199k >> >SYMBOL res 32 304 R180 >> >WINDOW 0 36 76 Left 2 >> >WINDOW 3 36 40 Left 2 >> >SYMATTR InstName R2 >> >SYMATTR Value 1k >> >SYMBOL res 464 176 R0 >> >SYMATTR InstName R3 >> >SYMATTR Value 100k >> >SYMBOL diode 256 176 R270 >> >WINDOW 0 32 32 VTop 2 >> >WINDOW 3 0 32 VBottom 2 >> >SYMATTR InstName D1 >> >SYMATTR Value 1N4148 >> >TEXT -562 344 Left 2 !.tran 2u >> >TEXT 376 -144 Left 2 ;EPW SED >> >TEXT 368 -104 Left 2 ;DEC 2023 >> >TEXT -152 -144 Left 2 ;SHOWING COMPARATOR AS PEAK DET >> > >> > >> >piglet >> > >> Nice sim. Kinda ringy. A bit of resistance in series with C1 might >> help.
And a schottky diode. That PN has too much personality.
>> >> Open-loop diode into the cap is easier to stabilize. >> >> Or maybe a sample-and-hold approach. >> >> A screaming fast ADC and some FPGA math would be accurate. > >if it is only 2MHz and sine, it wouldn't need to scream that much
If the ADC clock walks across the pulse train, you'll hit a peak sooner or later. Equivalent-time sampling would be fun. Random would work too. A sine is flat on top, which helps. However you do it, you'll need a good voltage divider.
Reply by Lasse Langwadt Christensen December 29, 20232023-12-29
fredag den 29. december 2023 kl. 22.10.27 UTC+1 skrev John Larkin:
> On Fri, 29 Dec 2023 19:49:01 +0000, piglet <erichp...@hotmail.com> > wrote: > > >On 29/12/2023 16:27, John Larkin wrote: > >> On Fri, 29 Dec 2023 08:11:43 +0000, piglet <erichp...@hotmail.com> > >> wrote: > >> > >>> On 29/12/2023 01:25, Lasse Langwadt Christensen wrote: > >>>> fredag den 29. december 2023 kl. 02.11.07 UTC+1 skrev Klaus Kragelund: > >>>>> Hi > >>>>> > >>>>> I have a voltage, only present for halfsine peak of 2MHz (500ns wide), which is 500V peak. > >>>>> > >>>>> I need to know the peak voltage, in an embedded system where the ADC samples at max 5MSa. So way too slow to find the peak. > >>>>> > >>>>> Figure 7-23 of this datasheet has a classic peak detector: > >>>>> > >>>>> https://www.ti.com/lit/ds/symlink/lmc6482.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1703760014317&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Flmc6482 > >>>>> > >>>>> But for a 2MHz signal, I would need a very fast opamp. > >>>>> > >>>>> I have done simple peak detection, with a diode, and a sample capacitor, followed with an opamp, but nothing is really good. > >>>>> In this case I have 95k/5k resistor to bring the voltage down to 24V, since then the simple diode drop won't matter much. But 30V opamps are slooooow, so no real good option. > >>>>> > >>>>> I tried using an emitter follower, but it has a funny peak where the base voltage is higher than the peak voltage, and also has potential to die due to Veb voltage. > >>>>> > >>>>> One idea I had, use the 24V divider with the diode, then right after the pulse, activate another resistive divider with an FET to bring it to 5V where fast opamps are cheaper. The FET will only turn on as long as to sample the voltage, but seems overly complicated. > >>>>> > >>>>> Any favorite peak detector? > >>>> > >>>> https://www.analog.com/en/design-notes/peak-detectors-gain-in-speed-performance.html ? > >>> > >>> Instead of op-amp use a comparator, they are often much faster? > >>> > >>> piglet > >>> > >> > >> One could divide down and use a comparator. Basicaslly slowly tease > >> the other input of the comparator until it's tripping about half the > >> time. > >> > >> If his ADC sample time is fast, he could random or equivalent-time > >> sample to find the peak. Just make the ADC clock async to the HV > >> pulse. > >> > >> Here's the monitor pickoff from my Pockels Cell driver. The pulse is > >> about 1400v 7ns, sort of half-sine. Could have used a BUF602. > >> > >> https://www.dropbox.com/scl/fi/8s5xexx4n9i1eyhgxtps8/T850_Pickoff.jpg?rlkey=bsq2uemyy9ijdruiq6lqnwdw0&raw=1 > >> > >> https://www.dropbox.com/scl/fi/rfoqchosbazddbql8smut/DSC02778.JPG?rlkey=wm0k2ys2917n8krscptwvss9p&raw=1 > >> > >> > >> > >> > >> > > > >I meant just use comp in place of op-amp in the classic peak hold > >circuit. For negative going peaks an open drain comparator makes for > >very low parts count :) > > > >Here is what I meant, it gets progressively more accurate at slower dv/dt: > > > >Version 4 > >SHEET 1 880 680 > >WIRE 16 -32 -416 -32 > >WIRE -512 32 -512 0 > >WIRE 16 32 16 -32 > >WIRE 480 48 64 48 > >WIRE 128 128 128 96 > >WIRE 64 144 64 48 > >WIRE 96 144 64 144 > >WIRE -512 160 -512 112 > >WIRE 256 160 160 160 > >WIRE 384 160 320 160 > >WIRE 480 160 480 48 > >WIRE 480 160 384 160 > >WIRE -416 176 -416 -32 > >WIRE 16 176 16 112 > >WIRE 96 176 16 176 > >WIRE 480 192 480 160 > >WIRE 16 208 16 176 > >WIRE 384 208 384 160 > >WIRE -416 320 -416 256 > >WIRE 16 320 16 288 > >WIRE 128 320 128 192 > >WIRE 384 320 384 272 > >WIRE 480 320 480 272 > >FLAG -416 320 0 > >FLAG -512 160 0 > >FLAG 128 320 0 > >FLAG 16 320 0 > >FLAG 384 320 0 > >FLAG 480 320 0 > >FLAG 128 96 P5 > >FLAG -512 0 P5 > >FLAG 480 48 OUT > >SYMBOL Comparators\\LT1720 128 96 R0 > >SYMATTR InstName U1 > >SYMBOL cap 368 208 R0 > >SYMATTR InstName C1 > >SYMATTR Value 470p > >SYMBOL voltage -512 16 R0 > >WINDOW 123 0 0 Left 0 > >WINDOW 39 0 0 Left 0 > >SYMATTR InstName V1 > >SYMATTR Value 5 > >SYMBOL voltage -416 160 R0 > >WINDOW 123 0 0 Left 0 > >WINDOW 39 0 0 Left 0 > >SYMATTR InstName V2 > >SYMATTR Value SINE(0 500 2meg 0 0 0 0.5) > >SYMBOL res 32 128 R180 > >WINDOW 0 36 76 Left 2 > >WINDOW 3 36 40 Left 2 > >SYMATTR InstName R1 > >SYMATTR Value 199k > >SYMBOL res 32 304 R180 > >WINDOW 0 36 76 Left 2 > >WINDOW 3 36 40 Left 2 > >SYMATTR InstName R2 > >SYMATTR Value 1k > >SYMBOL res 464 176 R0 > >SYMATTR InstName R3 > >SYMATTR Value 100k > >SYMBOL diode 256 176 R270 > >WINDOW 0 32 32 VTop 2 > >WINDOW 3 0 32 VBottom 2 > >SYMATTR InstName D1 > >SYMATTR Value 1N4148 > >TEXT -562 344 Left 2 !.tran 2u > >TEXT 376 -144 Left 2 ;EPW SED > >TEXT 368 -104 Left 2 ;DEC 2023 > >TEXT -152 -144 Left 2 ;SHOWING COMPARATOR AS PEAK DET > > > > > >piglet > > > Nice sim. Kinda ringy. A bit of resistance in series with C1 might > help. > > Open-loop diode into the cap is easier to stabilize. > > Or maybe a sample-and-hold approach. > > A screaming fast ADC and some FPGA math would be accurate.
if it is only 2MHz and sine, it wouldn't need to scream that much