III. Tuning the PID Filter
(Continued)
TABLE 11. Initialization Section — Filter Tuning Program
(Continued)
Port
Bytes
Command
Comments
d
04
LB
A 04 hex LB enables (unmasks) the trajectory complete interrupt. All other interrupts are
disabled (masked). See
Busy-bit Check Module
c
1E
LFIL
This command initiates loading the filter coefficients input buffers.
Busy-bit Check Module
d
d
00
x2
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 x2 hex LB indicates only k
d
will be loaded.
The other filter parameters will remain at zero, their reset default value.
Busy-bit Check Module
d
d
00
02
HB
LB
These two bytes set k
d
to two.
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
c
1F
LTRJ
This command initiates loading the trajectory parameters input buffers.
Busy-bit Check Module
d
d
00
00
HB
LB
These two bytes are the trajectory control word. A 00 hex LB indicates no trajectory
parameters will be loaded.
Busy-bit Check Module
c
01
STT
STT must be issued to execute the desired trajectory.
3. Determine the Proportional Gain Coefficient
Inertial loading causes following (or tracking) error, position
error associated with a moving shaft. External disturbances
and torque loading cause displacement error, position error
associated with a stationary shaft. The filter proportional
term provides a restoring force to minimize these position
errors. The restoring force is proportional to the position error
and increases linearly as the position error increases. See
. The proportional gain coefficient, k
p
, is the con-
stant of proportionality.
Coefficient k
p
is determined with an iterative process — the
value of k
p
is increased, and the system damping is evalu-
ated. This is repeated until the system is critically damped.
System damping is evaluated manually. Manually turning the
shaft reveals each increase of k
p
increases the shaft “stiff-
ness”. The shaft feels spring loaded, and if forced away from
its desired holding position and released, the shaft “springs”
back. If k
p
is too low, the system is over damped, and the
shaft recovers too slowly. If k
p
is too large, the system is
under damped, and the shaft recovers too quickly. This
causes overshoot, ringing, and possibly oscillation. The pro-
portional gain coefficient, k
p
, is increased to the largest value
that does not cause excessive overshoot or ringing. At this
point the system is critically damped, and therefore provides
optimum tracking and settling time.
Note:
Starting k
p
at two and doubling it at each iteration is a good method of
increasing k
p
. The final value of k
p
for the reference system is 40.
4. Determine the Integral Gain Coefficient
The filter proportional term minimizes the errors due to iner-
tial and torque loading. The integral term, however, provides
a corrective force that can eliminate following error while the
shaft is spinning and the deflection effects of a static torque
load while the shaft is stationary. This corrective force is
proportional to the position error and increases linearly with
time. See
. The integral gain coefficient, k
i
, is the
constant of proportionality.
High values of k
i
provide quick torque compensation, but
increase overshoot and ringing. In general, k
i
should be set
to the smallest value that provides the appropriate compro-
mise between three system characteristics: overshoot, set-
tling time, and time to cancel the effects of a static torque
load. In systems without significant static torque loading, a k
i
of zero may be appropriate.
The corrective force provided by the integral term increases
linearly with time. The integration limit coefficient, i
l
, acts as a
clamping value on this force to prevent integral wind-up, a
backlash effect. As noted in
, i
l
limits the summation
of error (over time), not the product of k
i
and this summation.
In many systems i
l
can be set to its maximum value, 7FFF
hex, without any adverse effects. The integral term has no
effect if i
l
is set to zero.
For the test system, the final values of k
i
and i
l
are 5 and
1000 respectively.
STEP TWO — STEP RESPONSE METHOD
Introduction
The step response of a control system reveals important
information about the “quality” of control — specifically, de-
tailed information on system damping.
In the second step to tuning the PID filter, an oscilloscope
trace of the control system step response is used to accu-
rately evaluate system damping, and the filter coefficients,
determined in step one, are fine tuned to critically damp the
system.
AN-693
www.national.com
20