Skip to main content

Theia Technologies motor control board interface

Theia Technologies offers a MCR600 motor control board for controlling Theia's motorized lenses. This board controls focus, zoom, iris, and IRC filter motors. It can be connected to a host comptuer by USB, UART, or I2C connection.

Features

python The MCR600 board (and MCR400, MCR500 and others in the MCR series) has a proprietary command protocol to control and get information from the board. The protocol is a customized string of up to 12 bytes which can be deciphered in the MCR600 documentation. For ease of use, Theia has developed this Python module to format the custom byte strings and send them to the board. For example, the user can request the focus motor to move 1000 steps. The focusRel() function will convert this request to the appropriate byte string and send it over USB connection to the MCR control board. This will cause the lens motor to move 1000 steps.

Quick start

This module can be loaded into a Python program using pip.
pip install TheiaMCR
Theia's motorized lens should be connected to the MCR600 board and the board should be connected to the host computer via USB connection thorugh a virtual com port. The class must be initizlized first using the __init__() function.

# create the motor control board instance
MCR = mcr.MCRControl(comport)

Then the motors must all be initialized with their steps and limit positions.

# initialize the motors (Theia TL1250P N6 lens in this case)
MCR.focusInit(8390, 7959)
MCR.zoomInit(3227, 3119)
MCR.irisInit(75)
MCR.IRCInit()

The initialization commands will create instances of the motor class for each motor which can be accessed by focus, zoom, and iris named instances. If the MCRControl class was not successful (possibly due to hardware connection issue) any subsequent functions will return an error value. There are some board query commands that use the MCRBoard subclass. This subclass was automatically initilized.

Now the motors can be controlled individually. For example, the focus motor can be moved to an absolute step number.

# move the focus motor
MCR.focus.moveAbs(6000)
log.info(f'Focus step {MCR.focus.currentStep}')

For the internal IRC switchable filter, the state can be 1 or 2 to match the specification sheet. Usually filter 1 is visible only transmission and filter 2 is visible + IR transmission.

When ending the program, call MCR.close() to close the serial port and release any resources being used.

Motor limits

The parameters for focusInit(), zoomInit(), and irisInit can be found in the lens specification. These are the parameters for some of Theia's lenses.

  • TL1250 (-N) lens:
    • focusInit(8390, 7959)
    • zoomInit(3227, 3119)
    • irisInit(75)
  • TL410 (-R) lens:
    • focusInit(9353, 8652)
    • zoomInit(4073, 154)
    • irisInit(75) (updated v.2.5.0)

Important variables

Each motor has these variables available

  • motor.currentStep: current motor step number
  • motor.currentSpeed: current motor speed in pulses per second (pps)
  • motor.maxSteps: maximum number of steps for the full range of movement
  • motor.PIStep: photointerrupber limit switch step position (within the full range of movement). After sending the motor to home, the current step will be set to this PIStep number.

More information about the available functions can be found in the wiki pages.

Logging

There are logging commands in the module using Python's logging libray. These are set by default to log WARNING and higher levels. To see other log prints in the console, initialize the class with MCR = TheiaMCR.MCRControl(serial_port="com4", degubLog=True) or manually set the logging level with TheiaMCR.log.setLevel(logging.INFO).
The module creates 2 rotating log files in the background by default based on Python's logging module. If the logging module isn't used, the log files can be disabled by calling MCR = TheiaMCR.MCRControl(serial_port="com4", logFiles=False).

Unhandled exceptions are logged to the log file using the sys.excepthook variable. This is a global variable so check the operation within your application if you set this variable elsewhere.

License

Theia Technologies BSD license Copyright 2023-2025 Theia Technologies

Contact information

For more information contact: Mark Peterson at Theia Technologies mpeterson@theiatech.com

Revision

v.3.2

Metadata

Release files for TheiaMCR 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TheiaMCR 3.2.0
File Size Uploaded Provenance Actions
theiamcr-3.2.0.tar.gz 23.9 kB Without provenance Details for theiamcr-3.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for TheiaMCR 3.2.0
File Interpreter ABI Platform Actions
theiamcr-3.2.0-py3-none-any.whl Python 3 none any Details for theiamcr-3.2.0-py3-none-any.whl

Total release size: 47.1 kB

Release files / theiamcr-3.2.0.tar.gz

Download URL theiamcr-3.2.0.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
be31de45df4c8e7c7f00d48abd17c713c0e5fda2e6f5b888de3a0e474bc3e5d3
BLAKE2b-256 checksum
How to use checksums
dca55da76f9cbf70703fb74b353ccc201b779b8b9b0cce21ac5408d54d727b60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / theiamcr-3.2.0-py3-none-any.whl

Download URL theiamcr-3.2.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7ebc2262dd7e40ee1612af18b5794e1b073083e555bb8f4d419567c4800d373
BLAKE2b-256 checksum
How to use checksums
7016920c22a3c0eb1f07531206e1b4de6f5b336c46b3940ddad127994ea9d2a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for TheiaMCR 3.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page