# Network device support packages reference¶

## Core device logging controller¶

ARTIQ controller for core device logs

usage: aqctl_corelog [-h] [--bind BIND] [--no-localhost-bind] [-p PORT]

Positional arguments:
Options:
 --bind=[] additional hostname or IP address to bind to; use ‘*’ to bind to all interfaces (default: %(default)s) --no-localhost-bind=False do not implicitly also bind to localhost addresses -p=1068, --port=1068 TCP port to listen on (default: %(default)d)

## Lab Brick Digital Attenuator (LDA)¶

### Driver¶

class artiq.devices.lda.driver.Lda(serial=None, product='LDA-102')[source]

Lab Brick Digital Attenuator driver.

This driver depends on the hidapi library.

On Linux you should install hidapi-libusb shared library in a directory listed in your LD_LIBRARY_PATH or in the conventional places (/usr/lib, /lib, /usr/local/lib). This can be done either from hidapi sources or by installing the libhidapi-libusb0 binary package on Debian-like OS.

On Windows you should put hidapi.dll shared library in the artiq\devices\lda folder.

close()[source]

Close the device.

get(command, length, timeout=1000)[source]

Sends a GET command to read back some value of the Lab Brick device.

Parameters: command – Command ID, most significant bit must be cleared. length – Length of the command, “count” in the datasheet. timeout – Timeout of the HID read in ms. Returns the value read from the device. bytes
get_attenuation()[source]

Reads attenuation value from Lab Brick device.

Returns: Returns the attenuation value in dB. float
set(command, data)[source]

Sends a SET command to the Lab Brick device.

Parameters: command – command ID, must have most significant bit set. data – payload of the command.
set_attenuation(attenuation)[source]

Sets attenuation value of the Lab Brick device.

Parameters: attenuation – Attenuation value in dB.
write(command, length, data=b'')[source]

Writes a command to the Lab Brick device.

Parameters: command – command ID. length – number of meaningful bytes in the data array. data – a byte array containing the payload of the command.
class artiq.devices.lda.driver.Ldasim[source]

Lab Brick Digital Attenuator simulation driver.

close()[source]

Close the device.

get_attenuation()[source]

Reads last attenuation value set to the simulated device.

Returns: Returns the attenuation value in dB, or None if it was never set. float
set_attenuation(attenuation)[source]

Stores the new attenuation value.

Parameters: attenuation – The attenuation value in dB.

### Controller¶

You can do that by creating a file under /etc/udev/rules.d/ named 99-lda.rules with the following content:

SUBSYSTEM=="usb", ATTR{idVendor}=="041f", MODE="0666"


Then you need to tell udev to reload its rules:

$sudo invoke-rc.d udev reload  You must also unplug/replug your device if it was already plugged in. Then, to run the Lab Brick Digital Attenuator (LDA) controller: $ aqctl_lda -d SN:xxxxx


The serial number must contain exactly 5 digits, prepend it with the necessary number of 0s. Also, the SN: prefix is mandatory.

You can choose the LDA model with the -P parameter. The default is LDA-102.

ARTIQ controller for the Lab Brick Digital Attenuator

usage: aqctl_lda [-h] [-P {LDA-102,LDA-602}] [--bind BIND]
[--no-localhost-bind] [-p PORT] [-d DEVICE] [--simulation]
[-v] [-q]

Options:
 -P=LDA-102, --product=LDA-102 product type (default: %(default)s) Possible choices: LDA-102, LDA-602 --bind=[] additional hostname or IP address to bind to; use ‘*’ to bind to all interfaces (default: %(default)s) --no-localhost-bind=False do not implicitly also bind to localhost addresses -p=3253, --port=3253 TCP port to listen on (default: %(default)d) -d, --device USB serial number of the device. The serial number is written on a sticker under the device, you should write for example -d “SN:03461”. You must prepend enough 0s for it to be 5 digits. If omitted, the first available device will be used. --simulation=False Put the driver in simulation mode. -v=0, --verbose=0 increase logging level -q=0, --quiet=0 decrease logging level

