# Performance Optimal PI controller Tuning Based on Integrating Plus Time Delay Models
## 3 Tuning for Maximum Time Delay Error
### Integrator Plus Time Delay Process  
Consider an IPTD system where \(k\) is the gain velocity and \(\tau\) is the time delay, and a PI controller. The loop transfer function, \(H_{0}(s)=H_{c}(s)H_{p}(s)\), is  
\[H_{0}(s)=K_{p}\frac{1+T_{i}s}{T_{i}s}k\frac{e^{-\tau s}}{s}. \tag{15}\]  
The frequency response is given by \(H_{0}(j\omega)=|H_{0}(j\omega)|e^{j\angle H_{0}(j\omega)}\), where the magnitude is \(|H_{0}(j\omega)|=\frac{K_{p}k}{T_{i}\omega^{2}}\sqrt{1+(T_{i}\omega)^{2}}\) and the phase angle is \(\angle H_{0}(j\omega)=-\tau\omega-\pi+\arctan(T_{i}\omega)\). We obtain the gain crossover frequency \(\omega_{c}\) analytically as \(|H_{0}(j\omega)_{c}|=1\). From this, we obtain analytically that \(\mbox{PM}=\angle H_{0}(j\omega_{c})+\pi\), and the MTDE \(d\tau_{\mbox{max}}\), such that, \(0=\mbox{PM}-d\tau_{\mbox{max}}\,\omega_{c}\). A factor \(f\) is defined as  
\[f=\frac{1+\sqrt{1+\frac{4}{(K_{p}T_{i}k)^{2}}}}{2}=\frac{1+\sqrt{1+\frac{4}{( a\beta)^{2}}}}{2}. \tag{16}\]  
The gain crossover frequency is analytically given by  
\[\omega_{c}=\sqrt{f}K_{p}k. \tag{17}\]  
See previous paper [1] for proof of Equation (17). The gain crossover frequency is then given by \(\omega_{c}=\sqrt{f}\frac{\alpha}{\tau}\). We obtain the PM analytically as \(\mbox{PM}=-\sqrt{f}\alpha+\arctan(\sqrt{f}\alpha\beta)\), and the MTDE as \(d\tau_{\mbox{max}}=\frac{\mbox{PM}}{\omega_{c}}=\delta\tau\), where \(\delta\) is defined as  
\[\delta=\frac{-\sqrt{f}\alpha+\arctan(\sqrt{f}\alpha\beta)}{\sqrt{f}\alpha}= \frac{\arctan(\sqrt{f}\alpha\beta)}{\sqrt{f}\alpha}-1. \tag{18}\]  
Consider the instance in which the MP parameter \(\bar{c}=\alpha\beta\) is constant, then Equation (18) may be written as, \(\delta=a\frac{1}{\alpha}-1\), and, \(\delta=\frac{a}{\alpha}\beta-1\), where \[a=\frac{\arctan(\sqrt{f}\alpha\beta)}{\sqrt{f}}, \tag{19}\]  
is a function of \(\bar{c}=\alpha\beta\) and constant. Notice that the parameter \(f\) is defined by Equation (16). We have the following Algorithm 1. **Algorithm 1** (Max time delay error tuning). : _The MP parameter is defined as_  
\[\bar{c}=\alpha\beta. \tag{20}\]  
_We express \(\beta\) as a linear function of a prescribed Relative Time Delay Error (RTDE) \(\delta>0\), to ensure stability of the closed loop system. We have_  
\[\beta=\frac{\bar{c}}{a}(\delta+1), \tag{21}\]  
_where parameter \(a\) is given by Equation (19). Note that \(\alpha\) can be expressed by_  
\[\alpha=\frac{\bar{c}}{\beta}=\frac{a}{\delta+1}. \tag{22}\]  
_or with regard to the PI controller parameters_  
\[T_{i}=\frac{\bar{c}}{a}\left(\delta+1\right)\tau, \tag{23}\]  
\[K_{p}=\frac{a}{k\tau(\delta+1)}. \tag{24}\]  
Note that Algorithm 1 is written as a MATLAB m-file function given in Appendix C in a previous paper [1]. Before advancing, we demonstrate the above algorithm in an instance to enhance the robustness of the classical closed loop ZN PI controller tuning. **Example 1** (ZN with increased margins). : _Given the classical ZN PI controller tuning (closed loop method), in which \(\alpha=\frac{\pi}{4\bar{4}}\), \(\beta=\frac{4}{\Gamma 2}\), where the RTDE \(\frac{d\tau\eta\alpha\pi}{\tau}=\delta\approx 0.56\) and the robustness \(M_{s}\approx 2.86\)._  
_For the original ZN method, we have the MP parameter \(\bar{c}=2.38\). Specifying an RTDE parameter, \(\delta=\frac{d\tau\eta\alpha\pi}{\tau}=1.6\). Using Equations (21) and (22) gives the altered ZN PI controller parameters_  
\[f=\frac{1+\sqrt{1+\frac{4}{(K_{p}T_{i}k)^{2}}}}{2}=\frac{1+\sqrt{1+\frac{4}{( a\beta)^{2}}}}{2}. \tag{16}\]0  
_The altered ZN PI controller tuning, \(K_{p}=\frac{\bar{\alpha}}{k\tau}\) and \(T_{i}=\beta\tau\), for an IPTD process has margins \(GM=3.35\), robustness \(M_{s}=1.66\) and prescribed \(\frac{d\tau\eta\alpha\pi}{\tau}=1.6\). The altered ZN PI controller tuning has relatively smooth closed loop responses with a relative damping slightly less than one.