-
Notifications
You must be signed in to change notification settings - Fork 0
Initialization functions
__init__(self, serialPort:str, moduleDebugLevel:bool=False, communicationDebugLevel:bool=False, logFiles:bool=True)
Class initialization
This class is used for interacting with the Theia MCR motor control boards.
Initialize the MCR board (this class) before any commands can be sent. Motor initialization (focusInit, zoomInit, irisInit) must be called separately for each motor. The controllerClass subclass is automatically initialized creating a MCRBoard = MCRControl.controllerClass instance.
Successful initialization is confirmed by receiving the board firmware version from the board. This can be checked with the MCRControl.MCRInitialized variable.
This is the top level class for all interactions with the MCR600 series boards
input
- serial_port: the serial port name of the board (e.g. "com21" or "/dev/ttyAMA0").
- moduleDebugLevel (optional boolean: False): Set true to set the level to DEBUG for the console stream instead of the default of INFO
- communicationDebugLevel (optional boolean: False): Set true to print the serial port communication to the console (and all debug level logs). This is not recommended for production use.
- logFiles (optional boolean: True): Set true to create log files for the MCR board. The log files will be created in the user directory.
class variables
- MCRInitialized: set when the MCR class is initialized and logging has started
- boardInitialized: set when the MCR board is initialized and com port is open
- boardCommunicationState: current state of the com port (True if open and available)
- boardCommunicationRestarts: (int) number of times the com port has been automatically reconnected
Sub-classes
- motor
- controllerClass
- MCRCom (serial communication with the board)
Motors must be initialized. Initializing the focus motor will create a MCRControl.focus instance which has movement and other commands such as MCRControl.focus.moveAbs(). See motor movements for more information.
focusInit(self, steps:int, pi:int, move:bool=True, accel:int=0) -> bool
Initialize the parameters of the motor. This must be called after the board is initialized.
input
- steps: maximum number of steps
- pi: photo interrupter limit switch (pi) location in step number
- move: (optional, True) move motor to home position or (False) initialize without moving.
- accel: (optional, 0) motor acceleration steps (check motor control documentation to see if this variable is supported in firmware)
return [True | False] motor initialization successful
zoomInit(self, steps:int, pi:int, move:bool=True, accel:int=0) -> bool
Initialize the parameters of the motor. This must be called after the board is initialized.
input
- steps: maximum number of steps
- pi: pi location in step number
- move: (optional, True) move motor to home position or (False) initialize without moving.
- accel: (optional, 0) motor acceleration steps (check motor control documentation to see if this variable is supported in firmware)
return [True | False] motor initialization successful
irisInit(self, steps:int, move:bool=True) -> bool
Initialize the parameters of the motor. This must be called after the board is initialized.
input
- steps: maximum number of steps
- move: (optional, True) move motor to home position or (False) initialize without moving.
return [True | False] motor initialization successful
IRCInit(self) -> bool
Initialize the parameters of the IRC motor.
For the IRC switch motor: maximum 1000 steps allows 1 second activation time (at speed 1000pps). The activation
time is set by the number of steps (1 step = 1 ms). See the motor control documentation for more info.
return [True | False] motor initialization successful