.TOPIC:
Contents
 General Topics
 --------------
 Using help
 Using the MD2 program
 Common problems
 MD-2 step motor system
 MD-2 step motor systems data
 Positioning table data
 Arrick Robotics

 Concepts and Features
 ---------------------
 Ports and motor numbers
 Calibration
 Parameter files
 Enable/disable motors
 Joystick control
 Holding motors
 Standby mode
 Absolute/relative moves
 Speeds and ramping
 Backlash compensation
 Step types
 Units conversion
 Soft limits
 Interrupts
 Input/Output port
 Errors

 Motor Parameters
 ----------------
 Backlash
 Home offset
 Home direction
 Interrupt control
 Limit fwd
 Limit rev
 Motor
 Motor Name
 Maximum Speed
 Minimum Speed
 Move Type
 Position
 Slope
 Status
 Step Type
 Target
 Units
 Unit Name

 Moving Motors
 -------------
 Quick moves
 Joystick control
 Home moves
 Line moves
 Circle and arc moves
 Grid moves

 Motion Programs
 ----------------
 Motion programs
 Teaching programs
 Editing programs
 Running programs
 Command line

.TOPIC:
Using the MD2 program
The MD2 program allows the operator to control the MD-2
dual stepper motor system interactively.  All motor
parameters can be edited and experimented with.  Motors
can be moved and advanced moves such as circles, arcs
and grids are also possible.  Motion control programs
up to 32,000 characters in length can be loaded, saved,
edited and executed.  Motion programs can be created 
automatically using the teach mode which writes code 
for you.  Other features include input bit reading, 
output bit control, motor speed calibration, standby 
mode control and port identification.

To use the MD2 program for the first time, connect
the MD-2 system to one of your parallel printer ports using
a standard printer cable.  Connect the motors to the MD-2
driver box and attach the AC power cable.

Create a directory on your hard disk named MD2 and copy
all of the MD-2 software into it.  Change directory to MD2
and run the MD2 program.

The first thing that must be done before moving motors
is calibration.  This process is required for motor speed
calculations on your computer.  You only need to
calibrate once.  Select CALIBRATE from the OPTIONS menu by
using the mouse or by holding down the ALT key while 
pressing O then pressing C again to select CALIBRATE.  
Calibration takes about 10 minutes.  See  Calibration

Next, you must determine which motor numbers are available
on your computer.  This depends on the addresses of your
parallel printer ports.  In the motor name column, 
"no port" will be displayed if that port doesn't exist.
See  Ports and motor numbers

Before actually moving motors you must enable the MD-2 by 
selecting the ENABLE checkbox using the mouse or by
pressing ALT 1, 3 or 5.  See  Enable/disable motors

After the MD-2 system is enabled, the function keys can be
used to move the motors.  Each time a function key is  
pressed, the desired motor will move according to the 
DISTANCE parameter.  The speed and other parameters which
can be seen on the parameter screen can be adjusted for
optimum performance.  Default parameters should be 
adequate to move motors initially.  See  Quick moves

For information on specific features, see the table of
contents.

When starting the MD2 program, the following files 
are loaded from the current directory:

MD2.CAL  calibration file
-----------------------------
This file is needed to calculate motor speeds.  If it is
not found, an error message is given.  See  Calibration

MD2.HLP  help file
----------------------
This file is used to provide on-line help.  If it is not
found, the help system will be unavailable.

MD2.PAR  Default parameter file
-----------------------------------
This file contains default motor parameters such as speeds,
limits, backlash compensation, etc.  You can load another
parameter file or simply change and save this one for
normal use.   See  Parameter files

MD2.BAS  Default program file
----------------------------------
This file contains the default motion program which is
used to write motion control programs.  You can load
other program files or simply use this one as your main
project.  See  Motion programs

Keypresses to activate commands:
Every function can be activated with the mouse or the
keyboard.  To use the mouse simply click on the desired
control with the left mouse button.  Activate a control
by pressing the ALT key while pressing the highlighted
letter in the control's name such as ALT-P to activate
the parameter button.  Menu activation occurs the same
way.  Most controls on the main screen can be activated
by simply pressing the key alone without the the ALT key
such as P for parameters or X for exit.  The exception
to this is when the cursor is located in one of the
text boxes for distance or position in which case the
1,3 and 5 keys will not activate the enable control but
will be entered into the text box.  In this case, use
ALT-1, 3 or 5 to activate the enable controls.

The following list of keys can be used when the main 
screen is showing.  

Alt-1 or 1          Enable MD-2 for motors 1 & 2
Alt-3 or 3          Enable MD-2 for motors 3 & 4
Alt-5 or 5          Enable MD-2 for motors 5 & 6

  Note: Enable controls can be activated by simply 
  pressing the number 1, 3 or 5 keys unless the 
  cursor is located in the distance or position 
  text boxes.

Alt-O,B or B        Beep in teach mode
Alt-C or C          Circle move
Alt-O,D or D        Distances = single steps
Alt-E or E          Edit motion program
Alt-G or G          Grid move
H                   Home move
Alt-H,A             Help, about
Alt-H,C             Help, contents
Alt-H,S             Help, search
Alt-H,H             Help, how to use
Alt-I,I or I        Input signals screen
Alt-O,J or J        Joystick control
Alt-L or L          Line move (single or dual motor move)
Alt-I,O or O        Output signals screen
Alt-P or P or Esc   Parameter screen
  
  Note: Use the escape key to toggle back and
  forth between the main screen and the parameters
  screen.

