# How do we decide to use a lag compensation versus a PI compensation?

Although lag and PI compensation apparently have the same objective of improving the steady state response, how does one decide which one to use?

Lag compensation is a specialized controller used in cases in which PI is not possible or desirable. For example set point signals are not constant but ever-changing, such as a time-varying sine wave. A PI controller, due to integrator's phase drop of $$\\frac{\pi}{2}\$$, will introduce phase shift and therefore a tracking error. In this case, lag compensation can be used to augment the low frequency gain value without introducing a frequency drop. It is maybe important to say that lag compensation doesn't guarantee zero following error. But in these spacial cases, the parameters of the compensator can be calculated in a way to bound the tracking error within the allowable limits.
Another interesting aspect is that compensation controllers (lead or lag) can be regarded as a pole and zero transfer function as follows $$G = K\frac{T_zs+1}{T_ps+1}.$$ If $$\T_p > T_z\$$ it is lag compensator and if $$\T_p < T_z\$$ then it is lead compensator. This type of definition is useful in root locus analysis of systems and is perhaps the most used way of designing these controllers. In root locus analysis, they can be easily visualized and tuned simultaneously with the influence of the gain $$\K\$$.