II. Programs
(Continued)
In the case of the examlple program, the second byte of the
MSKI data word, 40 hex, enables the breakpoint interrupt. All
other interrupts are disabled (masked).
When interrupted, the host processor can read the Status
Byte to determine which interrupt condition(s) occurred. See
Note:
Command MSKI controls only the host interrupt process. Bits one
through six of the Status Byte reflect actual conditions independent of
the masked/unmasked status of individual interrupts. This feature
allows interrupts to be serviced with a polling scheme.
Set Breakpoints (Absolute and Relative)
An SBPA command sequence enables the user to set break-
points in terms of absolute shaft position. An SBPR com-
mand sequence enables setting breakpoints relative to the
current target position. When a breakpoint position is
reached, bit six of the status byte, the breakpoint interrupt
flag, is set to logic high. If this interrupt is enabled (un-
masked), the host will be interrupted via the host interrupt
output (pin 17).
An SBPA (or SBPR) command initiates loading/setting a
breakpoint. The two data words, written immediately follow-
ing the SBPA (or SBPR) command, represent the breakpoint
position.
The example program contains a relative breakpoint set at
80,000 counts relative to position zero (the current target
position). This represents a move of twenty forward direction
revolutions. When this position is reached, the LM628 inter-
rupts the host processor, and the host executes a sequence
of commands that increases the maximum velocity, resets
the breakpoint interrupt flag, and loads an absolute break-
point.
The example program contains an absolute breakpoint set at
160,000 counts. When this absolute position is reached, the
LM628 interrupts the host processor, and the host executes
a Smooth Stop Module.
Breakpoint positions for this example program are deter-
mined.
Load Trajectory Parameters
This example program contains two LTRJ command se-
quences. The trajectory control word of the first LTRJ com-
mand sequence, 1828 hex, programs forward direction ve-
locity mode, and indicates an absolute acceleration and an
absolute velocity will be loaded. The trajectory control word
of the second LTRJ command sequence, 180C hex, pro-
grams forward direction velocity mode, and indicates a rela-
tive velocity will be loaded. See
.
Trajectory parameters calculations follow the same format
as those detailed for the simple absolute position move. See
TABLE 10. Basic Velocity Mode Move with
Breakpoints Program
Port
Bytes
Command
Comments
Initialization Module
Filter Programming Module
c
1C
MSKI
Mask interrupts.
Busy-bit Check Module
d
xx
HB
don’t care
d
40
LB
A 40 hex LB enables (unmasks) the breakpoint interrupt. All other interrupts are
disabled (masked).
Busy-bit Check Module
c
21
SPBR
This command initiates loading a relative breakpoint.
Busy-bit Check Module
d
d
00
01
HB
LB
A breakpoint is loaded in two data words. These two bytes are the high data word. In
this case, the breakpoint is 80,000 counts relative to the current commanded target
position (zero).
Busy-bit Check Module
d
38
HB
breakpoint data word (low)
d
80
LB
Busy-bit Check Module
c
1F
LTRJ
Load trajectory.
Busy-bit Check Module
d
d
18
28
HB
LB
These two bytes are the trajectory control word. A 18 hex HB programs forward
direction velocity mode operation. A 28 hex LB indicates acceleration and velocity will
be loaded and both values are absolute.
AN-693
www.national.com
15