Trigger at the peak of a pulse - Page 1
Forum section: electronics / general

author: msngupta
author_rank: Contributor
timestamp: February 12, 2018, 07:47:42 pm
content: Hi,I have a signal (first waveform in the img attached), I want to make a circuit which can generate a trigger at the peak of the pulse(second waveform in the img). The typical FWHM of this pulse would be ~1us and the amplitude may vary. I also don't want to generate false triggers at the peaks of noise. I was thinking about a simple differentiator, but not sure how to shape it to make a square wave. It would be really helpful if someone could give me any pointers.Thanks,

author: nfmax
author_rank: Super Contributor
timestamp: February 12, 2018, 09:04:29 pm
content: You should split this into three parts:A straightforward threshold: when the signal is above some threshold, enable the trigger, otherwise disable it. The threshold can be automatically set using a peak detector and taking some fraction, like 1/2 or 2/3 of the peak value as the thresholdA differentiator, which doesn't have to be particularly wonderful, so long as the response is a good approximation to the derivative over the expected frequency range (i.e. pulse width range).A zero-crossing detector on the output of the differentiator - essentially a comparator with 0V as one inputYou combine these so that the trigger is generated when the zero-crossing detector switches (in the +ve to -ve direction) AND the the threshold detector is high.The differentiator/zero crossing detector finds the signal peak, while the threshold (hopefully) guarantees it is the true signal peak, not a smaller noise peak.

author: voltsandjolts
author_rank: Unknown
timestamp: February 12, 2018, 09:35:50 pm
content: I have seen some simple photomultiplier tube pulse height analysers that use a simple comparator to trigger a monostable.The monostable pulse width is set to the time between comparator trigger point and the pulse peak.This time was surprisingly constant for a range of pulse heights, in those systems at least.Try the simple solutions first!

author: BrianHG
author_rank: Super Contributor
timestamp: February 12, 2018, 10:24:02 pm
content: Method 1:All you need to basically do is feed your signal into a comparator with logic output. The signal will go to the - input, then connect the - input through an inductor and resistor in series to the + input and add a cap and and a pull down resistor in parallel from the + input to GND. Add a pull-up resistor to the - input as well unless your input signal already has a bit of DC bias.Now, what you have created here is a filter and you are triggering on the fall of the input signal, just after a peak has been reached. The values of the inductor-resistor/cap tunes the frequency range which this falling edge detector will trigger at. The pull up and pull down resistors controls your sensitivity. To make this circuit, you will need to know how to use an analog comparator. To select and tune the inductor/resistors & cap, there are others here better suited to help you with that, but if I were to do it, I would just setup a bread-board and scope the circuit playing with the values.Note that the circuit can be done without the inductor, it will just respond to any rising pulse that is high enough.Method 2, filter you input signal through a high pass filter using a series cap and inductor to GND. Feed that to the - input of a comparator and tie the + of the comparator to a trimpot adjustable between GND and around 1/2 your max signal amplitude. This trimpot will adjust the sensitivity of your detector.Both filter type methods have their strengths and weaknesses in detection speed and noise immunity. Method 2 is easier but requires a filter which cuts out all frequencies below your typical signal rise and fall rate. Method 1 is a bit more flexible and depending on your source signal speed, it will trigger more-so on the rise to the peak instead of like method 2 which triggers at the falling edge after the peak has been reached.These methods are not a peak detector, they scan for the falling edge after the peak has been reached. If you make a peak detector, the second lower peak in your example source might be ignored.Method 3, simple peak detector. Feed your source to the + input of the comparator. Add a schotkey diode from the + input to the - input. Add a pull-down resistor and capacitor in parallel on the - input. The voltage drop across the diode and the charge retained in the cap on the - input determines when the output would be triggered. Once again, you need to tune the cap and resistor so that their charge drops fast enough so that your detector will see you second adjacent weaker pulse, however, if your next pulse is stronger, the detector will trigger as that pulse rises before it actually reaches it's peak, which you specifically asked not to do.Since all 3 methods use basically the same parts, and if you know how to use analog comparators, and you have a scope, you should be able to play with all 3 on a breadbord. With a 4 channel scope, you can run all 3 in parallel and see how each behaves all super-imposed.

author: BrianHG
author_rank: Super Contributor
timestamp: February 12, 2018, 11:00:45 pm
content: Method 4: Do it digitally. Use a simple PIC with ADC, sample your source analog pulse signal and program a falling edge detector, but, expect a bit of software execution delay. With PICs running at 32MHz today, and some variants with a flash ADC module, you can numerically analyze the source and para-metrically create any type of sophisticated filter with adaptive threshold & time based filtering you like roasting a dubious analog comparator filter circuit.

author: danadak
author_rank: Super Contributor
timestamp: February 13, 2018, 02:57:49 am
content: Do it with a PSOC -http://www.cypress.com/file/134261/downloadRegards, Dana.

author: ejeffrey
author_rank: Super Contributor
timestamp: February 13, 2018, 06:30:48 am
content: A classic constant fraction discriminator does basically what nfmax describes, except it uses a really basic "differentiator" that works by delaying and scaling a discrete copy of the signal. With such a broke-ass differentiator the trigger doesn't coincide with the exact peak of the signal, but will be repeatably positioned relative to the actual peak regardless of pulse amplitude -- i.e., it might trigger when the pulse is at 75% of max, or 50% depending on the delay and scaling factor and the typical pulse shape.https://en.wikipedia.org/wiki/Constant_fraction_discriminator

author: hamster_nz
author_rank: Super Contributor
timestamp: February 13, 2018, 08:40:19 am
content: Maybe after the peak detector you could send the main signal down a length of coax, removing the latency required to detect the top of the peak?Or is that a silly idea?

author: Marco
author_rank: Super Contributor
timestamp: February 13, 2018, 06:44:51 pm
content: At 150 ns response time the PSOC comparators are a bit slow for a 1us waveform.Assuming spending a couple bucks isn't a problem I'd just use two fast comparators (LT1720?). The first to detect the signal is above a given level, the second after a RC differentiator to detect the derivative going negative (you'll want a resistor divider between the rails to get a virtual ground for the zero crossing detection, doing it at actual ground is not convenient, it will move around a bit with the pulse but that's not a problem, it switches when there is zero voltage across the resistor of the RC differentiator and that's all that matters). Combine the outputs with diode logic, then a monostable to stretch the pulse.You could do it all with discrete components cheaper, but that's harder.PS. might want to low pass filter the pulse a bit before detection.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: February 13, 2018, 07:39:29 pm
content: add low pass filter first to minimize noise. A filter with a 1us rise time might just suit.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 13, 2018, 08:01:20 pm
content: One issue here is with noise discrimination/removal.Do you have robust criteria for noise discrimination that can be applied in real-time (such as amplitude threshold, frequency...) without compromising the response delay?(Actually, since pretty much any kind of real-time filtering will introduce delays, your best bet would be with just amplitude tresholding. But since your signal seems not to have a precise expected amplitude, that may be kind of difficult. We need to know more about your signal and your expectations in terms of response delay.)Also, amplitude thresholding would only deal with the kind of noise you're showing here: low-amplitude (relative to the signal) noise. For any noise superimposed to the signal, you will have to resort to filtering, with the potential issues with the response delay.What seems relatively simple when done offline (as in not in real time, with the ability to look ahead) is not trivial when done in real-time. For instance, offline filtering delays can be compensated.But again, we know nothing about the signal you're dealing with. Would the amplitude of the peaks be relatively constant during a certain period of time? Would it be acceptable that your detector need some kind of "training" period before starting to output the peak detection? What max delay would you accept between the actual peaks and your output pulses?

author: rstofer
author_rank: Super Contributor
timestamp: February 13, 2018, 09:42:57 pm
content: Quote from: hamster_nz on February 13, 2018, 08:40:19 amIt was done on analog oscilloscopes for decades. The example I saw was just an etched PCB with traces drawn like narrow square waves to get the maximum length without having the PCB stick out the back of the case.

author: danadak
author_rank: Super Contributor
timestamp: February 14, 2018, 01:32:34 pm
content: @Marco, depends on the PSOC.4M family datasheet shows 38 nS, 50 mmV overdrive, worst case.5LP family shows 110 nS, 50 mV overdrive, worst case.Other familys, ones with LP Comparator, definitely much slower.Regards, Dana.

author: bson
author_rank: Unknown
timestamp: February 16, 2018, 12:11:35 pm
content: You could use a comparator where one input is slightly delayed from the other - this will give you a directional indicator telling you whether the signal is rising or falling. The peak will be on one edge, the bottom on another, delayed by the equivalent of the input delay...