Author Topic: Using a AWG and a Scope -> using stairs to get to 1 mV accuracy  (Read 31948 times)

0 Members and 1 Guest are viewing this topic.

Online tautech

  • Super Contributor
  • ***
  • Posts: 28136
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Using a AWG and a Scope -> sidetrack... Averaging 1891 frames by script
« Reply #50 on: April 18, 2019, 03:07:08 pm »
BTW, when using an external trigger source into one of the channels you can if you wish hide that channel.
The channel tab will still remain and show H. You can select Visible or Hidden on P2 in the channel menu.
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> sidetrack... Averaging 1891 frames by script
« Reply #51 on: April 19, 2019, 10:36:21 am »
So from the  70K x 378 samples I get, I discard 94 of the highest values and 94 of the lowest ones ending up with 190 for each of the 70K samples.

These 190 are normally averaged to a single "high resolution" value. Then the 70K high resolution samples are grouped and averaged: the circles.

These are the values used for the voltage based curves.

Taking this road even brings out the adc steps of the scope to light. But now much more stable than using a single frame.

Because of this I'm quite sure that the spikes (in the output B) are really there (ringing?). They turn up in every graph.

So I made the AWG output, which feeds the dividers less then 20 cm of coax, but it remains.

The question is whether the probe is causing this? Also the knee of the curve became a bit wobbly..., adc steps I guess.
« Last Edit: April 20, 2019, 11:49:56 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> sidetrack... Averaging 1891 frames by script
« Reply #52 on: April 19, 2019, 10:42:00 am »
Also I mentioned the animation of the 378 frames was rock solid, that is true regarding the triggering. But the traces seem to have "a wave" on them, which is probably noise. But maybe someone knows a technique to bring that down?
« Last Edit: April 19, 2019, 10:57:32 am by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> sidetrack... Averaging 1891 frames by script
« Reply #53 on: April 19, 2019, 11:14:51 am »
The technique I used to discard the lowest and the highest values was the following. (Because 70K x 378 values need to be sorted this better be a quick  and memory efficient algorithm  :-+)

When the 378 values are added, they are divided in value bands of 32 values each. (Value div 32)  Because they are close to each other, most likely only 1 or 2 bands will be used.

In each band the separate values (value mod 32) are counted. (3x3, 2x7, 1x8, 13x17 etc.)

When doing the summing one loops through the bands (starting with the lowest) and the 32 counters in each. This is in sorted order, so the unwanted values can easily be discarded.

The fun part of this, is that thousands (64K) of samples could be summed, without any extra memory needed (or any dramatic loss in speed). And millions if the counters where made bigger.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #54 on: April 19, 2019, 08:49:30 pm »
In my graphs there seem reoccurring glitches (value going down for a few samples and the up again) around certain Y-values. This can be show by taking time based averages and showing the slope between them. At each larger peak there's probably a glitch.

I've tried different frequencies/probes/channels and calibrating. But the problem remains. I think the ADC or “firmware logic” has something to do with it.

The values in the graph are translated values I get from the scope (VOffset + VFactor * RawValue). Around the RawValue of 0 (-> 400mV), there's always such a glitch. However it seem to repeating at other values as well.

Can someone give a clue about what is happening and whether it is improvable?
« Last Edit: April 19, 2019, 09:52:19 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #55 on: April 19, 2019, 08:56:11 pm »
I created a normal size image with only the glitches at 400 mV.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #56 on: April 19, 2019, 09:01:45 pm »
When I look at the above one thing strikes me, it seems that the value drops, but it never really jumps back. Like the whole positive (RawValue > 0) side should be lifted 1 step.
In the slope graph this can also be seen. A spike going down, doesn't have a spike going up. (The average slope is not restored)
« Last Edit: April 19, 2019, 09:06:58 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline genghisnico13

  • Regular Contributor
  • *
  • Posts: 56
  • Country: cl
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #57 on: April 20, 2019, 02:51:49 pm »
I don't know much about the subject, but have you tried adding white noise to your input signal with the generator?
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #58 on: April 20, 2019, 02:53:51 pm »
When I look at the above one thing strikes me, it seems that the value drops, but it never really jumps back. Like the whole positive (RawValue > 0) side should be lifted 1 step.
In the slope graph this can also be seen. A spike going down, doesn't have a spike going up. (The average slope is not restored)
In this thread this problem is discussed, which lead to the cause.
https://www.eevblog.com/forum/testgear/siglent-sds1204x-e-released-for-domestic-markets-in-china/msg2355744/#msg2355744

