Jump to content
  • 0

AD3 scope feature reduction in signal height? pydwf. Switched voltage range?


torbos

Question

@attila@reddish

 

I tried to use record mode with AD3. I use pydwf because of its good documentation.

I sent in a sine wave from W1 that further was digitized on 1+. The sine wave is also monitored with an external scope where I see no irregularity on the sine wave. See configuration attached in snippet.
The snippet also show how I try to loop and collect available samples from statusRecord().
Despite 1+ being configured with a 5 V range, it seems that it switches over to 50V range during the loop? See image.

How do you recommend me to go about this issue? I wish to record minimum 1 MSample, but preferably more, and with NO skip, it must really sample on External1.

Thanks for your help in advance, the forum helps a lot!

Edit: I should mention that first time I run the code after resetting everything it works as expected!! The problem shown below is only present from the second sample run and all consecutive sample runs. I checked the range with channelRangeGet, and its still 5V after...

 

Kind regards

question.py

image.png

Edited by torbos
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @torbos

With the information given, the only hypothesis I can think of from the top of my head is that the sine we're seeing is in fact an alias, and that the jump is in fact a phase jump in the external trigger. But that's pretty far-fetched, I shall admit.

To debug this, what I would do first is to get record mode to work without an external sampling source; just set a reasonable sampling frequency, and see if everything looks normal if you do that. If not, you first need to figure that out. If yes, we know that the problem is somehow related to the external sample clock, which is a usage mode that is much less common than sampling on an internally generated clock, so bugs may lurk there (either in the hardware, th DWF library, or pydwf). Can you try that?

As a sidenote: that "chain.from_iterable(samples)" is pretty gruelling in terms of performance. You may want to use numpy.concatenate() instead.

Link to comment
Share on other sites

  • 0

@reddish Thanks for your quick reply. I tried using frequencySet(8e6) instead of sampling on the external trigger. The problem is still there.

Great that you mentioned np.concatenate, I will use it.

Interestingly, as I mentioned, the problem is not present the first time after resetting (see figure, yes, some feature in the start immediately after the trigger, but I can accept this). After running the function again (buttom click in pyqt window), I get the smaller amplitude as show. For this reason, I reckon the problem could arise in the scripts... Let me know if you have any other debug ideas!

Thanks

image.png

Link to comment
Share on other sites

  • 0

Hi @torbos

Could this be related to the AD3's Scope channel low/high range relay toggle ?
Most of the WF SDK examples mention using a settle delay after adjusting the offset/range or opening the device, for example:
dwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(0)) # configure
time.sleep(1.0) # wait
dwf.FDwfAnalogInConfigure(hdwf, c_int(0), c_int(1)) # start

For the relays about 50ms delay is needed.

AD3 high to low range ~20ms :

image.png

 

AD3 low to high range ~50ms :

image.png

 

AD3 offset settle ~5ms :

image.png

 

AD2 offset settle ~600ms :

image.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...