### Driver¶

class artiq.devices.korad_ka3005p.driver.KoradKA3005P(serial_dev)[source]

The Korad KA3005P is a 1-channel programmable power supply (0-30V/0-5A) with both USB/serial and RS232 connectivity.

All amplitudes are in volts. All currents are in amperes.

close()[source]

Close the serial port.

get_i()[source]

Request the current as set by the user.

get_id()[source]

Request identification from device.

get_v()[source]

Request the voltage as set by the user.

measure_i()[source]

Request the actual output current.

measure_v()[source]

Request the actual voltage output.

ping()[source]

Check if device is responding.

set_i(v)[source]

Set the maximum output current.

set_ocp(b)[source]

Enable/disable the “Over Current Protection”, the PS will switch off the output when the current rises above the actual level.

set_output(b)[source]

Enable/disable the power output.

set_ovp(b)[source]

Enable/disable the “Over Voltage Protection”, the PS will switch off the output when the voltage rises above the actual level.

set_v(v)[source]

Set the maximum output voltage.

setup()[source]

Configure in known state.

### Controller¶

ARTIQ controller for the Korad KA3005P programmable DC power supply

usage: aqctl_korad_ka3005p [-h] [--bind BIND] [--no-localhost-bind] [-p PORT]
[-d DEVICE] [--simulation] [-v] [-q]

Options:
 --bind=[] additional hostname or IP address to bind to; use ‘*’ to bind to all interfaces (default: %(default)s) --no-localhost-bind=False do not implicitly also bind to localhost addresses -p=3256, --port=3256 TCP port to listen on (default: %(default)d) -d, --device serial port. --simulation=False Put the driver in simulation mode, even if –device is used. -v=0, --verbose=0 increase logging level -q=0, --quiet=0 decrease logging level

## Novatech 409B¶

### Driver¶

class artiq.devices.novatech409b.driver.Novatech409B(serial_dev)[source]

Driver for Novatech 409B 4-channel DDS.

All output channels are in range [0, 1, 2, 3]. All frequencies are in Hz. All phases are in turns. All amplitudes are in volts.

close()[source]

Close the serial port.

do_simultaneous_update()[source]

Apply update in simultaneous update mode.

reset()[source]

Hardware reset of 409B.

save_state_to_eeprom()[source]

Save current state to EEPROM.

set_freq(ch_no, freq)[source]

Set frequency of one channel.

set_gain(ch_no, volts)[source]

Set amplitude of one channel.

set_phase(ch_no, phase)[source]

Set phase of one channel.

set_phase_continuous(is_continuous)[source]

Toggle phase continuous mode.

Sends the “M n” command. This turns off the automatic clearing of the phase register. In this mode, the phase register is left intact when a command is performed. Use this mode if you want frequency changes to remain phase synchronous, with no phase discontinuities.

Parameters: is_continuous – True or False
set_simultaneous_update(simultaneous)[source]

Set simultaneous update mode.

Sends the “I m” command. In this mode an update pulse will not be sent to the DDS chip until an “I p” command is sent. This is useful when it is important to change all the outputs to new values simultaneously.

setup()[source]

Initial setup of 409B.

### Controller¶

ARTIQ controller for the Novatech 409B 4-channel DDS box

usage: aqctl_novatech409b [-h] [--bind BIND] [--no-localhost-bind] [-p PORT]
[-d DEVICE] [--simulation] [-v] [-q]

Options:
 --bind=[] additional hostname or IP address to bind to; use ‘*’ to bind to all interfaces (default: %(default)s) --no-localhost-bind=False do not implicitly also bind to localhost addresses -p=3254, --port=3254 TCP port to listen on (default: %(default)d) -d, --device serial port. --simulation=False Put the driver in simulation mode, even if –device is used. -v=0, --verbose=0 increase logging level -q=0, --quiet=0 decrease logging level

