Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behaviour of AD2 Oscilloscope, Displaying Incorrect Values After Multiple Waveform Loops #7

Open
JUNAID-TARIQ1991 opened this issue Oct 30, 2024 · 1 comment

Comments

@JUNAID-TARIQ1991
Copy link

Hello dwfpy author,

I'm working with the Analog Discovery 2 (AD2) to produce a sequence of waveforms as part of a control loop. Here’s a summary of the setup:
I’m generating a pulse waveform with an amplitude of -1V and a time period of 200 μs, followed immediately by a triangular waveform with an amplitude of 0.1V.
These two waveforms are generated in a loop, alternating between the pulse and triangular waveforms continuously.
After several loop iterations, I observe that the oscilloscope begins displaying incorrect or ‘stuck’ values that don’t reflect the actual output. This issue seems to resolve temporarily after performing a hard reset on the device, but it reoccurs after additional loop cycles.
Questions:
Do I need to explicitly reset the wavegen and oscilloscope buffer after each loop iteration to prevent this issue?
Should I perform a full device reset (on the AD2) at the beginning of each loop or only once at startup?
Any insights into handling this issue or recommendations for stable operation in this scenario would be appreciated.
Thank you!

@mariusgreuel
Copy link
Owner

If you generate the waveforms using two setup calls and a loop, I suspect you have a USB buffering issue. Not sure what the WaveForms API does when you continuously send it commands to generate waveforms, for instance, you may hit some USB limit. Also, Windows/Linux is not a real-time OS - if you setup command arrives late (which is to be expected) your setup is going to break.

If you need a continuous stream of these two waveforms, I guess its better to use a custom waveform containing the two waveforms and set up the AD2 once (i.e. with a single setup call).

You may get a better answer in the WaveForms forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants