# [time-nuts] PI Math question

WarrenS warrensjmail-one at yahoo.com
Wed Apr 16 12:50:08 EDT 2014

```A question to the math time-nuts

With the values of K1, K2 & K3 constant,
and the initial state of I#1, I#2 and Last_Input all zero
assuming there is no rounding, clipping or overflow in the math
and that if I've made any obvious dumb typo errors that they are corrected,

Given this PID type of controller;
D = (Input - Last_Input))
Last_Input = Input
I#1 = I#1 + (K1 * Input)
I#2 = I#2 + (K2 * D)
Output = I#1 + I#2 + (K3 * Input)

Is the above Input to Output's transfer function any different than any of
the following more simplified versions of PI controllers?
Or asked another way, if each of the four codes are given the exact same
input string and same K Gains, will the difference between any of their
outputs ever be non zero?

a)
D = Input - Last_Input
Last_Input = Input
I#1 = I#1 +  (K1 * Input) + (K2 * D)
Output = (K3 * Input) + I#1

b)
D = (Input - Last_Input)
Last_Input = Input
Output  = Output + (K1 * Input) + (K2 + K3) * D

a)
I#1 = I#1 + (K1 * Input)
Output = I#1 + ((K2 + K3) * Input)

ws

```