Skip to main content

Theia MCR motor control functions

Project description

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

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)

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.

License

Theia Technologies BSD license Copyright 2023 Theia Technologies

Contact information

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

Revision

v.2.2.0

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

TheiaMCR-2.2.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

TheiaMCR-2.2.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file TheiaMCR-2.2.0.tar.gz.

File metadata

  • Download URL: TheiaMCR-2.2.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for TheiaMCR-2.2.0.tar.gz
Algorithm Hash digest
SHA256 40a4aa53f014be2719885a1a0f932c94d863c51cf5e2a642704305eadee1555f
MD5 e25a9391e7cba3bea4f09675a88d904e
BLAKE2b-256 1ec5ae69061efb255da35584ea3a6f1e68aaaa942b54f45b5bc5261bcc1bde41

See more details on using hashes here.

Provenance

File details

Details for the file TheiaMCR-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: TheiaMCR-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for TheiaMCR-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6bbacb575b9b5ae605dfa06054efa0e94a36932d030fe689f345e9a82a9eee1
MD5 4aa7c8545d850841e47cd64c964f2af2
BLAKE2b-256 7db0ef44322086c809d28a4ba8966a4bdc4b90de4d4c8e4b3acb3c9c1a2ac02b

See more details on using hashes here.

Provenance

Supported by

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