Jump to content
  • 0

Analog Discovery 3 Waveform Sync


diligent1

Question

Hello Digilent Forum!

We are experimenting with the Analog Discovery 3 board and trying to get multiple waveforms locked and synchronized together from a sync pulse however we are having jittering between the output pulses.

They look to be sequential?

Do you have any pointers/ common mistakes people make whilst doing this?

Many thanks!

 

waveforms1.jpg

waveforms2.jpg

Edited by diligent1
Link to comment
Share on other sites

Recommended Posts

  • 0
On 11/16/2023 at 1:41 PM, attila said:

Hi @diligent1

Yes, see the WF SDK manual and Python examples.

image.png

Hi @attila, thanks for this info. We have been using the SDK to sync all channels of all devices. We are struggling to find an example which shows how to do both of these things.

Could you point me in the direction of a good strategy? We are looking to output 5 waveforms from 3 devices. Want to to output 3ms pulses and loop through to change the amplitude of 1 of them for 256 iterations from 1 to -1. 

Many thanks!

Link to comment
Share on other sites

  • 0

Hi @diligent1

See the following: AnalogOut_Devices.pydwfconstants.py
Connect trigger IOs between devices for reference clock (supported by AD3, ADP2230, ADP3X50...) and trigger synchronization. First channel of first device will perform AM 256 steps. You change the device names to have an order or modify the (auto) connection. Run once if you want...

image.png

image.png

Link to comment
Share on other sites

  • 0
1 hour ago, attila said:

Hi @diligent1

See the following: AnalogOut_Devices.pydwfconstants.py
Connect trigger IOs between devices for reference clock (supported by AD3, ADP2230, ADP3X50...) and trigger synchronization. First channel of first device will perform AM 256 steps. You change the device names to have an order or modify the (auto) connection. Run once if you want...

image.png

image.png

@attila This is amazing. Thank you so much! The only things are now that we need a custom function on each of these channels (including the scaled one and each of the functions is different). We have the functions in our python already. And we just want 1 pulse of each - not a continuous stream of pulses.

This is excellent. I really appreciate your help!

Link to comment
Share on other sites

  • 0

@attila, I've been struggling working out how to output just one pulse of each waveform. There seems to be multiple pulses for each waveform. Is this an issue with my custom waveform? Do I need to fill the entire 32k buffer with the waveform otherwise it will repeat? How would I do this Or should I change the frequency somewhere?

Many thanks

Link to comment
Share on other sites

  • 0
6 minutes ago, attila said:

Hi @diligent1

Use FDwfAnalogOutRunSet and FDwfAnalogOutRepeatSet if you want to run for limited time

image.png

Thanks @attila. I already managed to do this to make it output just 1 pulse each by modifying your code - however when you just set it to run 1/hzfreq - the loop for the amplitude modulated pulse doesn't happen. You just get one pulse at the initial amplitude. I hope this makes sense!

Link to comment
Share on other sites

  • 0

Hi @attila. Essentially -  I want to put out one pulse which changes amplitude over time betwen 1 and -1. In the example you kindly provided I have managed to get this working great however there are multiple pulses in a pulse train which all change in amplitude between 1 and -1. If I change the run time to 1/hzfreq - I just get 1 pulse which doesn't change in amplitude and if I change the burst length to 2*256/hzfreq then I get lots of pulses doing the same thing. We need a single pulse which varies over time.

I hope this clarifies things. Very grateful for all of your help.

 

Link to comment
Share on other sites

  • 0

Do I understand correctly that you want for each software call to generate only one pulse on 5 channels synchronized ?
So the sequence of pulses does not need to have precise timing, just the phase between the channels ?

Link to comment
Share on other sites

  • 0
On 6/27/2024 at 12:39 PM, attila said:

Do I understand correctly that you want for each software call to generate only one pulse on 5 channels synchronized ?
So the sequence of pulses does not need to have precise timing, just the phase between the channels ?

So - we want to output 1 (3ms) pulse for 5 channels. This is repeated for a number of instances every 50ms or so over 256 samples. Each time the sample number is changes, we need one of the pulse to scale from 1 to - 1 over this over the 256 pulses. (1, 0.992187, 0.984375, ..., -1).

Simultaneously, we also need to collect the data synchronously from the inputs from the devices. So we need timing between the pulses and the channels and the inputs and outputs.

I hope this makes more sense and is possible.

Kind regards and thank you

Link to comment
Share on other sites

  • 0
On 7/9/2024 at 12:22 PM, attila said:

Hi @diligent1

Could you sketch the signals ?

Hi Attila,

So - the waveforms are outputting and scaling properly. The issue I have is - with the custom waveforms I cannot change the time between each of the pulses. They are regular with the frequency. With the pulse output - I can change the duty cycle/ symmetry to change the ratio of on/ off however if I change the frequency of the customfunc, it changes the length of the pulse as well as the time between pulses. I need the length of the pulse to remain the same independent of the time between pulses.

Link to comment
Share on other sites

  • 0
1 hour ago, attila said:

Hi @diligent1

Use wait-run-repeat

image.png

image.png

image.png

Thanks @attila, I was literally just thinking of this. The concern I have is - if we run 1 pulse in a sequence which has a changing amplitude, then wait, then repeat this with another pulse in the sequence - will this repeat the first pulse again, or move onto the next pulse with different amplitude? 

 

Thanks always 

Link to comment
Share on other sites

  • 0
On 7/12/2024 at 11:07 AM, diligent1 said:

Thanks @attila, I was literally just thinking of this. The concern I have is - if we run 1 pulse in a sequence which has a changing amplitude, then wait, then repeat this with another pulse in the sequence - will this repeat the first pulse again, or move onto the next pulse with different amplitude? 

 

Thanks always 

Hi @attila I just got round to checking this and although I have the waits working nicely, the amplitude will never change because it is outputting only the first pulse with maximum amplitude. I'm struggling to think of a way to do the wait/run/repeat alongside amplitude modulation in the waveforms program, too.

 

Any ideas?

 

Thanks!

Link to comment
Share on other sites

  • 0

This post is getting long and I've forgotten that you need different amplitudes for each cycle... wait/run/repeat can only generate identical waveforms.
It would be great if you could provide a sketch, drawing... to better understand what you want to generate.

Link to comment
Share on other sites

  • 0
30 minutes ago, attila said:

This post is getting long and I've forgotten that you need different amplitudes for each cycle... wait/run/repeat can only generate identical waveforms.
It would be great if you could provide a sketch, drawing... to better understand what you want to generate.

Hi @attila. Please find attached

diagram.jpg

Link to comment
Share on other sites

  • 0

Hi, @attila. This is fine, however I need to be able to change the time between the pulses. Maintain the pulse width but change the off time. This could be done with changing the symmetry for a pulse wave but not for my custom function. I think I may need to just change the custom function and frequency accordingly?

 

Link to comment
Share on other sites

  • 0

Hi @diligent1

You could use custom waveform, like [1,0,1,0,0,1,0,0,1,...] set the frequency to 1kHz/steps which will generate [Amplitude+Offset for 1ms, O for 2ms, A+O for 1ms, O for 3ms...]
Or if you want finer delay between pulses [1,1,0,0,0,1,1,....] freq to 2kHz/steps [A+O 1ms, O 1.5ms,...] make sure the number of steps does not exceed the AWG device buffer size, 16k with first and 32k with 3rd configuration. Use funcCustomPattern for fixed sample period, funcCustom is for more precise waveform frequency.

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...