Skip to main content

a lightweight python interface for ASI brand Tiger Controllers

Project description

TigerASI

a feature-rich Python interface for ASI Tiger Controllers.

This driver was written to simplify the serial api to ASI's Tiger Controllers while reduce reliance on their documentation for most users. Many (but not all!) of the commands have been exposed and wrapped in a simplified, self-consistent interface and documented for easy usage.

Installation

To install this package from PyPI, invoke: pip install TigerASI.

To install this package from the github repository in editable mode, from this directory invoke pip install -e .

Intro and Basic Usage

from tigerasi.tiger_controller import TigerController

box = TigerController("COM4")

The basic command syntax looks like this:

box.zero_in_place('x', 'y')  # Zero out the specified axes at their current location.
box.move_axes_absolute(x=1000, y=25)  # Move to an absolute location in "stage units" (tenths of microns).
box.move_axes_relative(z=100) # Move z +100 stage units in the positive z direction.

Syntax Basics

All commands that reference stage axes accept a variable, optional number of arguments.

box.zero_in_place('x')  # only zeros the x axis. Other axes are ignored.

Stage axes are also case-insensitive,

box.zero_in_place('X', 'y', 'Z')  # also ok

and the order doesn't matter.

box.zero_in_place('y', 'z', 'x')  # also ok 

All commands that query stage axes return a dict, keyed by upper-case stage axis.

box.get_position('x', 'z', 'y')
# {'X': 100.0, 'Y': 305.0, 'Z': 10000.0}

Some commands can take an axis setting to be "current value" and another axis setting to be a specified value. The syntax for these commands look like this:

box.set_home('x', 'z', y=100.0) # Set x and z axes homing location to current spot. Set y axis to specific spot.
box.set_home('z', 'y', 'x', m=100.0, n=200.0) # variable number of arguments ok! order and case don't matter.

Advanced Usage

Many (but not all!) of ASI's more advanced features have been made available via this simplified API. This list includes joystick enabling/disabling and remapping, setting stage travel limits, queuing moves into the hardware buffer, and many other more nuanced features. For a breakdown of what commands have been exposed, have a look at the examples and the docs.

Documentation

Docs can be generated via Sphinx. Stay tuned for docs made available online.

Implementation Details

Blocking or Non-Blocking?

All commands to the Tigerbox return a reply. Commands that query the Tigerbox state will also return data with that reply.

Waiting for a reply introduces 10-20[ms] of execution time before the function returns. By default, methods will block until receiving this reply unless otherwise specified, like this:

box.move_axes_absolute(x=1000, y=25, wait_for_output=False, wait_for_reply=False) # will not block.

This behavior can only be used for commands to change the Tigerbox state. Commands that query the Tigerbox state will always block until they receive a hardware reply.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TigerASI-0.0.4.tar.gz (19.4 kB view hashes)

Uploaded Source

Built Distribution

TigerASI-0.0.4-py3-none-any.whl (21.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page