Making accurate low frequency measurements with your scope - Page 1
Forum section: electronics / testgear

author: joeqsmith
author_rank: Super Contributor
timestamp: December 06, 2015, 04:51:16 pm
content: I was thinking about this after someone had posted a comment on my AC power measurement video.The LeCroy scopes have a fairly deep buffer and I was going to try and over sample the the crap out of the signal I want to measure and a precision reference to remove the drift (assuming the channels track).Not knowing anything about the ADCs they used in these, I was going to just try it and see how far I could push it.

author: tggzzz
author_rank: Super Contributor
timestamp: December 06, 2015, 05:26:34 pm
content: Accurate what? Voltage? Time? Noise? Statistics?Accurate in the sense of precision, or resolution, or repeatability?

author: joeqsmith
author_rank: Super Contributor
timestamp: December 06, 2015, 07:42:18 pm
content: All of the above!

author: tggzzz
author_rank: Super Contributor
timestamp: December 06, 2015, 08:19:41 pm
content: OK, to don't even have a wish list, nor even a requirement definition, let alone a specification.Come back when you have an answerable question

author: joeqsmith
author_rank: Super Contributor
timestamp: December 06, 2015, 08:35:50 pm
content: Did I ask a question? That is a question.

author: vk6zgo
author_rank: Super Contributor
timestamp: December 07, 2015, 01:30:31 am
content: What does your 'scope's sample rate reduce to when you are looking at one,or several cycles at 60Hz?Can you force your 'scope to use a higher sample rate?Wuerstchenhundis very knowledgeable on all things Lecroy--he can probably give you all the information you need on using one of their 'scopes to do what you want to do.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 07, 2015, 01:54:47 am
content: Quote from: vk6zgo on December 07, 2015, 01:30:31 amI plan to stay with the 64Xi and have control over the sample rate. The scope presents the data as 8-bits. I am not sure how they arrange them. For example, the old NSC ADC (now TI) would run 4 ADCs in a package to get the sample rate up. Non-linearity between the ADCs inside the chip are easily measurable. My old LeCroys used 4 ADCs that have adjustments to trim their offsets. Similar to the NSC parts but very old....After looking at the IEC 61000-3-2 standard, they look at 40 harmonics out. We use 60Hz, so 2400Hz on the high end. Just thinking, say to add six bits, that's 4096 * 4800ish or just under 20MHz.When I made that little demo, I was looking at 10 cycles to calculate the power. Well under 15 million data points (current, voltage and reference). I think the 64Xi has gigabit Ethernet but I have not tried to pull anything off it. It may be slow compared with the WM.Then I don't know what the ADC is doing. My plan was to just try some things out and see if I could improve the measurement.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 07, 2015, 03:47:23 am
content: Quote from: blueskull on December 07, 2015, 02:03:50 amAgree and I think if I wanted to make something people could replicate, this would be the way to go and forget the scope. The 64Xi does support their ERES mode.For this little exercise, I would like to use the scope with just the raw data. It's just for fun.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 08, 2015, 05:01:36 am
content: With the scope set to 10V/div, 80V full scale (313mV/count for 8-bit raw data), plot showing the DSO collecting 10.0V from my Fluke standard for about 20 minutes. The DSO had been running about 2 hours before I collected this data.I used 3X over the 2400Hz (40th harmonic) with 12-bits, or about 1.8MHz, and set it to 2. I have not tried to push it out another bit yet. 10MHz, for a half second seems very doable.The transfer rates are no problem with it. I am collecting about about a half second of data, or 30 cycles. This is the whole delay, waiting for the next half second.My plan was to use this to compensate for the drift.Anyway, looks like I could improve on my initial measurements somewhat.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 09, 2015, 03:33:09 am
content: If I use two channels set to the same gain with one input attenuated then watch the gain and offset drift, appears most of the drift is offset. Really don't care about the DC drift for this 60Hzish stuff, so plan to just calibrate it and call it good. Attempting to stay with the 7200ish Hz, and going to 5 bits with the same 30 cycles brings things to a crawl. Need to get a good programmable source on it next.

author: tggzzz
author_rank: Super Contributor
timestamp: December 09, 2015, 07:43:47 am
content: Simple way to measure frequency offset is to apply an accurate 60Hz to one axis, the unknown frequency to the other axis, and time how long it takes for the lissajous pattern to return to its original shape.

author: SL4P
author_rank: Super Contributor
timestamp: December 09, 2015, 08:13:47 am
content: Just my 2c worth, and I say this as I have never had to work with very low frequencies...There is probably an arbitrary threshold where 'frequency' becomes less relevant - in favour of 'wavelength' (period) as a more meaningful meaasure...Anything with too low a frequency will create problems to accurtely identify the sampling points - so a 'best guess' of the peak-to-peak sample points will besomewhatmore meaningful. ??If you really need to know the 'frequency', then do the math from the period - being aware that the precision to the right of the decimal is going to be pretty loose compared to higher frequencies / shorter wavelengths with clearly defined / sharp peaks.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 10, 2015, 12:48:22 pm
content: The DSO's sample clock is more than stable enough to determine the fundamental. The FFT is ran on the oversampled/decimate data w/ Hanning. Next time I have it running, I'll pull some data. Next thing is to setup a precision source to the ADC.

