# Optimal Design of I-PD and PI-D Industrial Controllers Based on Artificial Intelligence Algorithm
## 3 Methods of AIS Algorithm for Industrial Controllers  
In the application of microprocessor-based process control methodologies within the oil and gas sector, the integration of controllers into the control system is a common practice. In the architecture of distributed control systems by different companies using microprocessor technology, several components are beyond conventional PID controllers. The control strategies applied by these controllers encompass not only the tracking error, \(E\), but also incorporate the real-time value of the output signal, \(PV\). This specific design of the controller configuration leads to an enhancement in system performance. It facilitates the generation of the required control actions, \(CV\), which are then directed towards the control plant to achieve the desired modes, \(SV\). During the operation of the control system, a seamless transition occurs between different controller types: PID, I-PD, and PI-D (see Figure 1). This dynamic switching contributes to the controller's adaptable structure. The control law governing the I-PD configuration of the control system takes on the following expression:  
\[CV_{I-PD}(t)=K_{P}\cdot PV(t)+\frac{1}{T_{I}}\int\limits_{t=0}^{t_{1}}E(t)dt+T_ {D}\frac{dPV(t)}{dt}, \tag{1}\]  
where \(K_{P}\) is a proportional gain of the controller; \(T_{I}\) is a time constant of the integral term of the controller; \(T_{D}\) is a time constant of the derivative term of the controller. The formation of the closed-loop control system transfer function, involving the controller (1):  
\[T_{I-PD}(s)=\frac{C_{I}(s)G(s)}{1+G(s)(C_{I}(s)+C_{PD}(s))}, \tag{2}\]  
\[C_{I}(s)=\frac{1}{T_{I}}.\frac{1}{s},\,C_{PD}(s)=K_{P}+T_{D}.s, \tag{3}\]  
where \(G(s)\) is a transfer function of the control plant; \(C_{I}\) is a transfer function I-controller in the forward circuit of the block diagram of the control system, to the input of which a tracking error is applied; \(C_{PD}\) is a transfer function of the PD controller in the feedback circuit of the control plant, the input of which is supplied with the current value of the output signal. Let us also consider the PI-D control law, in which the control action is formed based on the tracking error, \(E\), and the change in the output signal \(PV\):  
\[CV_{PI-D}(t)=K_{P}.E(t)+\frac{1}{T_{I}}\int\limits_{t=0}^{t_{1}}E(t)dt+T_{D} \frac{dPV(t)}{dt} \tag{4}\]  
In this case, the expression for the transfer function of the closed-loop control system has the following form:  
\[T_{PI-D}(s)=\frac{C_{PI}(s)G(s)}{1+G(s)(C_{PI}(s)+C_{D}(s))},\,\,\,C_{PI}(s)=K_ {P}+\frac{1}{T_{I}}.\frac{1}{s},\,\,\,C_{D}(s)=T_{D}.s. \tag{5}\]  
This paper presents the results of tuning industrial controllers (1), and (4) intending to minimize a performance criterion expressed through Integral Square Error (\(ISE\)) performance index [17]:  
\[ISE=\int\limits_{t=0}^{t_{1}}E^{2}(t)dt=\int\limits_{t=0}^{t_{1}}(SV-PV(t))^{2 }dt\to min. \tag{6}\]  
The integration range is limited by the simulation time of the process, denoted by \(t_{1}\). With the principles outlined above, we establish the problem formulation for the design of optimal control actions, \(CV\). For the control system illustrated in Figure 1, the task involves determining the parameter settings for the variable controller. This is carried out to minimize the \(ISE\) while achieving predetermined values for the output signals, \(SV\). This optimization task is approached through the application of an intelligent search optimization algorithm AIS. In line with the findings of [21], the AIS algorithm entails the conventional stages of an evolutionary search algorithm, inspired by the mechanisms of the biological immune system. These stages encompass the initialization phase, involving the establishment of initial values for controller parameters, followed by affinity calculations for the parameters  
Figure 1: Scheme of an industrial control system with a variable controller. concerning the fitness function.