#### Abstract

To solve the difficulty in selecting the crossover probability and mutation probability in genetic algorithms, a fuzzy immune algorithm based on adaptive estimation of crossover probability and mutation probability in a fuzzy reasoning system is proposed, and it is used in the parameter optimization design of a two-degree-of-freedom PID controller. According to the experiment and simulation results, classic genetic algorithm evolution tends to halt after 37 generations, with a fitness value of 7.135, whereas fuzzy genetic algorithm evolution tends to stop after 20 generations, with a fitness value of 7.486. The 2-DOF PID controller that was created can give the system strong target value following and interference suppression features at the same time.

#### 1. Introduction

The actual PID control system has two sets of optimal tuning parameters: the optimal setting and tracking parameters and the optimal interference suppression parameters. The typical PID controller can only alter one set of PID parameters. If the PID settings are changed based on the disturbance suppression characteristics, the target tracking quality will suffer. If the PID settings are changed based on the target tracking characteristics, the interference suppression properties will degrade. As a result, in actual system design, the compromise method is usually used to select the PID parameters, making it difficult to get the best control effect. A two-degree-of-freedom PID controller is devised and frequently utilized in the practical system to resolve this issue. By setting two sets of PID parameters independently, the two-degree-of-freedom PID controller can achieve the optimal target tracking and interference suppression characteristics at the same time. Due to the need to set two sets of PID parameters, the difficulty of engineering design is increased [1]. In recent years, artificial intelligence (AI) structures based on combination learning have been developed, including neural networks, fuzzy control, evolutionary computing, and immunity network structures [2, 3]. The two-degree-of-freedom PID control is integrated with the neural network’s self-learning function, and the two sets of parameters for the two-degree-of-freedom PID are acquired by self-learning the weight of the neuron. In this way, the problem of parameter self-tuning is not only solved, but also has the ability of self-adaptation. Even if the object changes within a certain range, it can be well controlled. However, the parameters of neuron 2-DOF PID controller, neuron learning rate and neuron proportionality coefficient, often need to be qualitatively adjusted according to the response curve, so the problem of parameter tuning has not been completely solved [4]. In practice, the controller parameter tuning process can be changed into an optimization process, and the PID controller optimization parameters can be obtained using the optimization approach. The controller’s settings are optimized using a genetic algorithm, and an enhanced genetic algorithm is proposed to address the general genetic algorithm’s shortcomings. However, the hybridization probability Pc and mutation probability Pm of the above genetic algorithms often adopt fixed values or fixed functions to adjust the parameters. However, it is very difficult to determine an appropriate Pc and Pm: when large values are used, good individuals may be destroyed, and the genetic algorithm turns arbitrary search algorithm, which destroys the stability and robustness of the algorithm, whereas when a smaller value is adopted, the algorithm will lose its ability to maintain population diversity, leading to premature convergence of the algorithm and falling into local solutions [5]. They are frequently used in industry for a range of tasks such as issue prediction, fault diagnostics, centralized management, energy management, production management, and computer engineering, to mention a few [6, 7]. By combining fuzzy logic reasoning method with genetic algorithm, an adaptive genetic algorithm formed on fuzzy reasoning is projected. Fuzzy set theory is used to define the fuzzy mapping connection with the values of Pc and Pm and various influencing factors. The genetic algorithm must first establish parameters that affect its operators before it may operate. Parameters to consider include the number of iterations, population size, number of variables, number of bits for coding a variable, crossover probability Pc, mutation probability Pm, degree of elitism, and upper and lower bounds. To accelerate the rate of genetic evolution, fuzzy self-adjustment of hybrid probability Pc and mutation probability Pm are realized. The modified genetic algorithm is used to tune the parameters of a two-degree-of-freedom PID controller, and the results of a control simulation and experiment for a typical delay system validate the utility of the proposed method [8]. PID control is used to combine the two-degrees-of-freedom concept, the neural network’s identity ability, and the two sets of variables for the two-degrees-of-freedom. To address this issue, a two-degree-of-freedom situation was created, and a PID controller was devised, which is now widely utilized in real-world systems. By separately constructing two sets of PID parameters, the two-degree-of-freedom PID controller may accomplish the best required monitoring and interference suppression features. In reality, the controller parameter tuning process may be transformed into an optimization process, and the PID controller optimization parameters can be discovered using this method [9].

