navigate.model.devices.APIs.sutter.MP285.MP285
- class navigate.model.devices.APIs.sutter.MP285.MP285(com_port, baud_rate, timeout=0.25)
Bases:
object
Sutter MP285 3D Stage API
The USB interface expects a baud rate of 9600, 8 data bits, 1 stop bits, no parity, and no flow control.
The serial interface expects a baud rate of 9600, 8 data bits, 1 stop bits, no parity, and hardware or RTS/CTS flow control.
Little-endian byte order is used for all commands and responses.
Each command sequence consists of at least one byte, the first of which is the “command byte”. Those commands that have parameters or arguments require a sequence of bytes that follow the command byte. No delimiters are used between command sequence arguments, and command sequence terminators are used in most cases.
Most command sequences have a terminator: ASCII CR (Carriage Return; 13 decimal, 0D hexadecimal) to indicate that the task associated with the command has completed. When the controller completes the task associated with a command, it sends ASCII CR back to the host computer indicating that it is ready to receive a new command. If a command returns data, the last byte returned is the task-completed indicator.
- __init__(com_port, baud_rate, timeout=0.25)
Methods
__init__
(com_port, baud_rate[, timeout])close
()Close the serial connection to the stage
connect_to_serial
()convert_microns_to_microsteps
(microns)Converts microsteps to microns.
convert_microsteps_to_microns
(microsteps)Converts microsteps to microns
disconnect_from_serial
()Flush Serial I/O Buffers.
Get the status of the MP-285 controller.
Get the current stage position.
Interrupt stage movement.
move_to_specified_position
(x_pos, y_pos, z_pos)Move to Specified Position (‘m’) Command
Refresh the display on the MP-285 controller.
Reset the MP-285 controller.
safe_write
(command)Set MP285 to Absolute Position Mode.
set_resolution_and_velocity
(speed, resolution)Sets the MP-285 stage speed and resolution.
- close()
Close the serial connection to the stage
- static convert_microns_to_microsteps(microns)
Converts microsteps to microns.
- Parameters:
microns (float) – Distance in microns.
- Returns:
microsteps – Distance in microsteps
- Return type:
float
- static convert_microsteps_to_microns(microsteps)
Converts microsteps to microns
- Parameters:
microsteps (float) – Distance in microsteps
- Returns:
microns – Distance in microns
- Return type:
float
- flush_buffers()
Flush Serial I/O Buffers.
- get_controller_status()
Get the status of the MP-285 controller.
This command gets status information from the controller and returns it in fixed-sized block of data. The command sequence consists of 2 bytes: Command byte and terminator. Return data consists of 33 bytes: 32 bytes of information and task-complete indicator.
- Returns:
True if command was successful, False if not.
- Return type:
command_complete = bool
- get_current_position()
Get the current stage position.
Gets the stage position. The data returned consists of 13 bytes: 12 bytes containing X, Y, & Z position values in microsteps (4 bytes each), followed with the task-complete indicator (1 byte).
- Returns:
x_pos (float) – X position in microns
y_pos (float) – Y position in microns
z_pos (float) – Z position in microns
- interrupt_move()
Interrupt stage movement.
This command interrupts and stops a move in progress that originally initiated by the Move (‘m’) command. The command sequence consists of 1 byte: Command byte (no terminator).
Return data consists of 1 byte if movement is not in progress, or 2 bytes (‘=’ (move-in- progress indicator)and task-complete indicator.
- Returns:
stage_stopped – True if move was successful, False if not.
- Return type:
bool
- move_to_specified_position(x_pos, y_pos, z_pos)
Move to Specified Position (‘m’) Command
This command instructs the controller to move all three axes to the position specified.
The command sequence consists of 14 bytes: Command byte followed by three sets of four bytes containing position information in microsteps for X, Y, and Z, and ending with the terminator. Return data consists of 1 byte (task-complete indicator), which occurs after the move is complete.
- Parameters:
x_pos (float) – X position in microns
y_pos (float) – Y position in microns
z_pos (float) – Z position in microns
- Returns:
move_complete – True if move was successful, False if not.
- Return type:
bool
- refresh_display()
Refresh the display on the MP-285 controller.
This command refreshes the VFD (Vacuum Fluorescent Display) of the controller. The command sequence consists of 2 bytes: Command byte and terminator. Return data consists of 1 byte: task-complete indicator.
- Returns:
command_complete – True if command was successful, False if not.
- Return type:
bool
- reset_controller()
Reset the MP-285 controller.
This command resets the controller. The command sequence consists of 2 bytes: Command byte and terminator. Return data consists of 1 byte: task-complete indicator.
- Returns:
command_complete – True if command was successful, False if not.
- Return type:
bool
- set_absolute_mode()
Set MP285 to Absolute Position Mode.
This command sets the nature of the positional values specified with the Move (‘m’) command as absolute positions as measured from the point of origin (Position 0). The command sequence consists of 2 bytes: Command byte, followed by the terminator. Return data consists of 1 byte (task-complete indicator).
- Returns:
command_complete – True if command was successful, False if not.
- Return type:
bool
- set_resolution_and_velocity(speed, resolution)
Sets the MP-285 stage speed and resolution.
This command instructs the controller to move all three axes to the position specified. The command sequence consists of 4 bytes: Command byte, followed by 2 bytes containing resolution and velocity information, and ending with the terminator. Return data consists of 1 byte (task-complete indicator).
- Parameters:
speed (int) – Low Resolution = 0-3000 microns/sec High Resolution = 0-1310 microns/sec
resolution (str) – Low - 0.2 microns/microstep = 10 microsteps/step High - 0.04 microns/microstep = 50 microsteps/step
- Returns:
command_complete – True if command was successful, False if not.
- Return type:
bool