Oscilloscope Auto Rise Time Measurement Cannot be Trusted for Impulses - Page 1
Forum section: electronics / general

author: niconiconi
author_rank: Frequent Contributor
timestamp: November 07, 2023, 04:57:01 pm
content: Accidentally clicked "Post", please wait while I'm uploading images...SummaryLast year, during the process of building and calibrating a IEC 61000-4-5 impulse generator for surge testing, I found serious problems in automatic rise time measurement in oscilloscopes when it's applied to an impulse waveform. The measured impulse rise time can be inaccurate or even completely wrong.This can easily mislead an unsuspecting experimenter.This situation occurs whenever you have a Dirac impulse-like waveform, instead of a Heaviside step-like waveform.Long story short, the root of the problem is that most oscilloscopes and data processing software is designed to measure step waveforms, not impulse waveforms. They use averaging to determine the 0% and 100% levels. This is done by creating a histogram and split it into a "high" part and "low" part (details of this algorithm is described in IEEE 181). For a step waveform, since the high and low levels occur at multiple data points across a long timespan, this averaging gives accurate results. For a impulse waveform, because the high level occur only at a single data point instantaneously, this averaging is counter-productive, leading to the under-estimation of peak voltage, artificially shortening the measured rise time to an incorrect value.Thus, it's wrong to use automatic rise time measurement on impulses. For these waveforms, you have to either write your own code or use cursor for manual measurement using the real peak value as the 100% reference point. In fact, bi-level histogram is far from the only acceptable algorithm for rise time measurement in IEEE 181. For an impulse, IEEE 181 explicitly says you can take its peak value. But I guess everyone just went with the default - which works well with common repetitive signal waveforms, but not a single-shot impulse.ImplicationsThis has serious implications. I suspect this problem is overlooked even by many professional engineers, making it a good note for publication inIn-Compliance MagazineorSignal Integrity Journal(but for now, it's only a post on EEVblog to raise awareness of the problem, publication elsewhere is welcomed)For example, I suspect most measurements of the Jim Williams' pulse generator are probably wrong. It's also worth noting that in the previous 2nd edition of IEC 61000-4-5, it specified a custom algorithm to calculate the front time of the impulse by extrapolating the waveform to a "virtual origin". But in the 3rd edition, it was abolished in favor of standard 10%-90% rise time, allowing people to measure that by pressing a button on the oscilloscope, instead of writing code. But it seems that the standard committee completely ignored this ambiguity problem of built-in rise time measurement. Good intention, but it looks like this reformation was misguided and caused unintended consequences - solving an old problem and introducing a new one!Demo 1: Incorrect Ground OffsetThe first impulse was measured to have a rise time of 9.58 microseconds, the next waveform was almost the same impulse, just with its time base shifted. Now rise time suddenly becomes 6.78 microseconds, an error of 40%. What's going on? The oscilloscope was trying to find the ground offset, the undershoot following the impulse made the calculation completely wrong.For the purpose of IEC 61000-4-5, the standard says the ground level is solely determined by the base line before the beginning of the impulse, not the undershoot afterwards. So 6.78 microseconds is correct, 9.58 microseconds is completely wrong. Without noticing this pitfall you can get seriously misleading diagnosis... It may vary for other applications.Demo 2: Incorrect Peak ValueThe first impulse has its undershoot truncated off the screen, the measured rise time was 6.76 microseconds. Now let's shift it further and also truncate the falling edge too, rise time suddenly became 7.24 microseconds, an 8% change! Again, the scope attempted to find the top level by averaging both sides. But for a short impulse, this averaging is counterproductive and gives a lower peak value, causing an artificial rise time reduction. What a metrology nightmare.Demo 3: MatlabThe oscilloscope's rise time measurement algorithm is a blackbox, it's hard to know exactly what it's doing. But Matlab's risetime() function implements the same algorithm with some internal parameters exposed for inspection. I found Matlab's rise time result matched my oscilloscope within 2 decimal places, which means both are indeed using the bi-level historgram algorithm in IEEE 181.Using this annotated graph from Matlab, we can see the problem is exactly what I suspected. The bi-level histogram method was only suitable for a step function, not an impulse. It attempts to average the top and bottom to get the HIGH/LOW voltages. For an impulse, it makes the peak artificially low and is ill-suited for the purpose of IEC 61000-4-5. The real peak current (mis-labeled as "voltage") is around 270 V, but the 100% reference used is ~260 V (pay attention to the dashed line labeled "upper state", which are different for the full and truncated waveform due to the use of histogram averaging).If the falling edge of the impulse is removed entirely, the rise time measured by the oscilloscope increases and its value gets closer to the "correct" answer, since the algorithm is no longer averaging both side to bring down the peak. Indeed, I can produce the same effect on Matlab, from 6.75 microseconds to 7.08, a 5% change.ConclusionThe default 10%-90% automatic rise time in most oscilloscopes is unusable for use on impulse waveforms.

author: KE5FX
author_rank: Super Contributor
timestamp: November 07, 2023, 05:22:05 pm
content: Weird. No idea what would possess someone to use a histogram to compute rise/fall times. Good to know.

author: niconiconi
author_rank: Frequent Contributor
timestamp: November 07, 2023, 05:36:15 pm
content: Quote from: KE5FX on November 07, 2023, 05:22:05 pmIEEE 181 (doi: 10.1109/IEEESTD.2011.6016198) basically says there are different algorithms, any method described within can be used when it's appropriate to do so, including changing between different methods depending on the waveform of interest. IEEE 181 also says using a histogram to determine the "high" and "low" levels of a waveform is a good way to do it (for the common case of logic switching signals), meanwhile for impulse-like waveform, it's better to take the peak value.Apparently many oscilloscopes used the histogram averaging method in all cases.Quote

author: KE5FX
author_rank: Super Contributor
timestamp: November 07, 2023, 05:38:49 pm
content: That's just so goofy. Histograms have meaning only in the time domain, and only then if you ignore causality. They are completely arbitrary and meaningless unless you are dealing with the statistics of the waveform as a whole, which rise/fall times of specific edges certainly do not.

author: 2N3055
author_rank: Super Contributor
timestamp: November 07, 2023, 05:51:19 pm
content: I read twice through the post... And couldn't find what scope are you talking about..A bit of dramatic overgeneralization if you ask me. It is not wrong to use measurements but we need to be aware of how measurements work not use measurements wrongly.User error .On top of that:1. Many scopes have cursors (indicators) that show what exact sampling point were used for measurements. You can plainly see that scope is picking wrong place.2. Many scopes can choose amplitude strategy for signal amplitude. Histogram or peak value. Even separate setting for low and high.3. Many scopes have4. It is well known and taken care of in scopes by said measures.In attachment: Similar signal. Please pay attention to difference between Top and Max and Base and Min. Make note also about cursor showing 10 and 90% point used for 10-90% measurement. These cursor are placed automatically by measurement showing what data it is operating on.Conclusion: You need better scope. And automatic measurements need to be checked. I agree on that one with you. When I say people should pay more attention to measurements and analytic capabilities on scopes, I get ridiculed.

author: niconiconi
author_rank: Frequent Contributor
timestamp: November 07, 2023, 05:52:33 pm
content: Quote from: KE5FX on November 07, 2023, 05:38:49 pmBecause of the existence of DC offset, noise, glitches and other distortions, it's basically impossible to have a foolproof definition of the 0% level and 100% level of an arbitrary waveform. If a 0 V to 5 V TTL signal has a momentary noise glitch to -100 mV and 5.2 V some microseconds before and after the initial transition has occurred, what is the 0%, 100%, 10% or 90% level? Defining the average value of the "flatline" before the transition as 0%, and defining the average value of the "flatline" after the transition as 100% is surely a reasonable way to do this. My understanding is that this is basically the histogram method in IEEE 181, the histrogram allows one to have a mechanical method to separate the "pre-rise" and "post-rise" parts.Of course, as my original post has pointed out, it's not appropriate for all cases but few are aware of that. Some oscilloscopes tell you explicitly where the 10% and 90% points are, so this problem should be more obvious on those instruments.

author: 2N3055
author_rank: Super Contributor
timestamp: November 07, 2023, 05:54:34 pm
content: Quote from: KE5FX on November 07, 2023, 05:38:49 pmHistogram is not used for waveform but for establishing min and max amplitude levels for establishing threshold levels for measurements.On a good scope you can choose whether MIN/MAX or Histogram is used. Separately.

author: niconiconi
author_rank: Frequent Contributor
timestamp: November 07, 2023, 05:56:13 pm
content: Quote from: 2N3055 on November 07, 2023, 05:51:19 pmThanks, good to know. Revised conclusion: The classic Tektronix TBS/TDS oscilloscope designs from the early 2000s have very limited automatic measurement. Today's oscilloscopes have much better automatic measurement capabilities, they explicitly mark the 10% and 90% points and also allows you to switch between strategies, this is no longer a problem.

author: 2N3055
author_rank: Super Contributor
timestamp: November 07, 2023, 06:02:05 pm
content: Quote from: niconiconi on November 07, 2023, 05:56:13 pmDon't get me wrong. You are 100% CORRECT we need to be sure to check data that "automagical machine" is spitting out..Measurement I have shown is made to be similar to yours, but I can easily reproduce errors if I feed it weird nonregular signal.Good thing about this scope is that when it gets confused it shows error sign and no bad data. So you know it is confused.Also, except on very regular simple signal like rectangular clock, all risetime measurements are local by nature. You need to place it on screen in convenient form...I like that you posted this because it raises the awareness that we can't do things on autopilot. All measurements require at least minimum amount of scrutiny to be dependable..Best.