Industrial intelligent control is a latest invention that employs intelligent system technologies to control machinery. This technology is interdisciplinary, with roots in system control, control theory, artificial intelligence, computer and signal processing, and other fields [10, 11]. In terms of engineering control algorithms, the fuzzy immune method is straightforward, dependable, and simple to implement. However, the stability and dynamics of standard fuzzy immunity algorithms have not been fully shown for nonlinear systems. It is also hard to monitor properly throughout the whole input range for broad input devices. With the fast development of processors in latest years, the miniaturization of ×86 platforms, and the popularity of GPU, it has become possible to run large computational algorithms on small mobile platforms [12]. At the same time, with the re-emergence of deep neural network frameworks and the rapid development of deep learning frameworks such as TensorFlow, Caffe, MXNet and Torch, the deployment of deep neural network algorithms is becoming more and more convenient. The combination of a PID controller and a linear quadratic regulator was proposed by Mohammadi Asl et al. The fuzzy switch module is used to combine the two controllers in the most efficient way possible. The member functions of the fuzzy module are optimized by a new adaptive version of the charging system search algorithm. The algorithm updated at the time to find a more appropriate solution more quickly. The simulation results of a unicycle robot under disturbance are shown to demonstrate the efficiency of intelligent controller design [13]. Fuzzy logic was the first intelligent system method in terms of time. Later came neural, neuro-fuzzy, and evolutionary systems, as well as their variants. Each approach opens up new possibilities, improving the versatility and applicability of intelligent systems in an ever-expanding spectrum of industrial applications [14, 15]. Sahu et al. suggested a modification strategy termed modified sine and cosine algorithm to tune the gain parameters of the aforementioned fuzzy controller to reach near-optimal gain values (M-SCA) [15]. The proposed modified algorithm is derived from the original sine and cosine algorithm by upgrading and updating a few equations, which may balance the algorithm’s exploration and consumption levels and improve the updating quality of the iteration. The suggested fuzzy controller goes through various sensitivity analyses at the final observation level, which are assessed with various changes in system parameter settings and varied load situations. The proposed M-SCA-tuned fuzzy-assisted PID controller is compared to traditional I, PI, and PID controllers for controller topmost analysis, and it is discovered that the recommended M-SCA-tuned fuzzy-assisted PID controller outperforms the traditional I, PI, and PID controllers by various offsets in AGC analysis response. Finally, ten system units were tested in five locations to demonstrate the majority of the requirements and maximum heights of the proposed technique while accounting for several physical nonlinear constraints such as generation rate constraints, governor dead zones, boiler dynamics, and time delays [16]. Significant progress has been achieved in two technology fields over the last decade or so: fuzzy logic (FL) and neural networks (NNs) [17]. There has been a lot of interest in the application of fuzzy neural network (FNN) systems in recent years, which combine the potential of fuzzy reasoning to handle variable only with the capability of creating the model to learn from processes, to deal with nonlinear systems, and to deal with unpredictability in control systems [18, 19]. The position control of a servo motor utilizing a PID controller and soft computing optimization approaches was explored by Ravi and Viswanadhapalli in industry, and PID controllers are commonly employed. Distinct approaches can be used to adjust the PID controller. To control the position of DC servo motors, the Z-N tuning approach and soft computing approaches such as genetic algorithm (GA) and particle swarm optimization (PSO) are used. When compared to the traditional tuning method (Z-N), the soft computing method (GA, PSO) results show that soft computing technology beats the traditional PID tuning strategy [20]. The suggested improved method is based on the original sine and cosine algorithm, with a few equations upgraded and updated to balance the algorithm’s investigation and consumption levels as well as improve the iteration’s current quality. At the last inspection level, the proposed fuzzy controller goes through multiple sensitivity studies, which are evaluated with various changing system parameter settings and various load scenarios. There has been a surge of attention in the use of FNNs to handle variables only with the potential of creating a model to learn from operations in recent years [5].

#### 2. Research Methods

##### 2.1. 2-DOF PID

