# PI Control Step and Ramp response, Controller D(z).

Cuthbert Nyack
Applets show the step and ramp response of a type 0 first order system with PI control. The continuous system is always stable.
In this case the controller transfer function Gc(s) = K(1 + 1/(Tis)) is digitised using a trapezoidal approximation for the integral to give D(z) = K(1 - Ts/2Ti + (Ts/Ti)(1/1 - z-1).
The system transfer function Gs(s) = 1/(T1s + 1) is converted to Gs(z) = (1 - z-1) Z{Gs(s)/s}
The forward transfer function is G(z) = D(z)Gs(z) and the closed loop transfer function is G(z)/(1 + G(z))

eg parameters (8.0, 1.0, 1.5, 0.03). Sampled and continuous response are very similar.
eg parameters (8.2, 1.0, 1.5, 0.12). One pole at zero and output rises to value with P control in 1 sample time, it increases slightly after because of I control.
eg parameters (10.0, 1.0, 1.5, 0.14). One pole is in the range -1 < K < 0. and the output has a damped contribution at half the sampling frequency.
eg parameters (14.3, 1.0, 1.5, 0.14). One pole is at -1 and the response is oscillatory at half the sampling frequency. System is unstable for K > 14.3. eg parameters (K, 1.0, 1.5, Ts). The range of K for stability depends on Ts. For Ts = 0.2, K < 10.1, Ts = 0.18, K < 11.2, Ts = 0.16, K < 12.6, Ts = 0.14, K < 14.3.

Gif images below show how the applets should appear.  