Alt-R or R          Run motion program
Alt-O,S or S        Sleep in teach mode
Alt-T or T          Teach mode ON/OFF
Alt-X or X          Exit program
'                   Comments in teach mode

Function keys provide a quick way to move motors 
individually.  The motor will move according to the
value of the distance parameter.

F1       Motor 1 reverse
F2       Motor 1 forward                                           
F3       Motor 2 reverse
F4       Motor 2 forward                                           
F5       Motor 3 reverse
F6       Motor 3 forward      See  Quick moves                                     
F7       Motor 4 reverse
F8       Motor 4 forward                                           
F9       Motor 5 reverse
F10      Motor 5 forward                                           
F11      Motor 6 reverse
F12      Motor 6 forward                                           

.TOPIC:
Arrick Robotics
Mailing Address                 Shipping Address
---------------                 ----------------
Arrick Robotics                 Arrick Robotics
P.O. Box 1574                   2107 W. Euless Blvd.
Hurst, Texas 76053              Euless, Texas 76040

Phone: (817) 571-4528
  Fax: (817) 571-2317

.TOPIC:
MD-2 step motor system
The MD-2 dual stepper motor system is a complete dual 
axis motion control system that connects to any IBM style 
personal computer.  The system comes complete with 2 
motors, cables, drive electronics, software and 
documentation.  Simply connect the MD-2 to a printer port 
and load the software.  These motors can be used to 
control a wide range of items including robotic arms, 
telescopes, cameras and lasers.  The operator and
programmer have complete control over the speed, 
direction and other parameters of each motor.  
Sophisticated motion control programs can be created to 
accomplish almost any job.

.TOPIC: 
Common problems
See also Errors

Vibrating or erratic motors
---------------------------
The torque of a step motor decreases as the speed 
increases.  If a motor is moved too fast, lost steps 
could occur.  Normally the motor will not miss just one
or two steps but large amounts.  Sometimes a motor may
just vibrate without moving at all.  To solve this 
problem, decrease the speed or slope until reliable
performance is achieved.  If lost steps still occur,
it may be necessary to decrease the torque requirement
of the motor or change to a stronger motor.

Another source of motor speed problems is computers that
change their processing speeds automatically.  Laptop
computers often change speeds unexpectedly to conserve
power.  Most laptops have an option to disable this
feature.

When moving motors in single steps, it may be necessary to
select HOLD which will keep the motor energized between
steps so that the step can be completed accurately.
See also  Holding motors   Speeds and ramping

Incorrect motor speeds
----------------------
The calibration process does a series of tests on a
particular computer in order to accurately produce motor
speeds.  Using a calibration file that was created
on another computer may result in incorrect motor speeds.
If in doubt, recalibrate the motor speeds.

See also  Calibration  Speeds and ramping  

File errors
-----------
File errors can be produced if a parameter file or
calibration file has been corrupted.  If this happens
while loading a parameter file, simply set the desired
parameters and save again.  If this happens to a 
calibration file, perform calibration again.

See also  Calibration  Parameter files

.TOPIC:
MD-2 step motor systems data
MODEL  SIZE  STEP  HOLD TORQUE     MAXIMUM SPEED
---------------------------------------------------
MD-2    23    .9     50in/oz      1,000 steps/sec.
MD-2a   23    .9     50in/oz     10,000 steps/sec.
MD-2ah  23    .225   25in/oz     10,000 steps/sec.
MD-2b   23    .9    150in/oz     10,000 steps/sec.
MD-2c   34    .9    300in/oz     10,000 steps/sec.

Step angles are in degrees.
All size 23 motors have .25" shaft diameters.
All size 34 motors have .375" shaft diameters.

Contact Arrick Robotics for a complete 
motion control catalog.

.TOPIC:
Positioning table data
MODEL AXIS TRAVEL DRIVE  MOTOR RESOLUTION ACCURACY
--------------------------------------------------
X-9     1    9"   BELT    #23     .005"     .010"
X-18    1   18"   BELT    #23     .005"     .010"
X-30    1   30"   BELT    #23     .005"     .010"
XY-9    2    9"   BELT    #23     .005"     .010"
XY-18   2   18"   BELT    #23     .005"     .010"
XY-30   2   30"   BELT    #23     .005"     .010"
Z-2     1    2"   SCREW   #23     .00125"   .005"

Positioning tables are not provided with motors or
controllers.  See  MD-2 step motor systems data

The following motor parameters can be used for belt-
driven positioning tables having 200 steps per inch:

    Backlash = .030  (depends on belt tension.)
    Home direction = Reverse
    Home offset = .1 inch
    Reverse limit = 0
    Forward limit = 9, 18 or 30 inches
    Minimum speed = 1 inch/sec
    Maximum speed = 3 inch/sec
    Slope = 1 inch
    Units = 200 steps per inch
    Unit Name = Inches
    Step Type = Half step mode
       
       Note:
       Speed and slope parameters can be increased when 
       using larger size 23 motor systems such as the 
       MD-2b.  Maximum speeds up to 20 inches per second 
       are possible depending on payload and other 
       factors.  Experiment to find best values.

