# Design of an IMCPID Optimized Neural Network for Stepless Flow Control of Reciprocating Machinery
## 3 Controller Design
### IMC Controller Design Based on Standard PID  
In this part, an improved IMC control based on standard PID controller and classical feedback structures is proposed. The Standard IMC structure is presented in Figure 4, where \(G_{p}(s)\) is the process, \(G_{m}(s)\) is the process model, \(G_{f}(s)\) is the filter, \(C_{\rm imc}(s)\) is IMC controller and \(C(s)\) is the IMC controller with feedback structure.  
The closed-loop transfer function obtained from Figure 4 is:  
\[y=\frac{C_{inc}(s)G_{p}(s)}{1+C_{inc}(s)[G_{p}(s)-G_{m}(s)]}r+\frac{1-C_{inc} (s)G_{m}(s)}{1+C_{inc}(s)[G_{p}(s)-G_{m}(s)]}d. \tag{16}\]  
If the process model is completely accurate, it is \(G_{m}(s)=G_{p}(s)\), and the external disturbances \(d=0\). Then, Equation (16) can be written as:  
\[y=C_{inc}(s)G_{p}(s)From Equation (17), we find an interesting property: the closed-loop transfer function can be considered as an open-loop system only related to \(C_{\text{imc}}(s)\). The designing process of the IMC controller can be regarded as the product of the inverted process and the closed-loop transfer function.  
The design process of the IMCPID controller includes three steps which are shown in Algorithm 2.  
```
Step 1: Factorize \(G_{m}(s)\)
```  
\[G_{m}(s)=G_{m}^{-}(s)G_{m}^{+}(s), \tag{18}\]  
where \(G_{m}^{-}(s)\) contains the minimum phase part of the model and \(G_{m}^{+}(s)\) contains all the right half plane zeros and the time delays of \(G_{m}(s)\). \(\left|G_{m}^{+}(0)\right|=~{}1\). Step 2: Design \(C_{\text{imc}}(s)\) and \(G_{f}(s)\)  
\[\left\{\begin{array}{l}C_{imc}(s)=\frac{1}{G_{m}(s)}G_{f}(s)\\ G_{f}(s)=\frac{1}{(\lambda s+1)^{\eta}}\end{array}\right. \tag{19}\]  
where \(G_{f}(s)\) is the filter which provides good performance for set-point tracking and disturbance suppression, \(\beta\) is the time constant of \(G_{f}(s)\) and the only tuning parameter of the IMC controller that affects the closed-loop response and stability and \(n\) is the filter order decided by \(G_{m}^{-}(s)\). Step 3: Calculate the IMCPID controller \(C(s)\) and turn it into the PID-type  
\[\begin{array}{ll}C(s)&=\frac{C_{imc}(s)}{1-G_{m}(s)C_{imc}(s)}\\ &=\frac{G_{f}(s)}{G_{m}^{-}(s)-G_{f}(s)G_{m}(s)}\\ &=K_{p}(1+\frac{1}{T_{l}}s+T_{d}(s))\end{array} \tag{20}\]  
where \(K_{p}\), \(T_{l}\) and \(T_{d}\) are proportional gain, integral time and derivative time, respectively. ```  
**Algorithm 2** The design process of the IMCPID controller.  
Most industrial processes can be represented by a first-order model plus time-delay system as shown below:  
\[G_{m}(s)=\frac{k}{ts+1}e^{-\tau s}, \tag{21}\]  
where \(k\), \(t\) and \(\tau\) are open-loop gain, time constant and delay time, respectively.  
Figure 4: The block diagram of the IMC structure.  
Considering that the delay time \(e^{-\tau s}\) is difficult to implement physically, we could replace it with first the order Pade approximation, that is, \(e^{-\tau s}=1-\tau s\). Then, \(G_{m}(s)\) can be factorized as:  
\[G_{m}(s)\approx\frac{k}{ts+1}\frac{1-\frac{\tau}{2}s}{1+\frac{\tau}{2}s}. \tag{22}\]  
\(G_{m}^{+}(s)\) and \(G_{m}^{+}(s)\) can be obtained as:  
\[G_{m}^{+}(s)=1-\frac{\tau}{2}s, \tag{23}\]  
\[G_{m}^{-}(s)=\frac{k}{(ts+1)(1+\frac{\tau}{2}s)}. \tag{24}\]  
The filter order \(n\) should be consistent with the system order, that is, \(n=1\). Substituting Equations (19), (22) and (24) into Equation (20), the PID-type IMCPID controller can be written as:  
\[C(s)=\frac{2t+\tau}{k(2\lambda+\tau)}(1+\frac{2}{\tau+2t}\frac{1}{s}+\frac{t \tau}{\tau+2t}s). \tag{25}\]  
Then, the PID parameters can be presented by the following equation:  
\[\left\{\begin{array}{l}K_{p}=\frac{2t+\tau}{k(2\lambda+\tau)}\\ K_{i}=\frac{2}{\tau+2t}\\ K_{d}=\frac{\tau}{\tau+2t}\end{array}\right., \tag{26}\]  
where \(K_{p}\) is proportional gain, \(K_{a}\) is integral gain and \(K_{d}\) is differential gain, respectively.