I. Program Modules
(Continued)
TABLE 4. Filter Programming Module
Port
Bytes
Command
Comments
c
1E
LFIL
This command initiates loading the filter coefficients input buffers.
Busy-bit Check Module
d
d
00
x8
HB
LB
These two bytes are the filter control word. A 00 hex HB sets the derivative sampling
interval to 2048/f
CLK
by setting d
s
to one. A x8 hex LB indicates only k
p
will be loaded.
The other filter parameters will remain at zero, their reset default value.
Busy-bit Check Module
d
d
00
0A
HB
LB
These two bytes set k
p
to ten.
Busy-bit Check Module
c
04
UDF
This command transfers new filter coefficients from input buffers to working registers.
Until UDF is executed, coefficients loaded via the LFIL command do not affect the filter
transfer characteristic.
Busy-bit Check Module
Comments
After executing both the example initialization and example
filter programming modules, the following observations are
made. Filter gain is nonzero, but desired shaft position con-
tinues to track actual shaft position. Under these conditions,
the motor drive signal remains at zero. The shaft should be
stationary and “free wheeling”. If there is significant drive
amplifier offset, the shaft may rotate slowly, but with minimal
torque capability.
Initially, k
p
should be set below twenty, d
s
should be set to
one, and k
i
, k
d
, and i
l
should remain at zero. These values
will not provide optimum system performance, but they will
be sufficient to test system functionality. See Tuning the PID
Filter.
TRAJECTORY PROGRAMMING MODULE
details the example trajectory programming module.
Load Trajectory Parameters
An LTRJ (Load TRaJectory) command sequence includes
command LTRJ, a trajectory control word, and a variable
number of data words.
The LTRJ command initiates loading trajectory parameters
into input buffers.
The two data bytes, written immediately after LTRJ, com-
prise the trajectory control word. The first byte programs,
with logical ones in respective bit positions, the trajectory
mode (velocity or position), velocity mode direction, and
stopping mode. See Stop Module. The second byte indi-
cates, with logical ones in respective bit positions, which of
the three trajectory parameters will be loaded. It also indi-
cates whether the parameters are absolute or relative. See
. Any combination of the three parameters can be
loaded within a single LTRJ command sequence.
Immediately following the trajectory control word, the trajec-
tory parameters are written. Each parameter is written as a
pair of data words (four data bytes). Because any combina-
tion of the three parameters can be loaded within a single
LTRJ command sequence, the number of data words follow-
ing the trajectory control word can vary in the range from
zero to six.
In the case of the example module, the first byte of the
trajectory control word, 00 hex, programs the LM628 to
operate in position mode. The second byte, 0A hex, indi-
cates velocity and position will be loaded and both param-
eters are absolute. Four data words, two for each parameter
loaded, follow the trajectory control word.
Start Motion Control
The start motion control command, STT (STarT), transfers
new trajectory parameters from input buffers to working reg-
isters and begins execution of the new trajectory. Until STT is
executed, the new trajectory parameters do not affect shaft
motion.
Note:
At this point no actual trajectory parameters are loaded. Calculation of
trajectory parameters and execution of example moves is left for a
later section.
high byte
01086011
low byte
01086012
FIGURE 9. Trajectory Control Word Bit Allocation
AN-693
www.national.com
7