SS4544 SyncroStep Motion Control System
Testra Corporation  1201 N. Stadem Drive Tempe, AZ 85281 Ph:(480)560-6141 Fax:(480)907-2876

    4.3 X&Y MOVES
     4.7 HOMING


    The SS4544 motion controller controls 4 stepper motors numbered 0-3. The
 controller can generate straight-line motion in three dimensions any 3 of the
 four axes.  The current position is maintained for each axis.  Older
 documentation may refer to axes Z=0, Y=1, R=2, X=3.

     Commands are issued through an asynchronous serial interface.  The
 serial rate is initially set to 38400 bps.  The format is 8 data bits, no
 parity, one stop bit.  Each command consists of a single command byte
 followed by parameter bytes.  When the command completes, an acknowledge
 byte containing status information is transmitted back to the host.  A
 motion command is acknowledged when a motion request is queued, not when the
 move destination is reached.  A command may return data, in which case the
 the last data byte serves as an acknowledge byte.  The host may send a
 command while the previous command is executing unless the executing command
 is interactive. The interactive commands are MCC_XYMANUAL, MCC_YMANUAL,

     The motion system maintains a serial input buffer that holds commands
 before they are interpreted.  The serial input buffer can hold at least 31
 bytes, so it has room for several unprocessed commands.  To avoid
 overflowing the serial input buffer, the host should assume that a command
 occupies space in the serial input buffer until it receives the acknowledge
 byte from that command.

     Even though it is possible to send a command before the preceeding
 command has been interpreted, it is rarely necessary because motion commands
 place requests into a queue when they are interpreted. Motion commands are
 acknowledged after they have been interpreted but before the actual motion
 occurs.  Even if the host waits for the acknowledge byte of the previous
 motion command before sending the next one, command transmission can occur
 while motion is in progress and individual moves can occur one after another
 without interruption.

 A typical command sequence would be:
  1. If WAIT flag is set, wait for acknowledge byte from previous command.
  2. Send command byte.
  3. Send parameter bytes, if any.
  4. Set WAIT flag to indicate that an acknowledge byte is expected.

 If the command returns data, the typical sequence is:
  1. If WAIT flag is set, wait for acknowledge byte from previous command.
  2. Send command byte.
  3. Send parameter bytes, if any.
  5. Receive a data byte.  If more bytes to get, go to step 4.
  6. Clear WAIT flag to indicate that no acknowledge byte is expected.

     Note that the protocol does not require any input buffering on the host
 side.  RSTEP sends no more than one byte in response to a byte from the
 host.  If the host does have some kind of serial input queue implemented in
 hardware or software, it can speed up data reception slightly by sending all
 of the MCC_NEXTBYTE characters at once and then reading the response bytes.


 1. Setup the motor power values for each axis:

 2. Set the velocity unit size for each axis (default is 1 full step):

 3. Setup the ramping parameters for each axis you intend to use:
     MCC_PARAM/MCP_SLOPE  (Multiple calls establish the curve)
     MCC_PARAM/MCP_MAXSPD (Set max speed for each axis before MAKERAMPS)

 4. Generate the ramp tables:

 5. Enable the motor drivers:

 6. Set the desired speed.  Use MCC_PENUP or MCC_PENDOWN to set the logical
    pen position.  When the pen is down or when continuous-path mode is
    selected, motion proceeds at the selected speed.  When the pen is up, and
    continuous-path mode is off, travel proceeds as fast as possible without
    exceeding the MCP_MAXSPD value for any axis.

 7. Establish the origin.  You will need some of these:
     MCC_PARAM/MCP_CURPOS ( Set the current position of an axis  )
     MCC_PARAM/MCP_MAXPOS ( Set the maximum position for an axis )
     MCC_HOME1            ( Home an axis )
     MCC_XYREL            ( Move selected x/y relative )
     MCC_XYABS            ( Move selected x/y absolute )
     MCC_1REL             ( Move 1 axis relative )
     MCC_1ABS             ( Move 1 axis absolute )
     MCC_XYSELECT         ( Select two axes for motion )


    Bit 7 (MSB)  Always 0
   Bit 6        Always 1
   Bit 5        Command-dependent
   Bit 4        Command-dependent
   Bit 3        Command-dependent
   Bit 2        Emergency stop occurred.  Cleared by MCC_PARAM/MCP_DRIVER.
   Bit 1        1 if the motion system is halted, else 0.
   Bit 0 (LSB)  1 if command failed, 0 if no error was detected.


 32b means a 32-bit binary value, high byte transmitted first.
 16b means a 16-bit binary value, high byte transmitted first.
  8b means an 8-bit binary value transmitted as 1 byte.

 Motion Commands                   Command code Parameters
 -----------------------------     ------------ ----------
 X axis relative move              MCC_XREL     x32b
 Absolute x/y move                 MCC_XYABS    x32b     y32b
 Relative x/y move                 MCC_XYREL    x32b     y32b
 Relative short X/Y move           MCC_XYREL16  x16b     Y16b
 X-axis absolute move              MCC_XABS     x32b
 Y-axis absolute move              MCC_YABS     y32b
 Y-axis relative move              MCC_YREL     y32b
 Select logical Y axis             MCC_YSELECT  8b
 1-axis absolute move              MCC_1ABS     8b y32b
 1-axis relative move              MCC_1REL     8b y32b
 Single-axis home                  MCC_HOME1    a8b p8b d8b t32b f32b
 Selected Y axis interactive move  MCC_YMANUAL  limit32b inc32b
 X/Y non-ramping interactive move  MCC_XYMANUAL dir8b
 Wait for motion to complete       MCC_WAIT     --

 Status commands                   Command code Parameters
 -----------------------------     ------------ ----------
 Get 32-bit status information     MCC_GETINFO  index8b sub8b + handshake
 Get x,y coordinates               MCC_GETXY    handshake
 Get encoder position              MCC_GETENC   8b + handshake
 Get RSTEP version                 MCC_GETVER   handshake

 Change settings                   Command code Parameters
 -----------------------------     ------------ ----------
 Set line speed in units/sec       MCC_SPEED    speed16b
 Set axis speed in units/sec       MCC_1SPEED   8b speed16b
 Set motion parameter              MCC_PARAM    index16b val32b
 Set pen pulse divisor             MCC_SCANRES  8b
 Select coordinated axes           MCC_XYSELECT xaxis8b  yaxis8b
 Enable/disable continuous path    MCC_RAMPMODE 8b
 Enter Slave mode                  MCC_SLAVE    xunit16b yunit16b
 Enter train mode                  MCC_TRAIN    --
 Exit  train mode                  MCC_TRAINEND --
 Pen down with Wait                MCC_PENDNWT  --
 Pen down                          MCC_PENDOWN  --
 Pen up with Wait                  MCC_PENUPWT  --
 Pen up                            MCC_PENUP    --

 Other commands                    Command code Parameters
 -----------------------------     ------------ ----------
 Degauss x,y,x&y                   MCC_DEGAUSS  8b
 No operation, no acknowledge      MCC_NOP      --
 Send character to diag port       MCC_PASSCHAR 8b
 Synchronize                       MCC_SYNC     8b
 Send next data byte               MCC_NEXTBYTE --
 Emergency stop code 60h           MCC_ESTOP    "`````````"


