Discrete Time PID Controller for DPEK This controller is based on the “ideal” PID, which in Laplace form is written G (s) = K P + KI + s KD s Discrete approximation by numerical integration is used for the integral and derivative terms. The derivative term uses backwards Euler approximation which leads to the substitution s← z −1 Tz The integral term uses trapezoidal approximation, with the substitution s← 2 z −1 T z +1 The z-transform of the equivalent PID controller becomes G( z) = K P + z −1 T z +1 KI + KD Tz 2 z −1 Re-arranging to express each terem as a power of z: 2Tz ( z − 1) G ( z ) = K P 2Tz ( z − 1) + K I T 2 z ( z + 1) + K D 2( z − 1) 2 (2Tz 2 − 2Tz ) G ( z ) = z 2 (2TK P + T 2 K I + 2 K D ) + z (−2TK P + T 2 K I − 4 K D ) + 2 K D The controller gains are re-defined by: ′ KP = KP ′ T KI = KI 2 ′ 1 KD = KD T Inserting these into the controller equation gives ′ ′ ′ (2Tz 2 − 2Tz ) G ( z ) = z 2 (2TK P + 2TK I + 2TK D ) ′ ′ ′ ′ + z (−2TK P + 2TK I − 4TK D ) + 2TK D A common factor of 2T can be removed and the equation re-arranged to find the transfer function G( z) = where… 2 b0 z 2 + b1 z + b2 z2 − z ′ ′ ′ b0 = K P + K I + K D ′ ′ ′ b1 = − K P + K I − 2 K D ′ b2 = K D