For the Z-2 lead-screw driven table, set parameters 
as follows:
    
    Backlash = .0  
    Home direction = Reverse
    Home offset = .1 inch
    Reverse limit = 0
    Forward limit = 1 inches
    Minimum speed = .25 inch/sec
    Maximum speed = .75 inch/sec
    Slope = .5 inch
    Units = 800 steps per inch
    Unit Name = Inches
    Step Type = Half step mode

For the GR-2 gripper, set parameters as follows: 

    Backlash = .0  
    Home direction = Reverse
    Home offset = 0
    Reverse limit = 0
    Forward limit = 1
    Minimum speed = 5
    Maximum speed = 5
    Slope = 0
    Units = 20 
    Unit Name = 1=close
    Step Type = Half step mode

.TOPIC:
Calibration
The calibration process does a series of tests on a
particular computer in order to accurately produce motor
speeds.  Calibration takes several minutes and is only 
required once on a computer.  Motors can not be moved 
without a calibration file present.  Using calibration 
files created on a different computer may result in 
inaccurate motor speeds.  Normally, motor speeds will
be within 5% of the desired speed.

.TOPIC:
Ports and motor numbers
The MD-2 system connects to the parallel printer port of
any IBM style personal computer using a standard printer
cable.  There can be as many as 3 parallel printer ports
on a single computer.  Since each port can be attached to
an MD-2, a total of 6 motors can be controlled with a 
single computer.  Each port has its own unique address.
The possible addresses are 3BC, 378 and 278 hex.  When
adding a new port to your computer, make sure that no two
ports have the same address.  The MD-2 software refers to
the motors connected to port 3BC as motors 1 and 2, port
378 as motors 3 and 4 and port 278 as motors 5 and 6.
Your computer may have only one or two ports.  Since the
motor numbers are determined by which port they are
connected to, your system may have motors 3 and 4 or 5
and 6 but not 1 and 2.  You may wish to keep your 3BC
port connected to your printer so it can be referred to
as LPT1. Parallel printer port cards are very inexpensive
and are normally available at computer stores or by 
mail-order.  There are usually jumpers on the boards that
will select the desired port address.  One way to find
which port your MD-2 system is connected to is to select
INPUTS from the menu and press one of the home switches.
The switch status will change from false to true when
the switch is pressed indicating which port the MD-2 is
connected to.

.TOPIC:
Parameter files
Parameter files are stored on disk and contain all motor
parameters such as backlash, speeds, motor positions,
circle parameters and grid parameters.  Parameter files
are normally used to store the beginning parameter values
before motion is started or a program is run.  Parameter  
files are text files and can be edited using a text editor
that works with unformatted documents.  Typographical
errors will produce FILE ERRORS when being read.  It's 
best to edit parameters in the program to insure accurate 
results.

.TOPIC:
Enable/disable motors
An MD-2 system must be enabled before the motors can be
moved.  Do this by selecting the ENABLE check box for the
appropriate MD-2 system.

See also  Ports and motor numbers

.TOPIC:
Holding motors
When a stepper motor is energized but not moving it 
produces holding torque which will cause the motor's shaft 
to resist movement.  While the motor is in this holding 
mode, heat is generated.  Control of this parameter is
found on the parameters screen.  Disabling an MD-2 will
also de-energize the motors which removes holding torque.

See also  Standby mode  Enable/disable motors

.TOPIC:
Standby mode
If some holding torque is necessary but heat is a problem, 
standby mode can be enabled which cuts motor torque in 
half.  Simply set the standby mode item in the OPTIONS
menu to activate this function.  Standby mode affects 
the entire MD-2 system (2 motors).  Moving a motor while 
in standby mode will greatly reduce the available torque.
Standby mode is not available on all MD-2 systems.

See also  Holding motors  Enable/disable motors

.TOPIC:
Absolute/relative moves
When moving a motor the operator has two choices, relative 
or absolute moves.  This is set using the MOVE TYPE 
parameter.  In relative moves, the motor will move the 
number of units in the TARGET parameter, positive numbers 
are forward and negative numbers are reverse.  In absolute 
moves the motor will move to the position indicated by the 
TARGET parameter.  Position values are in units from home, 
with positive numbers indicating positions forward from 
home and negative numbers reverse from home.  In absolute 
moves the motor will take into account its current position
and determine which direction and step count is needed to 
move to the desired position.  The direction of forward 
and reverse can be swapped by using the HOME DIR parameter.  
Both linear and circular moves are affected by the move 
type parameter.


See also  Target  Move Type

.TOPIC:
Speeds and ramping
Motor speeds are determined by the frequency of the 
pulses sent to the MD-2 system by the computer and are 
programmable using the MINIMUM SPEED, MAXIMUM SPEED and 
SLOPE parameters.  The minimum speed and maximum speed 
values are in units per second.  Calibration must be done 
on a particular computer once to insure proper speed 
calculation.  The minimum and maximum speed ranges are 
determined by the processing speed of the computer.  Fast 
computers are capable of sending faster step pulses to 
the motors.  If pulses are sent to the motor too fast, the 
result will be erratic motion or simply vibration.  This 
does not harm the motor or MD-2 system.  The torque of a 
stepper motor decreases as the speed increases.  This may 
cause the motor to move a load at slow speeds but miss 
steps at faster speeds.  Homing the motor can always be 
used to resyncronize the system if this occurs.  
Experimentation will be necessary to determine the optimum 
speed for a given motor, mechanical system and load.