The documented way to translate raw sample values seems not to be correct. That's why every value below the center point is 1 step to high. When values get close to the centerpoint this results in a noticeable glitch.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #59 on: April 20, 2019, 03:02:15 pm »
I don't know much about the subject, but have you tried adding white noise to your input signal with the generator?
Via the UI I cannot add white noise, but maybe there's a SCPI way, I have to figure that out. But first I like to know the cause of the smaller glitches. I'm pretty confident that they are analogue issues (besides the centerpoint crossing error). But I may have to leave these issues it for a while: holidays are coming.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: us
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #60 on: April 20, 2019, 04:44:56 pm »
In my graphs there seem reoccurring glitches (value going down for a few samples and the up again) around certain Y-values. This can be show by taking time based averages and showing the slope between them. At each larger peak there's probably a glitch.

I've tried different frequencies/probes/channels and calibrating. But the problem remains. I think the ADC or “firmware logic” has something to do with it.

The values in the graph are translated values I get from the scope (VOffset + VFactor * RawValue). Around the RawValue of 0 (-> 400mV), there's always such a glitch. However it seem to repeating at other values as well.

Can someone give a clue about what is happening and whether it is improvable?

If I have your setup, I would offer to try and replicate what ever test you are trying to run.  Because you are plotting the change in slope the sampling time is critical.  We know you were missing a lot of data early on.  To run this test, the sampling will need to be solid.  No missing data.  The trigger jigger will need to be VERY small.  on and on....   Once you have all the small details ironed out, it should be flat.  There should be no need to disguard data.   

I was attempting to use the scope to measure phase errors.  To get around problems like the trigger, I just let the scope record a large amount of data and realign it in software. 
https://youtu.be/Bg45FuoeHZk?list=PLZSS2ajxhiQA9yWh-hvVtv2ib-3ObOHGV&t=766

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #61 on: April 20, 2019, 05:27:00 pm »

We know you were missing a lot of data early on.  To run this test, the sampling will need to be solid.  No missing data.  The trigger jigger will need to be VERY small.  on and on....   Once you have all the small details ironed out, it should be flat.  There should be no need to disguard data.
Hi, thanks for the response.
I think the triggering is OK now, using the sync pulse of 5 ns rise time at a cycle of ms, should do the trick.
Also because I have 2 simple ramps, I don’t think the timing can create the glitches I’m still seeing (1 I tackled).

Making the averaging more advanced, did not make it better. I’m seeing more of the true measurements now, thus the adc’s discrete values. But it is also an indication that the glitches are not single high spikes that where averaged down. They are in the signal of all the frames and go up and down with the AWG offset.

I’m not sure about what you mean by missing data. I turned away from scope averaging to do it in a script myself. So I know I get 378 frames of data.

My setup is way more simple (and slower) than yours. But still I seem to get some ringing. I purposely choose a ramp which was symmetrical and thus not having large change in voltages/currents.

Even in the most simple setup of having the AWG directly connected to the scope, they turn up.

Maybe I should suspect the AWG of acting strange. I could “zoom” on a glitch and see how that looks like.

If it’s in the signal than it will show up enlarged. Maybe showing dac issues.
« Last Edit: April 20, 2019, 05:35:14 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: us
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #62 on: April 20, 2019, 06:02:51 pm »
I was thinking you are plotting the slope of the change in values, not the values.  If I understand what you are doing (which is a pure guess on my part) then the time the data is sampled will have a dramatic effect on the amplitude, and hence the slope.   So timing is critical as well as the amplitude.   

