I am currently working on configuring a sampler and Urukul in a suservo setup for laser intensity stabilization. My primary goal at the moment is to obtain a signal from the Urukul module with feedback disabled.
Current Status:
Despite the apparent correctness of the code, I am unable to obtain a signal from the Urukul module. Notably, the RF Switch (green LED) is lit, and the DDS (red LED) is correctly set up. I have also taken some steps to validate the configuration. I ensured that the PLL is configured properly by removing the MMCX cable and observing that the red LED starts glowing. Additionally, I confirmed that channel settings are being written correctly by enabling and disabling channels through code and observing the behavior of the RF LED.
However, I am not entirely certain about the configurations for the iir and dds.
Code Reference:
To guide my work, I have been following the code example provided in the 'GitHub Example'
[https://github.com/m-labs/artiq/blob/master/artiq/examples/kasli_suservo/repository/suservo.py#L82]
I have attached my code and device database files for your perusal.
Hardware Configuration:
- One Urukul and a sampler
- MMCX clock
- Currently, there is no input provided to the sampler.
I would greatly appreciate any insights or assistance that forum members can offer. Your expertise and guidance will be instrumental in resolving this matter. Thank you in advance for your support.
Code
`
from artiq.experiment import *
class SuServo_Minimal(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("suservo0")
for i in range(4):
self.setattr_device("suservo0_ch{}".format(i))
@kernel
def run(self):
self.core.break_realtime()
self.core.reset()
self.suservo0.init() #Initialize the servo
#set the attenuation on the DDS channels
self.suservo0.cplds[0].set_att(0, 10.)
#Set the sampler gain on channel 0
self.suservo0.set_pgia_mu(0, 0)
#Validate survo is done and disabled
assert self.suservo0.get_status() & 0xff == 2
#Enable output on suservo0_ch0 to generate 70 * MHz frequency
for channel in [self.suservo0_ch0]:
delay(100 * us)
channel.set(en_out=0) #Start by disabling channel
delay(100 * us)
#Take the input from channel 0
channel.set_iir(profile=0, adc=0, kp=-0.1, ki=-300./s, g=0.,delay=0.)
delay(100 * us)
channel.set_dds(profile=0,offset=-0.5, frequency=71*MHz, phase=0.)
delay(100 * us)
channel.set(en_out=1, en_iir=0, profile=0) # Enable channel, but keep the PID loop disabled`
Relevant portion of device db file
`
device_db["suservo0_ch0"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x000008, "servo_device": "suservo0"}
}
device_db["suservo0_ch1"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x000009, "servo_device": "suservo0"}
}
device_db["suservo0_ch2"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x00000a, "servo_device": "suservo0"}
}
device_db["suservo0_ch3"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x00000b, "servo_device": "suservo0"}
}
device_db["suservo0_ch4"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x00000c, "servo_device": "suservo0"}
}
device_db["suservo0_ch5"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x00000d, "servo_device": "suservo0"}
}
device_db["suservo0_ch6"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x00000e, "servo_device": "suservo0"}
}
device_db["suservo0_ch7"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "Channel",
"arguments": {"channel": 0x00000f, "servo_device": "suservo0"}
}
device_db["suservo0"] = {
"type": "local",
"module": "artiq.coredevice.suservo",
"class": "SUServo",
"arguments": {
"channel": 0x000010,
"pgia_device": "spi_sampler0_pgia",
"cpld_devices": ['urukul0_cpld', 'urukul1_cpld'],
"dds_devices": ['urukul0_dds', 'urukul1_dds']
}
}
device_db["spi_sampler0_pgia"] = {
"type": "local",
"module": "artiq.coredevice.spi2",
"class": "SPIMaster",
"arguments": {"channel": 0x000011}
}
device_db["spi_urukul0"] = {
"type": "local",
"module": "artiq.coredevice.spi2",
"class": "SPIMaster",
"arguments": {"channel": 0x000012}
}
device_db["urukul0_cpld"] = {
"type": "local",
"module": "artiq.coredevice.urukul",
"class": "CPLD",
"arguments": {
"spi_device": "spi_urukul0",
"refclk": 125e6,
"clk_sel": 2
}
}
device_db["urukul0_dds"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 32,
"pll_en": 1,
"chip_select": 3,
"cpld_device": "urukul0_cpld"
}
}
device_db["spi_urukul1"] = {
"type": "local",
"module": "artiq.coredevice.spi2",
"class": "SPIMaster",
"arguments": {"channel": 0x000013}
}
device_db["urukul1_cpld"] = {
"type": "local",
"module": "artiq.coredevice.urukul",
"class": "CPLD",
"arguments": {
"spi_device": "spi_urukul1",
"refclk": 125e6,
"clk_sel": 2
}
}
device_db["urukul1_dds"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 32,
"chip_select": 3,
"cpld_device": "urukul1_cpld"
}
}`