Reference Manual

PMAC 2 Software Reference
PMAC Saved Setup Registers 383
The more complex tracking filter, which is a five-line entry in the table, is suitable for smoothing either
master data or feedback data, because its integrator eliminates steady-state errors. Still, its filtering can
introduce delays in responding to dynamic changes (e.g. accelerations), so it needs to be set up carefully.
This software tracking filter is dynamically equivalent to the hardware tracking filters common in
resolver-to-digital converter ICs. It is commonly used to smooth the results of direct conversion of
sinusoidal encoders and resolvers.
Exponential Filter ($D0xxxx)
The equation of the exponential filter executed 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
Out(n) = Out(n-1) + (K/2
23
)*[In(n)-Out(n-1)]
In, Out, and K 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)-1. The lower the value of K, 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.
Method/Address Word: The first setup line of an exponential filter entry contains a ‘D’ in the first hex
digit (bits 20 – 23), a ‘0’ in the second hex digit, and the address of the source X-register in the third
through sixth hex digits (bits 0 – 15). If it is desired to execute an exponential 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 exponential filter entries are almost
always from the conversion table itself (X:$0720 – X:$073C). For example, to perform an exponential
filter on the result of the fourth line of the table, the first setup line of the filter entry would be $D00723.
Maximum Change Word: The second setup line of an exponential 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 Gain Word: The third setup line 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
Ix05 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).
Resolver Conversion Entries ($E) [Geo PMAC only]: The $E entry converts the sine and cosine
resolver feedback values processed through the Geo PMAC’s A/D converter (ADC) registers to a 14-bit
resolver angle value.
Method/Address Word: The first setup line of a resolver conversion entry contains $E in the first hex digit
and the Y-address of the first ADC register to be read in the low 16 bits (the third through sixth hex
digits). The next ADC register is read at the next higher Y-address. If bit 19 of the line is set to 0