Say you do something similar to what I show where I plot the time between samples.  Then fire up DOOM (or what ever games are now popular).   :-DD   Does everything remain stable?   In  my case, Windows gets in the way of doing anything time critical.   This is why I let the scope capture lots of data and then I offload and process it.   

In your case, you may be able to run it at DC.  Step the Arb, let it settle, trigger the scope to grab a frame, download and average it and step the DAC.  Remove time from the setup.  Again, I am not really following along with what you are attempting to do and may be way off base in my suggestions.

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #64 on: April 20, 2019, 06:39:18 pm »
I was thinking you are plotting the slope of the change in values, not the values.  If I understand what you are doing (which is a pure guess on my part) then the time the data is sampled will have a dramatic effect on the amplitude, and hence the slope.   So timing is critical as well as the amplitude.
In case of a simple ramp/slow signal a change in time would mean it only goes up/down a bit, it would probably average the slope, but not have the reactive stuff I've got now (I guess).

I think I might have found a problem with the AWG signal.
« Last Edit: April 20, 2019, 08:22:48 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #65 on: April 20, 2019, 08:47:18 pm »
In your case, you may be able to run it at DC.  Step the Arb, let it settle, trigger the scope to grab a frame, download and average it and step the DAC.  Remove time from the setup.  Again, I am not really following along with what you are attempting to do and may be way off base in my suggestions.
In my case 378 frames are held in the deep memory (i think its called like that). They’re placed there in succession and the acquisition is stopped after the last frame is acquired (the scope does this). After that the script has all the time in the world to download the data. So no real time issues.

Also in windows applications (processes or threads) can be run at high priority. Time critical software should use those possibilities. A multi core PC should be able to run a task almost real-time without any disturbances. (Not doing HDD stuff)
« Last Edit: April 20, 2019, 08:57:43 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: us
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #66 on: April 20, 2019, 09:03:53 pm »
I was thinking you are plotting the slope of the change in values, not the values.  If I understand what you are doing (which is a pure guess on my part) then the time the data is sampled will have a dramatic effect on the amplitude, and hence the slope.   So timing is critical as well as the amplitude.
In case of a simple ramp/slow signal a change in time would mean it only goes up/down a bit, it would probably average the slope, but not have the reactive stuff I've got now (I guess).

I think I might have found a problem with the AWG signal.
That would depend.  If the DSO is set to say 1mV / count.  Say the Arb slews at 1mV/ms.    Say the sample rate is 1KHz +/- 10ms.  That's +/-10 counts.  I'm not there and have no idea what your setup is.  This is why I was suggesting you run the system synchronously to remove these potential problems. 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #67 on: April 20, 2019, 09:20:44 pm »
I was thinking you are plotting the slope of the change in values, not the values.  If I understand what you are doing (which is a pure guess on my part) then the time the data is sampled will have a dramatic effect on the amplitude, and hence the slope.   So timing is critical as well as the amplitude.
In case of a simple ramp/slow signal a change in time would mean it only goes up/down a bit, it would probably average the slope, but not have the reactive stuff I've got now (I guess).

I think I might have found a problem with the AWG signal.
That would depend.  If the DSO is set to say 1mV / count.  Say the Arb slews at 1mV/ms.    Say the sample rate is 1KHz +/- 10ms.  That's +/-10 counts.  I'm not there and have no idea what your setup is.  This is why I was suggesting you run the system synchronously to remove these potential problems.
But almost the whole trace get the 10 counts, so the slope is not really affected, the absolute values are, but also not that much. Having a simple ramp has it benefits. That’s probably the reason I could not accept the roughness of my slopes.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: us
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #68 on: April 20, 2019, 09:37:53 pm »
Again, hard to say without understand more about what you are doing.  Obviously with the example I provided, it could be off a fair amount.   If your trigger is not stable or Windows is still missing data.... I could see this level of error in the sampling depending how you are collecting the data.   

With you looking at the slope and not the raw averaged data, it could compound the problem.  I would start splitting up the problem until you understand where the causes of error come from. 