Axis unit size (MCP_UNIT)

         Axis travel is expressed in units of 1/1024 of a full step. All axis
 coordinates are positive.  Relative moves can be positive or negative.
 Velocities are expressed in velocity units (VUNIT) which default to 1 full
 step.  Each axis has its own VUNIT assignment. Two axes that are moved
 together should have VUNITS that represent the same physical travel.  The
 user can select velocity units of 1/64, 1/32 1/16, 1/8, 1/4, 1/2, 1, or 2
 steps with the constraint that the total travel for an axis cannot exceed
 2,097,120 velocity units and the maximum speed for the axis cannot exceed
 65535 velocity units per second.

      The size of an axis unit can be specified individually for each axis.
 The specified size must be a power of 2 no greater than 32768 (8000h). The
 axis unit size is a linear quantity: an axis unit size of 32768 (8000h)
 corresponds to 2 full steps, a size of 16384 (4000h) corresponds to 1 full
 step, 8192 (2000h) is 1/2 step and so on.

    The maximum axis speed is 25,000 steps per second.


 Pen up             (MCC_PENUP)
 Pen up with Wait   (MCC_PENUPWT)
 Pen down           (MCC_PENDOWN)
 Pen down with Wait (MCC_PENDNWT)
 Set the pen state.

     If the pen is down, pen pulses are output for every unit of linear
 motion and travel occurs at the specified linear speed. If the pen is up and
 continuous-path mode is off, the linear speed is the maximum possible (ASAP)
 without exceeding ramping or axis speed limits.  MCC_PENUPWT and MCC_PENDNWT
 wait for motion to complete before sending the acknowledge byte.


 1-axis relative move    (MCC_1REL)
 1-axis absolute move    (MCC_1ABS)
 X-axis relative move    (MCC_XREL)
 X-axis absolute move    (MCC_XABS)
 Y-axis relative move    (MCC_YREL)
 Y-axis absolute move    (MCC_YABS)
 Short relative x/y move (MCC_XYREL16)
 Relative x/y move       (MCC_XYREL)
 Absolute x/y move       (MCC_XYABS)
     Motion proceeds at the maximum speed if the pen is up and
 continuous-path mode is off.

 X refers to the X axis selected by the last MCC_XYSELECT command.
 Y refers to the Y axis selected by the last MCC_XYSELECT command.
 The 1-axis moves take an axis number as a parameter.

     Prior to issuing any move commands, the host should set the maximum
 position for each axis and each axis should be homed.  If the MCC_HOME1
 command is inappropriate for the application, the host can home an axis
 itself if it can read the home flag.  Before the host can home an axis, it
 must initialize the axis position (MCC_PARAM/MCP_CURPOS) and the maximum
 position (MCC_PARAM/MCP_MAXPOS) to allow sufficient range of motion to reach
 the home flag.

     Each axis has an associated ramp (acceleration) curve.  For single-axis
 moves, including x/y relative moves with one displacement equal to zero, the
 ramp associated with the moving axis is used.  For 2-axis moves, the slower
 of the two ramps is used.


    This command allows the host to control the X and Y axes in real time.
 In slave mode, each data byte received is treated as two 4-bit
 two's-complement signed numbers that represent axis displacements to be
 applied immediately.  Each displacement may be in the range -8 (8h) to +7
 (7h).  The MCC_SLAVE command includes two 16-bit parameters which specify
 the slave unit sizes for x and y.  Each 4-bit number is multipled by the
 corresponding slave unit size to yield the phase change for each axis.
 16364 phase units are equivalent to 1 full step. Normally, the slave unit
 size would be some power of two less than a half step.  A value of 4096 (1/4
 step) would allow stepping from 1/4 step to 1 full step at a time.  A zero
 byte (deltaX=deltaY=0) terminates slave mode.  An acknowledge byte is sent
 when SLAVE mode is initiated and when it is terminated.  If SLAVE mode is to
 be followed by other motion commands, the axes should be left at phases that
 are multiples of 1/1024 step.  The logical position is not updated during
 slave mode, so the host must load the x and y logical positions before using
 other motion commands.  The maximum slave-mode update rate is determined by
 the serial communications rate.  Since each character from the host requires
 10 bit times to transmit, the maximum slave-mode update rate is the baud
 rate divided by 10.

     Range checking is not done.  No pen pulses are generated. The motor
 power is set to MANUAL.

 The high nybble contains the X displacement.
 The low  nybble contains the Y displacement.


