Design of an IMCPID Optimized Neural Network for Stepless Flow Control of Reciprocating Mechinery

: It is usually difﬁcult to design a controller for a nonlinear multiple-input and multiple-output (MIMO) system. The methodological approach taken in this study is a mixed methodology based on a PID-type internal model control (IMC) method and neural network (NN) optimization algorithm. The NN controller is designed for adjusting the sole parameter in IMCPID and compen-sating the characteristic changes and non-linearity in stepless ﬂow control. In this study, a simulation of a nonlinear MIMO system with strong coupling is carried out. The simulation results indicate that the proposed control method has a better performance in settle time, overshoot, robustness and set-point tracking accuracy compared with other considered methods.


Introduction
Reciprocating compressors are widely used in some industrial fields such as petroleum, chemical, natural gas transportation and so on. It is the main power-consuming equipment in industrial factories and it is usually run at factory setting. However, in some conditions, the outlet flow of compressors needs to be regulated with the real-time demand of the downstream production process. Therefore, it is necessary and meaningful to control the outlet flow of compressors. Many approaches have been proposed, and the by-pass regulation is the simplest and most reliable method [1]. However, this method will cause a huge waste of electricity because the reflux gas will be sent back to the inlet of the compressor to be compressed again. In comparison with the by-pass regulation, the stepless flow control method has a better energy-saving performance because excess gas will be expelled from the compression cylinder prior to the compression process. Thus, this part of the gas will not be compressed, and some power consumption can be reduced. After equipping with the stepless flow control system, the effective power of the compressor will be greatly improved, and a lot of electricity will be saved. The stepless flow control system for the reciprocating compressor should meet the following requirements [2,3]:

•
The control system should be capable of continuous stepless flow regulation within 0~100% working load. • The control system should require low investment and low energy consumption. • The control system should be reliable, safe and convenient to operate. • The control system should have a wide range of applications.
From the point of view of control science, the stepless flow control system has multiple controlled variables and multiple manipulated variables [4]. The inlet flow of each stage is the manipulated variable, and the outlet gas pressure of each stage is the controlled variable. Thus, this is a multiple-input and multiple-output (MIMO) system. The primary feature of MIMO system is the strong coupling, where each manipulated variable can affect the other controlled variables. It is harder to design the controller than the single-input and single-output (SISO) system due to the interaction process between controlled variables and manipulated variables. Thus, one of the main control objectives for a MIMO system is reducing the coupling. Many approaches have been proposed to solve this control problem in state space and transfer function matrix representations. Some frequency-based frameworks have been researched in this study including the relative gain array (RGA) measure, feed-forward decoupling method, IMCPID and neural network [5].
The Proportional Integral Derivative (PID) control has been widely used in the industrial fields due to its simple structure and stable characteristics. However, for some dynamic processes such as time-delay, nonlinearity and coupling, the PID controller does not always represent high efficiency. In the past decades, the question of how to find simpler PID tuning methods has caught a mass of interest [6]. In both academic research and engineering applications, many PID-type controller designs have been developed, such as the famous Ziegler-Nichols (ZN) tuning rules [7], the well-know H 2 /H ∞ robust optimal design method [8], the internal model control principle [9] and neural network PID [10]. In the above methods, IMC is considered as the simplest tuning rule of PID controller. This because all the three controller parameters of PID can be obtained from the only user-defined tuning parameter of IMC called λ (λ > 0). It is easy to control the linear or nonlinear, time-delay and coupling systems for the IMC scheme due to its simple and robust performance characteristics [11].
Many studies have been conducted to obtain PID tuning methods using IMC schemes which are achieved by complex mathematical manipulations or require a filter algorithm. For the stable linear and separable nonlinear system, an IMC-based PID (IMCPID) tuning scheme employing first-order in place of second or higher-order filter is presented [12]. Some heuristic methods have also been developed to get PID parameters [13][14][15]. A IMCPID controller has been slightly modified in [16] to demonstrate the importance of mid-frequency and high-frequency robustness for tuning parameters. As some processes having model uncertainty, [17] proposed an IMC tuning method based on gain margin and maximum peak criterion.
In order to eliminate the effects of uncertainty of system parameters, some adaptive control methods have been used in industrial processes [18,19]. The model-reference adaptive control and self-tuning regulator control can effectively solve the disturbance problem in linear system [20]. The method in [21] combines IMC and adaptive PSD control. The result of applying it to the main steam temperature system shows that the method is effective. However, the parametric uncertainties and external disturbances of nonlinear systems are more sophisticated than those of linear systems. To solve this problem, some intelligent techniques [11] have been applied to adaptive controller, including neural network and fuzzy logic control, etc. Paper [22] presents an IMCPID control method to modified the weight of the set-point online with fuzzy logic, which can improve the setpoint tracking performance and robustness of the system. In paper [23], the technique of the self-tuning neural network PID control for the stabilizer fin to reduce ship rolling motion is successfully developed. Because the neural network can approximate any continuous function, the adaptive controller based on neural networks has excellent online estimation characteristics [22].
In this paper, a neural network based on IMCPID control strategy is proposed to improve the performance of the stepless flow controller. A feedforward decoupling method is designed which can eliminate the coupling and transform the multiloop system into several independent single-input and single-output loops [24]. In the feedback loop, an adaptive IMCPID control method is proposed which uses the system error as the input signal of the neural network and regulates the IMCPID parameter λ by its self-learning in real time [23]. The main purpose of this paper is to solve the problem of PID parameter setting in the actual industrial field operation process, which is usually a complex job. Therefore, we proposed a more concise neural network combined with an IMCPID control method, which reduces the number of system parameters and the difficulty of parameter setting. Some researchers found out that after applying neural networks to these nonlinear systems, not only will the parameter tuning process become simpler, but also the control performance will present more excellently [25]. PID neural network will automatically adjust the control parameters due to its self-organizing, self-learning and self-adaptation characteristics [26]. The simulation experiments show that the IMCPID controller based on neural network for a stepless flow control system has better performances in set-point tracking, stability and robustness than those of the other considered controllers.
The rest of this paper is organized as follows. Section 2 gives the mathematical model for a stepless flow control system of a reciprocating compressor. In Section 3, The IMCPIDbased neural network (IMCPIDNN) control scheme is presented. The simulation results of a multivariable nonlinear control system are compared and discussed in Section 4. Finally, the conclusion and some open problems are given in Section 5.