Ramping means accelerating the motor from a slow speed to 
a maximum speed gradually then decelerating back to the 
slow speed when the motion is done.  Ramping greatly 
increases the speed at which a motor can move a load and 
greatly reduces the amount of vibration and jerk in a 
system.  Three parameters are used to accomplish ramping: 
MINIMUM SPEED, MAXIMUM SPEED and SLOPE.  The MINIMUM SPEED 
is the speed at which the motor begins to move at and
ultimately ends at.  The MAXIMUM SPEED parameter is the 
speed at which the motor moves after ramping up 
(accelerating) and before ramping down (decelerating). 
SLOPE is the rate at which the speed changes given in 
number of units.  If the SLOPE parameter is set to 100 
then it will take 100 units for the motor to go from the 
MINIMUM SPEED to MAXIMUM SPEED during acceleration and also 
100 units for the motor to go from MAXIMUM SPEED back down 
to MINIMUM SPEED when done.  Set the MINIMUM SPEED to a 
value that the motor can always start and stop at without 
missing steps or overshooting.  Set the SLOPE value to a
number that allows the motor to ramp quickly without 
missing steps.  Set the MAXIMUM SPEED to a speed faster 
than the MINIMUM SPEED parameter but one that does not 
cause lost steps.  Experimentation will provide the best 
values for these parameters resulting in smooth motion and 
high speeds.  Setting the SLOPE parameter to 0 will cause
the motor to move at a constant speed determined by the 
MAXIMUM SPEED parameter without ramping.  Homing the motor
only uses MINIMUM SPEED, no ramping is performed.

See also  Calibration  Home moves
          Maximum Speed  Minimum Speed  Slope

.TOPIC:
Backlash compensation
Most mechanical systems include gears, chains, belts or 
other devices that contain looseness known as backlash.  
This results from small spaces between gear teeth, belt 
stretch, etc.  Backlash is not a problem as long as the 
motor moves in the same direction.  As soon as the motor 
changes direction, the backlash results in a positioning 
error since the motor must move additional distance to 
take up the looseness.  This backlash could be eliminated 
as a source of positioning error by making sure that the 
desired position is always approached from the same 
direction.  This may require overshooting the desired 
position and returning to it from the other direction.  
Another way to solve the backlash problem is to compensate 
for it in software by adding steps whenever the motor 
changes direction.  The BACKLASH parameter is used to do 
just that.  Set this parameter to the number of units of
backlash in the mechanical system.  Every time the motor 
changes direction, the backlash will be added to the 
desired distance.  This will result in greatly improved 
bi-directional repeatability which means that the position 
will be accurately acquired no matter which direction it is 
approached from.  

See also  Backlash

.TOPIC:
Step types
Stepper motors operate by energizing their windings 
(phases) in certain sequences called phase patterns.  
Changing from one pattern to another causes the motor to 
move one step.  There are 3 different types of phase 
pattern sequences.  In half step mode, the motor alternates 
between one and two motor phases being energized which 
results in steps that are half of the typical full step.  
Half steps are usually .9 degrees but differ depending 
on the motor.  Half step mode is the most common mode since 
it has twice the resolution of full step modes which 
reduces vibration.  There are two types of full step modes.  
Double-phase full step mode always energizes two motor 
phases at a time which results in more torque and motor
heat.  Single-phase full step mode always energizes one 
motor phase at a time which results in less torque and less 
motor heat.  Both full step modes normally result in steps 
that are 1.8 degrees. The STEP TYPE parameter allows the 
step type to be changed.  Options are half step mode, 
single-phase full step mode and double-phase full step mode.  
In most applications half step mode should be used to 
minimize vibration and increase resolution.

See also  Move Type

.TOPIC:
Units conversion
Stepper motors move in small steps, usually .9 degrees.  
Normally the stepper motors are attached to some device 
which converts these steps to rotational motion or linear 
motion.  In most cases, the user doesn't care how many 
motor steps must be given to reach a desired location,
but is interested only in the distance traveled.  This 
distance is often feet, inches, millimeters, or degrees.  
The UNITS and UNIT NAME parameters contain 
user-definable units and are used to convert from the
users units to steps.  The UNITS parameter contains 
the number of steps in each unit.  The UNIT NAME 
parameter contains the name of the units.  For example, 
if a positioning table has 200 steps for each inch,
the user would set the UNITS parameter to 200 and 
set the UNIT NAME parameter to "inches".  The 
operator can now deal with motor positions in terms of 
units (inches) instead of steps.  This affects the 
MD2POSITION, TARGET and BACKLASH parameters
which are set in units.  Setting the UNITS parameter 
to 1 and the UNIT NAME parameter to "steps" will 
allow the operator to deal with motor steps.  Units 
conversion can reduce confusion during programming
and can also allow easy changes to the mechanical system.
For example, if you create a program to control a 
positioning table that has 200 steps per inch and then 
switch to a table that has 1000 steps per inch, simply
change the units parameters and run the program without 
modification.  Adjusting units can also result in a 
changing size of the motor moves.  This can be used to 
enlarge or reduce motion programs.  For example, if 2 
motors are being used to control an XY positioning table 
that moves a router to cut square shapes out of plastic, 
changing the UNITS parameter will result in smaller 
or larger squares without changing the program.  

See also  Units  Unit Name

.TOPIC:
Soft limits
Often it is necessary to limit the travel of a step motor
to a defined range of motion.  This can prevent motions
that may cause damage to the mechanics of the system such
as a tool.  Both forward and reverse limits can be set in
the software to prevent the motor from traveling beyond a
certain range.  Set the LIMIT FWD and LIMIT REV parameters
to accomplish this.  The values are given in units.

See also  Units  Limit fwd  Limit rev

.TOPIC:
Interrupts
A computer can receive interrupts from various sources
such as modems, mice and keyboards.  Each action that is
generated from these devices causes the computer to quit
what it is doing temporarily and process the device's
request.  If a motor move is in the process during one
of these interrupts, the motor's speed may change causing
undesirable effects such as lost steps.  You can choose 
to turn interrupts OFF during moves using the INTERRUPTS
parameter.  Setting the INTERRUPTS parameter to ON 
allows interrupts to occur and be processed during moves,
turning it OFF will prevent interrupts from occurring.

See also  Interrupt control

.TOPIC:
Input/Output port
Some MD-2 systems have an Input/Output port which can be
used to read digital inputs such as sensors and switches
and used to control digital outputs such as relays which
can in-turn control lamps, motors and tools.  The 14-pin
I/O port can be found on the rear panel of the MD-2 system.
There are 3 digital inputs and 2 digital outputs along
with +5 volts and +12 volts.  See the MD-2 manual for
detailed information on this feature.

.TOPIC:
Errors
Several error conditions can be detected while moving a
motor.  Some of these conditions are not really errors,
just special indicators.  The following list describes
the errors.

Calibration needed ---- You must perform calibration
                        before moving motors.
                        See Calibration

File error ------------ An error occurred while reading
                        a disk file. Resave the file.

Limit exceeded -------- A motor was requested to move
                        beyond the forward or reverse
                        limit. 
                        See Soft limits

Port not available ---- The parallel printer port for
                        that motor # is not available
                        on this computer.
                        See Ports and motor numbers

MD-2 not enabled ------ You must first enable an MD-2
                        system before attempting to
                        move the motors.
                        See Enable/disable motors

Bad parameter --------- Some motor parameter is out of
                        range or invalid for some reason.

See also Common problems

.TOPIC:
Backlash
Used to perform backlash compensation.  
Valid values are in UNITS and should never be negative.

See also  Backlash compensation

.TOPIC:
Home direction
Used to reverse the motor's natural home direction which
is reverse.  Reverses the meaning of forward and reverse
for all moves.
Valid values are forward and reverse.

See also  Home moves

.TOPIC:
Home offset
Used when homing the motor.  Determines how far off of the
home switch the motor will move before setting the home
position.
Valid values are in UNITS and should never be negative.

See also  Home moves

.TOPIC:
Interrupt control
Used to turn ON or OFF computer interrupts during motor
moves to prevent erratic motion.
Valid values are ON or OFF.

See also  Interrupts

.TOPIC:
Limit fwd
Used to set the forward limit to prevent over travel.
Valid values are in UNITS.

See also  Soft limits

.TOPIC:
Limit rev
Used to set the reverse limit to prevent over travel.
Valid values are in UNITS.

See also  Soft limits

.TOPIC:
Motor
Used to select the motor(s) to be moved or to select the
MD-2 system to be acted upon.  For single motor moves
set the motor number to 1,2,3,4,5 or 6.  For dual motor
moves, circle moves or grid moves, set to a motor pair
such as 12, 34 or 56.

See also  Ports and motor numbers

.TOPIC:
Motor Name
Used to describe the function of a motor only.
Valid values are alphabetic characters with a length
not greater than 8.

.TOPIC:
Maximum Speed
Used to set the maximum (fully accelerated) speed of
the motor.
Valid values are in UNITS and are never negative.

See also  Speeds and ramping

.TOPIC:
Minimum Speed
Used to set the minimum (start/stop) speed of
the motor.
Valid values are in UNITS and are never negative.

See also  Speeds and ramping

.TOPIC:
Slope
Used to set the distance required to go from the minimum 
(start/stop) speed to the maximum (fully accelerated)
speed during acceleration and from maximum to minimum
during deceleration.
Valid values are in UNITS and are never negative.

See also  Speeds and ramping

.TOPIC:
Move Type
Determines if the target position will be interpreted
as absolute or relative for line or circle moves.

See also  Absolute/relative moves
          
.TOPIC:
Position
Stores the current motor position relative to home in
units.

.TOPIC:
Status
The status code is set each MD-2 function such as line
moves, circle moves, MD-2 enable, etc.  This code tells
if an action was a success or failure.
Possible status conditions are:

        Successful
        Limit was exceeded
        Motion was stopped with a keypress
        Bad parameter
        Port not available
        MD-2 not enabled
        Calibration needed
        File error

See also  Errors  Common problems

.TOPIC:
Step Type
Determines the step type used when moving the motors.
Possible selections are:

        Half step
        Double-full step
        Single-full step