Synchronize (MCC_SYNC)

    The parameter byte is incremented and echoed back to the host when the
 command is processed.  Any commands that have been received after the
 synchronize command are discarded.  In other words, the command input buffer
 is flushed.  The purpose of this command is for synchronization with the
 host at power-up time.  Any motion commands sent during power-up will be
 lost.  The host needs a way to determine if the motion system is ready to
 accept commands.  It can do so by sending an MCC_SYNC command and waiting
 for the corresponding acknowledge byte.  If an acknowledge byte is not
 received by the host within some timeout period, the host can send another
 MCC_SYNC command.  When the motion controller becomes ready it will send
 back the incremented parameter byte.  By varying the parameter byte, the
 host can match the acknowledge byte with the command that is being
 acknowledged. Synchronization has occurred when the acknowledge byte
 corresponds to the most recently issued MCC_SYNC command.


Home an axis (MCC_HOME1)

 The parameters are:

   1) The axis to be homed (8b)
   2) The polarity of the home flag (0=active high, 1=active low) (8b)
   3) The direction and overtravel used to find the flag. (32b)
      The sign of this number indicates the direction to move.
      The maximum travel distance is the sum of the maximum axis position and
      the absolute value of this number.
   4) The logical position of the flag. (32b)

 The homing sequence is:

   1) Get onto the flag using the direction and maximum travel specified
      by the displacement parameter.  Rampdown begins when the flag is
      seen.  The speed of this motion is determined by the last MCC_SPEED
      or MCC_1SPEED command.
   2) Move onto the flag a few more steps.
   3) Move off of the flag and note the position where the flag negates.
      The stopping point will probably be a few steps away from the
      flag, but the distance between the stopping point and the flag
      position will be known.
   4) Set the motor phase to zero degrees.
   5) Set the current logical position to the flag position parameter
      value adjusted by the current distance from the flag.

     If the homing sequence cannot leave the flag, the acknowledge byte will
 contain the failure bit MCA_FAIL.

     If the flag is more than 1 full step from 0 degrees phase then the
 MCAM_FIXFLAG bit will be set to indicate that the flag should be adjusted to
 achieve consistent homing.


X/Y interactive non-ramping move (MCC_XYMANUAL)

     The minimum time for a linear motion request is about 2.56 ms, so
 performing manual motion using repeated single step moves is a bit clumsy.
 This command performs fixed-speed stepping in increments of 1 plotter unit
 at a constant rate adjustable between TBD and TBD steps per second.  The
 manual move command is acknowledged when it is received.  Motion begins when
 the first direction byte is received.  Additional direction bytes may be
 sent to change direction.  Each direction byte is acknowledged
 independently.  A direction byte of "0" halts the move and terminates
 interactive mode.  There is a short pause after the first step to facilitate
 single-step moves.  The host should query the motion system afterwards to
 determine the new x/y position.  The MCP.MNLDLY parameter is used to adjust
 the initial pause and the MCP.MNLSPD parameter is used to adjust the step

     The direction byte is an ASCII digit from 1 to 8:


                                  8 | 2
                             -x  7--*--3  +x
                                  6 | 4


 Y-axis ramping interactive move (MCC_YMANUAL)

     Motion proceeds in the direction implied by the specified incremental
 distance.  Motion ramps up during the first half of the increment and
 continues at that speed until the host sends a 0 byte to start rampdown. The
 total distance traveled will be a multiple of the increment. The travel
 speed will be the lesser of the specified y speed and the maximum speed that
 can be reached in half of the incremental distance. Before sending the 0
 byte, the host can send a non-zero byte.  The interactive move command will
 respond to each byte (including the 0 byte) with a single byte containing
 the number of increments traveled since the last byte was received from the
 host.  Very short increments (less than 10 milliseconds or so of travel
 time) may cause this command to malfunction.


 Set linear x/y speed for all axes (MCC_SPEED)
 Set linear x/y speed for one axis (MCC_1SPEED)

     Set the linear speed for pen-down x/y moves in velocity units per
 second. The maximum speed is 65535 velocity units per second.  By default, a
 velocity unit is 1 full step.  Each of the four axes has an associated speed
 setting.  MCC_SPEED sets the speed for all axes to the same value.
 MCC_1SPEED sets the speed for the specified axis.  The setting for the
 selected Y axis is used when the pen is down or continuous-path mode is on,
 even the moves that only move X.  If the pen is up and continuous-path mode
 is turned off, the maximum speed is used.  MCC_1REL and MCC_1ABS moves treat
 the specified axis as the selected Y axis.

 Maximum Speed (MCP_MAXSPD)
 Set the maximum speed for axis EPARAM1.

   The maximum speed setting serves two purposes:

   1) It influences the firmware ramp table generator.
      Internal ramp tables are not generated for speeds above the maximum.
   2) It is used to determine the speed of pen-up moves, which are
      performed at the maximum linear speed allowed by the two coordinated

     The parameter is the speed in velocity-units per second. These axis
 values are used when motion is requested and also when the ramp tables are
 generated.  If the maximum speed for an axis is changed to a value larger
 than the value that was in effect when ramps were last generated, the  ramp
 tables must be regenerated (MCP_MAKERAMPS) before the next motion command.