In 1963, American Issac M. Horowitz was the first to introduce the concept of two degrees of freedom into the PID control system, presenting eight alternative two degrees of freedom PID control structures, four of which are regarded to have industrial application value. One, value filter type (filter type), two, value feed forward type (FF type), three, value feedback compensation type (FB type), and four, value loop compensation type (loop compensation type) (loop type). As a result, this research focuses on parameter optimization for the feed forward (FF) 2-DOF PID controller. The structural block diagram of the feed forward two-degree-of-freedom PID control system is shown in Figure 1.

To:

Then is the transfer function of the main controller, and is the transfer function of the feed forward compensator. The transfer function of perturbation *D* to output *Y* is:

The transfer function from the given value *R* to the output value *Y* is:

It can be seen that if is adjusted as an ideal value, that is the disturbance suppression characteristics reach the best, only parameters of need to be adjusted; so if is kept constant, as long as is adjusted to make reach the optimum, the given tracking characteristics can also be ensured to reach the optimum, which is the benefit of a PID with two degrees of freedom [21].

Proportional (*P*), integral (*I*), and derivative (*D*) are the three parameters that a PID controller uses to govern a process (*D*). There are two groups of traditional 3-DOF PID parameters that must be modified (6 in total, including 5 feed forward parameters in this research), and the difficulty of parameter tuning induced by parameter correlation may be expected. This is also the primary reason for the limited popularity of classic 2-DOF PID that must be changed, as well as the difficulty of parameter tuning caused by parameter correlation. This is also the main reason for the limited popularity of traditional 2-DOF PID.

This is also the main reason why the popularization of conventional 2-DOF PID is limited. At present, the methods to realize conventional 2-DOF PID mainly include: the first is incomplete 2-DOF PID, such as P-PID, PI-PID, etc., which reduces the parameters to 5 or 4; the second one is a two-degree-of-freedom PID with one set of parameters fixed and the other set of parameters set. The fixed parameters are obtained in advance by simulation or empirical method, and only one set of parameters need to be set on-site. The third type is the self-tuning two-degree-of-freedom PID, which is currently the most sophisticated two-degree-of-freedom PID, with features like PID parameter self-tuning using a neural network, a genetic algorithm, and so on. This study mainly studies the latter.

##### 2.2. Fuzzy Genetic Algorithm

A genetic algorithm is a computational model of biological evolution. Genetic algorithms are useful as problem-solving search strategies as well as models for evolutionary systems. In genetic algorithms, binary strings are stored in a computer’s memory and modified over time, exactly as populations of animals evolve through natural selection. Despite the fact that the computational context is considerably condensed when compared to the natural universe, genetic algorithms are capable of producing incredibly complicated and interesting structures [22–24]. Genetic algorithms (GAs) are efficient parallel global search algorithms for problem-solving. The application of genetic algorithm to seek the optimal solution generally includes three basic operations: selection, crossover, and variation. Among them, crossover and mutation are two key activities that have a significant impact in ensuring that the optimization process of GAs can converge to the global optimal advantage and improving the convergence speed of the optimization process. At present, there are variety of crossover and mutation operation forms, but most of them are fixed, that is crossover probability *A* and mutation probability are constant. However, studies show that when and are constants, it is often not conceivable for GAs to uniformly examine for the best result in the optimization space, nor can it adapt to the requirements of different situations in the optimization process, thus affecting the optimization performance of GAs. There is no unified principle at present on how to choose and . A large number of experiments show that besides the fitness function value (fit-ness), the factors affecting and are the current genetic algebra (CN) and the algebra (Kgn) where the maximum fitness function value remains unchanged.

CN represents the stage to which GAs has evolved. CN is very small, indicating that GAs is just beginning, larger and should be adopted to enlarge the search scope and maintain the diversity of the group. When CN is large, it indicates that the evolution of GAs is near the end, and smaller and should be adopted to prevent the destruction of superior individuals. Kgn represents the optimization effect of the current generations. When Kgn is very small, it indicates that a breakthrough has been made in optimization, and and should be appropriately reduced. When Kgn is large, it indicates that the optimization progress is slow, and and should be increased to strengthen the search. The above analysis shows that CN and Kgn are fuzzy quantities that are difficult to express with precise quantities, and the relationship between various factors is intricate, making it difficult to employ an accurate mathematical formula to describe them. In order to realize the adaptive adjustment of crossover probability and mutation probability , this study establishes the fuzzy mapping relationship between the precise input and the fuzzy variable. Fuzzy reasoning and clarification are carried out using the membership function, that is fuzzy decisions are taken to produce exact output, namely the adjustment coefficients and of and are obtained [25].

