pylab_ml.pollux.pollux.Pollux

class Pollux(*args, **kwargs)[source]

Bases: LocalInstrument

Class to control the Pollux positioning controller via NI-VISA.

__init__(addr=3, instName='pollux')[source]

Initialize the Pollux controller instance and connect to the device, then calibrate the device and set the limits for each axis.

Parameters:
  • addr (int) – The address of the Pollux controller (default is 3).

  • instName (str) – The name of the Pollux controller instance (default is ‘pollux’).

Methods

__init__([addr, instName])

Initialize the Pollux controller instance and connect to the device, then calibrate the device and set the limits for each axis.

base_position()

Set the base position for each axis of the Pollux controller. The base position is set to the following for each axis:

calibrate()

Calibrate each axis of the Pollux controller to determine the origin (lower limit).

check_group_dialout()

Check if the user is in the 'dialout' group on UNIX systems, which is required for accessing serial ports.

connect()

Connect to the Pollux controller using NI-VISA settings that match LabVIEW's configuration.

disconnect()

Disconnect from the Pollux controller and close the VISA resource.

idtry(instrument)

Attempt to fix VISA termination characters to Query IDN.

list_com()

List all COM ports available on the system.

list_usb_serial_ports()

List all USB serial ports available on the system.

maximum_limits()

Determine the maximum limits for each axis of the Pollux controller.

resource_id(interface, address)

Generate the resource ID for the instrument based on its interface and address.

search4vidpid(addr[, backend])

Search for VID:PID in the addr.

serial_list([backend])

List all devices from serial-port (USB-Ports).

set_limits()

Set the maximum limits for each axis of the Pollux controller. The limits are set to the following for each axis: - X-axis : 60mm - Z-axis : 100mm - Angular axis : 354 degrees.

status()

Check the status of each axis (X, Z, Angular) and return True if all are ready, otherwise return False and log the reasons for each axis that is not ready.

stop()

Stop any ongoing movement of the Pollux controller.

Attributes

ang

Get the current angular position in degrees.

has_visa

interchoices

pos_x

Get the current position of the X-axis in millimeters.

pos_z

Get the current position of the Z-axis in millimeters.

speed_ang

Get the current angular speed in degrees per second.

speed_x

Get the current speed of the X-axis in millimeters per second.

speed_z

Get the current speed of the Z-axis in millimeters per second.

property ang

Get the current angular position in degrees.

base_position()[source]
Set the base position for each axis of the Pollux controller. The base position is set to the following for each axis:
  • X-axis : 40mm

  • Z-axis : 100mm

  • Angular axis : 0 degrees

calibrate()[source]

Calibrate each axis of the Pollux controller to determine the origin (lower limit).

check_group_dialout()

Check if the user is in the ‘dialout’ group on UNIX systems, which is required for accessing serial ports.

Returns:

True if the user is in the ‘dialout’ group or if the platform is Windows, False otherwise.

Return type:

bool

connect()[source]

Connect to the Pollux controller using NI-VISA settings that match LabVIEW’s configuration.

disconnect()[source]

Disconnect from the Pollux controller and close the VISA resource.

idtry(instrument)

Attempt to fix VISA termination characters to Query IDN.

Parameters:

instrument (Instrument) – The instrument object for which to attempt the IDN query.

Returns:

The IDN string returned by the instrument, with termination characters removed.

Return type:

str

list_com()

List all COM ports available on the system.

list_usb_serial_ports()

List all USB serial ports available on the system.

maximum_limits()[source]

Determine the maximum limits for each axis of the Pollux controller.

property pos_x

Get the current position of the X-axis in millimeters.

property pos_z

Get the current position of the Z-axis in millimeters.

pyvisa = <module 'pyvisa' from '/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/pyvisa/__init__.py'>
resource_id(interface, address)

Generate the resource ID for the instrument based on its interface and address.

Parameters:
  • interface (Interface) – The interface type of the instrument (e.g., GPIB, USB, serial).

  • address (str or int) – The address of the instrument.

Returns:

id_name – The resource ID string for the instrument.

Return type:

str

search4vidpid(addr, backend=None)

Search for VID:PID in the addr.

Parameters:
  • addr (str or int) – The address of the device in the format ‘VID:PID’ (e.g., ‘16C0:0483’).

  • backend (str, optional) – The backend to use for the search.

Returns:

The device name or address if found, otherwise None.

Return type:

str or int

serial_list(backend=None)

List all devices from serial-port (USB-Ports).

Parameters:

backend (str, optional) – The backend to use for the search. If None, the default backend is used. Can be @py’ or @ni’ to also print ASRL::INSTR.

set_limits()[source]

Set the maximum limits for each axis of the Pollux controller. The limits are set to the following for each axis:

  • X-axis : 60mm

  • Z-axis : 100mm

  • Angular axis : 354 degrees

property speed_ang

Get the current angular speed in degrees per second.

property speed_x

Get the current speed of the X-axis in millimeters per second.

property speed_z

Get the current speed of the Z-axis in millimeters per second.

status()[source]

Check the status of each axis (X, Z, Angular) and return True if all are ready, otherwise return False and log the reasons for each axis that is not ready.

Returns:

True if all axes are ready, False otherwise.

Return type:

bool

stop()[source]

Stop any ongoing movement of the Pollux controller.