MM220 Technical Reference Manual
MM220 Technical Reference Manual
www.soc-robotics.com
Warranty Statement
SOC Robotics warrants that the Product delivered hereunder shall conform to the applicable SOC Robotics Data Sheet or mutually
agreed upon specifications and shall be free from defects in material and workmanship under normal use and service for a period of
30 days from the applicable date of invoice. Products that are “samples”, “design verification units”, and/or “prototypes” are sold
“AS IS,” “WITH ALL FAULTS,” and without a warranty. If, during such warranty period, (i) SOC Robotics is notified promptly in
writing upon discovery of any defect in the goods, including a detailed description of such defect; (ii) such goods are returned to
SOC Robotics, DDP SOC Robotics facility accompanied by SOC Robotics Returned Material Authorization form; and (iii) SOC
Robotics examination of such goods discloses to SOC Robotics satisfaction that such goods are defective and such defects are not
caused by accident, abuse, misuse, neglect, alteration, improper installation, repair, improper testing, or use contrary to any
instructions issued by SOC Robotics. SOC Robotics shall (at its sole option) either repair, replace, or credit Buyer the purchase price
of such goods. No goods may be returned to SOC Robotics without SOC Robotics Returned Material Authorization form. Prior to
any return of goods by Buyer pursuant to this Section, Buyer shall afford SOC Robotics the opportunity to inspect such goods at
Buyer’s location, and any such goods so inspected shall not be returned to SOC Robotics without its prior written consent. SOC
Robotics shall return any goods repaired or replaced under this warranty to Buyer transportation prepaid, and reimburse Buyer for
the transportation charges paid by Buyer for such goods. The performance of this warranty does not extend the warranty period for
any goods beyond that period applicable to the goods originally delivered.
THE FOREGOING WARRANTY CONSTITUTES SOC ROBOTICS EXCLUSIVE LIABILITY, AND THE EXCLUSIVE REMEDY
OF BUYER, FOR ANY BREACH OF ANY WARRANTY OR OTHER NONCONFORMITY OF THE GOODS COVERED BY
THIS AGREEMENT. THIS WARRANTY IS EXCLUSIVE, AND IN LIEU OF ALL OTHER WARRANTIES. SOC ROBOTICS
MAKES NO OTHER WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE SOLE AND EXCLUSIVE
REMEDY FOR ANY BREACH OF THIS WARRANTY SHALL BE AS EXPRESSLY PROVIDED HEREIN.
Limitation on Liability
Notwithstanding anything to the contrary contained herein, SOC Robotics shall not, under any circumstances, be liable to Buyer or
any third parties for consequential, incidental, indirect, exemplary, special, or other damages. SOC Robotics total liability shall not
exceed the total amount paid by Buyer or SOC Robotics hereunder. SOC Robotics shall not under any circumstances be liable for
excess costs of re-procurement.
1935A–08/00/5M
Table of Contents
Warranty Statement………………………………………………………………………2
1.0 Introduction………………………………………………………………………….4
1.0 Introduction
Features:
• 6A/phase Bipolar microstepping driver
• Optically Isolated inputs
• 20-48VDC Stepper Motor drive voltage
• ATmega168 onboard processor
• Integrated Heat Sink design
• Inline command processing
• 512 Internal EEPROM
• 512 Internal SRAM
• Aux digital IO on ISP port
• ISP Programming Port (requires CISP adapter)
• Small form factor (4.4x1.6 in)
Hardware
The MM220 is a 1/16th Microstepping bipolar 6A per phase stepper motor driver that converts step and
direction signals to appropriate high voltage stepper motor drive signals. The board is designed to
operate at 5VDC. Motor voltage can vary from 20-48VDC. The motor drive chip is controlled by a
dedicated onboard 8 bit RISC processor (Atmega168) that provides various expansion and enhancement
features. Applications can communicate with the board using encoded commands on the step and
direction inputs. A Limit switch input is monitored and can be used to stop step operation.. An eStop
input can also be monitored to stop step operation. The MM220 consumes about 12ma in active state not
including motor drive current. All signal inputs are optically isolated.
At power up the two LEDs flash twice then the RED LED flashes slowly for 5 seconds after which both
LEDs go out. While the RED LED is flashing the driver is in Command Recognition Mode. In Command
Recognition Mode signals on the step and direction inputs are interpreted either as step commands or
high level commands. High Level Commands can change driver configuration parameters or tell the
driver to execute a set of functions. The specific encoding is described in the Technical Reference Manual
along with a complete description of all high level commands. After 5 seconds the driver automatically
switches to Pass Through Mode – in this mode encoded commands are not recognized and commands to
change step mode, automatic shut off, etc are ignored. Re-powering the MM220 starts the 5 second
process again.
By default the MM220 software sets the step mode to quarter step, enable smart limit recognition,
disables eStop recognition and switches to Pass Through Mode after 5 seconds.
The control program in the MM220 processor can be re-Flashed using programming cable Part No. MCM-
8 and the appropriate host software (MK4Prog.exe).
MM220 Controllers
Although the MM220 can operate standalone it usually requires a controller to send step and direction
input signals to it. SOC Robotics has several controllers compatible with the MM220 - MC-USB, MK1,
MK4, MK14, MK54 and MK200. Each controller supports increasing levels of sophistication and control
flexibility. The MK1 is a simple breakout board that allows three MM220’s to be attached and controlled.
The MK4 is a four axis breakout board with four auxiliary output ports, four limit switch inputs and one
Estop input. The MK14 is a special version of the MK4 with a USB 2.0 interface. The MK54 is a high
performance G Code processor with 10/100BaseT, CAN and USB 2.0. The MK200 is an ultra high
performance G Code processor with onboard vision processing. For more information on our line of
controllers and to help determine which one is best for your application go to our web site or contact the
firm.
With the MC-USB stepper motors can be controlled via a host PC USB port.
The MK4 is an optional parallel port controller with connectors for four MM220 drivers. The MK4 has
four aux open collector outputs and five limit switch inputs all set/read via the parallel port. The MK4 is
an excellent choice to attach up to four MM220’s to a PC’s parallel port and be controlled using Mach3.
MK4 Controller
The MK14 is a USB 2.0 version of the MK4 with an onboard processor that accepts up to four MM220
drivers. The MK14 has four aux open collector outputs and five limit switch inputs all read via the
parallel port. The onboard processor (AT91USB162) accepts step commands via USB and allows the host
PC to communicate with the individual MM220 drivers and send high commands directly to each driver.
In this case the parallel port interface can be bypassed and commands sent directly to each MM220
processor using a standard serial communications protocol.
MK14 Controller
The MK54 is a high end G Code processor with onboard ARM7 processor running 55MHz. The ARM7
processor executes G Code directly eliminating the need for a PC based G Code processor. The MK54 is
capable of receiving commands via a USB 2.0 interface, 10/100BaseT Ethernet or CAN.
The MK200 is a high end DSP based G Code processing platform with built-in vision processing that is
capable of driving the MM220’s at their maximum rate of 80,000 microsteps/second. The MK200 is
intended for high end applications that require extremely fast stepper motor operation and/or real time
vision processing.
The correct controller for your application depends on many parameters. If you require help in choosing
a controller or need additional information please contact the company.
2.1 Introduction
The MM220 is a compact single axis stepper motor microstepping driver with a dedicated onboard
processor. The processor responds to step/direction signals on the primary control input port, receives
and interprets commands received on the I2C interface or encoded on the step/direction signal lines and
processes sensor data received on the auxiliary IO port.
2.2 Processor
The MM220 has an 8bit RISC AVR processor (ATmega168) running at 20MHz. Note that the Atmega168
requires 5VDC to run at 20MHz. The program running in the Atmega168 monitors the step/direction
input lines and drives the A3986 microstepping driver chip. Commands supported by the processor
firmware is described in the software operation section of this manual.
Figure 2-4. ISP610 ISP Adapter and correct attachment to the MM220 .
The housing connector’s crimp terminal accepts 26-28AWGwire (Molex Part No. 50079-8000 - Digikey
Part No. WM1722-ND – Crimp tool 63811-0300 ) or 28-32AWG (Molex Part No. 50058-8000 - Digikey
Part No. WM1775-ND - Crimp tool 63811-0200).
MK200 plus P0 DSP with four MM220’s MK1 with Wasp and USB10 G Code processor
The MM220 can communicate with other SOC Robotics embedded processors such as the Wasp,
WaspARM, SAM48, AmberM, SmartLCD, Ant6, Cricket and a host of other embedded processors.
USB10 is a USB 2.0 device with an onboard AVR processor – the AT90USB162. The USB10 converts
commands sent to it via the USB to step/direction commands that can drive the MM220.
2.6 Applications
The MM220 is a bipolar stepper motor driver that responds to step and direction signal inputs and
monitors limit and eStop switch inputs.
The MM220 also can accept sensor input on the ISP programming lines providing an upgrade to a closed
loop design in which sensor feedback is used to tune stepper motor operation. An example of a possible
external sensor is a rotary magnetic sensor and a linear capacitive position sensor.
3.1 Introduction
The MM220 has two I/O ports: a motor control port and an ISP Programming port as shown in the
connector layout diagram below. Two alternative configurations of the board are available:
Configuration 1 replaces the 0.1” motor control port header with an 8 pin picoBlade Molex connector and
configuration 2 replaces the motor 0.1” motor control port header with a 4 pin picoBlade Molex connector
for the I2C port.
The MM220 is shipped with a software application in which Command Recognition mode is enabled for
the first five seconds of operation following power up after which Pass Through mode is activated. In
Command Recognition mode all motion control and configuration setup commands are recognized. In
Pass Through mode the step/direction signals are simply passed through the processor to the A3986
driver. In Pass Through mode commands sent to the MM220 are not longer recognized. The MM220
defaults to Pass Through mode after 5 seconds to make sure the application software driving the MM220
works reliably. If the application driving the MM220 can meet the strict step/direction signal setup and
hold times then Pass Through mode is not required and the more flexible Command Recognition mode
can be used. Pass Through mode should also be used if the cables supplying the step/direction signals to
the MM220 are noise prone. Pass Through mode activation can be changed to Command Recognition
mode in the first 5 seconds of operation using the free application GSTepPP.exe available from our web
site www.soc-robotics.com.
The motor drive chip A3986 is a bipolar microstepping driver with external current sense resistors and
logic to control drive current given a drive voltage. A potentiometer allows the user to set the operating
current of the driver. The A3986 is designed to drive 2-3A motors but should be able to drive smaller
motors without any trouble. Power for the board logic is taken from the motor power input and is
regulated to 5V on the board. The standard board runs at 20MHz.
J2 also has limit/eStop switch inputs. Limit/eStop Switch inputs by default are not recognized but can
be enabled by the user.
Command Features
A script based parameter configuration utility allows the user to set the configuration options of each axis
on an individual basis. Configuration parameters can be stored in on-chip EEPROM for automatic power
up configuration control. A special built-in test/setup mode provides a simplified method for setting up
the board. Configuration commands can be sent to the motor controller in real time using a special
communications protocol based on the Step and Direction lines. A bi-directional communication utility
provides a real time link with MM220 processor allowing dynamic change and update of system
parameters on the fly.
- New communication protocol for bidirectional data flow between the host and MM220 via the
STEP/DIRECTION and Limit Switch lines and I2C
- The following parameters can be set by the user while the MM220 is operating:
o Pass through mode enabled for noisy environments
o Limit switch detection– enable, disable, smart enable, polarity settable
o EStop switch detection– enable, disable, polarity settable
o Step mode selection – wave, full, half, quarter, sixteenth
o Automatic motor shut off – enable, disable and time period settable
o Motor power - enable/disable
o Step rate, direction and number of steps to execute
o Maximum step rate
o Distance traveled for each step in inch or metric
o Feed Rate – ipm or cmpm
o Linear or rotary distance commands in inch or metric
o G1 G code commands accepted directly
o Single Step - Clockwise or counterclockwise
o Step Movement Direction Polarity – Clockwise or counterclockwise
o Direction polarity settable – high – clockwise, high –counterclockwise
o Backlash set
o Communication mode – enable/disable
o Save configuration settings in EEPROM
The MM220 supports the following commands. A detailed description of each command follows. A
command consists of two or more ASCII characters. Some commands require entry of integer or floating
point numbers. A floating point number entered as an integer is interpreted correctly. Integer or
floating point number must be terminated with a semicolon “;” character. Note that all commands are
lower case characters. Commands are acted on immediately.
On power up the MM220 processor loads configuration settings from on chip EEPROM. If these settings
are changed using the commands below the processor does not automatically store the new settings in
EEPROM – the user must explicitly do this using the Save Settings command. If power is lost all changed
settings will be lost if they have not been stored.
A desktop program called GStepPP.exe is used to send commands to the MM220. GStepPP.exe
sends commands to a specific axis attached to a MK4 by entering the “c” character following by an axis
identifier character (x,y,z,a) followed by one or more of the command sequences below all entered on one
line. The command is sent to the driver when the enter key is pressed. Command Recognition mode
must be enabled in the driver for commands to be recognized. An example of a command sequence is:
-cxs4
-cxcss
The first command instructs the x-axis driver to set the step mode to quarter step. The following
command then stores this new setting in EEPROM so the next time the driver is powered up quarter step
mode is activated. A few of the command functions can be halted by entering the character sequence
cxq.
If the control software driving the MM220 does not need to support command mode then for increased
reliability in noisy environments command recognition mode can be disabled by sending the command
mode disable command cxcci. Once Command Recognition mode has been disable to only way to re-
enable it to re-Flash the processors flash memory using a special programming utility (MK4Prog.exe) and
a special cable.
NOTE: The MM220 is shipped with Command Recognition mode enabled for the
first 5 seconds to allow you time to change configuration parameters such as
step mode, holding torque, shut-off delay, etc without re-flashing the board using
GstepPP.exe. Re-flashing the board requires a special programming utility and
optional cable. Pass Through mode is the most reliable mode in noisy
environments or in situations where you do not know how the host software is
manipulating the step/direction lines.
Command Summary
All commands are printable ASCII characters.
d – Drive motors (enter direction and step rate), e-exit (entered at any time)
z – Zero absolute position
h – Go to Home position, n-near side, f-far side, o-offset (float)
i - Set feed rate (ipm), float cxdi10.0;
p – Pause execution (msec), int cxdp1000;
c – Step clockwise
w – Step counterclockwise
s – Set slow step rate (pps), float
f – Set fast step rate (pps), float
m – Constant step cxdmw220000;1300;
direction, stepmode, number of steps, step rate (pps)
x – Ramp for n loops using default low high pps cxdx220;2000;4;
stepmode, steps at each speed, constant step number, loops
r – Ramp between low and high pps cxdr2300;2000;20;2000;
stepmode, slow step rate, high step rate, step increment, constant steps
d – Distance mode cxdd21.25;6.27;
stepmode, new position, feed rate (ipm)
Note that changing step mode may not guarantee a smooth step transition. Step mode changes take
effect immediately.
d – Drive motors (enter direction and step rate), e-exit (entered at any time)
z – Zero absolute position
h – Go to Home position, n-near side, f-far side, o-offset (float)
i - Set feed rate (ipm), float
p – Pause execution (msec), int
c – Step clockwise
w – Step counterclockwise
s – Set slow step rate (pps), float
f – Set fast step rate (pps), float
m – Constant step cxdmw220000;1300;
direction, stepmode, number of steps, step rate (pps)
x – Ramp for n loops using default low high pps cxdx220;2000;4;
stepmode, steps at each speed, constant step number, loops
r – Ramp between low and high pps cxdr2300;2000;20;2000;
stepmode, slow step rate, high step rate, step increment, constant steps
d – Distance mode cxdd21.25;6.27;
d – Drive Motors (enter direction and step rate), e-exit (entered at any time)
Enter drive motor command function. The drive mode allows step commands to be executed directly by
the on board processor. Relative and absolute step position functions are supported. Most of the
commands can be terminated early by entering the exit command: cxe
h – Go to Home Position
Move to the home position which is closest to the stepper motor with the limit switch activated. This
command should be used in combination with the Limit Switch Smart setting. There are three
parameters that set which end the home position is located at and an offset from the limit switch. The
offset allows the home position to be located at any position between either end of the travel.
Example:
cxdhn Home position located at near side
cxdhf Home position located at far side
cxdho1.25; Home position is offset by 1.25 in from limit switch
c – Step clockwise
Step clockwise one step using the existing step mode. Note that if the desired step direction is not
clockwise use the Step Direction Polarity command to change the direction.
w – Step counterclockwise
Step counterclockwise one step using the existing step mode. Note that if the desired step direction is not
counterclockwise use the Step Direction Polarity command to change the direction.
Set the fast step rate in pulses per second (pps). This command sets the slow speed step rate that is used
by several other commands such as the ramp command. The parameter is entered as an integer or
floating point number.
m – Constant step
Step at a constant rate (pps) given an entered direction, step mode and number of steps. This command
allows a set of step parameters to be entered. Variable length parameters such as step rate may be
entered as an integer or floating point number. Direction is “c” or “w”. Step mode is 1, !, 2, @, 4, 8 or 6.
Example: cxdmw220000;1300; - Step CCW, half step, 20000 steps at 1300 pps
cxdmc41000;400; - Step CW, quarter step, 1000 steps at 400 pps
Entered parameters: stepmode, steps at each speed, constant step number, loops
Entered parameters: stepmode, slow step rate, high step rate, step increment, constant steps
power up the home is set to zero. Positive or negative absolute positions can be entered. Backlash
compensation is applied automatically and step resolution defines the number of steps either clockwise
or counterclockwise. The function automatically compensates for step mode changes so if a position
command says move to absolute position 1.000 at full step and then step to 0.000 at half step the carriage
will return the exact starting point.
t – Toggle Back and Forth – All step modes, hit any key to exit
This command causes the drive to step the motor in the clockwise direction for a defined number of steps
and then step in a counterclockwise direction the same number of steps at a pre-defined pps rate starting
with full step mode and sequencing through all the step modes. Entering cxq caused the sequence to
terminate.
x – Ramp Low to High/High to Low – All step modes, hit any key to exit
This command causes the driver to step the motor through a clockwise then counterclockwise motion
while ramping the speed from a minimum pps rate to a maximum pps rate sequencing through all step
modes from full to sixteenth step.
Mode 3
The on or off condition of the Green and Red LEDs is set using commands. The next character selects the
Red or Green Led and the state (on or off).
Examples:
cxlro - Turn the Red Led on
cxlgf - Turn Green Led off.
EStop switch detection can be enabled, disabled. When disabled the state of the EStop switch has no
effect on motor operation. If enabled the motor will stop immediately and remained stopped as long as
the EStop switch is active. Motor operation will resume if the EStop switch active state is removed or
EStop Switch detection is disabled. EStop switch inputs are pulled high with a 10K resistor so to activate
an eStop event the switch must pull the high level to ground. By default EStop recognition is disabled.
Example:
b – Set Backlash
If the backlash of the lead screw is known this command calibrates the absolute position command when
direction changes. The backlash is the number of steps required to move the thrust nut in direction
change operations.
Example: cxcx1000.0;
The distanced traveled for a single step is used to calibrate the absolute position move command.
Typically this parameter depends on the tpi of the lead screw and step mode. For example a 20tpi screw
moves a carriage by 0.00025 inch in full step mode. The parameter is entered as a floating point number.
The minimum pulse per second (pps) setting is used by the test and drive commands to set the slow step
rate. The parameter is entered as a floating point number. The maximum pps setting is used by the test
and drive commands to set the high step rate. The Ramp rate is a parameter that sets the acceleration for
the test, drive and absolute position commands.
Example:
cxzb
cxdd21.00;5.45;
cxdd21.25;6.57;
cxdd21.00;6.57;
cxdd20.0;5.45;
cxzh
cxze
In the example above the store command mode is entered followed by a movement of the carriage from
position 0 to position 1.00 at 5.45 inch/minute, then moves to 1.25 at 6.57ipm, then moves back to 1.00 at
the same rate and finally returns to the starting position 0.00. Recording mode ends when the halt
recording command is entered. The complete motion sequence is then executed by the start execution
command.
Electrical
Input power: 20-48VDC @ 6A
Mechanical
Dimensions: 4.4x1.6 in
Weight: 16 grams
Notes: