I have a phaser card (baseband variant) that I am trying to set up for amplitude stabilization. I have the following minimal experiment, but I don't see any evidence of the servo functioning (even just railing the output) under any combinations of parameters. The output level just stays the same as if I remove the servo-related calls.
from artiq.experiment import EnvExperiment, kernel, delay, NumberValue
from artiq.language.units import MHz, dB, ms
class PhaserServoTesting(EnvExperiment):
"""Phaser Servo Testing"""
def build(self):
self.setattr_device("core")
self.setattr_device("phaser0")
self.setattr_argument("amp", NumberValue(0.8))
self.setattr_argument("kp", NumberValue(-1.0))
self.setattr_argument("ki", NumberValue(-1000.0))
self.setattr_argument("g_limit", NumberValue(0.0))
self.setattr_argument("x_offset", NumberValue(-0.3))
self.setattr_argument("y_offset", NumberValue(0.0))
@kernel
def run(self):
self.core.break_realtime()
self.core.reset()
self.phaser0.init()
self.phaser0.set_cfg()
osc = self.phaser0.channel[0].oscillator[0]
ch = self.phaser0.channel[0]
ch.set_duc_cfg(select=0)
ch.set_duc_frequency(80*MHz)
ch.set_duc_phase(0.0)
ch.set_att(0 * dB)
osc.set_frequency(1*MHz)
delay(1*ms)
ch.set_iir(0, self.kp, self.ki, self.g_limit, self.x_offset, self.y_offset)
ch.set_servo(0, enable=1, hold=0)
osc.set_amplitude_phase(self.amp, 0.0)