Author Topic: Help with opamp for shaping circuit  (Read 7510 times)

0 Members and 1 Guest are viewing this topic.

Offline snxTopic starter

  • Contributor
  • Posts: 47
  • Country: ch
Help with opamp for shaping circuit
« on: August 09, 2020, 06:37:26 pm »
I want to sample and process a pulse from a Silicone-Photomultiplier.

The Pulse has amplitudes between 10mV and 2.5V (depending on light strength and bias voltage. Therefore, an amplification with switchable gain would be very helpful. For example if a high bias voltage is used, the gain can be zero, and when lower voltage for bias is used, the gain can be 2) The pulse length is from around 10us to 80us in a sharply rising and then slowly decaying curve, making it very hard to sample since the peak is of interest, and would have to be sampled very quickly after the trigger condition.

I've attached 3 Scope images of the pulses, one with persistence at the highest  bias voltage (Gain 0). And two were you can see a very large pulse (2.4V peak) and a regular pulse (400mV Pulse).

My goal is to sample this with a 16-bit 3.6MSPS or 2MSPS ADC (2.5V Reference IC) that is built in in STM32H750VB Microcontroller. I've attached the ADC specifications extracted from the datasheet for you. To have a good number of samples, i would like to shape this pulse to a more Gaussian shape with uniform rise and fall times (like sine-wave). Also i would be good to have a pulse length of around 15-20us so a 2MSPS ADC would get 30-40 Samples.

The MCU has two build in OP Amp, maybe these can be put to use, the specifications are attached. The Voltages currently planned to be available on the design are 5V from USB and 3.3V from SMPS, surely, if its vital to have other voltages, i can add them.

So i'm not that familiar with opamps, but 've seen designs with variable gains by switching resistors with analog switches. But i'm more worried what i would need to create the desired shape of the signal.

Can someone give me advice on a circuit for shaping the signal?
Do i need a OP-Amp for the ADC to buffer? (seen this on some adc datasheets).
Can the OP-Amp from the MCU be used, or are they too bad?
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #1 on: August 09, 2020, 07:14:32 pm »
do not use an analog switch with many different resistors.

It seems like the peak is actually negative, then you most likely need an inverting amplifier setup. I strongly suggest you ditch the built in ADC / OP AMP since they're not actually optimized for anything, they're more for general purpose applications where accuracy is not that important.It all depends on what you need to do.

Use a dual pot, you can easily get 8 bit 10k digital pots for around 1$. it allows you to fine tune your gain. The absolute value of digital pots is really bad, but the ratio-metric arrangement is very accurate. Especially since they're on the same die, effects like temperature drift and whatnot won't change the ratio accuracy.

Try to set them to max values for any given ratio as they have a current limit, just something to be aware of.it's also easy to do the math as you can easily just use values from 0 to 255 (or 256, depending on the exact part you use, some use a 16 bit number and go from 0 to 256 instead of 0 to 255 or 1 to 256, just check the datasheet).
« Last Edit: August 09, 2020, 07:21:45 pm by OM222O »
 

Offline snxTopic starter

  • Contributor
  • Posts: 47
  • Country: ch
Re: Help with opamp for shaping circuit
« Reply #2 on: August 09, 2020, 07:51:00 pm »
Good Idea with the digital potentiometer, i will try to implement this!

Any ideas on the OpAmps?

I need to extract the peak value of the peak. If the internal ADC of the MCU is capable, i would like to use it, since it saves cost an board space, but of course if its not accurate enough, i will  have to ditch it. The Problem is, that usually, when using high-bit, fast speed adc, you need to take care of signal routing and have high clock lines. For example a 3.6MSPS 16bit ADC needs at last 57.6MHz of Clock and probably SPI. Other high speed ADC's then to use LVDS, which is not supported by this mcu.

I've looked for standalone ADC with following parameters

16-bit
>3MSPS
1 CH
Serial SPI or Paralell Interface
For example, Analog Devices only hase 5 matches, all super expensive

Would LTC2311-16 (13.80$) https://www.analog.com/en/products/ltc2311-16.html be a much better choice than built in ADC?


