atomiq.components.sinara.suservo¶
Classes¶
Representation for the SUServo gateware |
|
A Urukul DDS channel in SUServo configuration as RF Source |
|
Analog Input of a Sampler in an SUServo configuration |
|
A Laser with intensity stabilization realized by the SUServo |
Module Contents¶
- class atomiq.components.sinara.suservo.SUServo(suservo_device, start_loop=True, *args, **kwargs)[source]¶
Bases:
atomiq.components.primitives.ComponentRepresentation for the SUServo gateware
On init, the servo loop in the SUServo is stared automatically. If this is not wanted configure the :param:start_loop
- Parameters:
suservo_device -- The artiq SUServo device from your device_db, e.g. @suservo0.
start_loop (artiq.language.types.TBool) -- Sets if the servo loop should be started at the prerun stage.
- kernel_invariants¶
- suservo_device¶
- servo_on = False¶
- start_loop = True¶
- _prerun()[source]¶
Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts.
- get_adc_value(channel)[source]¶
- Parameters:
channel (artiq.language.types.TInt32)
- Return type:
artiq.language.types.TFloat
- set_adc_gain(channel, gain=0)[source]¶
- Parameters:
channel (artiq.language.types.TInt32)
gain (artiq.language.types.TInt32)
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- children = []¶
- __in_build = True¶
- class atomiq.components.sinara.suservo.SUServoChannel(suservo, suservo_channel, default_attenuation=19.0, default_profile=0, servo_divider=10.0, *args, **kwargs)[source]¶
Bases:
atomiq.components.electronics.rfsource.RFSource,atomiq.components.primitives.SwitchableA Urukul DDS channel in SUServo configuration as RF Source
If not in servo mode, this can be used just like a normal :class:UrukulChannel
- Parameters:
suservo (SUServo) -- The atomiq SUServo component this channel belongs to
suservo_channel -- The artiq SUServo channel from your device_db, e.g. @suservo0_ch2.
default_profile -- Which of the 32 profiles of the SUServo should be used? (default 0)
servo_divider (artiq.language.types.TFloat) -- Todo: Why do we need this? (default 10.0)
- kernel_invariants¶
- suservo¶
- suservo_channel¶
- profile = 0¶
- attenuation = 19.0¶
- servo_on = False¶
- servo_divider = 10.0¶
- next_on¶
- next_off¶
- _prerun()[source]¶
Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts.
- set(frequency=float('nan'), amplitude=float('nan'), phase=0.0, profile=-1)[source]¶
Set the frequency and amplitude of the DDS channel
Frequency/amplitude are set to the last known value if
nanis passed (default).- Parameters:
frequency (artiq.language.types.TFloat) -- Frequency in Hz (
nanto use previous value)amplitude (artiq.language.types.TFloat) -- If servomode is off, this is the DDS amplitude (0..1). If servomode is on, this is the target voltage on the photodiode. (
nanto use previous value)phase (artiq.language.types.TFloat) -- Phase in rad to be set (default 0.0)
profile (artiq.language.types.TInt32) -- DDS Profile (
-1to keep current profile)
- set_att(attenuation)[source]¶
Set the hardware attenuation for this urukul channel via cpld.
- Parameters:
attenuation (artiq.language.types.TFloat) -- channel attenuation (0. to 31.0 in 0.5 increments) [dB]
- set_amplitude(amplitude)[source]¶
Set the amplitude of the DDS output
- Parameters:
amplitude -- If servomode is off, this is the DDS amplitude (0..1). If servomode is on, this is the target voltage on the photodiode.
- set_servomode(enabled)[source]¶
Switch servo mode of the SUServo on or off
The servo loop in the SUServo gateware (running on the Kasli) can only be switched on globally for all channels. However, we can decide for each channel if the output of the servo loop should be given to the DDS. This function switches the the updating for this channel.
- Parameters:
enabled (artiq.language.types.TBool) -- Whether the servomode should be enabled
- _ramp(duration, frequency_start, frequency_end, amplitude_start, amplitude_end, ramp_timestep=0.0002)[source]¶
At some point, we want to replace this by code that uses the digital ramp generator (DRG) on the AD9910 because this allows for much faster ramps
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
amplitude_start (artiq.language.types.TFloat)
amplitude_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
- amplitude = 0.0¶
- frequency = 100000000.0¶
- phase = 0.0¶
- default_ramp_steps = 30¶
- blind = False¶
- _prerun_blind()¶
- set_frequency(frequency)¶
- Parameters:
frequency (artiq.language.types.TFloat)
- _check_frequency(frequency)¶
- get_frequency()¶
- Return type:
artiq.language.types.TFloat
- _check_amplitude(amplitude)¶
- Parameters:
amplitude (artiq.language.types.TFloat)
- get_amplitude()¶
- Return type:
artiq.language.types.TFloat
- set_phase(phase)¶
- Parameters:
phase (artiq.language.types.TFloat)
- get_phase()¶
- Return type:
artiq.language.types.TFloat
- ramp(duration, frequency_start=float('nan'), frequency_end=float('nan'), amplitude_start=float('nan'), amplitude_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
Ramp frequency and amplitude over a given duration. Parameters default to
-1ornanto indicate no change. If the start frequency/amplitude is set tonan, the ramp starts from the last frequency/amplitude which was set. This method advances the timeline by ´duration´- Parameters:
duration (artiq.language.types.TFloat) -- ramp duration [s]
frequency_start (artiq.language.types.TFloat) -- initial frequency [Hz]
frequency_end (artiq.language.types.TFloat) -- end frequency [Hz]
amplitude_start (artiq.language.types.TFloat) -- initial amplitude [0..1]
amplitude_end (artiq.language.types.TFloat) -- end amplitude [0..1]
ramp_timesteps -- time between steps in the ramp [s]
ramp_steps (artiq.language.types.TInt32) -- number of steps the whole ramp should have. This takes precedence over ramp_timesteps
ramp_timestep (artiq.language.types.TFloat)
- _arb(duration, samples_amp, samples_freq, samples_phase, repetitions=1, prepare_only=False, run_prepared=False, transform_amp=identity_float, transform_freq=identity_float, transform_phase=identity_float)¶
- Parameters:
duration (artiq.language.types.TFloat)
samples_amp (TList(TFloat))
samples_freq (TList(TFloat))
samples_phase (TList(TFloat))
repetitions (artiq.language.types.TInt32)
prepare_only (artiq.language.types.TBool)
run_prepared (artiq.language.types.TBool)
- arb(duration, samples_amp=[], samples_freq=[], samples_phase=[], repetitions=1, prepare_only=False, run_prepared=False, transform_amp=identity_float, transform_freq=identity_float, transform_phase=identity_float)¶
Play Arbitrary Samples from a List
This method allows to set the output amplitude, frequency an phase according to the values specified in respective lists. The whole sequence is played in the specified duration. The pattern store in the sample list can also be repeated.
Tip
We supports a scheme to prepare the arb function before it is actually used. If that is needed, run this function with
prepapre_only = Truewhen the arb should be prepared and withrun_prepared = Truewhen the prepared arb should be played. In both calls the other parameters have to be passed.- Parameters:
samples_amp (TList(TFloat)) -- List of amplitude samples. If this list is empty (default), the amplitude is not modified.
samples_freq (TList(TFloat)) -- List of frequency samples. If this list is empty (default), the frequency is not modified.
samples_phase (TList(TFloat)) -- List of phase samples. If this list is empty (default), the phase is not modified.
duration (artiq.language.types.TFloat) -- The time in which the whole sequence of samples should be played back [s].
repetitions (artiq.language.types.TInt32) -- Number of times the sequence of all samples should be played. (default 1)
prepare_only (artiq.language.types.TBool) -- Only write the sequence to RAM, don't play it.
run_prepared (artiq.language.types.TBool) -- Play arb sequence previously prepared with
prepare_only.transform_amp -- Function to transform amplitude samples, must take a single argument of type
TFloatand return a singleTFloat.transform_freq -- Function to transform frequency samples (see
transform_amp).transform_phase -- Function to transform phase samples (see
transform_amp).
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- children = []¶
- __in_build = True¶
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- abstractmethod is_on(channel=None)¶
- Parameters:
channel (artiq.language.types.TStr)
- toggle(channel=None)¶
- Parameters:
channel (artiq.language.types.TStr)
- pulse(pulsetime, channel='')¶
- Parameters:
pulsetime (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- class atomiq.components.sinara.suservo.SUServoADCChannel(suservo, default_gain=0, *args, **kwargs)[source]¶
Bases:
atomiq.components.electronics.adc.ADCChannelAnalog Input of a Sampler in an SUServo configuration
ATTENTION: When default_gain is !=1 is given, this might cause problems in closed loop mode. It seems SUServo internally uses gain=1. Maybe it can be set differently but I don't see how.
- Parameters:
suservo (SUServo) -- The SUServo component that this channel belongs to
default_gain (artiq.language.types.TInt32) -- The default gain in machine units (0: 1, ..., 3: 1000) to set for this channel on startup
- kernel_invariants¶
- suservo¶
- gain = 0¶
- _prerun()[source]¶
Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts.
- set_gain(gain=0)[source]¶
Set the gain for the ADC channel in SUServo configuration
- Parameters:
gain (artiq.language.types.TInt32) -- Gain in machine units (0: 1, ..., 3: 1000)
- measure(samples=1, cached=False)[source]¶
- Parameters:
samples (artiq.language.types.TInt32)
cached (artiq.language.types.TBool)
- Return type:
artiq.language.types.TFloat
- adc_device¶
- channel¶
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- children = []¶
- __in_build = True¶
- measurement_channels()¶
- class atomiq.components.sinara.suservo.SUServoModulatedLaser(default_kp, default_ki=0.0, default_ki_limit=0.0, *args, **kwargs)[source]¶
Bases:
atomiq.components.laser.ContinuouslyStabilizedModulatedLaserA Laser with intensity stabilization realized by the SUServo
The SUServo realizes a PI servo controller in hardware with an update time interval of 1.3us, leading to a maximum analog bandwidth of >500kHz. To achieve this a Sampler (8 analog in) is bundled in the gateware with two Urukuls (2 x 4 DDS channels).
With this class, the SUServo can be used in open loop as well as in closed loop mode. Use the
stabilize()function to switch between open and closed loop mode. When switching from closed to open loop, the last output power on the DDS channel will be hold.- Parameters:
modulator -- The modulator (most likely an AOM) that is driven by the SUServo. The Modulator given here must be of a class derived from :class:RFLightModulator and the rfsource of the modulator must be of the class :class:SUServoChannel.
photodiode -- The photodiode monitoring the laser. The photodiode must be of a class derived from :class:AnalogPhotodiode and the photodiode's :param:adc_channel must be of the class :class:SUServoADCChannel.
default_kp (artiq.language.types.TFloat) -- default proportional (P-) part for the SUServo loop. Values should be negative.
default_ki (artiq.language.types.TFloat) -- default integral (I-) part for the SUServo loop. Values should be negative. (default 0.0)
default_ki_limit (artiq.language.types.TFloat) -- default limit for I-part of the SUServo loop. 0.0 means unlimited. (default 0.0)
- kernel_invariants¶
- default_kp¶
- default_ki = 0.0¶
- default_ki_limit = 0.0¶
- suservo_channel¶
- _prerun()[source]¶
Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts.
- set_servo_parameter(adc_channel, kp, ki, ki_limit, delay=0.0)[source]¶
Set servo loop parameters.
- Parameters:
kp (artiq.language.types.TFloat) -- proportional (P-) part for the SUServo loop. Values should be negative.
ki (artiq.language.types.TFloat) -- integral (I-) part for the SUServo loop. Values should be negative.
ki_limit (artiq.language.types.TFloat) -- limit for I-part of the SUServo loop. 0.0 means unlimited.
delay (artiq.language.types.TFloat) -- delay between switching on the laser an the servo loop becoming active (default: 0.0)
- _transform_power_dummy(power)[source]¶
- Parameters:
power (artiq.language.types.TFloat)
- Return type:
artiq.language.types.TFloat
- _transform_power_calibration(power)[source]¶
- Parameters:
power (artiq.language.types.TFloat)
- Return type:
artiq.language.types.TFloat
- _amplitude_from_power(power)[source]¶
- Parameters:
power (artiq.language.types.TFloat)
- Return type:
artiq.language.types.TFloat
- _docstring_overwrites¶
- stabilized = True¶
- photodiode¶
- get_power()¶
- Return type:
artiq.language.types.TFloat
- stabilize(enable)¶
- Parameters:
enable (artiq.language.types.TBool)
- modulator¶
- laser_source¶
- fm_device = 'mod'¶
- am_device = 'mod'¶
- src_transmission = 1.0¶
- get_amplitude()¶
- Return type:
artiq.language.types.TFloat
- set_amplitude(amplitude)¶
- Parameters:
amplitude (artiq.language.types.TFloat)
- get_frequency()¶
- Return type:
artiq.language.types.TFloat
- set_frequency(frequency)¶
Set the absolute frequency of the light after modulation
- Parameters:
frequency (artiq.language.types.TFloat) -- Absolute frequency of the light after modulation in Hz
- _set_frequency_through_modulator(frequency)¶
- Parameters:
frequency (artiq.language.types.TFloat)
- _set_frequency_through_source(frequency)¶
- Parameters:
frequency (artiq.language.types.TFloat)
- ramp(duration, frequency_start=float('nan'), frequency_end=float('nan'), detuning_start=float('nan'), detuning_end=float('nan'), amplitude_start=float('nan'), amplitude_end=float('nan'), power_start=float('nan'), power_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
Ramp frequency and/or power/amplitude over a given duration.
Parameters default to
-1ornanto indicate no change. If no starting value is given, the ramp starts from the last frequency/amplitude which was set.Either power or amplitude can be given to ramp the intensity of the laser. If power is given, it overwrites the value for the amplitude
This method advances the timeline by ´duration´
- Parameters:
duration (artiq.language.types.TFloat) -- ramp duration [s]
frequency_start (artiq.language.types.TFloat) -- initial frequency [Hz]
frequency_end (artiq.language.types.TFloat) -- end frequency [Hz]
detuning_start (artiq.language.types.TFloat) -- initial detuning [Hz]
detuning_start -- final detuning [Hz]
amplitude_start (artiq.language.types.TFloat) -- initial amplitude
amplitude_end (artiq.language.types.TFloat) -- end amplitude
power_start (artiq.language.types.TFloat) -- initial power [W]
power_end (artiq.language.types.TFloat) -- final power [W]
detuning_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- arb(duration, samples_amp=[], samples_power=[], samples_freq=[], samples_det=[], samples_phase=[], repetitions=1, prepare_only=False, run_prepared=False, transform_amp=identity_float, transform_freq=identity_float, transform_phase=identity_float)¶
Play Arbitrary Samples from a List
This method allows to set the output amplitude, frequency an phase according to the values specified in respective lists. The whole sequence is played in the specified duration. The pattern store in the sample list can also be repeated.
We supports a scheme to prepare the arb function before it is actually used. If that is needed, run this function with prepare_only = True when the arb should be prepared and with run_only = True when the prepared arb should be played. In both calls the other parameters have to be passed.
- Parameters:
samples_amp (TList(TFloat)) -- List of amplitude samples. If this list is empty (default), the amplitude is not modified.
samples_power (TList(TFloat)) -- List of power samples. If this list is empty (default), the amplitude is not modified. This overwrites samples_amp.
samples_freq (TList(TFloat)) -- List of frequency samples. If this list is empty (default), the frequency is not modified.
samples_det (TList(TFloat)) -- List of frequency samples relative to the zero frequency. If this list is empty (default), the frequency is not modified. This overwrites samples_frequency
samples_phase (TList(TFloat)) -- List of phase samples. If this list is empty (default), the phase is not modified.
duration (artiq.language.types.TFloat) -- The time in which the whole sequence of samples should be played back [s].
repetitions (artiq.language.types.TInt32) -- Number of times the sequence of all samples should be played. (default 1)
prepare_only (artiq.language.types.TBool)
run_prepared (artiq.language.types.TBool)
- set_power(power)¶
Set the absolute power of the light after modulation
- Parameters:
power (artiq.language.types.TFloat) -- Absolute power of the light after modulation in W
- switch¶
- on()¶
- off()¶
- zero_freq¶
- _set_frequency_dummy(frequency)¶
- Parameters:
frequency (artiq.language.types.TFloat)
- set_detuning(detuning)¶
Set the detuning of the light from the frequency defined by zero_freq
Note
If you are using a modulator (e.g. AOM) the center frequency is not taken into account. If you want to set the detuning from the center frequency of the modulator use self.modulator.set_detuning
- Parameters:
detuning (artiq.language.types.TFloat) -- Detuning in Hz
- detune(frequency)¶
Alias for
set_detuning()- Parameters:
frequency (artiq.language.types.TFloat)
- _frequency¶
- _power = 0.001¶
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- children = []¶
- __in_build = True¶
- abstractmethod is_on(channel=None)¶
- Parameters:
channel (artiq.language.types.TStr)
- toggle(channel=None)¶
- Parameters:
channel (artiq.language.types.TStr)
- pulse(pulsetime, channel='')¶
- Parameters:
pulsetime (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- abstractmethod measure(channel='')¶
- Parameters:
channel (artiq.language.types.TStr)
- Return type:
artiq.language.types.TFloat
- measurement_channels()¶