See also  Step types

.TOPIC:
Target
Determines the target position or distance for motor moves.
The value is in units.

See also  Units conversion  Position

.TOPIC:
Units
The Units parameter determines the number of motor steps
in each unit.  User definable depending on mechanical 
system.

See also  Units Name  Units conversion

.TOPIC:
Unit Name
The name of the user definable unit such as inches or
degrees.  Depends on mechanical system.

See also  Units  Units conversion

.TOPIC:
Joystick control
A pair of motors can be controlled with the computer's 
joystick.  Select JOYSTICK from the OPTIONS MENU or type
J.  A dialog box will allow you to select which
pair of motors to control.  The joystick-active message
will appear on the main screen.  Moving the joystick will
cause the motors to move just as if one of the function
keys has been pressed.  Pressing the upper joystick button
will cause the joystick mode to be canceled.  Pressing the
lower joystick button will select single step mode.
Pressing J at the main screen while in joystick mode will
disable it.  As an example, from the main MD2 screen type 
J then 3 to control motors 3 & 4 with the joystick.

.TOPIC:
Quick moves
Quick moves are enacted using the function keys.  Each
time a function key is pressed, the appropriate motor will
move according to the distance value.  All motor 
parameters seen on the parameters screen will be used to
execute the move.  This provides a way to quickly position 
each motor using the keyboard.  A message will be given if 
an error condition prevents the motion.  The following 
chart shows the function key assignments:

        F1  Motor 1 reverse
        F2  Motor 1 forward

        F3  Motor 2 reverse
        F4  Motor 2 forward
        
        F5  Motor 3 reverse
        F6  Motor 3 forward
        
        F7  Motor 4 reverse
        F8  Motor 4 forward
        
        F9  Motor 5 reverse
        F10 Motor 5 forward
        
        F11 Motor 6 reverse
        F12 Motor 6 forward

See also  Status

.TOPIC:
Home moves
Moves the selected motor to the home position using the
home switch.  Only one motor can be home'd at a time.
Each motor on the MD-2 system has a home switch associated 
with it.  At the beginning of a program, the software does 
not accurately know the positions of the motors.  Homing 
causes the motor to seek the home switch to establish the 
home position (position zero).  All moves are relative to 
this home position.  The programmer or operator can, at any 
time, home the motors to insure accurate positioning.  This 
is not necessary in most situations where the home function 
is only used at the beginning of a program once.  The 
MD2HOME subroutine moves the motor reverse (clockwise as 
viewed from the front of the motor) until the home switch 
is activated, then forward until the switch is deactivated.  
This sequence has the effect of preloading the mechanical 
system in the forward direction which will increase the
accuracy of systems which have backlash or belt stretch.
A new home position can be established by homing the motor 
normally, moving to the desired location, then setting the 
MD2POSITION(M) parameter to zero.  All motions thereafter 
will be relative to this new home position.  This can be 
used to duplicate motion programs for step and repeat 
operations without modifications to the fundamental program.  
The MD2HOMEOFFSET(M) parameter determines how far off of the 
home switch to move after it is pressed and released.  The 
offset value is in units and can be used to duplicate motion 
programs at various places on the positioning system.  The 
MD2HOMEDIR(M) parameter determines the direction of the home
switch which then determines the direction of all other 
moves.  Normally the MD2HOMEDIR(M) parameter is set to 0 for 
reverse.  Set it to -1 for forward.  This parameter is 
useful because mechanical systems such as gear boxes and 
lead screws often change the motor directions.  During home 
moves, the motor will move at the MD2MINSPEED, ramping does 
not apply.  The home switches may also be used as general 
purpose inputs and can be read by the program through the 
MD2INPUTS subroutine.

As an example, to move motor 3 home, simply press H then
3 at the main screen.

.TOPIC:
Line moves
Moves two motors simultaneously according to the target
parameter.  The two motors must be 1 & 2, 3 & 4 or 5 & 6.
Both motors will begin and end at the same time.  This
action will result in linear interpolation which means
that the motors would move in a straight line if connected
to an XY positioning table.  The speed parameters for the
motor moving the longest distance determines its speed,
the other motor will track at some fraction of this speed.
The move may be to an absolute position in units or to
a relative distance and direction (set by the move type 
parameter).

As an example, to move motor 4 to position 12, simply
press L then 4 then 12 then ENTER.

See also  Absolute/relative moves  Speeds and ramping

.TOPIC:
Circle and arc moves
Circle and arc moves provide a way to move two motor which
are attached to an XY positioning table in a circular 
manner.  The two motors must be 1 & 2, 3 & 4 or 5 & 6.
The circle parameters are:

        X & Y motor numbers.
        Absolute or relative move type.
        X-axis radius in units.
        Y-axis radius in units.
        X-axis center position or distance.
        Y-axis center position or distance.
        Starting angle in degrees.
        Arc angle in degrees.
        Chord angle in degrees.

