DDS Continuity and AC Coupling

Post general discussions on using our drivers to write your own software here
Post Reply
hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

DDS Continuity and AC Coupling

Post by hexamer »

I am looking to make an improvement to the FRA application I've been developing. Specifically I want to address the issue of discontinuities mentioned on the Wiki page: https://bitbucket.org/hexamer/fra4picos ... nding-bugs After some further investigation, I'm not entirely sure my issue description on the Wiki page explains the whole story. But here's an example of the issue as it appears on a simple RC highpass filter:
step2try0.png
(look at the very beginning of the input signal)

So I have a couple of questions:

First:

I know from prior conversations TS00061982 and other forum posts that changing signal generator frequencies results in discontinuities. I've confirmed this myself - see attached captures: And, such discontinuities could translate to DC offsets that will take some time to settle through the AC coupling capacitor.

But given that the signal generator is using DDS, I wonder if that's really unavoidable? DDS should be able to provide smooth frequency jumps. Is it practical to fix that?

Second:

I see here: topic19881.html that the AC coupling capacitor is switched in only when the capture is made. I assume that means the call to psXXXXRunBlock? What that post doesn't mention is when the capacitor is switched back out. Is it immediately after the block capture, on scope disconnect/reset, or some other time? Since the call to psXXXXSetChannel specifies the coupling, is it possible to switch in the capacitor then and leave it switched in until a subsequent call to psXXXXSetChannel?

Hitesh

Re: DDS Continuity and AC Coupling

Post by Hitesh »

Hi hexamer,

When changing the frequency, the signal generator briefly stops while the new waveform is written down to the device. I do not think it will be possible to fix this.

With regards to the coupling, the settings are written down to the device when the ps5000aRunBlock() and ps5000aRunStreaming() functions are called. The AC coupling should remain in place until the settings are next changed (just prior to the device commencing data collection). Changing the resolution may also change the settings.

I hope this helps.

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: DDS Continuity and AC Coupling

Post by hexamer »

Thanks for the feedback, Hitesh. Please see my follow-up questions below.

Aaron.
Hitesh wrote:Hi hexamer,

When changing the frequency, the signal generator briefly stops while the new waveform is written down to the device. I do not think it will be possible to fix this.
If one is switching from a sine at one frequency to a sine at another frequency, why would there be a need to write a new waveform to the device with DDS?
Hitesh wrote: With regards to the coupling, the settings are written down to the device when the ps5000aRunBlock() and ps5000aRunStreaming() functions are called. The AC coupling should remain in place until the settings are next changed (just prior to the device commencing data collection). Changing the resolution may also change the settings.

I hope this helps.
When you say changing the resolution, I assume you're talking about the ADC resolution (only relevant to some scopes). Are you also referring to changing channel voltage ranges?

Hitesh

Re: DDS Continuity and AC Coupling

Post by Hitesh »

Hi Aaron,

When changing the frequency, the settings have to be written down to the device (apologies, the wording was incorrect in my last post about the waveform being written down).

You may wish to consider a sweep of frequencies from the signal generator.

I have run some tests here and the discontinuity from the PicoScope 2204A is something I can repeat with a PicoScope 2205A so I will raise a bug report for our Development Team. The waveform on the PicoScope 5000 Series should start again from 0V when the frequency is changed. In tests that I ran, the transition is around 700us (see the screenshot below).
Signal generator transition
Signal generator transition
I was referring to the flexible ADC resolution for the PicoScope 5000A/B devices. With voltage ranges, there should not be any impact unless you change the coupling in the call to psXXXXSetChannel().

Hope this helps,

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: DDS Continuity and AC Coupling

Post by hexamer »

Hitesh wrote:When changing the frequency, the settings have to be written down to the device (apologies, the wording was incorrect in my last post about the waveform being written down).
No problem. But I still don't see why the DDS system couldn't be designed so that it doesn't require being interrupted. Such an ability is one advantage of DDS.
Hitesh wrote: You may wish to consider a sweep of frequencies from the signal generator.
I had actually tried sweeping. But the only way that I could think of (that is also compatible with my application) is the pattern of sweeping from A to B, then sweeping from B to C, then C to D etc. I.e. I need to pause on a frequency to take a measurement. When I tried that I still get the interruption to the generator each time the new sweep is programmed. I was thinking about how I could use shots, sweeps, and SW triggers to achieve the ability to stop on a given frequency to take a measurement, but it seems to me that's not possible. Were you thinking of a way?
Hitesh wrote: I have run some tests here and the discontinuity from the PicoScope 2204A is something I can repeat with a PicoScope 2205A so I will raise a bug report for our Development Team. The waveform on the PicoScope 5000 Series should start again from 0V when the frequency is changed. In tests that I ran, the transition is around 700us (see the screenshot below).
Thank you. 700us doesn't seem so bad. Is the capacitance of the AC coupling capacitor such that a ~1ms interruption could lead to such a visible jump? Otherwise, I'm inclined to suspect the other issue. However based on the name of the capture file (step2try0.png), it definitely should not be the first capture on the scope since calling psXXXXSetChannel.
Hitesh wrote: I was referring to the flexible ADC resolution for the PicoScope 5000A/B devices. With voltage ranges, there should not be any impact unless you change the coupling in the call to psXXXXSetChannel().
OK, that's helpful. It should be easy to workaround this by just running a quick dummy block run.