2.2.1. Quantization of Input Variables and Output VariablesFor the genetic operator adjustment problem, the input variables are CN/N, Kgn/N (*N* represents the total evolutionary algebra), and the range of variation is [0, 1], (0.02, 0.1) respectively. The output variables are and , with the range of [0.4, 0.99] and [0.01, 0.1], respectively. The quantization level of variables is 3 [0, 1, 2], and uniform quantization is adopted. Table 1 presents the quantization of variables.

###### 2.2.1. Membership Function of Fuzzy Set

The membership function of their fuzzy set is quantitatively given for input variables CN/N and Kgn/N and output variables and , as shown in Table 2.

2.2.3. Fuzzy Inference RulesThe fuzzy inference rules for the adjustment of genetic operators in the process of genetic evolution may be generated using the foregoing fuzzy analysis of the factors impacting genetic operator adjustment, as seen in Table 3.

###### 2.2.2. Clarification of Fuzzy Variables

The fuzzy quantity achieved above through fuzzy reasoning is the fuzzy quantity, whereas the actual control must be the clear quantity. Therefore, to convert the fuzzy quantities and into the corresponding clarity quantities, the center of gravity method was used.

In summary, the specific implementation steps of fuzzy GA are as follows: *Step 1*. Initialize related parameters, namely, Initialization code length, population size popsize, shutdown criteria, the maximum value of the optimization target , initial algebra T = 0, maximum evolution algebra , , initial crossover probability , and mutation probability . *Step 2*. Generate initial population Generate popsize initial chromosome that meets the constraint conditions, , popsize. and are the minimum and maximum values of the KTH chromosome. *Step 3*. Analyze the appropriateness value and sequence the individual to decode the of each stain. If the chromosome violates the constraint conditions, set its fitness value to 0 to be eliminated; otherwise, the fitness value is its decoding value. The chromosomes were sequenced according to the fitness value. *Step 4*. Genetic operation: ① Selection operation adopts proportional selection method to perform selection operation, forming the parent generation of population size as popsize. ② Intersection and operation of each selected chromosome calculation, according to CN/N and Kgn /N fuzzy reasoning, to find the current and , the current , . Record the current generation of CN and Kgn. Two new child individuals are produced by hybridization of the two individual pairs according to crossover probability (i.e., part of the code in the interchange string). ③ Mutation operation randomly selects an individual in the population and changes the value of a character in the string with the mutation probability to get a new individual. *Steps 5.* Stop when the individual optimal value of the current group reaches the optimal index or the evolutionary algebra reaches . Otherwise, let *T* = *T* + 1 and go to Step 3 [26].

##### 2.3. Fuzzy Genetic Optimization Design of Two-Degree-of-Freedom PID Controller

As can be seen from Figure 1, the feed forward two-degree-of-freedom PID controller needs to set 5 parameters, namely , , , , and . Make , , , , and . The corresponding codes were selected as: 16 bit, 16 bit, 8 bit, 8 bit, and 8 bit. As a means of achieving good dynamic characteristics, the absolute error time integral performance index is employed as the minimal goal function for parameter selection. To avoid excessive control energy, the square term of control input is added to the objective function, and equation (5) is chosen as the optimum index for parameter selection:where *e*(*t*) is the system error, *u*(*t*) is the output of the controller, and and are the adjusting weights of the components of the control quantity and error in the index [27]. The fitness function of genetic algorithm is as follows:

#### 3. Result Analysis

##### 3.1. Simulation Research

This method is applied to the temperature control system of a tunneling furnace to verify its effectiveness. According to the model of the controlled object, as shown in equation (6), the link of first-order inertia plus pure lag is as follows:

The simulation parameters are selected as follows:

= 0.99, = 0.01, initial crossover probability = 0.8, initial mutation probability = 0.02, and an initial population of 20 with maximum evolutionary algebra . The system input is *R* (*t*) = 5 × 1(*t*), 1(*t*) is the unit step input, and the disturbance input is *D* (*t*) = 1 × 1(*t* − 90). Figure 2 shows the Simulink model of the control system. The traditional genetic algorithm and fuzzy genetic algorithm were used for simulation. Figure 3 shows the simulation results, and genetic algorithm population evolution process is shown in Figure 4.

**(a)**

**(b)**

The basic genetic algorithm sets the following parameters for the two-degree-of-freedom PID controller:

The fuzzy genetic algorithm is used to set the parameters of the two-degree-of-freedom PID controller as follows:

The proposed fuzzy genetic algorithm is used to improve the settings of the single-DOF PID controller in order to compare the effectiveness of the proposed method. The parameters are identical to those of the two-DOF PID controller, with the exception of two optimization parameters. Figure 3 shows the simulation results in curve 3. The following are the parameters of a single-degree-of-freedom PID controller set by a fuzzy genetic algorithm:

The system response under the 2-DOF PID control set by the fuzzy genetic algorithm is proposed in curve 1 in Figure 3, and curve 2 shows the system response under the two-degree-of-freedom PID control set by the traditional genetic algorithm. Compared with the two calibration curves, it can be seen that the control effect of the former is obviously superior to that of latter, with rapid response speed and no overshoot. The fuzzy genetic algorithm proposed in curve 3 sets the system response under single-degree-of-freedom PID control. When compared to curve 1, it is clear that: under single-degree-of-freedom PID control, the system overshoot is considerable and the interference suppression process is lengthy, indicating the superiority of the two-degree-of-freedom PID controller. By comparing Figures 4(a) and 4(b), it is clear that the evolution rate of the fuzzy genetic algorithm is faster than that of the traditional genetic algorithm, and that the index acquired by the fuzzy genetic algorithm is greater. The evolution of traditional genetic algorithm tends to stop after 37 generations, and the fitness value is 7.135, while the evolution of fuzzy genetic algorithm tends to stop after 20 generations, and the fitness value is 7.486.

##### 3.2. Experimental Study

With the intention to further validate the effectiveness of the method, a set of temperature control experimental system is designed, and the system structure is shown in Figure 5. Among them, ADAM4016 is the key component, which sends a 3-way switch signal to control the 3 solid-state relays. The solid-state relay controls the actual power of the heating body by controlling the on-off of the AC power supply. The heating body is composed of two 20W soldering iron heads tightly bound together. The temperature sensor is PT100. The temperature signal is changed from the integrated transmitter to the current signal, 0∼200°C corresponds to 4∼20 mA. The transmitter can also display the temperature of the heating element in real time. In order to make the temperature of the heating element reduced quickly at some time, a fan is installed on the surface of the heating element. If you need to exert certain interference to the control, you can press the button switch of the fan to cool the heating element.

The corresponding control software is compiled using BorlandC++3.1 under the DOS7.0 operating system, and the single-degree-of-freedom PID control algorithm based on fuzzy genetic algorithm, the two-degree-of-freedom PID control algorithm based on basic genetic algorithm, and the two-degree-of-freedom PID control algorithm based on fuzzy genetic algorithm are all realized. The system’s set temperature is 40°C, and the experimental results are depicted in Figure 6.

Curve 1 shows the system response under two-degree-of-freedom PID control, curve 2 shows the system response under two-degree-of-freedom PID control set based on the traditional genetic algorithm, and curve 3 shows the system response under single-degree-of-freedom PID control adjusted by the fuzzy genetic algorithm proposed in curve 3. A conclusion similar to the simulation results can be obtained by comparing the two curves, which verifies the effectiveness of the method.

#### 4. Conclusions

A fuzzy genetic algorithm-based parameter optimization method for two-degree-of-freedom PID controllers is proposed, which addresses the problem of challenging parameter tuning in standard two-degree-of-freedom PID controllers. The experimental and simulation results are good. The improved genetic algorithm not only has the advantages of simple operation, wide adaptation, and good robustness of the basic genetic algorithm, but also has faster convergence speed and higher efficiency, which is a parameter optimization method suitable for engineering applications. Classic genetic algorithm evolution tends to terminate after 37 generations, with a fitness value of 7.135, whereas fuzzy genetic algorithm development tends to halt after 20 generations, with a fitness value of 7.486, according to the experiment and simulation data. The system may benefit from the 2-DOF PID controller’s strong target value following and interference suppression characteristics at the same time.

#### Data Availability

The data are available from the corresponding author upon request.

#### Conflicts of Interest

The authors declare that there are no conflicts of interest.