Power settings

    There are four power settings for each axis, corresponding to four
 different operating modes:

 1) Idle           - Not moving
 2) Ramping        - Accelerating or decelerating
 3) Coasting       - After accelerating and before decelerating
 4) Manual motion  - XY manual mode is in effect

     If the power setting is too low, the axis motor will perform poorly. If
 the power setting is too high, the motor will overheat. Normally, the
 ramping power is set to the largest value that will not damage the motor or
 saturate its magnetics. This can often be twice its normal opeating current
 specification. The coasting power (constant speed) may be set to normal
 operating specifications. The idle power should be set to the minimum power
 needed to prevent the motor from being bumped out of position when it is not


 Acceleration (MCP_SLOPE)

     Ramping tables are maintained separately for each physical axis. The
 acceleration capabilities of an axis are configured in terms of acceleration
 versus time.  Application software provides a small number of time/slope
 pairs (2 to 4 should be enough) to describe the acceleration curve.
 Acceleration is interpolated linearly between the specified points.  RSSxxxx
 uses the acceleration curve and the specified start speed to construct a
 velocity curve made of parabolic segments. A typical ramp curve has a small
 non-zero velocity, zero acceleration at time 0, quickly increases to maximum
 acceleration after a few tens of milliseconds, then gradually reduces
 acceleration to a fraction of the maximum.   The velocity curve is S-shaped,
 tightly convex upward at the beginning, then gently convex downward, more
 tightly convex downward at the end.

     The application specifies an acceleration curve for full-speed motion,
 but RSSxxxx modifies the acceleration curve based on the motion speed in
 order to avoid the jerk caused by abruptly reducing the acceleration to zero
 when the desired speed is reached.  The time of the first non-zero slope
 specified by the application also specifies the length of the time interval
 over which the acceleration is linearly reduced to zero at the top of the
 ramp curve.

 Chosing Ramp Parameters
     Determining the optimal ramping parameters empirically is a tedious
 process.  Here are a few tips that may help:

   *     Independently determine the upper limits of start speed, low-end
     acceleration and maximum speed.

         To determine the maximum start speed, set it to a very large value
     and perform motion at gradually increasing speeds until the axis fails
     to perform.

         To determine the maximum low-end acceleration, perform motion at a
     fixed speed (8% or so) using an increasing slope until the axis fails to
     perform.  The ramp tables must be rebuilt each time the slope is

         To determine the maximum speed, use conservative values for the
     start speed and slope and gradually increase the speed of motion until
     the axis fails to perform.

   *     The high-end acceleration has a much smaller effect on travel time
     than the low-end acceleration, so optimizing the low end deserves more

   *     For very short movements, the start speed dominates performance.


Get encoder position (MCC_GETENC)

    The 32-bit position of the specified encoder is sent high byte first,
low byte last. Each byte is sent in response to a MCC_NEXTBYTE character
from the host. The four MCC_NEXTBYTE characters from the host may be sent
all at once along with the command, or one at a time as the host processes
each incoming byte.


