AnsweredAssumed Answered

Programming 33220a AWG for feedback control

Question asked by nickgrupp on Apr 5, 2013

I am writing a feedback controller that sets the voltage of two 33220A AWGs in Matlab using GPIB. I have programmed it to apply a ~2000-4000 cycle burst (SIN), analyze a measurement obtained with a different device, and based on that measurement, either increase or decrease the voltage on the next burst. To execute a burst, I am using the internal trigger (code: "'TRIG:SOUR BUS;*TRG;*WAI"). I use the timer function in matlab to execute the bursts at regular intervals.

So far it is working pretty well, and I can run it at repetition frequencies that are fast enough for my application. However, when I look at the waveforms pm a scope, occasionally I get a delay in the start of the burst, and a sort of ramp-up before the correct voltage is reached. This seems to happen when a certain voltage threshold is reached, which made me think it could be instabilities produced when a relay is triggered inside the AWG. 

When I get the problem bursts, the delay after the trigger before the I see a voltage on my scope is different for the two AWG's. They are the same model, but of different vintage (*IDN? for one is 'Agilent Technologies,33220A,MY44037738,2.02-2.02-22-2', the second is ''Agilent Technologies,33220A,MY44045423,2.07-2.06-22-2''). The delay is worse on the second - sometimes 1.5-2 ms. With the first, I often don't see this delay, but do see a ramp-up of the voltage.

The burst always ends at the correct time, so it's not a triggering issue. 


Is this an issue with relay switching? 

If so, is there any way to avoid it? I can perhaps add a pause to take this into account, but I really don't want to slow things down.

I can see that it happens when certain voltage thresholds are crossed (for example when the voltage is increased above or below 1V). I could add a pause when such thresholds are crossed. Is there documentation somewhere saying what voltages cause a relay switch? Is there documentation on every command (beyond changing voltage) that produces a relay switch?

Is there any way to know how long I might need to pause to avoid this problem?

Finally, is this the best way to program this sort of controller?

I had some other issues with this project, described below. They might be related. These things are not critical for my application, but I would be interested if there are solutions.

I tried toggling the Output and Synch Out before the start of the controller. This produced even more problems - several of my bursts had no signal, then I would get delayed bursts, and ultimately I would get the desired voltage. 

I also experimented with adding a random phase to each burst. When I do this, I got a voltage offset at the start of the burst (sometimes positive, sometimes negative), which decays towards zeros over the burst. If I turn this feature off, but don't have phase set at zero, I get a small static voltage offset to my burst. Any idea what is going on here?