# Comparative Real-Time Study of Three Enhanced Control Strategies Applied to Dynamic Process Systems
## 3 Classical Controller Methods for Coupled Tank System
### CPIR and CNPIR Controllers for Coupled Tank System  
In this section, the mathematical model and block structure of the time-delayed CPIR and CNPIR controllers are explained, considering the system dynamic model for the position control of the liquid level tank. Velocity measurements feed the integral retarded (IR) controller, which corresponds to the inner loop. Three parameters need to be adjusted: the gains \(K_{i}\) and \(K_{ir}\), and the time delay \(h\). The outer loop is closed using a proportional controller with a gain of \(K_{p}\) and is supplied with position readings.  
\[\dot{u}(t)=(K_{i}-K_{ir})K_{pe}(t)+K_{ir}\dot{y}(t-h)-K_{i}\dot{y}(t) \tag{26}\]  
Equation (26) defines the time-effective mathematical expression of the CPIR controller [21]. Here, \(\dot{y}(t)\) represents the derivative of the output parameter, in other words, the change in liquid level for Tank 1 and Tank 2. In Figure 3, the reference input \(y_{d}\) represents the desired liquid level for Tank 1 and Tank 2, while \(y(t)\) represents the output magnitude, i.e., the liquid level obtained for Tank 1 and Tank 2.  
\[p(s)=s^{3}+as^{2}+bK_{i}s+bK_{p}(K_{i}+K_{ir})-bK_{ir}se^{-sh} \tag{27}\]  
The characteristic quasi-polynomial of the closed-loop system is directly obtained with the help of Figure 3 and is presented in Equation (27).  
\[v(s)=s^{2}+as+bK_{i}\pm bK_{ir}se^{-sh} \tag{28}\]  
However, the quasi-polynomial expression of the inner velocity loop can be defined by Equation (28).  
\[\dot{u}(t)=[(K_{i}-K_{ir})/G]\ SAT(GK_{p}e(t))+K_{ir}\dot{y}(t-h)-K_{i}\dot{y}(t) \tag{29}\]  
Figure 4 displays the closed-loop CNPIR controller. In this case, the CNPIR control law [21] can be defined in its most general form by Equation (29). The saturation function of CNPIR is shown in Figure 4, and this function, specified in Equation (29), is expressed by Equation (30) as follows:  
\[SAT(x)=\left\{\begin{array}{ccc}x,&|x|&\leq&1\\ -1,&x&<-1\\ 1,&x&>&1\end{array}\right. \tag{30}\]  
The saturation function of CNPIR is shown in Figure 4, and this function, specified in Equation (29), is expressed by Equation (30).  
Equation (29) defines 'G' as the scaling factor. If the positional error \(e(t)\) is small enough, the value of \(x=GK_{pe}(t)\) does not exceed the saturation limitations, and both the outer and inner loops operate in conjunction. Therefore, the values of \(G\) and \(1/G\) nullify each other. If the positioning task results in a significant position error, \(SAT(x)\) can be either \(1\) or \(-1\). Here, the outer loop is disabled, and only the inner velocity loop functions.  
Figure 4: CNPIR controller block diagram.  
The system attains a steady velocity. When the position error diminishes, the saturation block functions within its linear range, causing both loops to become active once more. An advantage of the CPIR controller over the standard P-PI controller is its utilization of time delays, which effectively eliminates the need for velocity measurements. The second advantage is that the CPIR method does not use the finite differences method, thereby eliminating the deficiencies associated with high-pass filters. The initial design of the CPIR controller, which does not have a cascade structure, is called the proportional integral retarded (PIR) controller. When a new outer loop is added to this PIR controller, the CPIR controller architecture is obtained. The CPIR controller has a notable advantage over the PIR controller in that the inner loop within the controller can function independently if the extra outer loop is disengaged. The addition of a saturation function (SAT) to the CPIR controller results in the formation of the cascade nonlinear proportional integral retarded (CNPIR) controller design [21]. Incorporating the saturation function into the controller architecture offers a notable benefit, especially in terms of mitigating overshoot in the system's response. For more detailed information on the tuning methodology for CNPIR, see reference [21].