Set motion parameter (MCC_PARAM)
Set the specified parameter.  Setting ramp parameter values
 does not affect motion until the ramp tables are regenerated
 by an MCC_PARAM command with an index of MCP_MAKERAMPS.

  Parameter index (default)
  MCP_MAKERAMPS     Regenerate ramp table using MCP_SLOPE, MCP_STARTx,
                    MCP_SHORTSPD settings.

  MCP_EPARAM1       Extended parameter 1. Some parameters require more than
                    32 bits of information to set.  To set such parameters,
                    the MCP_EPARAM1 value may need to be loaded first.  For
                    example, to set MCP_MAXPOS, Extended Parameter 1 must be
                    set to the desired axis identifier.  The value of
                    Extended Parameter 1 persists through MCC_PARAM commands,
                    so it is not necessary to reload it when several
                    MCC_PARAM commands require the same value.

  MCP_EPARAM2       Extended parameter 2. Some parameters require more than
                    64 bits of information to set.  To set such parameters,
                    the MCP_EPARAM1 and MCP_EPARAM2 values may both need to
                    be loaded first. The value of Extended Parameter 2
                    persists through MCC_PARAM commands, so it is not
                    necessary to reload it when several MCC_PARAM commands
                    require the same value.

  MCP_SLOPE         Set ramp slope for EPARAM2 milliseconds. The ramp axis is
                    selected by EPARAM1. Units are 1000
                    velocity_units/second/second. All slopes after the
                    selected time are discarded. Setting the slope for time 0
                    effectively clears the slope table.  Up to MCN_SLOPES
                    pairs of time and slope can be stored for each ramp.
                    These values are used together with the MCP_STARTx values
                    to generate ramp curve tables.  Note that small slope
                    values can cause the ramp curve tables to exhaust
                    available ramp table space. If the ramp tables won't fit
                    in memory, MCP_MAKERAMPS will indicate failure.  Changing
                    the slope table has no effect on motion until the ramp
                    tables are regenerated by MCP_MAKERAMPS.

  MCP_START0 (50)   Set the starting speed for slow lines for ramp EPARAM1 in

  MCP_START1 (50)   Set the starting speed for fast lines for ramp EPARAM1 in

                    EPARAM1 values for MCP_SLOPE, MCP_START0, MCP_START1:


  MCP_POWER  (0)    Set motor current levels for physical axis EPARAM1.

                               ^                              ^
                          Bit 31 (MSb)                    Bit 0 (LSb)

                         IIIIIIII = idle             00000000 = min
                         CCCCCCCC = coasting         11111111 = max
                         RRRRRRRR = ramping
                         MMMMMMMM = manual

  MCP_UNIT          Set the size of an axis unit for axis EPARAM1. Valid
                               8000h (  2  steps)
                               4000h (  1  step )
                               2000h (1/2  step )
                               1000h (1/4  step )
                               0800h (1/8  step )
                               0400h (1/16 step )
                               0200h (1/32 step )
                               0100h (1/64 step )

  MCP_VUNIT (4000h) Set the size of an velocity unit for axis EPARAM1. To
                    make the linear speed setting for coordinated moves
                    meaningful, axes that move together should have velocity
                    units that represent the same physical travel distance.
                    Valid values:

                               8000h (  2  steps)
                               4000h (  1  step )
                               2000h (1/2  step )
                               1000h (1/4  step )
                               0800h (1/8  step )
                               0400h (1/16 step )
                               0200h (1/32 step )
                               0100h (1/64 step )

  MCP_MAXPOS        Set the maximum position for axis EPARAM1.

  MCP_CURPOS        Set the position of axis EPARAM1.

  MCP_MAXSPD        Set the maximum speed for axis EPARAM1. The parameter is
                    the speed in velocity-units per second. These axis values
                    are used when motion is requested and also when the ramp
                    tables are generated.  If the maximum speed for an axis
                    is changed to a value larger than the value that was in
                    effect when ramps were last generated, the  ramp tables
                    must be regenerated (MCP_MAKERAMPS) before the next
                    motion command.

  MCP_SETENC        Set 32-bit encoder position. EPARAM1 contains the encoder

  MCP_XYRAMP        Set the ramp curve to be used for combined X/Y moves.
                    When an axis is moved alone, its associated ramp is used.
                    When two axes are moved together the slower of the two
                    ramps is used by default.  To override this selection
                    write this parameter after selecting the axes. Legal
                    parameter values are MCI_XRAMP and MCI_YRAMP.

  MCP_HBPS          Set the serial port transfer rate.  The parameter
                    contains the desired baud rate divided by 100. The
                    MCC_PARAM command is acknowledged at the old baud rate.
                    The maximum serial rate is 115200 bps. The serial rate is
                    set to 38400 bps upon power-up.

  MCP_DUMPRAMP      Dump ramp tables for ramp EPARAM1 to download port

  MCP_SETENC        Set 32-bit encoder position for encoder EPARAM1.

                      EPARAM1 values:
                         0      Encoder associated with axis 0
                         1      Encoder associated with axis 1
                         2      Encoder associated with axis 2
                         3      Encoder associated with axis 3
                    MCI_XWHEEL  Train X control wheel
                    MCI_YWHEEL  Train Y control wheel

  MCP_OPTIONS       Set option flags.
                    Bit0=0 Curve ramp based on faster axis
                    Bit0=1 Curve ramp based on linear speed
                    Other bits are reserved for future use.

  MCP_MNLSPD (40)   Manual move inter-step-delay, 0-65535.

  MCP_MNLDLY (3000) Manual move delay after first step, 0-65535.

  MCP_IDLETIME      Number of 2.56ms intervals after motion stops before
                    setting IDLE power.

  MCP_SETTLES       Chopper settle times each 0-7 in bottom two bytes.

  MCP_DRIVER        Turn a driver on or off.  Clear the Emergency Stop flag.
                    The parameter value:

                               00000000 00000000 000000mm 0000000f
                               ^                                 ^
                          Bit 31 (MSb)                       Bit 0 (LSb)

                                   --               f
                                   00 axis 0        -
                                   01 axis 1        0 turn driver off
                                   10 axis 2        1 turn driver on
                                   11 axis 3

  MCP_TRAINRATIO    Set scale for TRAIN wheel EPARAM1 to param/EPARAM2

  MCP_TRAINSLIP     Set counts per turn for TRAIN wheel EPARAM1.
                    EPARAM1: MCI_YTRAIN or MCI_XTRAIN

  MCP_DEBUG         Set debug flags.  0 disables all debug options.

  MCP_PULSE         Set the duty-cycle of the pulse axis in percent.

  MCP_DACOFFSETS    Set DAC offsets for motor EPARAM1.

  MCP_SCURRENT      Write one entry of a current table for an axis. The high
                    16-bits of the parameter are the sine value and the low
                    16-bits are the cosine value. EPARAM1 contains the phase
                    of the entry and is automatically incremented by 0100h
                    after the entry is written.  EPARAM2 contains the axis
                    number and table number in the format below:

                               00000000 00000000 000000tt 000000mm
                               ^                                 ^
                          Bit 31 (MSb)                       Bit 0 (LSb)

                                         tt            mm
                                         --            --
                                         00 Idle       00 axis 0
                                         01 Coasting   01 axis 1
                                         10 Ramping    10 axis 2
                                         11 Manual     11 axis 3

  MCP_AXISFLIP      1 to reverse the direction of axis EPARAM1, else 0.

  MCP_ENCFLIP       1 to reverse the direction of encoder EPARAM1.

  MCP_LOCKSTEP      axis# to phase lock to axis EPARAM1, else -1.

  MCP_PHASE         Set the phase shift for current table for axis EPARAM1.
                    0=no shift, 2000h=45 degrees, 4000h=90 degrees.

  MCP_SAVE          Save settings to serial NVRAM.

  MCP_RESTORE       Restore saved state from serial NVRAM.

  MCP_LOCKABORT     1 to enable Interlock Abort else 0. When Interlock Abort
                    is enabled, motion is aborted when the Interlock input is
                    not grounded.  The Emergency Stop flag is set when an
                    Interlock Abort occurs and the motor drivers are powered
                    off. Recover by turning the drivers back on and homing.
                    Use MCC_GETINFO/MCG_MOTOR to read in interlock flag.

  MCP_USER          Set the value of a 32-bit variable that can be read
                    using MCC_GETINFO/MCG_USER.


 Get x,y position (MCC_GETXY)

     The x,y position is sent to the host in this sequence:

     x24:31, x16:23, x8:15, x0:7, y24:32, y16:23, y8:15, y0:7

     Each byte is sent in response to a MCC_NEXTBYTE character from the host.
 The eight MCC_NEXTBYTE characters from the host may be sent all at once
 along with the command, or one at a time as the host processes each incoming

 Get USTEP version (MCC_GETVER)

     The host may need to use this command to determine which features are
 available The USTEP firmware version is sent to the host in this sequence:

           version_high8, version_low8, config_high8, config_low8

     Each byte is sent in response to a MCC_NEXTBYTE character from the host.
 The four MCC_NEXTBYTE characters from the host may be sent all at once along
 with the command, or one at a time as the host processes each incoming byte.

 No operation (MCC_NOP)

     The MCC_NOP command is ignored when received.  It is not acknowleged.

 Wait for motion to complete (MCC_WAIT)

     The MCC_WAIT command waits for the motion system to come to a halt and
 then sends the acknowlege byte.

 Emergency Stop (MCC_ESTOP)

     Sending MCE.ESTOPLEN bytes of MCC_ESTOP bypasses any commands in the
 serial input buffer and aborts motion in progress.  No acknowledge byte is
 sent and any unprocessed commands in the serial input buffer are discarded.


 Get Status Information (MCC_GETINFO)

     Get 32 bits of information based on the index and subindex. The high
 byte is sent first.  Each byte is sent in response to a MCC_NEXTBYTE
 character from the host.  The four MCC_NEXTBYTE characters from the host may
 be sent all at once along with the command, or one at a time as the host
 processes each incoming byte.

   Get per-motor status for subindex motor#.
   Use these mask bits with the return value to test the conditions:
     MGM_LOCK    Interlock input, single input, motor# ignored
     MGM_ENABLED Motor is enabled
     MGM_INDEX   Index input
     MGM_LIMIT   Limit input

   Get the 2 DAC offsets for subindex=axis#.

   Get logical axis position for subindex=axis#.
   The position is initialized by MCC_PARAM/MCP_CURPOS and is updated when
   the axes move.  Units are 1/1024 steps.

   Get encoder value for subindex=encoder#.
   Encoder positions can be initialized by MCC_PARAM/MCP_SETENC and are
   updated when the encoders move.  One transition of an encoder phase input
   increments or decrements the position.

   Get the RSTEP hardware (Not firmware) version.

   Get the RSTEP firmware (Not hardware) version.
   The high 16-bits contains the version number.
   The low  16-bits contains option flags.

   Get the value of a 32-bit user variable that can be set


     The following is a list of the Command Mnemonics used in describing
 characters necessary to implement the motion control commands.  This list is
 also available as include files for FORTH, PASCAL, and C software
 development.  They reside in the SS\MOTION\ Directory, as USTEPCMD.4TH,
 USTEPCMD.INC, and USTEPCMD.H respectively.  The PASCAL and C mnemonics use
 an underline rather than the period within the mnemonic.

