Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Global I-Variables 244
in one servo cycle to 64 counts with an input register in units of 1/32 count, this third line would be 64*32
= 2048.
Filter Gain Word: The third setup line (I-variable) of an exponential filter entry contains the filter gain
value K, which sets a filter time constant T
f
of (2
23
/K)-1 servo cycles. Therefore, the gain value K can be
set as 2
23
/(T
f
+1). For example, to set a filter time constant of 7 servo cycles, the filter gain word would be
8,388,608/(7+1) = 1,048,576.
Result Word: The output value of the exponential filter is placed in the X register of the third line of the
conversion table entry. An operation that uses this value should address this third register; for example
Ixx05 for position following, or the source address for a time-base conversion-table entry (to keep
position lock in time base, this filter must be executed before the time-base differentiation, not afterward).
Tracking Filter ($Dxxxxx, bit 19 = 1)
For the tracking filter, the equation of the filter every servo cycle n is:
If [In(n) - In(n-1)] > Max_change, In(n) = In(n-1) + Max_change
If [In(n) - In(n-1)] < -Max_change, In(n) = In(n-1) - Max_change
Err(n) = In(n) Out(n-1)
Temp1 = (Kp/2
23
) * Err(n)
Int(n) = Int(n-1) + (Ki/2
23
) * Err(n)
Out(n) = Out(n-1) + Temp1 + Int(n)
In, Out, K
p
and K
i
are all signed 24-bit numbers (range -8,388,608 to 8,388,607). The difference [In(n)-
Out(n-1)] is truncated to 24 bits to handle rollover properly.
The time constant of the filter, in servo cycles, is (2
23
/K
p
)-1. The lower the value of K
p
, the longer the
time constant.
No shifting action is performed. Any operations such as 1/T interpolation should have been done on the
data already, so the source register for this filter is typically the result register of the previous operation in
the conversion table.
Method/Address Word: The first setup line (I-variable) of a tracking filter entry contains a ‘D’ in the first
hex digit (bits 20 23), a 1 in the bit-19 mode-switch bit, and the address of the source X-register in bits
0 18. If it is desired to execute a tracking filter on the contents of a Y-register, the contents of the Y-
register must first be copied to an X-register in the conversion table with a “parallel” entry ($2) higher in
the table. The source addresses for tracking filter entries are almost always from the conversion table
itself (X:$003501 X:$0035BC). Since bits 16 18 of conversion table registers are 0, this makes the
entire second hex digit of this line ‘8’. For example, to perform an tracking filter on the result of the
fourth line of the table, the first setup line of the filter entry would be $D83504.
Maximum Change Word: The second setup line (I-variable) of a tracking filter entry contains the value
“max change” that limits how much the entry can change in one servo cycle. The units of this entry are
whatever the units of the input register are, typically 1/32 of a count. For example, to limit the change in
one servo cycle to 64 counts with an input register in units of 1/32 count, this third line would be 64*32 =
2048.
Filter Proportional Gain Word: The third setup line (I-variable) of a tracking filter entry contains the
filter proportional gain value K
p
, which sets a filter time constant T
f
of (2
23
/K
p
)-1 servo cycles. Therefore,
the proportional gain value K
p
can be set as 2
23
/(T
f
+1). For example, to set a filter time constant of 7
servo cycles, the filter proportional gain word would be 8,388,608/(7+1) = 1,048,576.