{'fraction_non_alphanumeric': 0.02305159165751921, 'fraction_numerical': 0.004326209078582037, 'mean_word_length': 4.934099616858237, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Optimization of the control system parameters using the genetic algorithm

The method for parametric optimization of an automatic control system is proposed. The criterion for the quality of the functioning of the system includes control accuracy and control costs. The method takes into account the change in the operating conditions of the control object and the influence of random disturbances. A combination of a genetic algorithm procedure in MATLAB and system simulation in Simulink is proposed. Recommendations for choosing the optimal values of the system parameters are passed on to the operator of the technological process.


Introduction
Improving the efficiency of oil refining facilities is achieved by the introduction of modern information technologies in control automation tools. Determination of the parameters that ensure optimal functioning of the automatic control system (ACS) of technological processes (TP) according to the selected quality indicator is an important problem. This problem must be solved both at the stage of systems design [1][2][3][4], and during the periodic determination of the tuning parameters of the ACS, when there is a change in the operating conditions of the facility, affecting the quality of control of technological parameters [4]. The development of new information technologies, for example, such as genetic algorithms (GAs), makes it possible to effectively solve the problem of automatic tuning of the ACS [5][6][7][8], even if the selected quality indicator has to be calculated under conditions when the object is influenced by random factors. The mathematical apparatus of genetic algorithms [5] makes it possible to carry out optimization if the performance indicator of the system is a nonlinear, non-differentiable function, and this function also has local extrema. As direct search algorithms, GAs (unlike classical optimization algorithms) do not require us to compute the function gradient and higher derivatives.

The problem statement
At present, the control of most of the technological objects of oil refineries is carried out on the basis of the use of controllers that implement the standard proportional-integral-differential (PID) control law [1][2][3]. The parameters of these controllers are determined by tuning to the basic operating mode. At the same time, it is not taken into account that the operating conditions of the facility may change and that there are various factors that affect the quality of process control. We carried out this study in connection with the increased requirements for the degree of automation of technological process control of oil refineries. We were tasked with investigating the possibility of automatically changing the parameters of PID loops if changes in the operating conditions of the facility are detected.
Such automatic optimization of the ACS will reduce the load on the operating personnel, reducing the need for constant monitoring of control systems. In addition, when identifying emerging problems associated with changing operating conditions, automatic optimization will reduce the time spent on tuning the corresponding PID loops in order to prevent deterioration in the quality of the object's functioning. We plan that the determination of the tuning parameters of the control loops will be carried out on the basis of identifying the characteristics of the control object under conditions when the object is affected by disturbances. The experimental transient characteristics of the operating ACS should be approximated, and then the analytical expressions obtained as a result of the approximation are used to determine the parameters of the transfer function of the object. To form the optimal settings for control loops, it is necessary to carry out model studies of control systems with parameters varying in the ranges that are determined by the regulations for carrying out technological processes in normal operation. We will optimize the settings using a genetic algorithm. The optimization software module based on the genetic algorithm repeatedly calls the control loop model for execution and, as a result, obtains the value of the objective function for optimizing the control quality. We assume that all calculations will be performed at the upper level of an automated process control system (APCS), which will operate in a supervisory control mode. We will calculate the optimal parameters of the control loops using the genetic algorithm, which is implemented as a procedure of the MATLAB / Global Optimization Toolbox package [7,9], and the model of the control loop developed by us. Then the obtained optimal values of the controller parameters (as recommended settings) will be provided to the operator of the automated process control system controlling the technological process.

The procedure for optimizing the ACS parameters using a genetic algorithm
GA is an analogy to the biological evolutionary process based on genetic inheritance and natural selection. In its implementation, a set of individuals is used, called a population, which is repeatedly modified during the solution process. In our case, the vector of settings (variable parameters) of the control loop is taken as an individual. We will consider a temperature control system that implements the PI control law (the differential component is equated to zero) and assume that the setting vector X = (k p , T i ). An important advantage of GA in comparison with other optimization methods is that it searches for a solution based on a population of points, and not from a single point. To approximate the optimal value, the most promising areas of the search space are considered, and at the same time, random changes in individuals make it possible to obtain many new individuals. The best individuals pass into the next generation without change, therefore each new generation contains a higher ratio of characteristics that are inherent in the best individuals. As a result, the population evolutionarily converges to the optimal solution of the problem -we obtain optimal settings for the control loop according to the adopted criterion. The optimization algorithm is shown in figure 1. To obtain optimal settings, it is necessary to carry out model studies of control systems with parameters varying in the ranges determined by the regulations of controlled technological processes. The search for parameters that provide a minimum to the selected optimization criterion is carried out using a specially designed m-file (MATLAB script), which performs multiple calls to the model of the control system under study with the transfer of parameters to the genetic algorithm. To work with the functions of the Global Optimization Toolbox, the necessary options are set both for the operation of the genetic algorithm and for monitoring the optimization. The search for the global minimum of a function is performed by the ga procedure, and the creation of the GA options structure is performed by the gaoptimset operator.

Description of the control loop model
Using MATLAB / Simulink tools [10], a mathematical model of a control loop (figure 2) has been developed, which contains models of a controller and a control object. The error signal at the input to the controller is formed as the difference between the signals of the setpoint and the current value of the controlled parameter. To simulate random pulsations of the controlled parameter, a shaping filter is implemented that generates a random signal [4], the filter output is then summed up with the output of the inertial unit. When modeling the system, the integral criterion of the system performance is also calculated. This quadratic integral criterion is calculated over a period T (longer than the duration of the transient) (1) The first element of integration characterizes the control accuracy, and the second one determines the controller's costs for control [3,8]. The weighting factor λ for the second term is chosen experimentally. We introduced a weighting factor λ in the criterion expression to scale the accounting of control costs to eliminate possible self-oscillations in the system. But it should be borne in mind that the accuracy of maintaining the set value of the controlled parameter decreases in this case. Therefore, in our research, we assumed the range of variation of this weighting factor which ensures the technological performance of the system: control accuracy and the absence of selfoscillations. In the process of optimizing systems, the simulation control procedure makes multiple calls to the Simulink-model of the system, and the found optimal settings are saved for subsequent analysis. Since we took X = (k p , T i ) as the vector of variable parameters, that is, the vector of settings for the PIcontroller, therefore, at each step of the algorithm, the vector of parameters X and the corresponding criterion value J (X) were considered.

Optimization results of control loops
Consider the process of optimizing the parameters of the temperature control loop of the vacuum unit. object k ob =1.25; object time constants T 1ob =200 s and T 2ob =2 s; root-mean-square deviation at pulsations of the controlled signal σ = 0.1., We have illustrated the optimization process by constructing a three-dimensional graph of the dependence of the criterion J (according to expression (1)) on two parameters: the gain k р and the integration constant T i , shown in figure 3. This figure also shows the values of these parameters that provide a minimum to criterion J. In addition, it also shows the graphs of the transient processes for these optimal parameters (when the setpoint is disturbed by 10%).For calculations, we used a Simulink-model of the control loop, which takes into account fluctuations of the controlled parameter. As can be seen from the graphs of transient processes, the controlled parameter (curve P) aperiodically, without overshoot, reaches a new setpoint, the control valve (curve MV) responds to the disturbance, remaining in the operating range (20-50% opening). It should be noted that to obtain the optimal parameters using the constructed three-dimensional graph (the dependence of the criterion J on k р and T i ), a lot of time is required, because it is necessary to perform multiple calls to execute the Simulink model. And the higher the required accuracy of determining the parameters (that is, the smaller the sampling step should be in calculations), the more computer time is required. The use of GA for optimization allows us to solve this problem: the time spent on determining the tuning parameters of the regulators is much less. Figure 4 shows the results of determining the optimal parameters using GA. Since the search for the parameters k р , and T i , which provide a minimum to the functional J = f(k р , T i ), is carried out, we considered the vector of parameters X = (k р , T i ) as an "individual". At each step of the GA operation, a set of individual solutions is considered: the vector of parameters X and the corresponding value of the criterion J = f(k р , T i ). The initial population is formed using a random number generator. Then GA was applied and the best solutions were selected. The parameter values were selected from the ranges ] 1 ; . The use of specialized graphical functions of the Global Optimization Toolbox allowed us to track the optimization progress. In figure 4a, we see the dynamics of changes in the quality criterion for the best individuals and the population averaged over all individuals: starting from the 5th population, the algorithm converges to a solution. In figure 4b shows the best individual in the form of bar graphs of the elements of the vector of optimal parameters X = (k р , T i ). In figure 4c shows the change in the average distance between individuals in the populations of the considered generations to minimize the criterion J. As can be seen, the scatter is significant, which indicates a large size of the considered space during the search. In addition to specialized GA graphs in figure 4d shows the transient processes of the control loop with the obtained optimal parameters. When comparing figure 3 and figure 4d shows that when tuning with the GA, the transient processes differ insignificantly, providing a quality of control close to optimal.
To study the possibilities of using the genetic algorithm, we will consider the process of optimizing the controller parameters for several (15) implementations. The optimizations results are shown above (see figure 3 -the graph of functional J and figure 4d -one of the implementations in the optimization using GA). We presented the obtained 3-dimensional graph of the quality functional J = f(k р , T i ) on an enlarged scale (figure 5) and superimposed the results of optimization using GA on it. Here, individuals of the genetic algorithm (the results of optimization calculations) are shown as asterisks. The figure 5 shows that the quality functional J is less sensitive to a change in the integration constant (we see a flat section of the graph surface) than to a change in the gain k р . In this regard, the found coordinates of the optimal parameters are located along the T i axis, while the value of k р in most cases changes insignificantly. This result allows us to understand why, when the time constant changes over a wide range ( ] 190 ; 110 , good control quality is ensured. Table 1 shows the values of the PI-controller parameters obtained as a result of optimization. The parameters of the dynamic characteristics of the control object were varied to simulate changes in operating conditions.

The discussion of the results
If we consider the obtained three-dimensional graph in figure 5, we will see that the dependence of the quality functional J = f (k р , T i ) contains local minima and is nonlinear. This is due to the fact that the calculation of the functional is performed under the action of perturbations on the object, as well as the presence of nonlinearity in the system. Therefore, to minimize the functional and determine the optimal parameters of the system, it is effective to use a genetic algorithm (instead of, for example, gradient optimization methods that require an analytical expression for the considered functional). Transient plots in GA tuned systems illustrate that the systems provide good quality control. In addition, it should be noted that the use of the developed optimization procedure makes it possible to expand and supplement table 1 (containing the recommended parameter values) at the stage when we design the process control system.

Conclusion
To obtain the optimal settings for the controllers, model studies were carried out, and the parameters of the object were changed in the ranges determined by the regulations of technological processes. We varied the dynamic characteristics of the facility to simulate changes in operating conditions. As a result of the conducted research, we obtained the values of the parameters of the control loops that can be recommended for use. We investigated the possibilities of using a genetic algorithm to determine the parameters that will ensure the optimal functioning of the system according to the selected criterion. As a result, the suitability of using GA for optimization was confirmed if the system performance indicator is a nonlinear, non-differentiable function with local extrema.