Problem Formulation
The stepless flow control system for a two-cylinder type reciprocating compressor [27] is shown in Figure 1, where r denotes the gas to be compressed and y denotes the compressed gas. In standard operating conditions, the gas satisfies the following ideal gas assumptions: . .
where P is gas pressure, ρ is gas density, R is gas constant, T is gas temperature, M is gas molar mass, m is derivative of gas mass, V is gas volume, ρ are derivatives of the gas volume and gas density, respectively. Usually, the gas volume is invariable in the buffer tank, so V = 0. Combining Equations (1)-(3), the dynamic pressure change of the cylinder can be described as: where φ in and φ out are process coefficients of the inlet gas or outlet gas, which are ranging from 0 to 1 depending on the gas process characteristic.
According to the mathematical model for reciprocating compressors introduced in paper [28], the gas mass flowing into the first stage cylinder and the second stage cylinder during the compressing process can be given as Equations (5) and (6), respectively. .
where P s is pressure of inlet gas, R m is gas constant, T s is temperature of inlet gas, T is temperature of buffer tank, V h is volume of cylinder stroke volume, ω p is pressure coefficient, ω t is temperature coefficient, ω l is leakage coefficient, σ is volume coefficient, P is pressure of buffer tank, m is gas mass and θ is working load. The subscript i (i = 1, 2) indicates the cylinder number of the compressor. The gas compressed by the first stage cylinder will be sent into the second stage cylinder. Then, we can obtain the relationship between the outlet mass of the first-stage cylinder and the inlet mass of the second-stage cylinder.
Considering the dynamic principle of the exhaust valve, the equation of the outlet mass of the second-stage cylinder can be expressed as Combing Equations (4)- (8), the dynamic change of cylinder pressure can be presented as: . .
The operation parameters of a two-cylinder reciprocating compressor with a stepless flow control system are listed in Table 1. Substituting the operation parameter values in Table 1 into Equations (9) and (10), the relationship between the outlet pressure and working load can be written as Equation (11), where y 1 and y 2 are outlet pressure, u 1 and u 2 are working load of each cylinder, respectively, and ξ is the opening of outlet:

