Skip to main content

Python wrappers for Thorlabs Elliptec ELLx modules on a shared serial bus.

Project description

Thorlabs Elliptec Motorized Stages

Python wrappers for Thorlabs Elliptec ELLx modules, organized by device family and built on a shared serial-bus architecture.

This project provides:

  • a shared RS-232 transport layer (ElliptecBus)
  • common protocol/motion mixins (ElliptecBase)
  • device-family APIs for rotary, linear, slider, and iris modules
  • a practical bench test script for ELL16 (ell16_bench_test.py)

Project Structure

  • ElliptecBus/
    • elliptec_bus.py: low-level bus I/O, packet parsing, address handling, status checks
    • elliptec_models.py: DeviceInfo and MotorInfo data models
  • ElliptecBase/
    • elliptec_base.py: shared parsing helpers and base mixins used by all families
  • ElliptecRotaryStages/
    • ELL14.py, ELL16.py, ELL18.py, ELL21.py, rotary_base.py
  • ElliptecLinearStages/
    • ELL17.py, ELL20.py, linear_base.py
  • ElliptecMultiPositionSlider/
    • ELL6.py, ELL6B.py, ELL9.py, ELL12.py, slider_base.py
  • ElliptecMotorized_IRIS/
    • ELL15.py, ELL15Z.py, iris_base.py
  • ell16_bench_test.py: CLI smoke test for ELL16

Supported Device Groups

Rotary

  • Ell14
  • Ell16
  • Ell18
  • Ell21

Linear

  • Ell17
  • Ell20

Multi-Position Slider

  • Ell6
  • Ell6B
  • Ell9
  • Ell12

Iris

  • Ell15
  • Ell15Z

Communication protocol

For the complete communication protocol covering all Thorlabs ELLx models, see the official Thorlabs manual:

Documentation:

https://thorlabs-elliptec-motorized-stages.readthedocs.io/en/latest/


Requirements

  • Python 3.9+ recommended
  • pyserial

Install runtime dependency:

pip install pyserial

Quick Start

1) Connect to a bus

from ElliptecBus.elliptec_bus import ElliptecBus
from ElliptecRotaryStages.ELL16 import Ell16

with ElliptecBus("COM18") as bus:
    stage = Ell16(bus, address="0")
    print(stage.get_info())
    print(stage.get_status())
    print(stage.get_position_degrees())

2) Typical motion calls

with ElliptecBus("COM18") as bus:
    stage = Ell16(bus, address="0")
    stage.home(direction="cw")
    stage.move_absolute_degrees(90.0)
    stage.set_jog_step_degrees(5.0)
    stage.jog_forward()

Bench Validation Script (ELL16)

Use the included test helper:

python ell16_bench_test.py COM18
python ell16_bench_test.py COM18 --home --move 90
python ell16_bench_test.py COM18 --jog-forward 5
python ell16_bench_test.py COM18 --jog-backward 2

Useful options:

  • --address (default 0)
  • --motion-timeout
  • --auto-validate-model

On Windows, find your COM port in Device Manager (Ports (COM & LPT)).


Addressing and Bus Behavior

  • Elliptec device addresses are hexadecimal: 0 to F.
  • One serial bus can host multiple modules on different addresses.
  • The wrappers are designed for addressed communication over one shared bus object.

Error Handling

Core exceptions from ElliptecBus:

  • ElliptecError: base exception
  • ElliptecTimeoutError: no response in time
  • ElliptecProtocolError: malformed/unexpected packet
  • ElliptecDeviceError: non-zero GS status code returned by device

STATUS_MESSAGES maps known GS codes to human-readable descriptions.


Documentation (Sphinx / Read the Docs)

Sphinx docs are included in docs/ and configured via:

  • .readthedocs.yaml
  • requirements-docs.txt
  • docs/conf.py
  • docs/index.rst
  • docs/api.rst

Local docs build:

pip install -r requirements-docs.txt
python -m sphinx -b html docs docs/_build/html

License

This project is licensed under the Apache License 2.0.

See the LICENSE file for full terms.


Notes

  • This project focuses on command/control protocol behavior for ELLx modules.
  • Always verify device model/address before issuing motion commands on shared buses.
  • For production integrations, consider adding application-level retries, logging, and safety interlocks.

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

thorlabs_elliptec_motorized_stages-1.0.0.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file thorlabs_elliptec_motorized_stages-1.0.0.tar.gz.

File metadata

File hashes

Hashes for thorlabs_elliptec_motorized_stages-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e2a6562016d7b9ca9809cd10734f60c928d455505b85ef2441d03503ef413751
MD5 58c6e299cb81a8a67d2ee8883500085c
BLAKE2b-256 cb1968ba15f4064ce86e2a36cb2bbb180577a7d468a89aef635f9697b923d716

See more details on using hashes here.

File details

Details for the file thorlabs_elliptec_motorized_stages-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thorlabs_elliptec_motorized_stages-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b591bea8a16d59cc67ae0fb0301c77a0919f4cb95db4c8cede06811925d8be61
MD5 1f5ea25ee524a07c67bdc8b92738165d
BLAKE2b-256 893204033506b3d384b91391b79fefd26f2370a2517f9a9122f5f2bb44805a49

See more details on using hashes here.

Supported by

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