## Thorlabs T-Cube¶

Note

When power is applied before the USB connection, some devices will enter a state where they fail to report the completion of commands. When using the ARTIQ controller, this cause certain function calls to never return and freeze the controller. To prevent this, connect USB first and then power up the device. When a device has entered the problematic state, power-cycling it while keeping the USB connection active also resolves the problem.

### TDC001 Driver¶

class artiq.devices.thorlabs_tcube.driver.Tdc(*args, **kwargs)[source]
get_av_modes()[source]

Get the LED indicator mode bits.

Returns: The LED indicator mode bits. int
get_button_parameters()[source]

Get button parameters.

Returns: A 3 int tuple containing in this order: button mode, position1 and position2. Cf. set_button_parameters() for description. A 3 int tuple
get_dc_pid_parameters()[source]

Get the position control loop parameters.

Returns: A 5 int tuple containing in this order: proportional gain, integral gain, differential gain, integral limit and filter control. Cf. set_dc_pid_parameters() for precise description. A 5 int tuple.
get_dc_status_update()[source]

Request a status update from the motor.

Returns: A 3 int tuple containing in this order: position, velocity, status bits. A 3 int tuple
get_encoder_counter()[source]

Get encoder count from the controller.

Returns: The value of the encoder counter. int
get_gen_move_parameters()[source]

Get the backlash distance.

Returns: The value of the backlash distance. int
get_home_parameters()[source]

Get the homing velocity parameter.

Returns: The homing velocity. int
get_jog_parameters()[source]

Get the velocity jog parameters.

Returns: A 5 int tuple containing in this order: jog_mode, step_size, acceleration, max_velocity, stop_mode A 5 int tuple.
get_limit_switch_parameters()[source]

Get the limit switch parameters.

Returns: A 2 int tuple containing the following in order: cw_hw_limit, ccw_hw_limit. Cf. description in set_limit_switch_parameters() method. A 2 int tuple.
get_move_absolute_parameters()[source]

Get the absolute position move parameter.

Returns: The absolute position to move. int
get_move_relative_parameters()[source]

Get the relative distance move parameter.

Returns: The relative distance move parameter. int
get_position_counter()[source]

Get the “live” position count from the controller.

Returns: The value of the position counter. int
get_pot_parameters()[source]

Get pot parameters.

Returns: An 8 int tuple containing the following values: zero_wnd, vel1, wnd1, vel2, wnd2, vel3, wnd3, vel4. See set_pot_parameters() for a description of each tuple element meaning. An 8 int tuple
get_status_bits()[source]

Request a cut down version of the status update with status bits.

Returns: The motor status.
get_velocity_parameters()[source]

Get the trapezoidal velocity parameters.

Returns: A 2 int tuple: (acceleration, max_velocity). A 2 int tuple (int, int)
move_absolute(absolute_distance)[source]

Start an absolute move.

Parameters: absolute_distance – The distance to move. This is a signed integer that specifies the absolute distance in position encoder counts.
move_absolute_memory()[source]

Start an absolute move of distance in the controller’s memory.

The absolute move position parameter used for the move will be the parameter sent previously by a set_move_absolute_parameters() command.

move_home()[source]

Start a home move sequence.

This call is blocking until device is homed or move is stopped.

move_jog(direction)[source]

Start a jog move.

Parameters: direction – The direction to jog. 1 is forward, 2 is backward.
move_relative(relative_distance)[source]

Start a relative move

Parameters: relative_distance – The distance to move in position encoder counts.
move_relative_memory()[source]

Start a relative move of distance in the controller’s memory

The relative distance parameter used for the move will be the parameter sent previously by a set_move_relative_parameters() command.

move_stop(stop_mode)[source]

Stop any type of motor move.

Stops any of those motor move: relative, absolute, homing or move at velocity.

Parameters: stop_mode – The stop mode defines either an immediate (abrupt) or profiled stop. Set this byte to 1 to stop immediately, or to 2 to stop in a controlled (profiled) manner.
move_velocity(direction)[source]

Start a move.

When this method is called, the motor will move continuously in the specified direction using the velocity parameter set by the set_move_relative_parameters() command until a move_stop() command (either StopImmediate or StopProfiled) is called, or a limit switch is reached.

Parameters: direction – The direction to jog: 1 to move forward, 2 to move backward.
resume_end_of_move_messages()[source]

Resume all unsolicited “end of move” messages and error messages returned by the controller.

i.e., MGMSG.MOT_MOVE_STOPPED, MGMSG.MOT_MOVE_COMPLETED, MGMSG.MOT_MOVE_HOMED

The command also disables the error messages that the controller sends when an error condition is detected: MGMSG.HW_RESPONSE, MGMSG.HW_RICHRESPONSE

set_av_modes(mode_bits)[source]

Set the LED indicator modes.

The LED on the control keyboard can be configured to indicate certain driver states.

Parameters: mode_bits – Set the bit 0 will make the LED flash when the ‘Ident’ message is sent. Set the bit 1 will make the LED flash when the motor reaches a forward or reverse limit switch. Set the bit 3 (value 8) will make the LED lit when motor is moving.
set_button_parameters(mode, position1, position2)[source]

Set button parameters.

The control keypad can be used either to jog the motor, or to perform moves to absolute positions. This function is used to set the front panel button functionality.

Parameters: mode – If set to 1, the buttons are used to jog the motor. Once set to this mode, the move parameters for the buttons are taken from the arguments of the set_jog_parameters() method. If set to 2, each button can be programmed with a differente position value such that the controller will move the motor to that position when the specific button is pressed. position1 – The position (in encoder counts) to which the motor will move when the top button is pressed. position2 – The position (in encoder counts) to which the motor will move when the bottom button is pressed.
set_dc_pid_parameters(proportional, integral, differential, integral_limit, filter_control=15)[source]

Set the position control loop parameters.

Parameters: proportional – The proportional gain, values in range [0; 32767]. integral – The integral gain, values in range [0; 32767]. differential – The differential gain, values in range [0; 32767]. integral_limit – The integral limit parameter is used to cap the value of the integrator to prevent runaway of the integral sum at the output. Values are in range [0; 32767]. If set to 0, then integration term in the PID loop is ignored. filter_control – Identifies which of the above are applied by setting the corresponding bit to 1. By default, all parameters are applied, and this parameter is set to 0x0F (1111).
set_eeprom_parameters(msg_id)[source]

Save the parameter settings for the specified message.

Parameters: msg_id – The message ID of the message containing the parameters to be saved.
set_encoder_counter(encoder_count)[source]

Set encoder count in the controller.

This is only applicable to stages and actuators fitted with an encoder. In general this command is not normally used. Instead the device is homed at power-up.

Parameters: encoder_count – The new value of the encoder counter.
set_gen_move_parameters(backlash_distance)[source]

Set the backlash distance.

Parameters: backlash_distance – The value of the backlash distance, which specifies the relative distance in position counts.
set_home_parameters(home_velocity)[source]

Set the homing velocity parameter.

Parameters: home_velocity – Homing velocity.
set_jog_parameters(mode, step_size, acceleration, max_velocity, stop_mode)[source]

Set the velocity jog parameters.

Parameters: mode – 1 for continuous jogging, 2 for single step jogging. step_size – The jog step size in encoder counts. acceleration – The acceleration in encoder counts/sec/sec. max_velocity – The maximum (final) velocity in encoder counts/sec. stop_mode – 1 for immediate (abrupt) stop, 2 for profiled stop (with controlled deceleration).
set_limit_switch_parameters(cw_hw_limit, ccw_hw_limit)[source]

Set the limit switch parameters.

Parameters: cw_hw_limit – The operation of clockwise hardware limit switch when contact is made. 0x01 Ignore switch or switch not present. 0x02 Switch makes on contact. 0x03 Switch breaks on contact. 0x04 Switch makes on contact - only used for homes (e.g. limit switched rotation stages). 0x05 Switch breaks on contact - only used for homes (e.g. limit switched rotations stages). 0x06 For PMD based brushless servo controllers only - uses index mark for homing. Note. Set upper bit to swap CW and CCW limit switches in code. Both CWHardLimit and CCWHardLimit structure members will have the upper bit set when limit switches have been physically swapped. ccw_hw_limit – The operation of counter clockwise hardware limit switch when contact is made.
set_move_absolute_parameters(absolute_position)[source]

Set the following absolute move parameter: absolute_position.

Parameters: absolute_position – The absolute position to move. This is a signed integer that specifies the absolute move position in encoder counts.
set_move_relative_parameters(relative_distance)[source]

Set the following relative move parameter: relative_distance.

Parameters: relative_distance – The distance to move. This is a signed integer that specifies the relative distance in position encoder counts.
set_position_counter(position)[source]

Set the “live” position count in the controller.

In general, this command is not normally used. Instead, the stage is homed immediately after power-up; and after the homing process is completed, the position counter is automatically updated to show the actual position.

Parameters: position – The new value of the position counter.
set_pot_parameters(zero_wnd, vel1, wnd1, vel2, wnd2, vel3, wnd3, vel4)[source]

Set pot parameters.

Parameters: zero_wnd – The deflection from the mid position (in ADC counts 0 to 127) before motion can start. vel1 – The velocity to move when between zero_wnd and wnd1. wnd1 – The deflection from the mid position (in ADC counts zero_wnd to 127) to apply vel1. vel2 – The velocity to move when between wnd1 and wnd2. wnd2 – The deflection from the mid position (in ADC counts wnd1 to 127) to apply vel2. vel3 – The velocity to move when between wnd2 and wnd3. wnd3 – The deflection from the mid position (in ADC counts wnd2 to 127) to apply vel3. vel4 – The velocity to move when beyond wnd3.
set_velocity_parameters(acceleration, max_velocity)[source]

Set the trapezoidal velocity parameter.

Parameters: acceleration – The acceleration in encoder counts/sec/sec. max_velocity – The maximum (final) velocity in counts/sec.
suspend_end_of_move_messages()[source]

Disable all unsolicited “end of move” messages and error messages returned by the controller.

i.e., MGMSG.MOT_MOVE_STOPPED, MGMSG.MOT_MOVE_COMPLETED, MGMSGS_MOT_MOVE_HOMED

### TPZ001 Driver¶

class artiq.devices.thorlabs_tcube.driver.Tpz(serial_dev)[source]

Either set_tpz_io_settings() or get_tpz_io_settings() must be completed to finish initialising the driver.

get_input_volts_source()[source]

Get the input source(s) which controls the output from the HV amplifier circuit.

Returns: Value which selects the various analog sources, cf. set_input_volts_source() method docstring for meaning of bits. int
get_output_lut()[source]

Get the ouput LUT values for WGM (Waveform Generator Mode).

Returns: a tuple whose first element is the lut index and the second is the voltage output value. a 2 elements tuple (int, float)
get_output_lut_parameters()[source]

Get Waveform Generator Mode parameters.

Returns: a 6 int elements tuple whose members are (mode, cycle_length, num_cycles, delay_time, precycle_rest, postcycle_rest). 6 int elements tuple
get_output_position()[source]

Get output position of piezo actuator.

Returns: The output position of the piezo relative to the zero position. int
get_output_volts()[source]

Get the output voltage applied to the piezo actuator.

Returns: The output voltage. float
get_pi_constants()[source]

Get the proportional and integration feedback loop constants.

Returns: Returns a tuple whose first element is the proportional term and the second element is the integral term. a 2 int elements tuple : (int, int)
get_position_control_mode()[source]

Get the control loop mode.

Returns: Returns the control mode.0x01 for Open Loop (no feedback). 0x02 for Closed Loop (feedback employed). 0x03 for Open Loop Smooth. 0x04 for Closed Loop Smooth. int
get_tpz_display_settings()[source]

Get the intensity of the LED display on the front of the TPZ unit.

Returns: The intensity as a value from 0 (Off) to 255 (brightest). int
get_tpz_io_settings()[source]

Get various I/O settings.

Returns: Returns a tuple whose elements are the voltage limit and the Hub analog input. Refer to set_tpz_io_settings() for the meaning of those parameters. a 2 elements tuple (int, int)
set_eeprom_parameters(msg_id)[source]

Save the parameter settings for the specified message.

Parameters: msg_id – The message ID of the message containing the parameters to be saved.
set_input_volts_source(volt_src)[source]

Set the input source(s) which controls the output from the HV amplifier circuit (i.e. the drive to the piezo actuators).

Parameters: volt_src – The following values are entered into the VoltSrc parameter to select the various analog sources: 0x00 Software Only: Unit responds only to software inputs and the HV amp output is that set using the set_output_volts() method. 0x01 External Signal: Unit sums the differential signal on the rear panel EXT IN(+) and EXT IN(-) connectors with the voltage set using the set_outputvolts method. 0x02 Potentiometer: The HV amp output is controlled by a potentiometer input (either on the control panel, or connected to the rear panel User I/O D-type connector) summed with the voltage set using the set_outputvolts method. The values can be bitwise or’ed to sum the software source with either or both of the other source options.
set_output_lut(lut_index, output)[source]

Set the ouput LUT values for WGM (Waveform Generator Mode).

It is possible to use the controller in an arbitrary Waveform Generator Mode (WGM). Rather than the unit outputting an adjustable but static voltage or position, the WGM allows the user to define a voltage or position sequence to be output, either periodically or a fixed number of times, with a selectable interval between adjacent samples.

This waveform generation function is particularly useful for operations such as scanning over a particular area, or in any other application that requires a predefined movement sequence. The waveform is stored as values in an array, with a maximum of 513 samples.

The samples can have the meaning of voltage or position; if open loop operation is specified when the samples are output, then their meaning is voltage and vice versa, if the channel is set to closed loop operation, the samples are interpreted as position values.

If the waveform to be output requires less than 513 samples, it is sufficient to download the desired number of samples. This function is used to load the LUT array with the required output waveform. The applicable channel is specified by the Chan Ident parameter If only a sub set of the array is being used (as specified by the cyclelength parameter of the set_output_lut_parameters() function), then only the first cyclelength values need to be set. In this manner, any arbitrary voltage waveform can be programmed into the LUT. Note. The LUT values are output by the system at a maximum bandwidth of 7 KHz, e.g. 500 LUT values will take approximately 71 ms to be clocked out.

Parameters: lut_index – The position in the array of the value to be set (0 to 512 for TPZ). output – The voltage value to be set. Values are in the range [0; voltage_limit]. Voltage_limit being set with the set_tpz_io_settings method.
set_output_lut_parameters(mode, cycle_length, num_cycles, delay_time, precycle_rest, postcycle_rest)[source]

Set Waveform Generator Mode parameters.

It is possible to use the controller in an arbitrary Waveform Generator Mode (WGM). Rather than the unit outputting an adjustable but static voltage or position, the WGM allows the user to define a voltage or position sequence to be output, either periodically or a fixed number of times, with a selectable interval between adjacent samples. This waveform generation function is particularly useful for operations such as scanning over a particular area, or in any other application that requires a predefined movement sequence. This function is used to set parameters which control the output of the LUT array.

Parameters: mode – Specifies the ouput mode of the LUT waveform as follows: 0x01 - Output Continuous - The waveform is output continuously (i.e. until a StopOPLut command is received.) 0x02 - Output Fixed - A fixed number of waveform cycles are output (as specified in the num_cycles parameter). cycle_length – Specifies how many samples will be output in each cycle of the waveform. It can be set in the range [0; 512] (for TPZ). It must be less than or equal to the total number of samples that were loaded. num_cycles – Specifies the number of cycles (1 to 2147483648) to be output when the Mode parameter is set to fixed. If Mode is set to Continuous, the num_cycles parameter is ignored. In both cases, the waveform is not output until a StartOPLUT command is received. delay_time – Specifies the delay (in sample intervals) that the system waits after setting each LUT output value. By default, the time the system takes to output LUT values (sampling interval) is set at the maximum bandwidth possible, i.e. 4 kHz (0.25 ms) for TPZ units. The delay_time parameter specifies the time interval between neighbouring samples, i.e. for how long the sample will remain at its present value. To increase the time between samples, set the delay_time parameter to the required additional delay (1 to 2147483648 sample intervals). In this way, the user can stretch or shrink the waveform without affecting its overall shape. precycle_rest – In some applications, during waveform generation the first and the last samples may need to be handled differently from the rest of the waveform. For example, in a positioning system it may be necessary to start the movement by staying at a certain position for a specified length of time, then perform a movement, then remain at the last position for another specified length of time. This is the purpose of precycle_rest and postcycle_rest parameters, i.e. they specify the length of time that the first and last samples are output for, independently of the delay_time parameter. The precycle_rest parameter allows a delay time to be set before the system starts to clock out the LUT values. The delay can be set between 0 and 2147483648 sample intervals. The system then outputs the first value in the LUT until the PreCycleRest time has expired. postcycle_rest – In a similar way to precycle_rest, the postcycle_rest parameter specifies the delay imposed by the system after a LUT table has been output. The delay can be set between 0 and 2147483648 sample intervals. The system then outputs the last value in the cycle until the postcycle_rest time has expired.
set_output_position(position_sw)[source]

Set output position of the piezo actuator.

This command is only applicable in Closed Loop mode. If called when in Open Loop mode, it is ignored. The position of the actuator is relative to the datum set for the arrangement using the ZeroPosition method.

Parameters: position_sw – The output position of the piezo relative to the zero position. The voltage is set in the range [0; 32767] or [0; 65535] depending on the unit. This corresponds to 0 to 100% of the maximum piezo extension.
set_output_volts(voltage)[source]

Set output voltage applied to the piezo actuator.

This command is only applicable in Open Loop mode. If called when in Closed Loop mode it is ignored.

Parameters: voltage – The output voltage applied to the piezo when operating in open loop mode. The voltage value must be in range [0; voltage_limit]. Voltage_limit being set by the set_tpz_io_settings() method between the three values 75 V, 100 V and 150 V.
set_pi_constants(prop_const, int_const)[source]

Set the proportional and integration feedback loop constants.

These parameters determine the response characteristics when operating in closed loop mode. The processors within the controller compare the required (demanded) position with the actual position to create an error, which is then passed through a digital PI-type filter. The filtered value is used to develop an output voltage to drive the pizeo.

Parameters: prop_const – Value of the proportional term in range [0; 255]. int_const – Value of the integral term in range [0; 255].
set_position_control_mode(control_mode)[source]

Set the control loop mode.

When in closed-loop mode, position is maintained by a feedback signal from the piezo actuator. This is only possible when using actuators equipped with position sensing.

Parameters: control_mode – 0x01 for Open Loop (no feedback). 0x02 for Closed Loop (feedback employed). 0x03 for Open Loop Smooth. 0x04 for Closed Loop Smooth.
set_tpz_display_settings(intensity)[source]

Set the intensity of the LED display on the front of the TPZ unit.

Parameters: intensity – The intensity is set as a value from 0 (Off) to 255 (brightest).
set_tpz_io_settings(voltage_limit, hub_analog_input)[source]

Set various I/O settings.”

Parameters: voltage_limit – The piezo actuator connected to the T-Cube has a specific maximum operating voltage. This parameter sets the maximum output to the value among the following ones: 75 V limit. 100 V limit. 150 V limit. hub_analog_input – When the T-Cube piezo driver unit is used in conjunction with the T-Cube Strain Gauge Reader (TSG001) on the T-Cube Controller Hub (TCH001), a feedback signal can be passed from the Strain Gauge Reader to the Piezo unit. High precision closed loop operation is then possible using the complete range of feedback-equipped piezo actuators. This parameter is routed to the Piezo unit as follows: 0x01: the feedback signals run through all T-Cube bays. 0x02: the feedback signals run between adjacent pairs of T-Cube bays (i.e. 1&2, 3&4, 5&6). This setting is useful when several pairs of Strain Gauge/Piezo Driver cubes are being used on the same hub. 0x03: the feedback signals run through the read panel SMA connectors.
start_lut_output()[source]

Start the voltage waveform (LUT) outputs.

stop_lut_output()[source]

Stop the voltage waveform (LUT) outputs.

### Controller¶

usage: aqctl_thorlabs [-h] -P PRODUCT [-d DEVICE] [--simulation] [--bind BIND]
[--no-localhost-bind] [-p PORT] [-v] [-q]

Options:
 -P, --product type of the Thorlabs T-Cube device to control: tdc001/tpz001 -d, --device serial device. See documentation for how to specify a USB Serial Number. --simulation=False Put the driver in simulation mode, even if –device is used. --bind=[] additional hostname or IP address to bind to; use ‘*’ to bind to all interfaces (default: %(default)s) --no-localhost-bind=False do not implicitly also bind to localhost addresses -p=3255, --port=3255 TCP port to listen on (default: %(default)d) -v=0, --verbose=0 increase logging level -q=0, --quiet=0 decrease logging level

### TDC001 controller usage example¶

First, run the TDC001 controller:

$aqctl_thorlabs_tcube -P TDC001 -d /dev/ttyUSBx  Note On Windows the serial port (the -d argument) will be of the form COMx. Note Anything compatible with serial_for_url can be given as a device in -d argument. For instance, if you want to specify the Vendor/Product ID and the USB Serial Number, you can do: -d "hwgrep://<VID>:<PID> SNR=<serial_number>". for instance: -d "hwgrep://0403:faf0 SNR=83852734" The hwgrep URL works on both Linux and Windows. Then, send commands to it via the artiq_rpctool utility: $ artiq_rpctool ::1 3255 list-targets
Target(s):   tdc001
$artiq_rpctool ::1 3255 call move_relative 10000 # will move forward$ artiq_rpctool ::1 3255 call move_relative -10000 # will move backward
$artiq_rpctool ::1 3255 call move_absolute 20000 # absolute move to 20000$ artiq_rpctool ::1 3255 call move_home # will go back to home position
$artiq_rpctool ::1 3255 call close # close the device  ### TPZ001 controller usage example¶ First, run the TPZ001 controller: $ aqctl_thorlabs_tcube -P TPZ001 -d /dev/ttyUSBx


Note

On Windows the serial port (the -d argument) will be of the form COMx.

Note

See the TDC001 documentation for how to specify the USB Serial Number of the device instead of the /dev/ttyUSBx (or the COMx name).

Then, send commands to it via the artiq_rpctool utility:

$artiq_rpctool ::1 3255 list-targets Target(s): tpz001$ artiq_rpctool ::1 3255 call set_output_volts 15 # set output voltage to 15 V
$artiq_rpctool ::1 3255 call get_output_volts # read back output voltage 15$ artiq_rpctool ::1 3255 call set_tpz_io_settings 150 1 # set maximum output voltage to 150 V
$artiq_rpctool ::1 3255 call set_output_volts 150 # set output voltage to 150 V$ artiq_rpctool ::1 3255 call close # close the device