Set both X and Y radius parameters to the same value for 
circles and to different values to produce an ellipse.  Set 
the arc angle parameter to 360 for a complete circle or 
ellipse or some smaller number for partial circles and 
ellipses which creates arcs.  A positive arc angle will 
produce counter-clockwise motion and negative angles will
produce clockwise motion.  Each circular motion profile is 
created by moving in straight lines between points on the 
circle.  The resolution of these points is set using the  
chord angle parameter.  Setting the chord angle to 1 will 
result in a line every one degree.  Setting the chord angle 
to 10 degrees will result in a 36 sided circle.  If an arc 
angle can not be evenly divided by the selected chord 
angle, the last line segment will be shortened so that the 
desired arc angle results.  Circle moves are affected by 
the move type parameter to perform absolute or relative 
moves.  When using absolute moves, set the circle center 
parameters to absolute circle center positions.  When using 
relative moves, set the circle center parameters to offsets 
from the current motor positions.  Center and radius values 
are in units.  Start, arc and chord angles are in integer 
degrees.  The speed of the motors is determined by the
minimum speed parameter, no ramping is done.  Set the
minimum speed for both motor to the same value for best
results.

.TOPIC:
Grid moves
Many motion control applications use XY positioning tables 
and need to position to a matrix (or grid) of workpieces 
such as a rack of test tubes.  The grid consists of a 
series of positions on the X axis (columns) and a series of 
positions on the Y axis (rows).  Instead of positioning
to a certain cell of the grid by distances and directions,
you can simply use X (column) and Y (row) targets with a
grid move.  The move type parameter does not apply, only
absolute grid coordinates are used.
Grid moves require the following parameters:

        X & Y motor numbers.
        X-axis beginning position of the grid in units.
        Y-axis beginning position of the grid in units.
        X-axis spacing between cells in units.
        Y-axis spacing between cells in units.
        Desired X-axis grid cell (column).
        Desired Y-axis grid cell (row).

.TOPIC:
Motion programs
Motion programs are programs that can be created to 
perform motion control functions for custom applications. 
Motion programs are similar to programs written in the 
BASIC language but without many features such as
FOR/NEXT loops, subroutines, etc.  This provides a way
to write motion control programs without using the MD-2
subroutine libraries and a language compiler.  The maximum
size of a motion program is about 32,000 characters.  For
larger programs, use the Level 2 subroutine libraries.
A program can contain commands to load parameter files,
set motor parameters, move motors using home, line, circle 
or grid moves and commands to turn ON or OFF output 
signals to control tools.  programs can be created and 
edited using any common text editor that will save files 
without format information.  Most programs can be
loaded into Quick-Basic or Visual-Basic/DOS along with 
the MD-2 subroutine library and run like a normal program.
Several example programs can be found on the distribution
disk.  Locate them and study them for detailed information
on the creation and modification of program files.
Here is an example of a motion program:

MD2SETUP                        'INITIALIZE MD2 SYSTEM.
MD2MOTOR=3                      'TURN ON MD2 FOR 3 AND 4.
MD2ON
SLEEP 10                        'WAIT 10 SECONDS.
MD2PARFILE="MOTOR.PAR"          'LOAD MOTOR PARAMETERS.
MD2PARLOAD
MD2PAREDIT                      'EDIT PARAMETERS.
MD2HOME                         'MOVE MOTOR 3 HOME.
MD2MOTOR=4                      'MOVE MOTOR 4 HOME.
MD2HOME
SLEEP 0                         'WAIT FOR A KEYPRESS.
MD2TARGET(3)=3                  'MOVE MOTOR 3, 3 UNITS.
MD2MOTOR=3
MD2MOVE
MD2TARGET(4)=1                  'MOVE MOTOR 4, 1 UNIT.
MD2MOVE
BEEP                            'BEEP.
MD2OFF                          'TURN OFF MD2.

Programs consists of both commands and parameter setting. 

COMMANDS----------------------------------------

  MD2SETUP      Used at the beginning of every program.
  MD2ON         Turns ON (Enables) an MD-2.
  MD2OFF        Turns OFF (Disables) an MD-2.
  MD2PARLOAD    Loads a parameter file.
  MD2PAREDIT    Lets user edit parameters on the screen.
  MD2HOME       Moves motor home.
  MD2MOVE       Moves motor(s).
  MD2CIRCLE     Moves motors in a circle.
  MD2GRID       Moves motors to grid coordinates.
  MD2OUTPUTS    Turns ON or OFF an output signal.
  MD2STANDBYON  Turns ON standby mode.
  MD2STANDBYOFF Turns OFF standby mode.
  BEEP          Sound a beep.
  SLEEP         Wait for a number of seconds or keypress.
  
PARAMETERS---------------------------------------

  (M) indicates the motor number 1,2,3,4,5 or 6.
  See the help menu for information on each parameter.

  MD2BACKLASH(M)    Backlash in units.
  MD2HOLD           -1=Hold motors, 0=don't.
  MD2HOMEOFFSET(M)  Offset from home switch.
  MD2HOMEDIR(M)     0=rev,-1=fwd, direction of home switch
  MD2INTERRUPTS     -1=leave ON, 0=turn OFF during moves.
  MD2LIMITF(M)      Forward limit in units.
  MD2LIMITR(M)      Reverse limit in units.
  MD2MOTOR          Motor number 1-6 or 12,34,56 for dual.
  MD2MOTORNAME(M)   Name of motor.
  MD2MAXSPEED(M)    Maximum accelerated speed.
  MD2MINSPEED(M)    Start/stop speed.
  MD2MOVETYPE       A=Absolute, R=relative.
  MD2OUTPUTCODE     Code to control output port.
  MD2POSITION(M)    Current motor position in units.
  MD2SLOPE(M)       Accel/Decel slope in units.
  MD2STEPTYPE       H=Half, D=double full, S=Single full.
  MD2TARGET(M)      Target position or distance & direction.
  MD2UNITS(M)       # of steps per unit.
  MD2UNITNAME(M)    Name of units.

.TOPIC:
Teaching programs
One of the most powerful features of the MD2 program is the
ability to create custom motion programs by teaching the
computer.  Teaching is accomplished by pressing the TEACH
button on the main screen.  A message on the main screen
will indicate that teach mode is active.  

While in teach mode the following commands are stored in
the program editor:

    Enable/Disable MD-2
    Standby on/off
    Quick moves (function keys)
    Joystick moves
    Line moves
    Home moves
    Circle moves
    Grid moves
    Beep
    Sleep 0 (wait for keypress)
    Sleep # (wait for # of seconds)
    Output control
    Load parameters
    Comments '

These commands will result in program code being added to
the end of the motion program in memory.  If an error
occurs, the code is entered anyway.  You can use teach 
mode to create complete programs or just parts of programs.  
The program editor allows you to move the code at the end 
of the program to anywhere in the program.  

Manual comments can be added while in teach
mode by pressing the ' key and typing a line of text.

A beep sound can be placed in a program by pressing B.

A delay can be created in a program by pressing S,
followed by the number of seconds to delay.  If this
entry is set to 0 then the program will wait for a
keypress before continuing.

To try teach mode, erase any motion program from memory
and follow these instructions:

    Press the TEACH button to turn ON teach mode.
    Enable the MD-2 system.
    Move the desired motor home.
    Press B to create a beep sound.
    Press S then enter 10 to wait for 10 seconds.
    Move the motor to a position.
    Press B again.
    Disable the MD-2 system.
    Press the TEACH button to turn off teach mode.

Your custom program is complete.  You can see the program
created by pressing the EDIT button.  You can run the
program by pressing the RUN button and selecting OK.  Your
custom motion control program will execute just like you
entered it.

.TOPIC:
Editing programs
Click the Edit program command button or press E from
the main screen to edit a motion program.  When the 
MD2 program is first loaded, a program named 
MD2.BAS is loaded from disk if it exists.  You can name
your primary project by this name or choose open from the
file menu when viewing the edit program screen.  Common
copy and paste commands are available from the Edit menu
and can be used to duplicate or move sections of your
program.  Make sure to save your program before running
it to prevent data loss in the event of a major system
failure.  On-line help is available from this screen also.
Select EXIT from the FILE menu or press escape to return
to the main MD2 screen.

.TOPIC:
Running programs
Click the RUN command button on the main screen or type
R to run a motion program.  You will be asked to
type the name of a motion program file.  If you leave
this blank and simply press ENTER, the motion program
that is in memory will be run.  The program that is in
memory can be view with the program editor.  The
program file must be in the current directory.
The program file commands will be executed in order
starting at the beginning of the program.  If the RUN
REPEATEDLY check box is selected, the program will
begin again when finished.  Pressing the space bar will 
stop the program when the current command is complete.  
You will be given the option to continue or cancel the 
program at that time.

.TOPIC:
Command line
You can cause the MD2 program to automatically run a
motion program by placing the name of the disk file
after MD2 in the command line. The following example
will run the program which is stored in the file
named DRILL12.BAS:

    MD2 DRILL12.BAS

It is also possible to run motion control commands
directly from the command line by placing them after
MD2 and surrounding them with quotation marks.  
This allows for simple motion control commands to
be executed without the need for a disk file.
The following example causes motor #3 to be moved
to the home position:

    MD2 "MD2MOTOR=3 : MD2ON : MD2HOME : MD2OFF"

These command line features allow complex motion control
tasks to be incorporated into DOS batch files or called
from other programs that allow the running of DOS 
programs.

It is possible to run the MD2 program in high-resolution
mode if you have a VGA (640x480) monitor.  This allows
you to see both the main screen and the parameter screen
or the editor screen.  Use the following DOS command
to place your screen in high-resolution mode before
running the MD2 program.

    MODE CON: LINES=50

.TOPIC:
Using Help
Selecting a Help link
---------------------
With a mouse - click on phrases outlined by two triangles.
With the keyboard - Press TAB or Shift-TAB to select a link.
                    Press ENTER to jump to that topic.

Scrolling the Help window
-------------------------
With a mouse - click on the scroll bars.
With the keyboard - press the cursor navigation keys.

Closing the Help window
-----------------------
With a mouse - click the OK button.
With the keyboard - press ALT-O.

Command Buttons
---------------
Use a mouse to click a button or press the letter mentioned
below.

Contents - displays a table of contents for the 
  application's Help.  Press C to select Contents.

Search -  opens a dialog box that lists all available Help
  topics.  Select a topic from the list box and press ENTER.
  Press S to select Search.

Back - jumps to the last Help topic viewed.
  Press B to select Back.

History - lists the last 20 Help topics viewed.  Jump to 
  any of these topics by selecting from the list box and 
  pressing ENTER.  Press T to select History.