( Command acknowlege bytes )
ASCII @ EQU MCA.OK       ( Operation succeeded, or unreported failure     )
ASCII A EQU MCA.FAIL     ( Operation failed                               )

( Command acknowlege byte mask bits )
01 EQU MCAM.FAIL         ( Bit 0  0=Command succeeded  1=Command failed   )
02 EQU MCAM.HALT         ( Bit 1  0=Moving             1=Halted           )
04 EQU MCAM.ESTOP        ( Bit 2  0=Ok                 1=Emergency stop   )
( Command-specific acknowlege byte mask bits )
10 EQU MCAM.FIXFLAG      ( Bit 4  0=Home flag ok       1=Adjust home flag )

( Command bytes )
ASCII E EQU MCC.DEGAUSS  ( Degauss x,y,x&y                   8b              )
\ ASCII W EQU MCC.HOME   ( Table zero                        8b              )
ASCII h EQU MCC.HOME1    ( Single-axis home              a8b p8b d8b t32b f32b
ASCII m EQU MCC.RAMPMODE ( Enable/disable curve ramps        8b              )
07F     EQU MCC.NOP      ( No operation, no acknowlege       --              )
ASCII p EQU MCC.PARAM    ( Set motion parameter              index16b val32b )
ASCII c EQU MCC.PASSCHAR ( Send character to diag port       8b              )
ASCII d EQU MCC.PENDNWT  ( Pen down with Wait                --              )
ASCII D EQU MCC.PENDOWN  ( Pen down                          --              )
ASCII u EQU MCC.PENUPWT  ( Pen up with Wait                  --              )
ASCII U EQU MCC.PENUP    ( Pen up                            --              )
ASCII e EQU MCC.SCANRES  ( Set pen pulse divisor             8b              )
ASCII v EQU MCC.SLAVE    ( Enter Slave mode                  xunit16b yunit16b
ASCII s EQU MCC.SPEED    ( Set line speed in units/sec       speed16b        )
ASCII N EQU MCC.SYNC     ( Synchronize                       8b              )
\ ASCII F EQU MCC.VIEWFROM ( Come from view position         --              )
\ ASCII V EQU MCC.VIEWTO ( Go to view position               --              )
ASCII G EQU MCC.WAIT     ( Wait for motion to complete       --              )
ASCII x EQU MCC.XREL     ( X axis relative move              x32b            )
ASCII a EQU MCC.XYABS    ( Absolute x/y move                 x32b     y32b   )
ASCII M EQU MCC.XYMANUAL ( X/Y non-ramping interactive move  dir8b           )
ASCII r EQU MCC.XYREL    ( Relative x/y move                 x32b     y32b   )
ASCII R EQU MCC.XYREL8   ( Relative Short x/y move           x8b      y8b    )
ASCII C EQU MCC.XYREL16  ( Relative short X/Y move           x16b     Y16b   )
ASCII f EQU MCC.XYSELECT ( Select coordinated axes           xaxis8b  yaxis8b)
ASCII | EQU MCC.XABS     ( X-axis absolute move              x32b            )
ASCII l EQU MCC.YABS     ( Y-axis absolute move              y32b            )
ASCII y EQU MCC.YREL     ( Y-axis relative move              y32b            )
ASCII w EQU MCC.YSELECT  ( Select logical Y axis             8b              )
ASCII z EQU MCC.1ABS     ( 1-axis absolute move              8b y32b         )
ASCII Z EQU MCC.1REL     ( 1-axis relative move              8b y32b         )
ASCII b EQU MCC.ZMANUAL  ( Z-axis interactive move           limit32b inc32b )
ASCII B EQU MCC.YMANUAL  ( Selected Y axis interactive move  limit32b inc32b )
ASCII k EQU MCC.1SPEED   ( Set axis speed in units/sec       8b speed16b     )

ASCII S EQU MCC.GETINFO  ( Get 32-bit status information     handshake seq   )
ASCII I EQU MCC.GETZ     ( Get Z coordinate and status byte  handshake seq   )
ASCII J EQU MCC.GETXY    ( Get x,y coordinates               handshake seq   )
ASCII j EQU MCC.GETVER   ( Get USTEP version                 handshake seq   )
ASCII g EQU MCC.GETENC   ( Get encoder position              8b + handshake  )
ASCII . EQU MCC.NEXTBYTE ( Send next data byte               --              )
ASCII T EQU MCC.TESTMODE ( Force pen down                    8b              )
ASCII t EQU MCC.TRAIN    ( Enter train mode                  --              )
ASCII G EQU MCC.TRAINEND ( An alias for MCC.WAIT             --              )
ASCII ` EQU MCC.ESTOP    ( Emergency stop code 60h           "`````````"     )

1A EQU MCE.ESTOPLEN      ( Length of ESTOP string )

ASCII Q EQU MCC.QUITUC   ( Debug quit                        --              )
ASCII q EQU MCC.QUITLC   ( Debug quit                        --              )

( X/Y manual-motion direction byte )

( Z-adjust command bytes )
ASCII ? EQU MCA.STATUS        ( Continue moving. Return incremental #moves. )
ASCII 0 EQU MCA.STOP          ( Stop moving.     Return incremental #moves. )

( Terminate SLAVE mode )
0       EQU MCS.STOP

( Parameter values for MCC.HOME  Table zero )

( Definitions for MCC.GETINFO  Get status information )

( Status indexes )
0000 EQU MCG.MOTOR      ( Get per-motor status for subindex motor# )
     1 EQU MGM.LOCK     (   Mask: Interlock in, single in, motor# ignored )
     2 EQU MGM.ENABLED  (   Mask: Motor is enabled )
     4 EQU MGM.INDEX    (   Mask: Index input      )
     8 EQU MGM.LIMIT    (   Mask: Limit input      )
0001 EQU MCG.DACOFFSETS ( Get the 2 DAC offsets for subindex motor# )
0002 EQU MCG.POS        ( Get axis position for subindex motor#     )
0003 EQU MCG.ENCODER    ( Get encoder value for subindex encoder#   )
0004 EQU MCG.HWVERSION  ( Get hardware version from RABIO           )
0005 EQU MCG.SRAM       ( Get4 bytes at even address EPARAM1+subindex )
0006 EQU MCG.DRAM       ( Get 4bytes even offset EPARAM1+subindex,row EPARAM2)
0007 EQU MCG.FWVERSION  ( Get firmware ver. in high word options in low word )
0008 EQU MCG.USER       ( Get user variable settable by MCC.PARAM/MCP.USER )

( Definitions for MCC.PARAM  Set motion parameters )

( Parameter indexes )
0001 EQU MCP.MAKERAMPS   ( Regenerate the ramp tables                        )
0002 EQU MCP.DEFAULTS    ( Reset to default ramp parameters                  )
0003 EQU MCP.HOME        ( Perform table zero                                )
0004 EQU MCP.TEST        ( Perform test routine                              )
     1 EQU MCT.PLOTVER   ( Plot the USTEP ROM version number )
0005 EQU MCP.YROTOR      ( Set Y position for rotary plotting                )
0006 EQU MCP.DUMPRAMP    ( Dump ramp tables for ramp EPARAM1 to download port)

( 0007 EQU MCP.YAXIS     ( Assign physical axis MCI.xPHYS to logical Y axis  )
   0 EQU MCI.ZPHYS       ( Z physical axis number )
   1 EQU MCI.YPHYS       ( Y physical axis number )
   2 EQU MCI.RPHYS       ( R physical axis number )
   3 EQU MCI.XPHYS       ( X physical axis number )
   4 EQU MCI.LPHYS       ( L physical axis number )

000C EQU MCP.EPARAM1     ( Extended parameter value 1                        )
000C EQU MCP.XPARAM1     ( Extended parameter value 1 old name               )
000D EQU MCP.EPARAM2     ( Extended parameter value 2                        )
000D EQU MCP.XPARAM2     ( Extended parameter value 2 old name               )
000E EQU MCP.SLOPE       ( Set slope of ramp EPARAM1 at EPARAM2 milliseconds )
000F EQU MCP.START0      ( Initial speed for slow lines for ramp EPARAM1     )
0010 EQU MCP.START1      ( Initial speed for fast lines for ramp EPARAM1     )
(    EPARAM1 values for MCP.SLOPE, MCP.START0, MCP.START1:                   )

0011 EQU MCP.UNIT         ( Plotter unit size            for axis EPARAM1    )
                          ( Valid plotter unit sizes are:                    )
                          ( 8000h, 4000h, 2000h, 1000h, 800h, 400h, 200h, 100h
                          ( 8000h is 2 full steps.   100h is 1/64th step.    )
0012 EQU MCP.VUNIT        ( Velocity unit size          for axis EPARAM1    )
0013 EQU MCP.MAXPOS       ( Maximum position             for axis EPARAM1    )
0014 EQU MCP.CURPOS       ( Current position             for axis EPARAM1    )
0015 EQU MCP.MAXSPD       ( Maximum speed pu/sec/100     for axis EPARAM1    )
0016 EQU MCP.POWER        ( Power settings               for axis EPARAM1    )
(                             16-bit format: 0000000000000000IIIICCCCRRRRMMMM)
(                             32-bit format: IIIIIIIICCCCCCCCRRRRRRRRMMMMMMMM)
(                             I=idle C=coasting R=ramping M=manual           )
(                                                                            )
(    EPARAM1 values for MCP.UNIT, MCP.MAXPOS, MCP.CURPOS, MCP.POWER:         )

   4 EQU MCI.#MOTORS      ( Z,Y,R,X   )
   5 EQU MCI.#AXES        ( Z,Y,R,X,L )
(                                                                            )
0017 EQU MCP.XYRAMP       ( Ramp to use for X/Y moves: MCI.XRAMP or MCI.YRAMP)
0018 EQU MCP.SETENC       ( Set 32-bit encoder position                      )
   4 EQU MCI.XWHEEL       ( Train X control wheel )
   5 EQU MCI.YWHEEL       ( Train Y control wheel )

0019 EQU MCP.CURRENT      ( Write current table                              )
001A EQU MCP.HBPS         ( Set serial communications rate in 100 bps units  )


384 EQU MCPD.HBPS        ( Default communications rate is 38400 bps          )


(                                                                            )
001B EQU MCP.OPTIONS     ( Set option flags                        )
(                          Bit0=0 Curve ramp based on faster axis  )
(                          Bit0=1 Curve ramp based on linear speed )
(                          Other bits reserved for future use      )
(                                                                            )
001C EQU MCP.SHORTSPD    ( Fixed speed for short lines for ramp EPARAM1      )
001D EQU MCP.MNLSPD      ( Manual move inter-step-delay                      )
001E EQU MCP.MNLDLY      ( Manual move delay after first step                )
( 001F EQU MCP.RESETCHOP ( Reset chopper breakers.  Obsolete. USE MCP.DRIVER )
0020 EQU MCP.IDLETIME    ( # idle packets after motion before IDLE power     )
0021 EQU MCP.SETTLES     ( Chopper settle times 0-7 in high and low bytes    )
0022 EQU MCP.DRIVER      ( Turn driver on/off 0m0f m:motor# f:1=on 0=off     )
0023 EQU MCP.TRAINRATIO  ( Set scale for TRAIN wheel EPARAM1 to param/EPARAM2)
0024 EQU MCP.TRAINSLIP   ( Counts per turn for TRAIN wheel EPARAM1           )
0025 EQU MCP.DEBUG       ( Debug flags                                       )
0026 EQU MCP.PULSE       ( Laser power 0-100%                                )
(                            I=idle C=coasting R=ramping M=manual            )
(                                                                            )
0027 EQU MCP.DACOFFSETS  ( Set DAC offsets for motor EPARAM1                 )
0028 EQU MCP.DGPERIOD    ( Degauss half-cycle period in microseconds         )
0029 EQU MCP.DGCYCLES    ( Number of degauss half-cycles                     )
002A EQU MCP.DGAMPLITUDE ( Degauss amplitude in 2.14 format                  )
002B EQU MCP.SCURRENT    ( Set signed current table entry                    )
002C EQU MCP.AXISFLIP    ( 1 to reverse the direction of axis EPARAM1, else 0)
002D EQU MCP.ENCFLIP     ( 1 to reverse the direction of encoder EPARAM1     )
002E EQU MCP.LOCKSTEP    ( axis# to phase lock to axis EPARAM1, else -1      )
002F EQU MCP.PHASE       ( Phase shift of current table for axis EPARAM1     )
(                        ( 0=no shift, 2000h=45 degrees, 4000h=90 degrees.   )
0030 EQU MCP.SAVE        ( Save settings to NVRAM                            )
0031 EQU MCP.RESTORE     ( Restore saved state                               )
0032 EQU MCP.LOCKABORT   ( 1 to enable interlock abort else 0                )
0033 EQU MCP.USER        ( A 32-bit variable that can be read by MCG.USER    )

0034 EQU MCP.RESERVED    ( An illegal parameter index                        )
0034 EQU MCP.MCPMAX      ( The last parameter index                          )

If you have comments or suggestions, email us at
Testra Corporation   1201 N. Stadem Drive  Tempe, AZ 85281  Ph. 480-560-6141  Fax: 480-907-2876