If your scope has a deep enough buffer to capture say 100 cycles of your triangle wave.  You could download that and then split and realign the data in software.  Then run your accumulation and division.  Basically the time error becomes the scope and arbs clocks.  You may be able to sync the two to minimize this error as well.  I am doing that using the GPS as a clock reference. 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #69 on: April 20, 2019, 09:53:10 pm »
If your scope has a deep enough buffer to capture say 100 cycles of your triangle wave.  You could download that and then split and realign the data in software.  Then run your accumulation and division. 
What you say here is good advice, and is exactly what the scope is doing for me. And the 2,3,4..378th trigger keeps the alignment intact. They call it segmenting mode resulting in frames. Otherwise it would be a great technique to apply by “hand”.
« Last Edit: April 20, 2019, 09:55:36 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: us
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #70 on: April 20, 2019, 10:20:53 pm »
If the scope is requiring more than one trigger, it's not what I am suggesting.   Let the Arb free run and the same for the scope.  One trigger to start the collection and just let it fill the scopes entire memory.   Maybe it can't work that way with your scope.  This will remove any trigger error, except what your alignment algorithm introduces. 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #71 on: April 20, 2019, 10:39:07 pm »
If there’s any need the resulting frames, can also be aligned by hand  :popcorn:

But the trigger accuracy is in my setup more than enough.

My setup is as far as I can see now pretty solid, but I’ve got an AWG that doesn’t create a good ramp.

Maybe iv’ve got to upload the ramp as an arbitrary wave. Never done that before and maybe the same glitch will arise.
However my data is good enough for the range I’m interested in. I could calculate directly with the slopes between (time averaged) points, or I could do a function fit between the point and use a derivative of it.

But what this exercise is about is learning, growing skills and getting some experience in this stuff. So I’m still glad the (single) ramp is a bit forgiving for all sorts of errors. But things that need improving, I’ll improve.
« Last Edit: April 20, 2019, 10:41:15 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: us
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #72 on: April 20, 2019, 10:45:09 pm »
My setup is as far as I can see now pretty solid, but I’ve got an AWG that doesn’t create a good ramp.

It's odd to me that your Arb wouldn't far exceed the scopes performance (noise, resolution).   I assume you have it terminated at 50 ohms.  What sort of Arb are you using?

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #73 on: April 20, 2019, 11:04:04 pm »
The Awg seems to have this repeatable glitch.
It is discussed by me at:
https://www.eevblog.com/forum/testgear/siglent-sds1204x-e-released-for-domestic-markets-in-china/msg2356566/#msg2356566

But it is not the first struggle I had with it:
https://www.eevblog.com/forum/testgear/sds1104x-e-and-sag1021-unwanted-dc-offset/

For the slow signals I did not terminate it with 50 ohms. Also in my original test setup is feeds a resistor/diode divider.

I’m quite sure it is not ringing or anything analogue. But maybe you’ve got an idea?
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: us
Re: Using a AWG and a Scope -> ADC inaccuracy?
« Reply #74 on: April 21, 2019, 12:42:44 am »
The Awg seems to have this repeatable glitch.

I don't know what I am looking at.  It's a graph with some data.   If I knew for example that this is the Arb connected to your DSO showing a ramp and it's just raw data and your point is that the signal increased, then yes there is a major problem.   

If indeed this is what you are trying to show, single step the Arb's amplitude while watching the output with a DVM and make sure that it is linear.  I again expect the scope can't resolve it.  If the Arb is linear, start looking at your setup or code.   

Again, just split the problem.  Don't assume it's the Arb. Prove it. 

****

I tried to look up the SAG1021 on Amazon and eBay but didn't turn anything up.  I found that part number on Siglent's site and am guessing this is the Arb you are using.   If it is, will it work standalone off a PC with Windows?  Labview interface?   

http://www.siglent.com/ENs/prodcut-fj.aspx?id=-1&tid=1&T=1
 
« Last Edit: April 21, 2019, 12:57:52 am by joeqsmith »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf