M O T I O N C O N T R O L P R O G R A M M I N G
STORED PROGRAMS
102
Motion Control Programming
·
Galil Motion Control, Inc.
·
800-377-6329
expressed in terms of units of resolution as a distance of
4000 counts, a slew velocity of 20,000 counts/sec, and accel-
eration and deceleration rates of 200,000 counts/sec
2
. The
motion parameters must be transmitted from the host
computer to the motion controller. The special instruc-
tions used by the DMC, along with their interpretation,
are given below.
Instruction
Interpretation
PR 4000
Relative distance
SP 20000
Speed rate
AC 200000
Acceleration rate
DC 200000
Deceleration rate
BGX
Start motion of X motor
All that is needed is that the host computer sends the
characters indicated by the program shown above and the
motion starts immediately.
Another type of simple motion is the jog move. Here the
motor is commanded to run indefinitely at a specified speed.
The motion parameters in this case are limited to the speed,
acceleration, and deceleration. These parameters can be
expressed in units of resolution as illustrated below.
Consider a system where the resolution of the encoder
is 4000 counts/turn and where the motor is required to
run at a speed of 600 rpm, or 10 revolutions/sec, and
must accelerate to that speed over 100 msec. Simple calcu-
lations show that the speed rate is 40,000 counts/sec and
that the acceleration rate is 400,000 counts/sec
2
.
The instructions used to generate such a motion, along
with their interpretations, are shown in following example.
Instruction Interpretation
JG 40000 Jog speed
AC 400000 Acceleration rate
BGX Start X motion
The generation of more complex moves is described in
the following section.
Stored Programs
The instructions to execute the motion can be issued directly
from the host computer, resulting in an immediate move.
This mode, the immediate mode, requires the continuous
involvement of the host computer. This requirement is often
undesirable because the host may have to perform other func-
tions simultaneously. An alternative method is to combine
several motion commands into a complete application pro-
gram which is downloaded to the controller memory. This
method reduces or eliminates the involvement of the host
computer. The DMC can receive its instructions from stored
programs. To start the motion, the host sends a short com-
mand, such as "Execute Program A." The controller will then
receive the instructions from its memory without the inter-
vention of the host computer.
To illustrate the concept, consider the move described
in the previous example. To perform the same move from
a stored program, the host modifies the program by
adding a label, #A, for example, and an end statement,
EN. The resulting program is as follows:
Instruction
Interpretation
#A Program label
PR 4000 Distance
SP 20000 Speed
AC 200000 Acceleration
DC 200000 Deceleration
BGX Start X motion
EN End of program
INDEPENDENT MOTION COMMANDS &
SLEW SPEED
VELOCITY
TIME
DECELERATION
RATE
ACCELERATION
RATE
Trapezoidal Velocity Profile