Sure, the op-amp can be ditched, i just mentioned that its there  :)
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #3 on: August 09, 2020, 08:17:03 pm »
the built in ADC seems to only go upto 3.6V max (3.3V normal operation) but you mentioned running on 5V? I'm not sure how that'd work.
Also there is no mention of INL + DNL or ENOB BUT there is a table at the end regarding RAIN( \$\Omega\$) which I'm not sure what input resistance that is exactly. Maybe you can make sense of that and how accurate it is?

I personally use sigma delta ADCs with only a few KPSP but 24 bits high accuracy, since I don't have fast signal applications, you should look into SAR ADCs for fast sampling if you want to buy an external one. Unfortunately I can't really help you with that. As for the Op Amp: how much gain bandwidth product do you need? any ideas on the min/max required gains? 3 good suggestions would be MAX4238 (unity gain stable), MAX4239(at least a gain of 10), INA189. I have used these for high accuracy measurements before and they work like a charm. Actually Dave recommended all of them in a recent video which was surprising, each of them has some benefits over the others so take your pick between them.

Edit: my bad, you mentioned 2.5V not 5V. please ignore that comment.
« Last Edit: August 09, 2020, 08:31:54 pm by OM222O »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 15159
  • Country: de
Re: Help with opamp for shaping circuit
« Reply #4 on: August 09, 2020, 08:32:58 pm »
16 bit resolution sounds plenty. With so much resolution there is no need to switch the gain, at least not in fine steps. Digital pots tend to be relatively slow with quite some unwanted internal capacitance. In addition the fet switches can act nonlinear. I would consider adjusting the high voltage to trim the gain if needed.

AFAIK the energy resolution is often quite limited, so more like 10 or 12 Bit. This is especially true for the more low cost type detector.

For the detection of the peak there are 2 options: either the maximum value, or the area under the curve.

For the OP I would expect something like a relatively fast CMOS OP, maybe LTC6240 or similar of price is not that important. The baseline (DC level) can probably be subtracted in software.

An important factor would be the expected count rate. The more the less pulse stretching is possibly without loosing to much to pulse collision.

In principle the pulse stretching would be similar to an anti aliasing filter - the rest would in theory be done in math.
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #5 on: August 09, 2020, 10:27:01 pm »
there are problems with the switching speed, but the bigger thing is the I2C communication time. I found that even with the max frequency, the 16 bit number takes longer to transmit than the actual switching so ... SOL there. Parasitics would be quite large for the switch ICs too, but you're then also adding the issue of unmatched resistor ratios, temp co, etc. Based on OP's description it seems like they carry out tests with different bias voltages, so they can adjust the gain for that specific voltage, carry out the test and change that if needed, rather than sampling at 3.6MSPS AND changing the gain dynamically at the same time, that'd be quite a feat to achieve using range switching and would require a different solution all together (usually having different fixed gain amplifiers and sampling all, then stitching together via software. Really expensive and time consuming to get right).

If OP provides more details, then perhaps we can make better recommendations.
Also MCUs usually advertise their ADCs as X number of bits but in reality they perform way worse.For example the popular ATMEGA-328P advertises 10 bit ADC but INL and DNL are about 2LSB, so really it's only an 8 bit ADC with a bunch of added noise. That's why I mentioned the noise figures don't seem to exist on the ST datasheet, at least not in a way that makes much sense to me.
 

Offline Unixon

  • Frequent Contributor
  • **
  • Posts: 400
Re: Help with opamp for shaping circuit
« Reply #6 on: August 09, 2020, 10:48:10 pm »
So i'm not that familiar with opamps, but 've seen designs with variable gains by switching resistors with analog switches. But i'm more worried what i would need to create the desired shape of the signal.
There are programmable gain amplifiers, but you have to condition signal into their working range anyway.

Do you have a random amplitude pulse each time?
 

Offline snxTopic starter

  • Contributor
  • Posts: 47
  • Country: ch
Re: Help with opamp for shaping circuit
« Reply #7 on: August 10, 2020, 06:09:18 am »
Also there is no mention of INL + DNL or ENOB BUT there is a table at the end regarding RAIN( \$\Omega\$) which I'm not sure what input resistance that is exactly. Maybe you can make sense of that and how accurate it is?

The Parameters are in the sheet, but it looks like ST made own shorts