author: vk6zgo
author_rank: Super Contributor
timestamp: December 11, 2015, 01:18:28 am
content: Quote from: SL4P on December 09, 2015, 08:13:47 amPeriod(1/f)is not synonymous with wavelength.Wavelength is the distance in metres which an electromagnetic wave will travel inone second,in free space (strictly speaking,in a vacuum,but air is near as dammit) between a reference point on one cycle of the waveform & the same point on the following cycle (zero crossings,for instance).This isc/fwherecis the speed of light (approx 300,000,000 metres/s)Just as an example,the wavelength of the US 60Hz Mains is approx 16.667km.

author: rch
author_rank: Regular Contributor
timestamp: December 11, 2015, 02:05:47 am
content: I think you mean distance travelled in 1/f seconds. And while the same point in the cycle is reached simultaneously at both ends of the wavelength it is only easy to measure this with a standing wave of some sort (but that a bit of an old-fashioned method).

author: seabell
author_rank: Contributor
timestamp: December 11, 2015, 02:27:54 am
content: Quote from: vk6zgo on December 11, 2015, 01:18:28 amMight want to double-check your maths there, vk6zgoNot trying to be obnoxious, as I'm learning a lot from you guys here, but even a relative simpleton like me can see that's not right. Isn't it almost 5000km?

author: joeqsmith
author_rank: Super Contributor
timestamp: December 11, 2015, 02:49:53 am
content: Frequency plot of the fundamental using the 64Xi after a 2 hour warmup with no changes to the sampling (2MHz, accumulated, decimated, fft windowed......).Also was able to get a good source hooked to the thing tonight and collected a few hours of data to nail down the gain/offset drift.

author: vk6zgo
author_rank: Super Contributor
timestamp: December 11, 2015, 03:16:49 am
content: Quote from: seabell on December 11, 2015, 02:27:54 amOf course,you are right-----that's what comes of miskeying a calculator & not checking the results.

author: vk6zgo
author_rank: Super Contributor
timestamp: December 11, 2015, 03:31:05 am
content: Quote from: rch on December 11, 2015, 02:05:47 amI haven't exactly covered myself with glory,have I?Some times it doesn't pay to be a smart-a*se.Yes,it is the distance travelled in the period.The theoretical construct seems to be of an observer at a point in space watching the signal pass by,but yes,the classic method would be to look at it with a standing wave,using Lecher lines or similar.Measuring frequency (or period) is a lot easier,these days.

author: rch
author_rank: Regular Contributor
timestamp: December 11, 2015, 11:12:16 am
content: It's easy to writes something straightforward down wrong if one isn't concentrating! i only made the correction in case any newcomers were mystified.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 11, 2015, 11:16:45 pm
content: Looked at the data I collected from the 64Xi last night. Basically using three voltage levels to look at the gain and offset for two channels. It's really stable once it's warmed up. This is the second test I have ran now looking at the drift. Next I need to look at the linearity of the ADC. A little more Labview code to get this setup.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 12, 2015, 02:28:55 am
content: I added the control for the precision DAC to the program to allow it to step.Picture shown is with 64Xi set to 2V/division scale. Normally, 8 divisions or 16V/2^8 or 62.5mV / count. Shown using 256 X oversample and decimation. Or 16/4096 or 4mV/count. The DSO was not warmed up yet, notice the offset after autocal.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 12, 2015, 02:31:11 am
content: Same data but with the Labview plot zoomed in to 5mV/division.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 12, 2015, 03:08:00 am
content: Current (red) trace set to 1V/division. Voltage (white) trace set to 2V/division. Both channels in parallel, 256X oversample. Note that it appears that the red trace begins to go nonlinear about a volt below saturation.Looks good. I'll run a fit on it.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 15, 2015, 12:45:35 am
content: Least squares fit. INL looks pretty bad.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 15, 2015, 12:51:49 am
content: Need to see if it really is the INL or something else. If it is, I plan to model it with a polynomial.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 15, 2015, 04:47:56 am
content: Looks repeatable. I ran 3 sweeps on each channel. Shown is INL in counts for channel 0 in counts (again, after oversample).

author: joeqsmith
author_rank: Super Contributor
timestamp: December 15, 2015, 04:52:21 am
content: Notice how that graph looked very similar to the single sweep I had made the other day....Showing INL for channel 1.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 16, 2015, 12:35:10 am
content: Imagine trying to fit that stupid INL curve... Table lookup. Green, least squares. White is raw (after 256X oversample). Red is compensated.Some hope .... almost.....

author: joeqsmith
author_rank: Super Contributor
timestamp: December 16, 2015, 12:39:17 am
content: Shown is INL before (green) and after (red) compensation. Raw INL was filtered with IIR (0-phase) using Butterworth to create the lookup table. Starts out really good, then all hell breaks loose. Suspect better filter could remove some of it but really, there are bigger problems with it...

author: joeqsmith
author_rank: Super Contributor
timestamp: December 16, 2015, 12:45:05 am
content: And here is the money shot. It would be very interesting to know more about the design of this DSO. That's not the input signal doing that. Why DNL goes in the crapper at a volt, no idea. Good question for LeCroy designers.So, in the end, there are gains to be had. This will help out in my power measurement program but if you want good data, don't use a scope...Hope it was helpful.