# Lag Compensator Second Order Type 1, Step Response and Root locus

Cuthbert Nyack
The applets here show the step response and Root Locus plot of a type 1 second order system with Lag Compensation.
The continuous system is discretised by the bilinear transform to get D(z) and a ZOH transformation of the system transfer function.

eg parameters (20.0, 0.5, 10.0, 1.0, 0.01, 0.1, 1.0) show the response of the uncompensated system. The Complex Conjugate poles of the sampled system are at 0.9891 ± j 0.0619 with magnitude 0.9910, just inside the unit circle. The uncompensated system becomes unstable at ~ 0.1065 of the sampling frequency for Ts = ~ 0.11 with the cc pole magnitude = 1.0058, just outside the unit circle.

eg parameters (20.0, 0.5, 10.0, 10.0, 0.1, 1.0, 1.0) show the response with lag compensation and reasonable agreement between the continuous and discrete systems. The cc poles of the sampled system are at 0.9046 ± j 0.1603 with magnitude 0.9187.

eg parameters (20.0, 0.5, 10.0, 10.0, 1.0, 4.0, 1.0). Significant damped oscillation on the discrete response. The cc poles of the sampled system are at 0.0192 ± j 0.8784 with magnitude 0.8786.

eg parameters (19.9, 0.54, 10.0, 10.0, 1.67, 5.0, 1.0). Discrete system oscillatory at 0.36 of the sampling frequency. The cc poles of the sampled system are at 0.639 ± j 0.7686 with magnitude 1.0000, on the unit circle. changing Ts from 1.5 to 1.9 show that the closed loop poles are keeping close to the unit circle.
eg parameters (20.0, 0.6, 10.0, 10.0, 1.68, 5.0, 1.0). Discrete system unstable with growing oscillation. The cc poles of the sampled system are at 0.597 ± j 0.8444 with magnitude 1.0345, outside the unit circle.

The applet shows the similar plot but with a magnified view of the right half of the unit circle.

Gif images below show how the applets should appear.