EEVblog Electronics Community Forum

EEVblog => EEVblog Specific => Topic started by: EEVblog on September 13, 2014, 10:44:33 pm

Title: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: EEVblog on September 13, 2014, 10:44:33 pm
In this tutorial Dave demonstrates the seldom used and often little understood mathematical integration function available on your modern digital oscilloscope. And demonstrates a practical example use for it in accurately measuring the total power consumption of a microcontroller that sleeps and then wakes up and does some processing before shutting down again. By getting the total area under the current curve.

EEVblog #662- How & Why to use Integration on an Oscilloscope (https://www.youtube.com/watch?v=Dh0xYu8YvaE#ws)
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: rs20 on September 13, 2014, 11:27:48 pm
About the inaccurate measurement of sleep current by the integral function -- Putting on my pedantic hat; it might be more accurate to blame that error on offset, rather than noise. I only say that because noise is not a DC thing, some of those samples will be high, some will be low, it all cancels out -- that's one of the wonderful things about integration, it pulls the interesting low-frequency stuff out of the noise. What's left over, and what survives integration, is offset error. It would be interesting to short the input to the uCurrent to see what a true zero-current reading looks like, and to see if any real signal survived the quantization process (it wouldn't be too bad to use the zero-current integral as an offset null).?

[ Double-posted to the YouTube comments as well because I reflexively commented on YouTube for some daft reason. EEVBlog forum is where it's at! ]
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: miguelvp on September 13, 2014, 11:43:19 pm
Nice video, I take back that you are only doing mailbag and teardowns :)

Question, is the Area measurement the same thing?
At least on my Rigol it does seem to match:

Both the integral and the area shows 10.5mVs
(https://www.eevblog.com/forum/blog/eevblog-662-how-why-to-use-integration-on-an-oscilloscope/?action=dlattach;attach=109178;image)

And in here they both agree on 4.20mVs (well, close enough)
(https://www.eevblog.com/forum/blog/eevblog-662-how-why-to-use-integration-on-an-oscilloscope/?action=dlattach;attach=109176;image)

Edit: updated the images so that it shows VMax of the Math channel, but it doesn't show the scale in mVs just mV.
Also Dave covered this in the video, I guess I wasn't paying attention at that moment.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Legit-Design on September 13, 2014, 11:49:07 pm
Sound is wrong on that video... also video looks yellowish, my guess that is the Sony camera.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: EEVblog on September 14, 2014, 12:01:56 am
Sound is wrong on that video... also video looks yellowish, my guess that is the Sony camera.

Canon HF G30.
I used the mid range boost function in the camera, designed for speech. Was an experiment.
Sounds good to me.
Re. the yellow, that's an oops, forgot to turn back on manual white balance after the trade show. That always happens.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: miguelvp on September 14, 2014, 12:40:16 am
Nevermind about the area measurement, you did cover it, I guess when I watch it I was distracted when you mentioned it :)

Edit: plus it's nice to be able to visualize it instead of just looking at a number.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Prime73 on September 14, 2014, 01:00:07 am
Sound is wrong on that video... also video looks yellowish, my guess that is the Sony camera.
sounds good to me - no issues.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: cosrologist on September 14, 2014, 01:06:52 am
Dave,

You should be able to configure the CRO probe input to convert the voltage to a current, including using a conversion factor such as 1mV = 100uA, (which is the setting on the uCurrent) so that the display shows Amperes (or mA) and the integral is mA Seconds.   which is easier to read/do calcs with.

Cheers
Kym
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: plesa on September 14, 2014, 01:08:39 am
You can also adjust the units in probe menu from volts to amps and change the sensitivity according to transimpedance of your uCurrent.
But there are some limitations max 10V/A minimum 1mV/A. So it is useless for measurement with uCurrent.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: rs20 on September 14, 2014, 01:28:36 am
At 9:37, you say the average current is 12.1 uA according to the scope, but you have a 2 second period on your integral -- so 12.1 mVs / 2 s works out to 6.05 mV average --> 6.05 uA, much closer to reality! But since a little bit of offset error could swamp the reading, I agree with your overall conclusion that the number isn't reliable.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: dentaku on September 14, 2014, 02:28:46 am
I've always known how integration is useful for me when modifying audio signals but this is the first time I've had a good explanation of what exactly integration is.
I see that if the yellow curve was to never settle back all the way down the purple one would just keep going up.

I can easily visualize why integrating a square wave gives you a triangle and integrating a triangle gives you a sine.

Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Wim_L on September 14, 2014, 03:47:34 am
About the inaccurate measurement of sleep current by the integral function -- Putting on my pedantic hat; it might be more accurate to blame that error on offset, rather than noise. I only say that because noise is not a DC thing, some of those samples will be high, some will be low, it all cancels out -- that's one of the wonderful things about integration, it pulls the interesting low-frequency stuff out of the noise. What's left over, and what survives integration, is offset error. It would be interesting to short the input to the uCurrent to see what a true zero-current reading looks like, and to see if any real signal survived the quantization process (it wouldn't be too bad to use the zero-current integral as an offset null).?

[ Double-posted to the YouTube comments as well because I reflexively commented on YouTube for some daft reason. EEVBlog forum is where it's at! ]

Indeed, noise doesn't matter, it's the offset between the average value and zero that will determine the deviation of the integral. That's also why integrals give nice curves even on noisy data: they're inherently averaging things together.

The opposite is true for differentiation, which amplifies noise. A typical high sample rate noise oscilloscope signal is likely to need a lot of averaging/low pass filtering, or the differentiated signal will be nothing but noise.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Dave on September 14, 2014, 04:36:47 am
I am also going to put on my pedantic hat (implying that I ever take it off) and say that the measurement was incorrect.
You measured the charge of that current pulse to be 700nC over the period of 5ms.
Then you connected the multimeter to measure the sleep current. The numbers were jumping from 4.16µA to about 13µA. You then turned on averaging and ruined your whole measurement. The multimeter was averaging the sleep current as well as the spikes. The actual sleep current was about 4.16-4.17µA (these were the lowest values the multimeter was settling to).

So, your actual current consumption would be closer to:
(4.16µA*(2s-5ms)+700nC)/2s = 4.51µA

On a side note, please watch out for correct terminology. You shouldn't confuse energy and charge.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: rs20 on September 14, 2014, 04:44:17 am
I can easily visualize why integrating a square wave gives you a triangle and integrating a triangle gives you a sine.

OK, I'm just going to declare today rs20-has-pedantic-hat-day: Triangle integrates to something vaguely sine-ish, but not a true sine wave -- only a (co)sine wave integrates to give a sine wave. However, it's true that as you keep on integrating over and over again, you get closer and closer to a sine wave as you attenuate those harmonics more and more: square --> triangle --> vaguely sine-ish string of parabolas --> even more sine-ish string of cubics --> (infinity* steps later) --> sine --> sine --> sine

* Where infinity is defined as anything greater than, oh, I dunno, seven.

Indeed, noise doesn't matter, it's the offset between the average value and zero that will determine the deviation of the integral. That's also why integrals give nice curves even on noisy data: they're inherently averaging things together.

The opposite is true for differentiation, which amplifies noise. A typical high sample rate noise oscilloscope signal is likely to need a lot of averaging/low pass filtering, or the differentiated signal will be nothing but noise.

It does leave me wondering why scopes don't have more versatile low-pass filtering capability. For instance, when I'm using my uCurrent, I want my scope to have a bandwidth limit of 0.4 to 0.5 MHz, because I know anything above that isn't a valid signal from the uCurrent, therefore pure noise. Low-pass filtering also gives you more effective bits. But no, all I have are two options: 20 MHz and 100 MHz.  It can be done in software; loosely speaking it's averaging contiguous samples in each captured waveform (instead of averaging feature, which averages separate waveforms)... a dialable software bandwidth limit feature would be higher up my list than many other impressive but more contrived features offered by modern scopes.

Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: zapta on September 14, 2014, 04:55:31 am
What is the nature of the noise near the horizontal line?  If it's random ac with zero DC average and if the integrator is signed then it should contribute zero charge to the integration.

Several months ago I faced a similar need, to measure the charge of single cell mobile devices. The current consumption fluctuates a lot over time, nothing clean as periodic like in this video. I ended up building a small OSH integrator based on LTC2943. It does continuous integration by a linear Coulomb counter (50mv burden voltage max scale, you provide the shunt) that triggers a digital charge counter. It was designed to have very low integration offset works great also with long term integrations (hours and days).  The integrator has a 1.3" OLED display and shows metrics such as average current (charge/time), number of software awakes (current is above a certain threshold), and a real time graph and also allows to log the data on a computer. So far I build 30 of them (3~5 at a time) giving to colleagues that ask.

(https://github.com/zapta/power-monitors/raw/master/pmon_3v8/www/pmon_3v8_with_phone.jpg)

One commercial charge integrator I am aware of is Monsoon Power Monitor https://www.msoon.com/LabEquipment/PowerMonitor/ (https://www.msoon.com/LabEquipment/PowerMonitor/)  it is fully controlled via a USB port and contains both a programable power supply and current integrator.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Dongulus on September 14, 2014, 06:06:15 am
I've seen the famous quantization noise SNR equation for an ideal ADC. The equation assumes that the probability of the error in an ADC sample is equally distributed between +/- 1/2 LSB. I know that SAR ADCs the distribution for the quantization noise will be from 0 to -1 LSB because the logic in a SAR ADC will always produce a result that is less than what the analog input actually is. This would produce quantiztion noise with a constant offset of -1/2 LSB.

Does anyone know if the quantization noise distribution veers from the ideal for other types of ADCs?
Also, what kind of ADCs are typically found in oscilloscopes?
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: rs20 on September 14, 2014, 07:22:15 am
I've seen the famous quantization noise SNR equation for an ideal ADC. The equation assumes that the probability of the error in an ADC sample is equally distributed between +/- 1/2 LSB. I know that SAR ADCs the distribution for the quantization noise will be from 0 to -1 LSB because the logic in a SAR ADC will always produce a result that is less than what the analog input actually is. This would produce quantiztion noise with a constant offset of -1/2 LSB.

Does anyone know if the quantization noise distribution veers from the ideal for other types of ADCs?
Also, what kind of ADCs are typically found in oscilloscopes?

A constant offset of -1/2 LSB with respect to what? None of this is relevant if the scope has a calibration procedure.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: T3sl4co1l on September 14, 2014, 07:39:40 am
OK, I'm just going to declare today rs20-has-pedantic-hat-day: Triangle integrates to something vaguely sine-ish, but not a true sine wave -- only a (co)sine wave integrates to give a sine wave. However, it's true that as you keep on integrating over and over again, you get closer and closer to a sine wave as you attenuate those harmonics more and more: square --> triangle --> vaguely sine-ish string of parabolas --> even more sine-ish string of cubics --> (infinity* steps later) --> sine --> sine --> sine

* Where infinity is defined as anything greater than, oh, I dunno, seven.

This resonates with the Fourier transform, and with the Taylor series expansion of sin(x).  (Screw pedantism, he's bringing out the calculus?  Head for the hills!!)

The expansion is all even (cos) or odd (sin) powers of x from 1 or 2 to n, each with a leading coefficient of 1/n!.  This is a true representation of the function, but only as long as n --> infty.  There's no reason it has to work for small n, though as it turns out, sin/cos are suitable functions which approximate reasonably well.  So, the more powers you have, the more accurate the approximation.

Now, one nice thing about a Taylor series is, it's trivial to integrate -- it's just a polynomial, so you increment each exponent by one, and divide the constant.  The power goes up, and the approximation gets better (assuming you bring in new constant terms every time you hit +/- cos) because the series 'grows'.

The Fourier transform of a square wave (and its subsequent integrals) follows a similar pattern: the harmonics goes as 1/n^(p+1), where p is the number of integrations.  A square wave has harmonics that go as 1/n, so the 3rd has an amplitude of 1/3, and so on.  Triangle goes as 1/n^2, so the harmonics drop off more quickly.  Each time you integrate, it goes lower and lower, until after infinite passes, the harmonics completely disappear.

When it comes to circuits, if you're talking single frequency (not the variable output from a function generator), the harmonics can be attenuated with a filter.  An integrator is simply a -20dB/decade everywhere, so it's as good as a lowpass filter if the unity gain frequency is appropriately selected.  Practically speaking, the lowest harmonics are the hardest to treat, and you can get better performance with a filter that incorporates zeroes (like an elliptical) at strategic frequencies.

Indeed, noise doesn't matter, it's the offset between the average value and zero that will determine the deviation of the integral. That's also why integrals give nice curves even on noisy data: they're inherently averaging things together.

Arguably not: low frequency noise tends to go as 1/f, which looks like Brownian noise in the integral, and depending on your point of view and scale, manifests as low frequency rumble, uncertain offset, etc.

There's also the matter of quantization: on average, it's just noise -- but for a given situation, it may not be incoherent.  That is, if your 8 bit ADC is always reading the same numbers for each point on the waveform, averaging won't get you anything, because the noise is correlated with, and now inseparable from, the signal.  It actually pays to have a slightly noisy measurement (1-2 LSBs, say) when you're doing averaging (or oversampling).  BTW, note that averaging is the same as equivalent time sampling (with averaging), because it doesn't matter whether the acquisition was obtained in real time (bursts of a screen at a time) or here-and-there (delayed or random trigger per point).

Tim
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: miguelvp on September 14, 2014, 07:42:56 am
I can easily visualize why integrating a square wave gives you a triangle and integrating a triangle gives you a sine.

OK, I'm just going to declare today rs20-has-pedantic-hat-day: Triangle integrates to something vaguely sine-ish, but not a true sine wave -- only a (co)sine wave integrates to give a sine wave. However, it's true that as you keep on integrating over and over again, you get closer and closer to a sine wave as you attenuate those harmonics more and more: square --> triangle --> vaguely sine-ish string of parabolas --> even more sine-ish string of cubics --> (infinity* steps later) --> sine --> sine --> sine

* Where infinity is defined as anything greater than, oh, I dunno, seven.

Since I'm using the 1KHz 3V test signal I did try to make a triangle wave with Intg(CH1)-Intg(3-CH1) that gives me a triangle wave.

(https://www.eevblog.com/forum/blog/eevblog-662-how-why-to-use-integration-on-an-oscilloscope/?action=dlattach;attach=109204;image)

But if I integrate that I do not get a sine wave.

Further I did try Intg(Intg(Intg(CH1)-Intg(3-CH1))) and I get 2 quadrants of a sine wave on 16 square wave cycles then it does a parabola down to minus infinity.

Edit: here is what it shows:
(https://www.eevblog.com/forum/blog/eevblog-662-how-why-to-use-integration-on-an-oscilloscope/?action=dlattach;attach=109206;image)
I'm just wondering what should I input in the math function to actually get a sine wave from a square wave (not using the sine cosine and tangent operators of course).

Edit: If I differentiate the result with  Diff(Intg(CH1)-Intg(3-CH1)) I do get the square wave back as expected.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: bktemp on September 14, 2014, 07:47:40 am
Sorry but I don't get it. What is the advantage of using a scope to measure the avarage current consumption? Would it not be much easier and more accurate to simply add a low pass filter after the uCurrent and measure the avaraged voltage with a DMM?
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Bored@Work on September 14, 2014, 08:25:53 am
I used the mid range boost function in the camera, designed for speech. Was an experiment.
Sounds good to me.

There was a kind of "bump" in the sound quality in the middle of the video.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Dave on September 14, 2014, 10:47:06 am
Sorry but I don't get it. What is the advantage of using a scope to measure the avarage current consumption? Would it not be much easier and more accurate to simply add a low pass filter after the uCurrent and measure the avaraged voltage with a DMM?
You would need a really low frequency filter, therefore huge inductance, resistance and capacitance. Capacitor leakage would kill the accuracy.

It might not be a bad idea to use a low pass filter in combination with a fast multimeter. The filter would stretch the pulse enough for a meter like 34401A to sample it at 1000/s or so. Slap the acquired data into Matlab and presto.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: T3sl4co1l on September 14, 2014, 11:50:50 am
Sorry but I don't get it. What is the advantage of using a scope to measure the avarage current consumption? Would it not be much easier and more accurate to simply add a low pass filter after the uCurrent and measure the avaraged voltage with a DMM?
You would need a really low frequency filter, therefore huge inductance, resistance and capacitance. Capacitor leakage would kill the accuracy.

It might not be a bad idea to use a low pass filter in combination with a fast multimeter. The filter would stretch the pulse enough for a meter like 34401A to sample it at 1000/s or so. Slap the acquired data into Matlab and presto.

If you're only looking for DC, any standard integrating DMM will do (i.e., not the $3 cheapshit yellow box kind).

Even if your meter responds poorly to AC (sample-and-hold type), a moderate R and sufficiently large C (larger than might be used for line frequency filtering, but no need for sheer farads) will get the cutoff frequency down in the Hz where absolutely any measurement device will do the job.

If you want to know the peaks and pulse widths, you have little choice but to graph or sample it.  Measuring the peaks quantitatively is best done with an integral as shown here -- the widths, heights and shapes may be deformed, but the integral over that range must be consistent.  This is used in many physical analyses, such as MS, NMR, XRD, nuclear spectroscopy and so on.

Tim
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Tek_TDS220 on September 14, 2014, 12:21:02 pm
Strictly speaking, it doesn't make sense to say 'total power consumption'.  It should be 'total energy consumption'.  Proper energy units would be uWs.  Similarly, when you write 'total current' you probably mean 'integrated current'.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: dentaku on September 14, 2014, 02:55:54 pm
I can easily visualize why integrating a square wave gives you a triangle and integrating a triangle gives you a sine.

OK, I'm just going to declare today rs20-has-pedantic-hat-day: Triangle integrates to something vaguely sine-ish, but not a true sine wave -- only a (co)sine wave integrates to give a sine wave. However, it's true that as you keep on integrating over and over again, you get closer and closer to a sine wave as you attenuate those harmonics more and more: square --> triangle --> vaguely sine-ish string of parabolas --> even more sine-ish string of cubics --> (infinity* steps later) --> sine --> sine --> sine

* Where infinity is defined as anything greater than, oh, I dunno, seven.


That would be a funny looking hat :)

I guess you're right but I really don't know anything about this stuff anyway. It's just that this video finally helped me understand what is happening when I build an integrator with an opamp to modify different waveforms.
When making analog synthesizers, nothing's ever perfect and I guess that's why the analog synth geeks love them so much.

I did a little experiment in Excel so I could graph what I was imagining and it works.
I broke up a triangle into little squares under the curve then added them all up and drew a graph.

Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: HighVoltage on September 14, 2014, 06:01:46 pm
I am using the Integral function very often to measure discharge energy
Voltage input to Channel 1 [Voltage in kV]
Current input to Channel 2 [Current in mA]
Math function one: CH1  * CH2 [Power Watt]
Math function two:  INT (Power) [Energy in mJ]

Once you set the probe correctly, the Energy is shown correctly
in mJ on the oscilloscope measurement output.

This works well on the modern Agilent scope, but the old
FLUKE / Philips scope PM3394B did this already in real time
in the 1990's

Great Video, Thanks

Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: miguelvp on September 14, 2014, 06:14:21 pm
I did a little experiment in Excel so I could graph what I was imagining and it works.
I broke up a triangle into little squares under the curve then added them all up and drew a graph.

That is what is shows per cycle if I do a single integral, but the next cycle  goes on top of the other one.
What it's needed is an offset in the triangle wave so that it shows that at a 90 degree phase for half a cycle and then for the other half cycle starting at 270 degrees it produces the inverse.

But when I scaled the single integral of the triangle wave without offset it showed a secondary wave that surely will affect the process above, not sure why that happens yet.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: dentaku on September 15, 2014, 01:43:14 am
I did a little experiment in Excel so I could graph what I was imagining and it works.
I broke up a triangle into little squares under the curve then added them all up and drew a graph.

That is what is shows per cycle if I do a single integral, but the next cycle  goes on top of the other one.
What it's needed is an offset in the triangle wave so that it shows that at a 90 degree phase for half a cycle and then for the other half cycle starting at 270 degrees it produces the inverse.

But when I scaled the single integral of the triangle wave without offset it showed a secondary wave that surely will affect the process above, not sure why that happens yet.

I wish I knew more about he match behind it. I just did another of my crude Adobe Illustrator and Excel experiments with a full cycle and this is what came out of it.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: EEVblog on September 15, 2014, 03:53:49 am
Didn't expect the level of math nit-pickiness on my latest video, that was rather foolish of me  :palm:
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: fvdpol on September 15, 2014, 06:35:42 am
Thanks Dave for the (as usual) clear explanation.  :-+  Some time ago a found on the Jeelabs blog an interesting post where the power consumption of a board was analysed by type of operation. Great to see correlation between the code/logic executed, specific hardware operated and the power consumption. 

http://jeelabs.org/2011/12/30/anatomy-of-a-room-node-transmission/ (http://jeelabs.org/2011/12/30/anatomy-of-a-room-node-transmission/)

(http://jeelabs.org/wp-content/uploads/2011/12/annotated-room-packet1.png)
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: HighVoltage on September 15, 2014, 07:38:59 am
Didn't expect the level of math nit-pickiness on my latest video, that was rather foolish of me  :palm:
I guess, when you use the word "Integration" as a math term in your video description,
all the mathematicians are coming out for offering suggestions and corrections.
 
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: EEVblog on September 15, 2014, 11:35:32 am
I use Math functions as well, they are very useful too for quick easy measurements. They also help build reports as well. Either Baffle with Bullshit or hope someone else knows what is being displayed.

I'd sometimes put bullshit units into reports to see if anyone notices, like Furlongs per Fortnight  ;D
https://en.wikipedia.org/wiki/FFF_system
No one ever did!  :-DD
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: dentaku on September 15, 2014, 11:51:01 am
Didn't expect the level of math nit-pickiness on my latest video, that was rather foolish of me  :palm:

At least it was civilized math nit-pickiness.
I don't really understand the math but at least this video finally made me understand what integration is.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: EEVblog on September 15, 2014, 12:14:11 pm
I don't really understand the math but at least this video finally made me understand what integration is.

Well, there was hardly any math in this really, it was meant to be a video showing the concept of integration on a scope and a basic usage case for it. If that helped you, then successful video! :-+
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Circlotron on September 15, 2014, 01:33:30 pm
One of the first things I did with my scope is measure the milliJoules energy output of a number of different car ignition coils. The integration function is a perfect fit for this. Just clamp the high voltage side of the coil to 1700V max with a string of zeners (typical arcing voltage) and integrate volts x current. One really interesting result was after measuring the output of some boxes from a REALLY big name CDI manufacturer. They claim with regard to one particular box "100mJ spark energy" but that is only what their box pumps into the coil primary. Actual coil secondary output with one of their CDI-specific coils was only 38mJ, and with a more conventional coil it was as low as 25mJ. See pics for good conventional ignition output vs CDI under same test conditions.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: dentaku on September 15, 2014, 03:21:38 pm
I don't really understand the math but at least this video finally made me understand what integration is.

Well, there was hardly any math in this really, it was meant to be a video showing the concept of integration on a scope and a basic usage case for it. If that helped you, then successful video! :-+

By "the math" I mean the stuff other people have posted in the forums, your video actually showed it visually so that's how it helped. :-+
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: DrJoe on September 15, 2014, 06:50:19 pm
Why is the integral wave less than (below) the wave of the input?  If the integral and the pulse begin together, it would seem to me that the integral function would initially follow the pulse curve, then level out as the pulse ended, but it should always be greater than the input and continually rising since it is, after all, the integral of the input (assuming the input is always positive).

Was the integral's scale much, much greater? I can only guess that the scales were different or the integral function actually began before the impulse. Or I'm misunderstanding something...

Very interesting video, BTW. The colors and sound were fine on my computer.

Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: robrenz on September 15, 2014, 07:01:25 pm
The vertical scale of the integral is representing area under the curve. Even though the current pulse height is very high it is also very narrow yielding a small area.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: David Hess on September 16, 2014, 03:49:03 am
Does anyone know if the quantization noise distribution veers from the ideal for other types of ADCs?
Also, what kind of ADCs are typically found in oscilloscopes?

They used to use predominantly flash converters but now they use folding interpolating or pipeline converters and of course interleaving is common which will alter the characteristics and *that* may change depending on the number of active channels.

If you can fiddle with the interleaving, then the change in the distribution of the noise may be revealing.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: T3sl4co1l on September 16, 2014, 05:19:44 am
Why is the integral wave less than (below) the wave of the input?  If the integral and the pulse begin together, it would seem to me that the integral function would initially follow the pulse curve, then level out as the pulse ended, but it should always be greater than the input and continually rising since it is, after all, the integral of the input (assuming the input is always positive).

Integration is always "PLUS A CONSTANT", which for a proper integral (one which spans a defined width, such as what's shown on screen) is technically zero at the start.  It seems this scope adds an additional offset so it remains balanced visually; which is kind of handy, as most integrals veer off to infinity and starting at mid-screen means you only get to see half of anything.

As long as the horizontal axis is indicated, it's a visual effect only, the math is still correct.  (And anyway, measuring a difference with cursors subtracts the "PLUS A CONSTANT" so even if the offset were wrong, it disappears again in that measurement.)

Quote
Was the integral's scale much, much greater? I can only guess that the scales were different or the integral function actually began before the impulse. Or I'm misunderstanding something...

The scale is necessarily different, because the units are different.  They're always adjustable, which is definitely handy!

Tim
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: T3sl4co1l on September 16, 2014, 05:26:33 am
Oh, another wonderful use of integration:

Current sense probes.

If you do the old "scope probe grounded to clip" trick and wave that over a circuit, you're bound to see impulses and ringing.  The ground loop isn't very particular at that size, so what you can do is, wind a small coil (maybe 10-20 turns of fine wire) and fit it in the end of a 6mm brass tube, which has been slotted up one side.  Add a 50 ohm series termination resistor, and run coax up to the scope (with source termination, it's not necessary to terminate the scope end).  Now, the brass tube shields stray E and B fields from your probe, except the ones that are axial with the tip.  Wrap it with tape, and you can wave it around your circuit and sniff the currents flowing through components, traces, even individual vias!

But you're not actually measuring current.  You're measuring EMF.  Which is the derivative of current.  So, you can integrate it, and now instead of impulses, you have steps -- corresponding exactly to the current steps in your circuit!  Of course, it's not calibrated, but knowing the general proportions and how the signal varies with distance, you can get a feel for how much current is flowing in a circuit, and where.

Tim
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: rs20 on September 16, 2014, 06:23:30 am
If you do the old "scope probe grounded to clip" trick and wave that over a circuit, you're bound to see impulses and ringing.  The ground loop isn't very particular at that size, so what you can do is, wind a small coil (maybe 10-20 turns of fine wire) and fit it in the end of a 6mm brass tube, which has been slotted up one side.  Add a 50 ohm series termination resistor, and run coax up to the scope (with source termination, it's not necessary to terminate the scope end).  Now, the brass tube shields stray E and B fields from your probe, except the ones that are axial with the tip.  Wrap it with tape, and you can wave it around your circuit and sniff the currents flowing through components, traces, even individual vias!

Awesome idea! When you say slotted up one side, do you mean a cut all the way down one side so that the tube has a "C" cross section? Is the idea to prevent the tube from acting as its own shorted-out coil and producing its own cancelling EMF? How long would you normally make the tube?
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: T3sl4co1l on September 16, 2014, 09:27:31 am
Slotted lengthwise near the end, yes.  It doesn't have to be full length.  The closer the end of the slot is to the coil, the more it shields the coil in that direction, which makes it less sensitive, more directive, and pushes the pattern off center (imagine the tube were mitered, instead of slit, to the same depth).

More info: http://www.bcarsten.com/?page=appnote (http://www.bcarsten.com/?page=appnote)

Tim
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: fpliuzzi on September 16, 2014, 12:24:44 pm
Here's a nice closeup of the tiny coil in the tip of the EMI sniffer probe referred to by T3sl4co1l. This image was extracted from page 55 of AN70 by Linear Technology (Jim Williams). This closeup detail came in handy when I made my EMI sniffer probe a few years ago.

AN70... http://www.linear.com/docs/4159 (http://www.linear.com/docs/4159)
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: MarkL on September 16, 2014, 01:53:09 pm
Another great app note by Jim Williams - thanks!

Here's another clever use of integration on a scope, this time to measure output load capacitance:

  http://www.edn.com/design/test-and-measurement/4370468/Oscilloscope-math-functions-aid-circuit-analysis (http://www.edn.com/design/test-and-measurement/4370468/Oscilloscope-math-functions-aid-circuit-analysis)

This was done on a Tek DPO3034 which has generalized, software-driven math functions (like many Tek scopes).  This particular example can't be done on the Agilent MSOX because it needs a second computation after the integration, which isn't a supported combination on the MegaZoom ASIC.


It seems this scope adds an additional offset so it remains balanced visually; which is kind of handy, as most integrals veer off to infinity and starting at mid-screen means you only get to see half of anything.
(Referring to the Agilent MSOX...)  It does.  There's an adjustable constant that pops up on the Math menu when integration is selected.  Dave didn't show that or maybe he didn't have to do anything since the input offset was already close enough to zero.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: KedasProbe on September 16, 2014, 02:39:22 pm
Calculating Power Value in the selected time range.
http://blog.hameg.com/?p=1799#more-1799 (http://blog.hameg.com/?p=1799#more-1799)
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: SNGLinks on September 17, 2014, 11:47:03 am
Pity my Agilent DSO-X 2024A doesn't have integration. At least I can't find it in the Math functions.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: rs20 on September 17, 2014, 12:01:59 pm
Pity my Agilent DSO-X 2024A doesn't have integration. At least I can't find it in the Math functions.

That's surprising, but I've had a quick look through the manual for the series and I concur that it doesn't seem to be there. However, the average of a waveform is just its integral divided by its width on the screen. So if you position your signal of interest to be the only thing on the screen, then measure the full-screen-width average (page 176 of the manual (http://cp.literature.agilent.com/litweb/pdf/75015-97012.pdf)) and multiply it by the width of the screen, you'll get exactly the same result.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: SNGLinks on September 22, 2014, 09:11:18 am
Thanks for that info. I was surprised about the missing feature. It's all done in software so would be fairly cheap to implement. 
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Digital Corpus on September 25, 2014, 10:26:53 pm
I'm happy to see another video from you Dave. As I'm working on a measurement project for automotive use, I've needed to quantify some signals coming out of the cars electronics, specifically some old diesel fuel injection ones. In the some of the first commercial direct inject diesel applications, primitive monitoring of fuel injection is required for to maintain engine speed and operation. This was done on one fuel injector and the signal lets the engine control unit know what's going on (clicky if you want to ready more (http://"http://www.myturbodiesel.com/wiki/tdi-nozzle-upgrade-fuel-injector-faq/")). Well, no one outside of the manufacturers ever really hooked up an oscilloscope to see what this signal looked like, so I decided to.

(http://mobrienphotography.com/Misc-Pics/TDI-Pics/Lighting%20%26%20Electrical/Scope/900%20RPM%20Idle%20-%20Duration.png)

The cursors are setup at the beginning and end of injection and the voltage is a function of the movement of the needle. In order to figure out its physical location, an integral needs to be taken. I exported the on-screen data plot into a spreadsheet, I ran the integral manually to compensate for the DC offset also so I wouldn't just idle my car forever in a day.

(http://mobrienphotography.com/Misc-Pics/TDI-Pics/Lighting%20%26%20Electrical/Scope/Fuel-Injection.png)

I don't have applicable units, but knowing other parameters of the injector such as fuel pressure, opening pressures, closing pressures, nozzle orifice size, a pretty accurate estimate as to the amount of fuel injected is able to be calculated from this reading. The fuel is also used as a lubricant so there is more fuel that flow through the injector than what is actually injected as well.
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: Circlotron on September 27, 2014, 02:10:36 pm
clicky if you want to ready more
Link fixed -> http://www.myturbodiesel.com/wiki/tdi-nozzle-upgrade-fuel-injector-faq/ (http://www.myturbodiesel.com/wiki/tdi-nozzle-upgrade-fuel-injector-faq/)
Title: Re: EEVblog #662- How & Why to use Integration on an Oscilloscope
Post by: ichbinsnur on September 29, 2014, 04:48:21 pm
Hi Dave and all you others round here!

At first i must say a really gigantic thank you to Dave.

THIS BLOG AND YOUR VIDEOS ARE ABSOLUTELY AWSEOME! :-+

I just picked up this Video because i exactly want to do what was mentioned : measuring my µc power consumption.

I downloaded about 20 gig of your Videos to my Brain during the last week .... :o
(still a bit fuzzy from it) ;D

Inspired by the Scope videos i decided to get a new scope (Rigol MSO1074Z-S) for my lab. (should arrive this week 8) )

Unfortunately measuring the low currents of sleeping microcontrollers is almost impossible if you don't own one of Dave's brilliant µCurrent Devices.

And that's where i suffer now.

I can't order at the eevBlog Store cause i'm located in Germany, where Dave won't ship to.

Other source (Adafruit) is sold out.

Can anyone help me getting one of these? Maybe there are additional sources that ship to germany?

I want to support Dave for his great work, so i surely want the original thing!
(not one of the rebuilds, where i don't know how reliable the are also)

cheers Chris