Suservo exampleΒΆ

Note

The suservo must be initialized manually once after power cycling by running:

self.laser_suservo_test.modulator.rfsource.suservo.suservo_device.init()

or by directly adding the suservo (here: suservo0) to the components and running:

self.suservo0.init()

Since initialization is very time-consuming, we recommend a separate init experiment that can be run after power cycling to handle these tasks.

Experiment

"""
SUServo Laser Example
#####################

Scenario
========

We want to control a laser that is intensity stabilized by a Sinara SUServo (Sampler + 2x Urukul with special gateware)

"""

from atomiq import AtomiqExperiment
from artiq.experiment import kernel, parallel, sequential, delay


class SuServoTest(AtomiqExperiment):
    components = ["laser_suservo_test", "ttl_test", "pd_aom_test_cal"]

    arguments = {
        "pulse_power": {"default": 0.5},
        "pulsetime": {"default": 3e-3, "unit": "ms", "scale": 1e-3},
        "off_time": {"default": 0.5, "unit": "s"},
    }

    @kernel
    def step(self, point):
        # Optional: If the PI parameter set in the components definition is not what you need
        # you can set a different value like so:
        self.laser_suservo_test.set_servo_parameter(0, -1.0, -1.0e4, 0.0)

        # Set the detuning of the laser. Depending on the `fmmod` parameter either the modulator
        # or the laser source will be used for detuning
        self.laser_suservo_test.set_detuning(400e6)

        # Activate servo loops for our laser
        self.laser_suservo_test.stabilize(True)

        # Set the power level we want to stabilize on. Since the photodiode is calibrated
        # we give the desired power in mW
        self.laser_suservo_test.set_power(point.pulse_power)

        with parallel:
            # Output a test tll for triggering our instrumentation
            self.ttl_test.pulse(point.pulsetime)

            # Pulse on the laser
            self.laser_suservo_test.pulse(point.pulsetime)

            # Ramp down the intensity of the laser to half its power in half the pulsetime
            self.laser_suservo_test.ramp(
                point.pulsetime / 2, power_start=point.pulse_power, power_end=point.pulse_power / 2
            )

            with sequential:
                delay(point.pulsetime / 2)

                # Switch off the servo loop and hold the output power
                self.laser_suservo_test.stabilize(False)

                # Measure the power on the photodiode
                power = self.pd_aom_test_cal.get_power()
                self.log.info("Measured PD output: {0}", [power])

        delay(point.off_time)

Components

components = {"type": None}

# Basics
components.update(
    {
        "log": {
            "classname": "atomiq.components.basics.log.KernelLogger",
        }
    }
)

# Calibrations
components.update(
    {
        "cal_pd_test": {
            "classname": "atomiq.components.basics.calibration.LinearCalibration",
            "arguments": {
                "input_unit": "V",
                "output_unit": "mW",
                "a": 30.0,
                "b": 0.0,
            },
        }
    }
)

# Sinara modules
components.update(
    {
        "kasli0": {
            "classname": "atomiq.components.sinara.Kasli",
            "arguments": {},
        },
        "suservo0": {
            "classname": "atomiq.components.sinara.suservo.SUServo",
            "arguments": {
                "suservo_device": "@suservo0",
            },
        },
    }
)

# TTL Out
components.update(
    {
        "ttl_test": {
            "classname": "atomiq.components.sinara.DioOutput",
            "arguments": {
                "kasli": "&kasli0",
                "ttl": "@ttl8",
            },
        }
    }
)

# Analog in
components.update(
    {
        "input_suservo_test": {
            "classname": "atomiq.components.sinara.suservo.SUServoADCChannel",
            "arguments": {
                "suservo": "&suservo0",
                "channel": 0,
                "default_gain": 0,
            },
        }
    }
)

# Photodiodes
components.update(
    {
        "pd_aom_test_cal": {
            "classname": "atomiq.components.optoelectronics.photodiode.CalibratedPhotodiode",
            "arguments": {
                "adc_channel": "&input_suservo_test",
                "calibration": "&cal_pd_test",
            },
        }
    }
)

# RF Sources
components.update(
    {
        "rfsource_aom_test": {
            "classname": "atomiq.components.sinara.suservo.SUServoChannel",
            "arguments": {
                "suservo": "&suservo0",
                "suservo_channel": "@suservo0_ch0",
                "default_amplitude": 0.75,
                "default_frequency": 220e6,
                "freq_limit": (15e6, 400e6),
                "blind": True,
            },
        }
    }
)

components.update(
    {
        "aom_test": {
            "classname": "atomiq.components.optoelectronics.lightmodulator.AOM",
            "arguments": {
                "rfsource": "&rfsource_aom_test",
                "switch": "&rfsource_aom_test",
                "center_freq": 200e6,
                "bandwidth": 60e6,
                "switching_delay": 30e-9,
                "order": 1,
                "passes": 2,
            },
        }
    }
)

# Lock
components.update(
    {
        "lock_test": {
            "classname": "atomiq.components.lock.SpectroscopyLock",
            "arguments": {
                "reference_frequency": 539e12,
                "lock_offset": -60.0e6,
            },
        }
    }
)

# Lasersources
components.update(
    {
        "ls_test": {
            "classname": "atomiq.components.laser.LockedLaserSource",
            "arguments": {
                "lock": "&lock_test",
                "power": 900e-3,
            },
        }
    }
)

# Lasers
components.update(
    {
        "laser_suservo_test": {
            "classname": "atomiq.components.sinara.suservo.SUServoModulatedLaser",
            "arguments": {
                "laser_source": "&ls_test",
                "photodiode": "&pd_aom_test_cal",
                "modulator": "&aom_test",
                "default_ki": -1.0e4,
                "default_kp": -1.0,
            },
        }
    }
)