ThorLabs APT piezo inertia actuator

Pieces for interacting with ThorLabs piezo inertia actuator controllers through the APT interface using the puzzlepiece framework.

Example usage (see Getting started for more details on using Pieces in general):

import puzzlepiece as pzp
from pzp_hardware.thorlabs import apt_piezo

app = pzp.QApp()
puzzle = pzp.Puzzle(debug=False)
puzzle.add_piece("stage", apt_piezo.Piece, row=0, column=0)
puzzle.show()
app.exec()

Installation

  • Install the APT Software from https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=9019

  • Locate the APT Server folder in the APT installation directory (usually C:\Program Files\Thorlabs\APT\APT Server) and copy its path.

  • When running the Piece for the first time, you will be asked for the DLL directory - provide the one you copied above.

Requirements

This Piece has additional requirements. You will be asked to install them at runtime, or you may choose to install them ahead of time.

  • thorlabs_aptpip install thorlabs-apt

Troubleshooting

If APT or your application crashes while connected to a stage, subsequent attempts to load APT will likely crash. To fix this, you can:

  • Restart the affected stages

  • Restart the affected computer

  • Use the Kinesis software to perform a quick fix (the fastest method, but requires additional software):

Note that there can only be one isntance of the APT server running at any time. If you are connected to a stage in this Piece and would like to use APT in another application, disconnect from the stage in the Piece. If you are not connected to a stage, you can still release APT from the puzzlepiece process by using this Piece’s Cleanup action (available from the Tree view, button at the bottom of the Puzzle or F1).

Available Pieces

class pzp_hardware.thorlabs.apt_piezo.Base(puzzle=None, custom_horizontal=None, param_defaults=None, *args, **kwargs)[source]

Bases: APTBase

../_images/pzp_hardware.thorlabs.apt_piezo.Base.png

Base Piece that doesn’t define any channels, and should be inherited to provide a Piece matching your piezo configuration. Two examples are included: Piece and DoublePiece.

make_channel(name, i)[source]

Create a named param for a channel number with a setter and getter. Should be called within define_params to create params for your piezo controllers x, y, z, etc axes:

def define_params(self):
    super().define_params()

    for i, name in zip((0, 1), "xy"):
        self.make_channel(name, i)
Parameters:
  • name – name of the channel/param to create

  • i – index of the channel on the piezo controller

Return type:

puzzlepiece.param.ParamInt

class pzp_hardware.thorlabs.apt_piezo.Piece(puzzle=None, custom_horizontal=None, param_defaults=None, *args, **kwargs)[source]

Bases: Base

A Piece that defines two piezo channels, x and y, for example to control a mirror.

../_images/pzp_hardware.thorlabs.apt_piezo.Piece.png
class pzp_hardware.thorlabs.apt_piezo.DoublePiece(puzzle=None, custom_horizontal=None, param_defaults=None, *args, **kwargs)[source]

Bases: Base

A Piece that defines four piezo channels, an x and y times two, for example to control two mirrors.

../_images/pzp_hardware.thorlabs.apt_piezo.DoublePiece.png