Controller Design
In this section, the set-point tracking and decoupling control scheme will be proposed. The basic structure of the IMCPIDNN control system is shown in Figure 2. The design process of the IMCPIDNN controller mainly consists of four parts: relative gain array, feedforward decoupling, IMC controller based on standard PID and IMCPIDNN controller design. In the whole control system, r(k) is set-point value, e(k) is error of subtracting the output value from the set-point value, y(k) is output value, u(k) is control signal, λ(k) is the only IMCPID controller parameter to be adjusted and d is external disturbance. The whole control algorithm is established based on the adaptive IMCPID controller and neural network algorithm, which is presented in Algorithm 1.

Algorithm 1 IMCPIDNN algorithm for MIMO nonlinear system.
Step 1: Initialize the weights of IMCPIDNN.
Step 2: Input the set-point value of controlled system into the controller.
Step 3: Regulate the compressor flow by IMCPIDNN controller.
Step 4: Calculate error and evaluation function.
Step 5: Adjust the weights of IMCPIDNN controller by back propagation algorithm.
Step 7: Stop the algorithm until the error is small enough. If not, return to Step 3.

Relative Gain Array (RGA)
As we can see in Equation (11), there are two controlled variables and two manipulated variables in the presented control process. There are two ways to pair control variables with operation variables and they are u 1 −y 1 /u 2 −y 2 and u 1 −y 2 /u 2 −y 1 , respectively. To find which configuration has a better performance in terms of resisting the system coupling, the RGA method is proposed. For the system G m (s) with n inputs and m outputs, its RGA can be calculated by: The RGA method is proposed. For the system G m (s) with n inputs and m outputs, its RGA can be calculated by: where * is the multiplication of Hadamard.
Considering that the sum of each row and each column is 1, the RGA for a two-input and two-output system satisfies the following equation: where β 11 (s) and β 22 (s) are the relative gains of main channel and β 12 (s) and β 21 (s) are the relative gains of coupled channel. Therefore, the whole RGA matrix can be calculated from λ 11 (s). In the RGA method, the value of β(s) describes the coupling degree within the system. If is β(s) close to 1, every loop can be considered to run independently. If it is close to 0, the coupling is serious. Negative β(s) must be avoided because it results in instability. Therefore, we should choose the β(s) which is positive and close to 1 to be the best configuration.

Feed-Forward Decoupling
The undesirable dynamic coupling within the system will affect the stability and control performance of the stepless control system [29]. This paper introduces a simple and efficient feed-forward decoupling method to eliminate the coupling, and the block diagram for a two-input and two-output system is shown in Figure 3 [24]. Here, r i is the set-point value, y j is the output value, C i (s) is the proposed controller, G ij (s) is the process plant and D ij (s) is the decoupler.
Supposing the system is decoupled completely, the transfer function matrix will turn into a diagonal matrix. D 21 (s) and D 12 (s) satisfy the following relationship: Then, we can obtain D 21 (s) and D 12 (s) as:

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 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: 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: 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 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.

Algorithm 2
The design process of the IMCPID controller.
Step 1: 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). G + m (0) = 1.
Step 2: Design C imc (s) and G f (s) where G f (s) is the filter which provides good performance for set-point tracking and disturbance suppression, β 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 where K p , T I and T d are proportional gain, integral time and derivative time, respectively.
Most industrial processes can be represented by a first-order model plus time-delay system as shown below: where k, t and τ are open-loop gain, time constant and delay time, respectively.
Considering that the delay time e −τs is difficult to implement physically, we could replace it with first the order Pade approximation, that is, e −τs = 1 − τs. Then, G m (s) can be factorized as: G + m (s) and G + m (s) can be obtained as: 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: Then, the PID parameters can be presented by the following equation: where K p is proportional gain, K a is integral gain and K d is differential gain, respectively.

IMCPIDNN Controller Design
In order to compensate the nonlinearity of the stepless flow control system, the neural network algorithm based on the IMCPID control scheme is proposed [30]. The block diagram of a MIMO system with a backpropagation (BP) neural network structure is as shown in Figure 5. Here, r and y are set-point value and output value, respectively. W if is the network weight between the j th node of the input layer and the i th node of the hidden layer and W i is the network weight between the i th node of the hidden layer and the output layer node.
From Equation (26), the discrete PID gains can be written as: where γ is the tuning coefficient to determine the flexibility of the control process. Then, according to the incremental PID principle [31], the output of IMCPID controller can be written as: In this article, a three-layer BP neural network is proposed as show in Figure 5. There are five input nodes, six hidden nodes and one output node in the neural network structure.
The input of the neural network is defined as: The input of the hidden layer is defined as: The output of the hidden layer is defined as: where f (x) is the sigmoid function: The input of the output layer is defined as: The output of the output layer is defined as: where g(x) is a non-negative sigmoid function to ensure the outputs to be positive as shown below: The central ideal of the learning algorithm for the IMCPIDNN is to obtain a gradient vector recursively. In this study, we define energy function as: In order to get the minimum J(k), the iterative algorithm of ∆w i (k) can be calculated as the following equation according to the gradient descent method: where η is the learning rate, and η > 0; α is the inertial coefficient, and ∂J(k) ∂W i (k) can be written as: From Equation (37), we can obtain: Considering that ∂y(k) ∂u(k) cannot be written [32], we use the sign function to approximate it.
Combining Equations (27) and (28), we can obtain ∂u(k) ∂λ(k) as below: where K P (k), K I (k) and K D (k) are the discrete style of K P (k), K I (k) and K D (k), respectively.
From Equations (33) According to Equations (37)-(43), the output layer weight change ∆w i (k) can be written as: where The hidden layer weights ∆w ij (k) can be obtained in the same way with the following equation: ∆w ij (k) = α∆w ij (k − 1) + ηδ (2) where Through the above derivation, we obtain the weight coefficient learning algorithm for the neural network, and only the parameter λ can be adjusted in real time according to the above derivation. The parameters of the IMCPIDNN controller are shown in Table 2.

Algorithm Simulation and Results
In this section, some simulations are completed to illustrate the effect of the proposed IMCPIDNN controller in a stepless flow control system. The design and training process of IMCPIDNN and PID, IMCPID and FLSMC (feedback linearization sliding mode control) are done with the MATLAB/SIMULINK environment. Some possible external disturbances have also been taken into consideration during the simulation process. The simulation sampling time is set as 0.01s. The controller output threshold is set as [0, 1] to simulate the real action of the actuators. The learning rate η and the inertial coefficient α are set as 0.5 and 0.1, respectively. In addition, the simulation results of the control effects are compared in terms of step responses, anti-interference and robustness, which shows the superior performance of the proposed IMCPIDNN controller in all aspects.
The industrial process presented in Section 2 is a two-input and two-output system whose open-loop transfer function can be described as: According to the controller design method presented in Section 3, we know that the system coupling is serious, and the best paring configuration is u 1 /y 2 and u 2 /y 1 . Thus, the process model G m (s) can be simplified as: The value of the filter parameter n is selected as n = 1 to meet the order of the model G m (s). The PID-IMC controller G c (s) can be obtained as the following equation according to the controller design method given in Equations (16)

