tl_elliptec¶
Python library for Thorlabs Elliptec (ELLx) resonant piezo motor modules — rotary stages, linear stages, multi-position sliders, filter wheels, and the motorized iris. Implements the ASCII-hex serial protocol from Thorlabs’ own protocol manual over a multidrop TTL RS-232 / USB bus, including a priority-based request broker so background position polling never delays a move you’re waiting on.
Supported devices: ELL6, ELL6B, ELL9, ELL12, ELL14, ELL15, ELL16, ELL17, ELL18, ELL20, ELL21, ELL22.
Source and issue tracker: https://github.com/TapyrLabs/tl_elliptec
Note
This is an unofficial, community-maintained library. It is not affiliated with, endorsed by, or sponsored by Thorlabs, Inc. “Thorlabs” and “Elliptec” are trademarks of Thorlabs, Inc., used here only to identify the hardware this library talks to.
Install¶
pip install tl_elliptec
Quick start¶
A single device wired straight to its controller (no hub) — construct the model class directly from the serial port; it opens and owns the port itself:
from tl_elliptec import ELL20
with ELL20("COM5") as stage: # "/dev/ttyUSB0" on Linux/macOS
stage.home()
stage.move_absolute(10) # 10 mm — physical units, not raw pulses
print(stage.get_position()) # 10.0
Several devices sharing one bus (a hub) — create one ElliptecBus and hand
it to each device:
from tl_elliptec import ElliptecBus, discover_devices
with ElliptecBus("COM5") as bus:
devices = discover_devices(bus) # probes addresses 0-F, builds the right class for each
for address, device in devices.items():
print(address, type(device).__name__, device.serial_number)
Continue with the guide below for units, multi-device address setup, position polling, and the full command reference.
Guide
API Reference
- protocol
is_valid_address()encode_int()decode_int()encode_char()decode_char()encode_word()decode_word()encode_short()decode_short()encode_dword()decode_dword()encode_long()decode_long()encode_float()decode_float()encode_le_word()decode_le_word()decode_le_dword()build_message()parse_message()
- status
- exceptions
- bus
- factory
- devices