Hitesh

Re: DDS Continuity and AC Coupling

Post by Hitesh »

Hi Aaron,

I think the DDS system may be looked at in the future.

In terms of sweeping the frequencies, one thing you can do with devices that have an external trigger input is to use a gated trigger to sweep the frequency - this way you can hold the output at one frequency by taking the voltage level on the external trigger input below the threshold and then trigger again to continue the sweep and so on. Please refer to our article on Triggering a PicoScope signal generator using
the PicoScope API functions
(see section 2.4.2 External trigger).

When the frequency is changed, the signal generator outputs at the current voltage level until the new waveform is output at the selected frequency, starting from 0V. It might be a little below 0V due to the charging effect of the capacitor.

When you change the coupling the changes will not be applied until the device is instructed to start the data collection process via the relevant RunBlock or RunStreaming commands.

Regards,

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: DDS Continuity and AC Coupling

Post by hexamer »

Thanks for the pointer to the triggering article. It definitely provides a much better description of the signal generator parameters than the API manual. Unfortunately, I don't think using gating will work for me for two reasons: (1) I won't be able to accurately control when it starts and stops, and (2), because the overall FRA sweep is logarithmic, given a fixed increment/dwellTime, later steps would take a very long time.

That second point gave me the idea to see if psXXXXSetSigGenPropertiesBuiltIn would be helpful. I got the idea to use software triggers and this function to sweep from A to B, then B to C, etc. Unfortunately this call also seems to interrupt the generator. So, I do hope PicoTech will seriously consider enhancing this to enable better continuity.

I did some further experimentation to see how these discontinuities affect the AC coupling. I can get results with similar magnitude as seen in my diagnostic plot above:
Effects of SigGen glitch on AC Coupling.pdf
(446.54 KiB) Downloaded 549 times
. Another thing possibly going on in that diagnostic plot is that the frequency being stepped from is near or even below 1Hz. At those frequencies, the AC coupling filter is attenuating the signal. So we may also be seeing the signal grow in magnitude around the frequency jump.

Hitesh

Re: DDS Continuity and AC Coupling

Post by Hitesh »

Hi Aaron,

I have put forward a request to our Development Team to see if they can update the signal generator operation to avoid the discontinuities.

The psXXXXSetSigGenPropertiesBuiltIn functions allow the User to change certain properties of a signal generator while it is waiting for a trigger event - note that the waveform type, offset voltage and peak to peak voltage cannot be changed.

It is part of the blocking effect of the capacitor that is causing the effect with the attenuation.

Regards,

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: DDS Continuity and AC Coupling

Post by hexamer »

Hitesh wrote:Hi Aaron,
I have put forward a request to our Development Team to see if they can update the signal generator operation to avoid the discontinuities.
Thank you, Hitesh. I think such an improvement would provide significant value.
Hitesh wrote: The psXXXXSetSigGenPropertiesBuiltIn functions allow the User to change certain properties of a signal generator while it is waiting for a trigger event - note that the waveform type, offset voltage and peak to peak voltage cannot be changed.
The reason I was experimenting with that function is that I was originally thinking about what it would mean to use it with gating. I had assumed (probably wrongly) that once the sweep had finished that the function generator would be waiting for another trigger (gate exit then entry) and I could safely reset the start/stop frequencies. Even if I could exit the gate after the sweep had reached the top (as a means to re-arm), I think there is another reason it would not enable continuity. If I understand correctly, exiting the gate would immediately freeze the DAC at its current value. Though, I'm wondering if that behavior depends on whether the top of the sweep has been reached yet. I suppose I could run an experiment to see for myself.
Hitesh wrote: It is part of the blocking effect of the capacitor that is causing the effect with the attenuation.
Fully expected. Somewhat off-topic, but it occurred to me that I could use the FRA application to estimate the effects of the AC coupling. All I have to do is connect the AWG to the FRA I/O channels, set the input to DC coupling and the output to AC coupling and sweep:
AC Coupling Response.png
As expected, it's a first order RC HPF :)

The potentially interesting part of this is that it serves as a reminder that a FRA could start to lose some accuracy in AC coupling mode as the frequencies approach 1 Hz. A couple factors exist: (1) the attenuation would cause us to start to lose precision (2) filter component variation that causes magnitude and phase shift differences between channels could lead to some inaccuracy. In this region, one may be better off using DC coupling and DC offsetting.

Hitesh

Re: DDS Continuity and AC Coupling

Post by Hitesh »

Hi Aaron,

Thanks for your reply.

When you exit the gate, the signal generator should continue to output at the last voltage level and frequency until you re-enter the gate.

Regards,

Post Reply