Step Response Test and Validation
To demonstrate the characteristics of the proposed IMCPIDNN controller, step response tests are made for the reciprocating compressor numerical model. The PID controller, IMCPID controller and FLSMC controller are constructed to make comparisons under the same condition. The simulations are carried out with reference pressure profile under the simulated condition to verify the control performance of the proposed controller.
In order to evaluate the performance of the proposed controllers, we use the integral of absolute value error criterion (IAE), integral of time multiplied by the absolute value of error criterion (ITAE), integral of square error criterion (ISE) and integral of time multiplied by squared error criterion (ITSE) as the evaluation function [33]. Two-system step response performance indicators have also been applied and they are t s and M p , where t s means the shortest time that reaches the step response steady-state value of 2% error and M p means the overshoot, respectively. Figure 6 shows that the dynamic output of each loop meets the desired set point. The dynamic tracking performances obtained by PID, IMCPID, FLSMC and IMCPIDNN controllers for the two-input and two-output nonlinear system were compared. The process of starting the system from the shutdown state is imitated, where the set-points of the first output and the second output change from 0 kPa to 120 kPa and 220 kPa at moment t = 0 synchronously. Obviously, IMCPIDNN has the shortest settle time and the smallest overshoot, and it performs the best among the four algorithms while PID performs worst.   At the moments t = 100 and t = 800, the set-point value is changed sequentially in the two loops. The simulation result in Figure 7 shows the step response and control effect obtained by the proposed IMCPIDNN controller. It is relevant to note that the performance of the PID and IMDPID controllers are not satisfied, and this is expected because of the strong interactions. The common problem of the two controllers is that they cannot eliminate the system coupling problem. For example, the step change at moment t = 100 in the set-point of the first input caused a negative effect on the second output, which is undesirable. It indicates that the system coupling is serious with no decoupling method. The FLSMC controller eliminates the coupling of the system by nonlinear method, but its performance in step response is not as good as that of the IMCPIDNN controller. Compared with the other three controllers, the proposed IMCPIDNN controller performs better in set-point tracking. Neither the first step change nor the second step change has a large effect on the other loop. The performance comparison of the four algorithms used for sequential step responses are presented in Table 4. For loop 1 and 2, the settle times t s obtained using the proposed controller are 61.91 s and 146.78 s respectively, and the overshoots M p are both zero. Meanwhile, the results of the smallest four error evaluation indexes obtained by the IMCPIDNN controller can ensure the set-point tracking accuracy. Obviously, the IMCPIDNN controller performs better in terms of facing the interactions.

Anti-Interference and Robustness Test
To illustrate the stability of the proposed IMCPIDNN controller, some anti-interference and robustness tests had been done. We want to know how the control effect changes when the values of the transfer function time constant and gain are mismatched with the actual system and how these controllers perform when the control process encounters external disturbance. Figures 8 and 9 present the step response with +40% variation on time constant and gains. We can see that the proposed IMCNNPID controller is very stable to the changes of model parameters. Figure 8 shows that the overshoot of PID, IMCPID, FLSM and IMCPIDNN in the face of model mismatch is 3.60%, 16.59%, 0% and 1.79%, respectively. Additionally, it can be seen that the IMCPIDNN controller has a faster adjustment speed than the other three controllers. Figure 9 shows the process outputs when the model mismatch increases to +40%. The most interesting aspect of these two figures is that the overshoot obtained by the IMCPIDNN controller is slightly larger than Figures 10 and 11, but it is acceptable because it is still small enough. Obviously, the proposed IMCPIDNN controller is effective and superior to other three controllers for the varied system errors.    Next, 20 kPa of external disturbance was added to output 1 and output 2 at t = 100 s and t = 600 s, respectively. The simulation results are shown in Figures 12-14. Compared with the PID, IMCPID and FLSMC controllers, the settle time and overshoot of the proposed IMCPIDNN controller performed better, obviously. Under the action of the IMCPIDNN controller, the output can return to the set-point faster and more steadily, and the other loop is not interfered. This is meaningful for a stepless flow control system as it can ensure that the system runs more safely in the presence of external interference and reduce the failure rate of the equipment.

Conclusions
In this paper, an IMCPIDNN controller based on IMCPID and a neural network optimization algorithm is proposed to optimize the control effect of MIMO processes such as stepless flow control of reciprocating compressors. The main contributions of this paper are the stepless flow process model with dynamic parameters as well as an IMCPIDNN controller, which inherits the main structure of a PID controller. In order to adjust the control parameters more efficiently, an adaptive algorithm based on a BP neural network is constructed. In terms of efficiently adjusting control parameters, the BP neural network algorithm with dynamically adjustable parameters has played a key role. Numerical experiments show that the proposed IMCPIDNN controller has good setpoint tracking performance and adaptability to a system model mismatch. Compared with PID, IMCPID and FLSMC controllers under the same conditions, the proposed IMCPIDNN controller performs best in terms of settle time, overshoot, robustness and anti-interference ability. More importantly, the process of the proposed IMCPIDNN controller to adjust the control parameters is the simplest because of the fewest adjustable parameters, which will provide great convenience for actual industrial applications. Finally, the proposed controller can be applied to any linear or non-linear MIMO system. We will continue to study process modeling, stability analysis, system convergence and robustness analysis to achieve better control effects.