EL = INL = 11LSB
ENOB = 12.2 bits
Total Unadjusted error = +10 -20 LSB




16 bit resolution sounds plenty. With so much resolution there is no need to switch the gain, at least not in fine steps. Digital pots tend to be relatively slow with quite some unwanted internal capacitance. In addition the fet switches can act nonlinear. I would consider adjusting the high voltage to trim the gain if needed.
Yes this is kinda true, but 16-bit ADC usually do not really have 16-bit Resolution because of error

AFAIK the energy resolution is often quite limited, so more like 10 or 12 Bit. This is especially true for the more low cost type detector.
This is true, usually there are 4k or 8k channels, so you need at aleast 13 valid bits to fill 8k Channels

For the OP I would expect something like a relatively fast CMOS OP, maybe LTC6240 or similar of price is not that important. The baseline (DC level) can probably be subtracted in software.
I have this one in stock. Maybe i will try it

An important factor would be the expected count rate. The more the less pulse stretching is possibly without loosing to much to pulse collision.
Usually big detectors put out 50 counts per second in a normal room and in my experience i never got more than 2000 cps. Since the Si-Detector is much smaller, i except around 1000cps as a maximum count rate.

If OP provides more details, then perhaps we can make better recommendations.
Also MCUs usually advertise their ADCs as X number of bits but in reality they perform way worse.For example the popular ATMEGA-328P advertises 10 bit ADC but INL and DNL are about 2LSB, so really it's only an 8 bit ADC with a bunch of added noise. That's why I mentioned the noise figures don't seem to exist on the ST datasheet, at least not in a way that makes much sense to me.

Are you sure 2LSB is referenced to resolution bits? As far as i know, LSB are stated as the difference in value, not bit position 2LSB would mean that a  binary value at 10 bit would have differences in the last 2 bits, not completely remove them. For example:

1111 1111 00 could be either 1111 1100 11 or 1111 1110 00, not remove 2 bits and reduce the resolution to 0 - 111 111 ?

More details:

The Goal is to first shape the Output to a better geometrical property. With the current shape, it will be very hard to have correct sampling, because the peak of the signal is almost immediately after the trigger threshold. If the curve rises smaller, there is more time for the MCU and ADC to get the values. Also the current signal is to short to be sampled with 2MSPS or 3.6MSPS and get the peak.

The gain of the amplifier does not have to be dynamically switchable, more like 2 or three gain settings. For example, when operating on low pulse height (low bias), lets say 0-500mV, it would be a shape to waste the remaining 2000mV (2.5V ref) of resolution because of fixed gain. If the signal is amplified by 4 in this case, you have 0-2000mV of Resolution.  In high pulse height mode (high bias), there would be a gain of 0 needed, because the pulses already reach 2.4V of height. Also, lowering the bias voltage to control the gain, is no option, since it must support different bias voltage, because bias voltage changes behavior of the detector.

Lets say i would need at maximum 3 Settings of Gain (0, 2, 4) and could live with 2 settings (0,2). They do not have to be fast or dynamically switchable. The idea with the analog switch I've seen in a commercial detector fronted by Amptek, but made for different detector. See image for the Circuit. But i do not need 4 gains. I will look into the digital pot solution that was proposed

The Signal is random each time, by the pulse-height of the signals a spectrum can be drawn where its possible to see peaks in certain values, looking roughly similar to those EMC test-reports (just as a reference how it will look). The gain will be set and fixed for the measurement and will be calculated from the bias. For example bias 25-27V will be Gain 2, and 28-32V will be Gain 0.

As stated, usually there are 4096 or 8192 Channels available, but they have to be valid. The idea is to round pulses into a certain value. For example, an equivalent of a value of 1023.4 would be binned as 1023, and 1023.6 would be 1024.  BUT! The initial accuracy must be at least as good as the channels. For example, if you have 4096 channels, the ADC resolution must be at least 12bits.

Lets say we take a "perfect" 16-bit ADC with 0 Error as example. It would output values between 0-65535. With 4k Channels, on a 16bit ADC there would be a channel each 16 Values

For example:
Channel   -   ADC Val
0                  0
1                  16
2                  32
...
1000            16000
1001            16016
1002            16032
1003            16048

1000 is binary   0000 1111 1010 0000
1001 is binary   0000 0011 1110 1001
1002 is binary   0011 1110 1010 0000
1003 is binary   0011 1110 1011 0000

So to in case of  this case, we can say the last 3 binary values can be ignored, or just be binned to the next channel value.
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #8 on: August 10, 2020, 06:57:34 am »
Regarding the number of bits, again my bad, was rushing to write an answer. It should be 4LSB to equal 2 actual bits, but if they provide an ENOB figure well then that's your actual resolution, which seems to be 12 bits in this case.

If you don't need fast switching then the digital pot idea works like a charm, giving you a very wide (almost infinite) control for the gain, since you can change both resistors in the amplifier path.

If you're going to such high sample rates just to detect the peak, why not use a peak detect + smaple and hold circuit for measuring the peak seperately?
« Last Edit: August 10, 2020, 06:59:27 am by OM222O »
 

Offline snxTopic starter

  • Contributor
  • Posts: 47
  • Country: ch
Re: Help with opamp for shaping circuit
« Reply #9 on: August 10, 2020, 07:17:32 am »
Regarding the number of bits, again my bad, was rushing to write an answer. It should be 4LSB to equal 2 actual bits, but if they provide an ENOB figure well then that's your actual resolution, which seems to be 12 bits in this case.

If you don't need fast switching then the digital pot idea works like a charm, giving you a very wide (almost infinite) control for the gain, since you can change both resistors in the amplifier path.

If you're going to such high sample rates just to detect the peak, why not use a peak detect + smaple and hold circuit for measuring the peak seperately?

Yes, this would be an idea, but given the short peak time, you would need a very fast peak-detector. I currently know no design that is that fast, but maybe some people around here know one.
 

Offline ChristofferB

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: dk
  • Chemistry phd student!
    • My channel:
Re: Help with opamp for shaping circuit
« Reply #10 on: August 10, 2020, 07:27:52 am »
For a multichannel analyzer 16 bit is way plenty resolution! This would theoretically let you have a conversion gain of 65K!!

Look up the manual for the Ortec 452 shaping amplifier (which seems very close to what you need), it's very 1970s but it has some excellent theory and a nice block diagram!
--Christoffer //IG:Chromatogiraffery
Check out my scientific instruments diy (GC, HPLC, NMR, etc) Channel: https://www.youtube.com/channel/UCZ8l6SdZuRuoSdze1dIpzAQ
 

Offline MattHollands

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: Help with opamp for shaping circuit
« Reply #11 on: August 10, 2020, 07:42:44 am »
Regarding the number of bits, again my bad, was rushing to write an answer. It should be 4LSB to equal 2 actual bits, but if they provide an ENOB figure well then that's your actual resolution, which seems to be 12 bits in this case.

If you don't need fast switching then the digital pot idea works like a charm, giving you a very wide (almost infinite) control for the gain, since you can change both resistors in the amplifier path.

If you're going to such high sample rates just to detect the peak, why not use a peak detect + smaple and hold circuit for measuring the peak seperately?

Yes, this would be an idea, but given the short peak time, you would need a very fast peak-detector. I currently know no design that is that fast, but maybe some people around here know one.

ADI have a nice article on peak detectors. https://www.analog.com/en/technical-articles/ltc6244-high-speed-peak-detector.html#

Looks like the Current Boosted Improved Peak Detector is approaching the performance you require. Might be worth a SPICE sim.
Read about my stuff at: projects.matthollands.com
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #12 on: August 10, 2020, 07:48:18 am »
https://www.analog.com/en/technical-articles/ltc6244-high-speed-peak-detector.html

I think you'd want to use the current boosted version that's promised to work at 200KHz.

You just need a fet to discharge the cap as it seems to be missing from the diagram.

Eidt: well someone else mentioned it too, posted at the same time sorry  :palm:
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 15159
  • Country: de
Re: Help with opamp for shaping circuit
« Reply #13 on: August 10, 2020, 08:33:36 am »
Analog peak detection is also not that simple and accurate. Using a fast ADC is a real alternative today and can be lower noise. Anyway an analog peak detector would also need peak shaping, it would be even more critical here.

For the ADC one does not need to have the unadjusted error to be so low to get perfect 12 Bits. Some of the errors like offset and a fixed gain error can be compensated for. Chances are the 4 K or 8 K channels are also more like enough so that quantization error does not matter - so this is not the factor that determines the accuracy needs for the ADC. The number of channels more like compared to the nominal resolution needed. So 12/13 Bit minimum.


The µC internal OP specs do not look that bad as I have expected. It is however relatively high noise (especially 1/f noise) and has a limited drive capability. For the speed it is quite low in power.
I would still prefer an external one as it would be difficult to upgrade - with more common OP one would have the option to keep the board and just upgrade / exchange a chip. They often come in standard cases.

If size is an issue the LMV771 would be a good candidate for the OP.
It helps to have the same supply as the ADC, as this also gives amplitude limiting and thus saves on additional clamping. With Rail to rail OP one may have to take care of the input cross over - so ideally not use the full RR input, but stay on the better side that often is some 0-2.5 V with a 3.6 V supply.

Anyway the first step would be getting the general circuit and do some simulations there and than choose the final OPs for the circuit. Here there are many OPs to chose from and I don't think one would need extreme performance or exactly one special OP to start with.

The problem with a digital pot is that the parasitic capacitance depends on the setting. So the wiper changes more than just the divider.
If simple is needed, there are ready made variable gain amplifiers like MCP6S91, that may be good enough.
 

Offline snxTopic starter

  • Contributor
  • Posts: 47
  • Country: ch
Re: Help with opamp for shaping circuit
« Reply #14 on: August 10, 2020, 11:14:39 am »
Analog peak detection is also not that simple and accurate. Using a fast ADC is a real alternative today and can be lower noise. Anyway an analog peak detector would also need peak shaping, it would be even more critical here.

For the ADC one does not need to have the unadjusted error to be so low to get perfect 12 Bits. Some of the errors like offset and a fixed gain error can be compensated for. Chances are the 4 K or 8 K channels are also more like enough so that quantization error does not matter - so this is not the factor that determines the accuracy needs for the ADC. The number of channels more like compared to the nominal resolution needed. So 12/13 Bit minimum.

So you think the ADC of the MCU can be used for this? This would save alot cost, since 16bit, >2MSPS ADC's seem to be very expensive.

The µC internal OP specs do not look that bad as I have expected. It is however relatively high noise (especially 1/f noise) and has a limited drive capability. For the speed it is quite low in power.
I would still prefer an external one as it would be difficult to upgrade - with more common OP one would have the option to keep the board and just upgrade / exchange a chip. They often come in standard cases.

If size is an issue the LMV771 would be a good candidate for the OP.
It helps to have the same supply as the ADC, as this also gives amplitude limiting and thus saves on additional clamping. With Rail to rail OP one may have to take care of the input cross over - so ideally not use the full RR input, but stay on the better side that often is some 0-2.5 V with a 3.6 V supply.

The 3.3V supply from the MCU is generated by generic SMPS wich supplies VDD and VDDA of the MCU. The 2.5V is the reference voltage for the ADC/DAC Part. Usually the references cannot supply enough Power to drive OPAMPS and stuff. So you suggest to use higher reference? For example 3V? If the Analog Input goes beyong 2.5V, the ADC will not damage, it will just display max value.

Do you know if LTC6268-10, or LTC6088 or ADA4622-2 would work too? These seem to have similar parameters an i have them in stock to do tests


If simple is needed, there are ready made variable gain amplifiers like MCP6S91, that may be good enough.


What about LTC6910? It has simple binary configuration
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #15 on: August 10, 2020, 11:43:01 am »
I would suggest you find a general equation for the decay of your signal, if you decide to go for the pure sampling method, that way you can work your way back and reconstruct the actual peak since it's likely you won't catch it exactly.

regarding digital pots and programmable gain amplifiers, the PGA inside the op amp is basically the same thing. It's a very wildly used circuit and I'm not sure what your problems are with it? the delay in changing the setting? if so that doesn't cause any issues since OP mentioned he doesn't need dynamic fast switching, just adjustment before each test.
 

Offline oschonrock

  • Regular Contributor
  • *
  • Posts: 67
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #16 on: August 10, 2020, 12:47:51 pm »
So you think the ADC of the MCU can be used for this?

Some clarifications:

1. I think "reshaping the signal" is a distraction. Any circuit which can "reshape it", can measure the peak (in analog domain or digital). Unless you call "peak detect" a reshape.

2. From what I understand, you just need the peak value right? You don't care about the exact shape?

3. What sort of accuracy are you after for the peak value?  You talk about 16bit. That's pretty accurate? Is that really necessary or will 12bit do? This is important because, together with the speed of the pulse, this will totally drive the solution. To get 16 bit accuracy, you don't just need a 16 bit ADC, your circuit and the power supply to it needs to be super noise free and you need a precision voltage reference (independent, the one in the CPU will almost certainly not do for proper 16bit accuracy). Your PCB will need to have fully seperate analog and digital sections with independent power supplies, independent ground/power planes etc etc etc.  So, will 12 bit do?  Note, that the scope you are using is just 8-bit....

As already discussed, either a fast ADC or an analog signal conditioner, followed by a simple ADC are the best bet. My instinct leans toward the analog signal conditioner first, then you can use CPU ADC. That LTC6244 App note (current boost option) is almost exactly what you need and for $10 BOM (2 "special" op-amps and a bunch of passives) and near zero design time, this seems like an attractive option. If it can do the job...

Also the discussion about amplifier gains is a bit premature for me. These are not super small signals. The small pulse has ~400mV peak. How accurately do you want to measure that small peak? To the nearest 5mV, which would be ~1% (8-bit is sufficient, if pre-amplified or 12bit to give 16x dynamic range which seems more than enough for your pulse size range)? Or is 16 bit accuracy (0.0015%!!) necessary? If so then you are dealing with measuring and/or preamplifying a delta V of 400/65000 ~ 6uV. I am not even sure that's possible at this bandwidth...

But we need more data....

The pulse is "fast ish" but it's not clear to me from the traces how fast it really is. Can you provide some traces with the horizontal zoomed out to 2us? (ie 10x what it is now) And/or turn on a rise time measurement on the scope. We need to see that edge. The width is not important, it is the rise time that matters,
Thanks
« Last Edit: August 10, 2020, 01:15:11 pm by oschonrock »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: Help with opamp for shaping circuit
« Reply #17 on: August 10, 2020, 02:17:27 pm »
Dave did a video that winds up with an op amp precision peak detector (the 3rd circuit iteration), maybe it is useful...


 
The following users thanked this post: oschonrock

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 15159
  • Country: de
Re: Help with opamp for shaping circuit
« Reply #18 on: August 10, 2020, 03:15:08 pm »
The analog peak detector gets tricky if it has to be fast and accurate at the same time. So one would need peak stretching anyway. Even than 10 bit accuracy gets tricky and slow.

The peak shaping is nothing magic, it is essentially a low pass filter with a suitable response in the time domain, so that the short pulse will get wider, as the higher frequency part is lost. Ideally this would be with little undershoot and not too much slow decay at the very end. However nearly every low pass filter will do pulse stretching and the differences are not that large. Even a not so good solution would still be linear. Optimization is a little about the last little bit of noise / sensitivity.

The LTC6910 and LTC6088 look good. The LTC6268 is more like overkill and the ADA4622 may not be happy with well below 5 V supply.
For looking at the peaks I would prefer looking at the area instead of the actual maximum value. With scintillators both should be proportional to the energy as the peak shape should be fixed. Chances are the area can be more stable (e.g. with temperature). In addition the area measurement can be lower noise as it uses more than just 1 ADC conversion. With enough computing power the ideal way would be a kind of peak fitting: with parameters amplitude and time. This is kind of in between the peak hight and area. With enough simplification this may be a feasible way: calculate the correlation with 2 test shapes (about the expected shape to get the amplitude and one closer to the derivative to fix the position).

There is also a semi analog way to the area way: have an extreme low pass filter close to an integrator with a very slow reset and measure the quasi DC value before and after the peak.

I think the ADC inside the µC can be OK if the µC gets a clean supply (e.g. LDO after SMPS). However I have no experience with the ST  µCs and don't know how sensitive it is to the actual layout.
This is because I very much doubt one would really need perfect 12 or 13 bits. Only really high end detectors (e.g. cooled germanium direct semiconductor detector) have such a resolution. For the gain error the more problematic point is a stable detector gain.

The OPs would likely be supplied by the same 3.3 V or similar voltage as the analog part of the µC.
 

Offline oschonrock

  • Regular Contributor
  • *
  • Posts: 67
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #19 on: August 10, 2020, 03:18:29 pm »
Dave did a video that winds up with an op amp precision peak detector (the 3rd circuit iteration), maybe it is useful...



Yeah good. I was going to find the link to that. This is a goo introduction. However, to be clear for the OP, even the final version of what Dave talks about is not at the level of complexity or performance of that ADI article linked to above.

Depending on the rise time of the pulse (waiting for detail) that ADI circuit, which catches the peak of a 200kHz sine wave as shown, may or may not be enough for this application.
 

Offline oschonrock

  • Regular Contributor
  • *
  • Posts: 67
  • Country: gb
Re: Help with opamp for shaping circuit
« Reply #20 on: August 10, 2020, 03:20:55 pm »

The peak shaping is nothing magic, it is essentially a low pass filter with a suitable response in the time domain, so that the short pulse will get wider, as the higher frequency part is lost. Ideally this would be with little undershoot and not too much slow decay at the very end. However nearly every low pass filter will do pulse stretching and the differences are not that large. Even a not so good solution would still be linear. Optimization is a little about the last little bit of noise / sensitivity.

This doesn't make sense to me.

The part the OP is interested in (I believe) is the rising edge and the initial peak.

If you apply a low pass filter to that, you will flatten the peak and get the wrong value. Totally defeats the purpose?

We want the information in the very steep edge. That has the highest frequency content. So why would we use a low pass filter? It will just give us some kind of "low frequency average"..which is exactly what we do not want.

You are right that "fast peak detect" is tricky. That's exactly because it has to deal with that high frequency content. Anyone can apply a low pass filter and get an average. Then I can get grandma to watch the value at the output of the low pass filter, and she will get it spot on?
« Last Edit: August 10, 2020, 03:43:47 pm by oschonrock »
 

Offline snxTopic starter

  • Contributor
  • Posts: 47
  • Country: ch
Re: Help with opamp for shaping circuit
« Reply #21 on: August 10, 2020, 04:31:08 pm »
Some clarifications:

1. I think "reshaping the signal" is a distraction. Any circuit which can "reshape it", can measure the peak (in analog domain or digital). Unless you call "peak detect" a reshape.

2. From what I understand, you just need the peak value right? You don't care about the exact shape?

3. What sort of accuracy are you after for the peak value?  You talk about 16bit. That's pretty accurate? Is that really necessary or will 12bit do? This is important because, together with the speed of the pulse, this will totally drive the solution. To get 16 bit accuracy, you don't just need a 16 bit ADC, your circuit and the power supply to it needs to be super noise free and you need a precision voltage reference (independent, the one in the CPU will almost certainly not do for proper 16bit accuracy). Your PCB will need to have fully seperate analog and digital sections with independent power supplies, independent ground/power planes etc etc etc.  So, will 12 bit do?  Note, that the scope you are using is just 8-bit....

As already discussed, either a fast ADC or an analog signal conditioner, followed by a simple ADC are the best bet. My instinct leans toward the analog signal conditioner first, then you can use CPU ADC. That LTC6244 App note (current boost option) is almost exactly what you need and for $10 BOM (2 "special" op-amps and a bunch of passives) and near zero design time, this seems like an attractive option. If it can do the job...

Also the discussion about amplifier gains is a bit premature for me. These are not super small signals. The small pulse has ~400mV peak. How accurately do you want to measure that small peak? To the nearest 5mV, which would be ~1% (8-bit is sufficient, if per-amplified or 12bit to give 16x dynamic range which seems more than enough for your pulse size range)? Or is 16 bit accuracy (0.0015%!!) necessary? If so then you are dealing with measuring and/or preamplifying a delta V of 400/65000 ~ 6uV. I am not even sure that's possible at this bandwidth...

But we need more data....

The pulse is "fast ish" but it's not clear to me from the traces how fast it really is. Can you provide some traces with the horizontal zoomed out to 2us? (ie 10x what it is now) And/or turn on a rise time measurement on the scope. We need to see that edge. The width is not important, it is the rise time that matters,
Thanks

Yes, correct the shape of the pulse is irrelevant, only the peak value is of interest.The peak is linked to the amount of radiation energy hitting the detector, the higher the energy, the higher the amplitude will be. In terms of Resolution, i need 4096 Channels, so basically a *perfect* 12-bit ADC, so in reality maybe a 14bit. Sure the scope has less, but usually scopes are to visualize values, not exactly measure them, that's why you use a bench top multi meter to measure voltage and not just the DC-Meter in the scope.  Also, the signal can be reshaped or transformed freely, unless the output has a defined link to the input. I've also seen approaches to measure the peak by simply use a Comparator to create a rectangular pulse, and then precisely measure the "on" time with a FPGA, but that's. The pulse length is linked to the pulse height, so this works. But that's another approach.

Detectors are limited towards energy depending on size, so lets say for this one, the maximum possible value out of 4096 Channels is 3000 Channels, the count rate above 3000chnl is so low, it can be ignored. Tricky is the thing, that the gain has to be set-able, because for example at low bias voltage, the 4069 Channels are spread between 0 and 400mV for example, but at high bias they are spread between 0 and 1200mV. If its unity gain 1, the problem would be that if we use a 10bit ADC for example,  when the value at high bias would be 0-1000mV, we would have 1024Channels, but if the bias is low (0-500mV) we only have half of values. The further processing of data would be to sample a collection of peaks, for example 5000pcs. Then a visible peaks in the values should be visible. For example, a calibration source would put two peaks in the spectrum, one at 32keV, and the other one at 661keV.  These are linked to ADC samples in case of spacing, so we would know between the adc reading x and y, where x = 32keV and y=661keV, there are 629Channels, so all values that not mach a channel would be rounded to the next one.


I've captured the two pulses for you. One rather small one of 140mV, the other 850mV. In the final version, the signal will be less noisier than in the scope shots, i basically used the voltage from a bench-top supply and put things on a breadboard with a not-professional coupled detector, so ignore the noises
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 7045
  • Country: nl
Re: Help with opamp for shaping circuit
« Reply #22 on: August 10, 2020, 04:40:31 pm »
i would like to shape this pulse to a more Gaussian shape with uniform rise and fall times (like sine-wave).

Meh, don't make things harder than they need to be ... just R-C filter it, then a PGA.
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 7045
  • Country: nl
Re: Help with opamp for shaping circuit
« Reply #23 on: August 10, 2020, 04:50:40 pm »
The part the OP is interested in (I believe) is the rising edge and the initial peak.

If you apply a low pass filter to that, you will flatten the peak and get the wrong value.

Lets say the avalanche is instantaneous for a moment ... the original waveform is already the output of a low pass filter for that instantaneous energy.

In principle it's all linear ... the peak of the low passed pulse has a linear relationship with the peak. Also in theory the area under the curve is linear with the original energy too, which can be measured with less noise than the peak (and with a lower resolution ADC). Not that noise seems to be a problem here.
 

Offline snxTopic starter

  • Contributor
  • Posts: 47
  • Country: ch
Re: Help with opamp for shaping circuit
« Reply #24 on: August 10, 2020, 08:02:04 pm »
By the area of the curve you mean like sample and then geometrically restore the peak by adapting the measurements to a known geometrical shape? Like measuring a sine wave with a low bit resolution?
Still, does this work with so few samples? Lets say we have 2MSPS, this means a sample each 500ns, so a pulse of 10us would get 20 Samples. Lets say for bad luck, the first and the last sample misses the pulse, so there is only 18 samples? Would that be enough to either find the peak, or calculate the area of the curve? Would it not even be more vital to shape the output to a better shape?

Also, i noticed that for example Amptek has a similar pulse shown here:
https://www.amptek.com/products/digital-pulse-processors/dp5-digital-pulse-processor-and-mca

(2- Prefilter Output - ADC Input

looks really similar to my pulses, but they have 80MSPS 12bit ADC which is extremely faster than my 2MSP. They would get 800 Samples in 10us
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf