Network device support packages reference

PDQ2

Driver

class artiq.devices.pdq2.driver.Pdq2(url=None, dev=None, num_boards=3)[source]

PDQ DAC (a.k.a. QC_Waveform)

Mediator

exception artiq.devices.pdq2.mediator.ArmError[source]

Raised when attempting to arm an already armed PDQ, to modify the program of an armed PDQ, or to play a segment on a disarmed PDQ.

exception artiq.devices.pdq2.mediator.FrameActiveError[source]

Raised when a frame is active and playback of a segment from another frame is attempted.

exception artiq.devices.pdq2.mediator.InvalidatedError[source]

Raised when attemting to use a frame or segment that has been invalidated (due to disarming the PDQ).

exception artiq.devices.pdq2.mediator.SegmentSequenceError[source]

Raised when attempting to play back a named segment which is not the next in the sequence.

Controller

PDQ2 controller

usage: pdq2_controller [-h] [--bind BIND] [--no-localhost-bind] [-p PORT]
                       [-d DEVICE] [--simulation] [--dump DUMP] [-r]
                       [-b BOARDS] [-v] [-q]
Options:
--bind=[] additional hostname or IP addresse 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=3252, --port=3252
 TCP port to listen on (default: %(default)d)
-d, --device serial port
--simulation=False
 do not open any device but dump data
--dump=pdq2_dump.bin
 file to dump simulation data into
-r=False, --reset=False
 reset device [%(default)s]
-b=3, --boards=3
 number of boards [%(default)s]
-v=0, --verbose=0
 increase logging level
-q=0, --quiet=0
 decrease logging level

Client

PDQ2 client. Evaluates times and voltages, interpolates and uploads them to the controller.

usage: pdq2_client [-h] [-s SERVER] [--port PORT] [-c CHANNEL] [-f FRAME]
                   [-t TIMES] [-u VOLTAGES] [-o ORDER] [-e] [-v] [-q]
Options:
-s=::1, --server=::1
 hostname or IP of the controller to connect to
--port=3252 TCP port to use to connect to the controller
-c=0, --channel=0
 channel: 3*board_num+dac_num [%(default)s]
-f=0, --frame=0
 frame [%(default)s]
-t=np.arange(5)*1e-6, --times=np.arange(5)*1e-6
 sample times (s) [%(default)s]
-u=(1-np.cos(t/t[-1]*2*np.pi))/2, --voltages=(1-np.cos(t/t[-1]*2*np.pi))/2
 sample voltages (V) [%(default)s]
-o=3, --order=3
 interpolation (0: const, 1: lin, 2: quad, 3: cubic) [%(default)s]
-e=False, --free=False
 software trigger [%(default)s]
-v=0, --verbose=0
 increase logging level
-q=0, --quiet=0
 decrease logging level

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:

Returns the value read from the device.

Return type:

bytes

get_attenuation()[source]

Reads attenuation value from Lab Brick device.

Returns:Returns the attenuation value in dB.
Return type: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.
Return type:float
set_attenuation(attenuation)[source]

Stores the new attenuation value.

Parameters:attenuation – The attenuation value in dB.

Controller

On Linux, you need to give your user access to the USB device.

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:

$ lda_controller -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: lda_controller [-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 addresse 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

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: novatech409b_controller [-h] [--bind BIND] [--no-localhost-bind]
                               [-p PORT] [-d DEVICE] [--simulation] [-v] [-q]
Options:
--bind=[] additional hostname or IP addresse 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.
Return type: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.
Return type: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.
Return type:A 5 int tuple.
get_dc_status_update()[source]

Request a status update from the motor.

This can be used instead of enabling regular updates.

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

Get encoder count from the controller.

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

Get the backlash distance.

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

Get the homing velocity parameter.

Returns:The homing velocity.
Return type: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
Return type: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.
Return type:A 2 int tuple.
get_move_absolute_parameters()[source]

Get the absolute position move parameter.

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

Get the relative distance move parameter.

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

Get the “live” position count from the controller.

Returns:The value of the position counter.
Return type: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.
Return type:An 8 int tuple
get_status_bits()[source]

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

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

Get the trapezoidal velocity parameters.

Returns:A 2 int tuple: (acceleration, max_velocity).
Return type: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]
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.
Return type: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.
Return type: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).
Return type: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.
Return type:int
get_output_volts()[source]

Get the output voltage applied to the piezo actuator.

Returns:The output voltage.
Return type: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.
Return type: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.

Return type: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).
Return type: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.
Return type: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: thorlabs_controller [-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 addresse 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:

$ thorlabs_tcube_controller -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:

$ thorlabs_tcube_controller -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