Package: elliptec
ElliptecSimple control of Thorlabs Elliptec™ devices.Explore the docs »Get started·Report a bug·Request a featureAbout The ProjectThorLabs 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 thepyseriallibrary and is inspired by theTL-rotation-controlproject byChris Baird. The end goal of the project is to reproduce the entire functionality of the officialElliptec™ Software.💣This library is still under active development. Serious bugs are present and breaking changes will be introduced.QuickstartA basic example, which shows how to use a shutter:importellipteccontroller=elliptec.Controller('COM3')sh=elliptec.Shutter(controller)# Get information about the deviceinfo=sh.get('info')# Home the shutter before usagesh.home()# Open shutter, acquire, and close againsh.open()# ... acquire or perform other taskssh.close()An example using a four-positional slider:importellipteccontroller=elliptec.Controller('COM3')sl=elliptec.Slider(controller)# Home the slider before usagesl.home()# Move slider to position 3sl.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:importellipteccontroller=elliptec.Controller('COM3')ro=elliptec.Rotator(controller)# Home the rotator before usagero.home()# Loop over a list of angles and acquire for eachforanglein[0,45,90,135]:ro.set_angle(angle)# ... acquire or perform other tasksAn example using a linear stage to find optimal focus:importellipteccontroller=elliptec.Controller('COM3')ls=elliptec.Linear(controller)# Home the linear stage before usagels.home()# Loop over a list of positions and measure gain for eachfordistanceinrange(0,61,10):ls.set_distance(distance)# ... measure gainAdvanced examplesControlling multiple devices through one ELB bus. The example assumes you have a shutter and a rotator on addresses 1 and 2 respectively, and shows how to take two images in perpendicular polarizations:importellipteccontroller=elliptec.Controller('COM4')sh=elliptec.Shutter(controller,address='1')ro=elliptec.Rotator(controller,address='2')# Home the shutter and the rotatorsh.home()ro.home()# Loop over a list of angles and opne/acquire/close for eachforanglein[0,90]:ro.set_angle(angle)# Open shutter, acquire, and close againsh.open()# ... acquire or perform other taskssh.close()If you haven't changed the addresses of your boards, you can either do so through theElliptec™ Software, or by connecting them one-by-one to the bus and using thechange_address()function of a device. Assuming aPC -> controller -> busconnecion, the setup would look something like this:importellipteccontroller=elliptec.Controller('COM4')# connect your first device to the busdevice_1=elliptec.Motor(controller)device_1.change_address('1')# connect your second devicedevice_2=elliptec.Motor(controller)device_2.change_address('2')The changes made to the addresses should last until the bus loses power, at which point all deviced might revert to the default address of 0.List of supported devicesCurrently (somewhat) supported devices:Rotation Mount (ELL14) -Thorlabs product page- useful for polarization state generatorsRotation Stage (ELL18) -Thorlabs product page- useful for rotating mirrorsLinear Stage (ELL20) -Thorlabs product page- useful for motorized focusingDual-Position Slider (ELL6) -Thorlabs product page- useful as a shutterFour-Position Slider (ELL9) -Thorlabs product page- useful as a filter wheelAs 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) devicesThese 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 thesomewhat supportedones:Linear Stage (ELL17) -Thorlabs product page- useful for motorized focusingSix-Position Slider (ELL12) -Thorlabs product page- useful as a filter wheelThe same could possibly extend to the discontinued/obsolete devices such as the ELL7, ELL8, and ELL10.What works and what doesn'tWhat works:basic movementgetting information about the devicegetting information about individual motorsability to control multiple devices on one controller via a bus moduleWhat needs improvements:documentationtests (more devices, more details)automated discovery of devicesWhat is missing:safety (no library performed bounds checks etc)consistency (across methods, devices, returns, ...)adding devices by serial numbersearching for and setting optimal motor frequenciescleaning and optimization proceduresSome of the missing functionality can be performed using the officialElliptec™ Software.SupportIf you are going to use this code in any way,please let me knowviaemail/twitter/issuesor find my contact info onmy 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 ;).DisclaimerThorlabs™ and Elliptec™ are registered trademarks of Thorlabs, Inc. This project is fully non-commercial and not affiliated with Thorlabs, Inc. in any capacity.