Elliptec
Simple control of Thorlabs Elliptec™ devices.
Explore the docs »
Get started
·
Report a bug
·
Request a feature
About The Project
ThorLabs Elliptec™ devices offer a neat way to quickly set up automated workflows in optical systems. This project aims to provide a simple and quick way to control them directly from Python. It uses the pyserial library and is inspired by the TL-rotation-control project by Chris Baird. The end goal of the project is to reproduce the entire functionality of the official Elliptec™ Software.
💣 This library is still under active development. Serious bugs are present and breaking changes will be introduced.
Quickstart
A basic example, which shows how to use a shutter:
import elliptec
controller = elliptec.Controller('COM3')
sh = elliptec.Shutter(controller)
# Get information about the device
info = sh.get('info')
# Home the shutter before usage
sh.home()
# Open shutter, acquire, and close again
sh.open()
# ... acquire or perform other tasks
sh.close()
An example using a four-positional slider:
import elliptec
controller = elliptec.Controller('COM3')
sl = elliptec.Slider(controller)
# Home the slider before usage
sl.home()
# Move slider to position 3
sl.set_slot(3)
# Move slider forward (to position 4)
sl.move('forward')
An example using a rotator (mount or stage) to collect multiple polarizations/angles:
import elliptec
controller = elliptec.Controller('COM3')
ro = elliptec.Rotator(controller)
# Home the rotator before usage
ro.home()
# Loop over a list of angles and acquire for each
for angle in [0, 45, 90, 135]:
ro.set_angle(angle)
# ... acquire or perform other tasks
An example using a linear stage to find optimal focus:
import elliptec
controller = elliptec.Controller('COM3')
ls = elliptec.Linear(controller)
# Home the linear stage before usage
ls.home()
# Loop over a list of positions and measure gain for each
for distance in range(0, 61, 10):
ls.set_distance(distance)
# ... measure gain
Advanced examples
Multiple devices
Controlling multiple devices through one ELLB bus is possible. This requires some setup, first. By default, every device has an address of "0", so plugging in multiple devices all have the same address, leading to undefined behavior. In these examples, we'll assume you are combining a shutter and a rotator. First you need to change the addresses of each device independently. This can be done through the Elliptec™ Software, or over serial. For the serial assignment, unplug all but one device
import elliptec
# connect to shutter
controller = elliptec.Controller('COM4')
shutter = elliptec.Shutter(controller)
# change address and save
shutter.change_address("1")
shutter.save_user_data()
now, plug in the second device
# connect to rotator
rotator = elliptec.Rotator(controller)
rotator.change_address("2")
rotator.save_user_data()
Note, if you do not save_user_data the device address will be lost when the device loses power, requiring you to perform these address changes again, which requires plugging the devices in one-by-one, again.
Once the devices have been addressed, you can access them and use them by specifying their address when connecting:
import elliptec
# connect to devices
controller = elliptec.Controller('COM4')
shutter = elliptec.Shutter(controller, address='1')
rotator = elliptec.Rotator(controller, address='2')
# Home the shutter and the rotator
shutter.home()
rotator.home()
# Loop over a list of angles and open/acquire/close for each
for angle in [0, 90]:
rotator.set_angle(angle)
# Open shutter, acquire, and close again
shutter.open()
# ... acquire or perform other tasks
shutter.close()
List of supported devices
Currently (somewhat) supported devices:
- Dual-Position Slider (ELL6) - Thorlabs product page - useful as a shutter
- Four-Position Slider (ELL9) - Thorlabs product page - useful as a filter wheel
- Rotation Mount (ELL14) - Thorlabs product page - useful for polarization state generators
- Motorized Iris (ELL15) - Thorlabs product page - useful for aperture control
- Linear Stage (ELL17) - Thorlabs product page - useful for motorized focusing
- Rotation Stage (ELL18) - Thorlabs product page - useful for rotating mirrors
- Linear Stage (ELL20) - Thorlabs product page - useful for motorized focusing
As of right now, I do not have access to any other devices from the Elliptec™ family. If you are interested in controlling a device that is not on this list, feel free to reach out to me. Thank you to Thorlabs Inc. for providing me with some of the devices above for testing.
Untested (but possibly working) devices
These devices have never been tested with this library, but could potentially work with some minor code changes, since they share a design with one of the somewhat supported ones:
- Six-Position Slider (ELL12) - Thorlabs product page - useful as a filter wheel
The same could possibly extend to the discontinued/obsolete devices such as the ELL7, ELL8, and ELL10.
What works and what doesn't
What works:
- basic movement
- getting information about the device
- getting information about individual motors
- ability to control multiple devices on one controller via a bus module
What needs improvements:
- documentation
- tests (more devices, more details)
- automated discovery of devices
What is missing:
- safety (no library performed bounds checks etc)
- consistency (across methods, devices, returns, ...)
- adding devices by serial number
- searching for and setting optimal motor frequencies
- cleaning and optimization procedures
Some of the missing functionality can be performed using the official Elliptec™ Software.
Support
If you are going to use this code in any way, please let me know via email/twitter/issues or find my contact info on my website. I am working on this project in my spare time and need every piece of encouragement I can get! If this project was useful to you, please consider buying me a coffee ;).
Disclaimer
Thorlabs™ and Elliptec™ are registered trademarks of Thorlabs, Inc. This project is fully non-commercial and not affiliated with Thorlabs, Inc. in any capacity.
Metadata
Release files for elliptec 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| elliptec-0.1.0.tar.gz | 93.2 kB | With provenance | Details for elliptec-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| elliptec-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for elliptec-0.1.0-py3-none-any.whl |
Total release size: 135.6 kB
Release files / elliptec-0.1.0.tar.gz
| Download URL | elliptec-0.1.0.tar.gz |
|---|---|
| Size | 93.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9e19579bb558d1236d5796ed12c8c93a3d8d19a9815d07b06241ac7ad39abc0
|
|
BLAKE2b-256 checksum How to use checksums |
72f048c6adf3b914be3b3e33d30bf9604f5da6416be23a97233555c173914397
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.
Transparency logRelease files / elliptec-0.1.0-py3-none-any.whl
| Download URL | elliptec-0.1.0-py3-none-any.whl |
|---|---|
| Size | 42.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0aab63f5497d2f40af00ac1d3c5096e456006984d9bbbca98ef1e8fbf9c1b549
|
|
BLAKE2b-256 checksum How to use checksums |
c7bfe0895fa52715feb2b67f5f75d54bc2e0f45da1aa99fa0214621eb0d71437
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.
Transparency logSecurity for elliptec 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for elliptec-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.