X
24
24
24
Ki_yn reg
Kp Coef
Xn-1 Reg
Xn
16
24
<>
9
9
16
24
24
24
24
24
24
Clamp
Kd yn_reg
Kd alpha
9
16
9
24
24
24
24
P
I
D
Limit Comparator
PID Filter Branch
Stages
Ki High
EADC_DATA
9
9
9
9
24
32
Ki Coef
Kd coef
Limit 4
9
9
Limit 5
…..
Limit 0
Coefficient
select
Ki Low
Optional
Selected
by
KI_ADDER_
MODE
Clamp
X
X
X
+
-
+
+
Round
1
−
−
n
n
X
X
9
Filter Math Details
144
SNIU028A – February 2016 – Revised April 2016
Copyright © 2016, Texas Instruments Incorporated
Filter
4.1
Filter Math Details
The Filter uses binary arithmetic. In most cases the precision of the results is preserved at the highest
level until the rounding/clamping at the output of the filter. The main exception to this is the extra pole,
using alpha, which has to round to a decreased resolution immediately. The filter is relatively complex, so
scaling is discussed in sections. After the filter math details are described, the registers which control the
filter are documented.
4.1.1 Filter Input and Branch Calculations
Here is a block diagram of the first part of the filter, with bit width information:
Figure 4-1.
All values shown in the filter are signed numbers, with the most significant bit going to the sign bit. All are
treated as being normalized to 1.
The main input to the filter is a 9 bit signed value from an Error ADC. It is shown on the upper left as Xn. It
goes to the input for filter calculations, and it also goes to a digital comparator. The Filter provides for
nonlinear calculations, with up to 7 different coefficient sets selected by the Xn value. This can be used to
change the compensation of the filter with different input error ranges. For a complete discussion of this
feature, see