Newport Motion Controller MM4006

The Newport MM4006 Motion Controller can control automated stages and stepper motors in general. It has a RS232 and a GPIB interface.

Remote Commands

Cf. chapter 3 of the manual.

Here are the most important remote commands:

  • MO to switch the motor control of the MM4006 on
  • XXPAYY absolute movement of motor xx to position yy
  • YYPRYY relative movement of yy units of motor xx

More on The Remote Control Of the Newport Motion Controller MM4006

For a start, set up the connection parameters as follows:

Connection Baud Rate Word Lenght Stop Bits XON/XOff Terminator
RS232 9600 8 1 No CR/LF

What you may send via RS232:

MO,1OR,1WS,1TP,1PR1,1WS,1TP

What that does is:

  • MO Switch on motor.
  • 1OR Search origin on axis #1.
  • 1WS Wait until end of motion on axis #1.
  • 1TP Read position on axis #1.
  • 1PR1 Cary out relative motion on axis #1.
  • 1WS Wait until end of motion on axis #1.
  • 1TP Read position on axis #1.

More examples:

SQ0.001
GQ10,1PR-1,1WS,NQ
TQ

Instructions carried out:

  • SQ0.001 Set sampling rate in seconds.
  • GQ20 Start a series of 20 acquisitions on all axes.
  • 1PR-1 Starts relative motion on axis #1.
  • NQ Reads the number of acquisitions done.
  • TQ Read data acquisition buffer TQ.

Python Code to Control Motion

update: Here is my Python code to send commands to the device:

#!/usr/bin/env python

## needs PySerial <http://pyserial.sourceforge.net/>:
import serial

####### Newport Motion Controller MM4006
#
#   The serial RS232 interface protocol
#
#
### Format of commands for RS232:
# xxAAnn
#  xx is an optional prefix
#  AA is the command itself
#  nn is a value, a ? or a variable $Ypp (integers,floats) or $Saa (strings).
#
### The maximum number of characters allowed on a command line is 110.
MAX_LEN_LINE=110
#
### Separator (p. 3.17, section 3.4.1)
# Commands issued on the same line must be separated by a comma (,) or semicolons (;).
SEP = ';'
#
### Terminator
# Each command line, to be executed or accepted in a program, must end with 
# a line terminator. The terminator must have the format defined in the
# GENERAL SETUP mode. The controller supports all combinations of line feed
# (LF) and carriage return (CR) combinations: LF, CR, LF/CR and CR/LF.

### A list of all commands can be found on p. 3.19 and 3.20 of section 3.5.1 of the manual


conn = serial.Serial('/dev/tty.usbserial',timeout=1, baudrate=9600)
#conn.write("MO,1OR,1WS,1TP,1PR1,1WS,1TP\r\n")
conn.write("*MO")
print repr(conn.readline())
#conn.write("DS\"Test\"\r\n")
#conn.write("TE\r\n")
#print repr(conn.readline())
#print repr(conn.readline())
print repr(conn.readline())
conn.close()

Resources

Comments