# Parameter Tuning of PID Controller for Beer Filling Machine Liquid Level Control Based on Improved Genetic Algorithm

Authors: Liqing Xiao
Journal: Computational Intelligence and Neuroscience
 (2021)

---

## Abstract

Parameter tuning of PID controller for liquid level control of beer filling machine was studied in this paper, which can meet the demand of accurate controlling in beer production and improve the rapidity under the same conditions. Firstly, an improved genetic algorithm was proposed which has been verified by eight kinds of test functions. Simulation results revealed that, in comparation with other modified particle swarm optimization algorithm and modified genetic algorithm, the algorithm proposed in this work is not only capable to improve the convergence speed and precision under the same experimental conditions but also to improve the probability to converge to the optimal value. Finally, the proposed algorithm was applied to the parameter tuning of the PID controller of beer filling machine for liquid level control. Superior property had been obtained, which implied an effective improvement in the rapidity with the premise of steady-state error exclusion.


---

## Body

## 1. Introduction

Usually, in order to improve the performance of the control systems, various measures need to be taken [1, 2]. PID controller has been widely employed in control systems due to its basal principle, excellent robustness, and considerable reliability [3–7]. Nevertheless, the controlling performance of PID controller relies on the value selection of scale coefficient, integral coefficient, and differential coefficient. With the purpose to improve the performance of the control system as possible, the parameter tuning of PID controller has become one of the research hotspots currently [8–10].The quantization factor and scaling factor were iteratively optimized in the offline state by using particle swarm optimization algorithm approach to adjust the fuzzy PID parameters rapidly, and the control system was simulated and analyzed by MATLAB, which has been reported in pervious literature [11]. Furthermore, Gao et Al. proposed a new objective function construction method according to the control system overshoot based on the conventional genetic algorithm to realize the parameter optimization of PID [12]. As presented in literature [13], aiming to overcome the shortages of the traditional quantum genetic algorithm, Jian-xin FENG et al. had addressed the premature problem of the traditional quantum genetic algorithm and improved the convergence speed through the following five aspects including coding method, population initialization, quantum revolving gates, quantum mutation, and the increase of quantum catastrophe. The optimized algorithm presented above had been applied to the parameter optimization of fuzzy self-tuning PID controller. Moreover, in order to deal with the complexity of parameter tuning of the fractional-order PID controller, Su WANG et al. had introduced the chaotic perturbation into the Beetle Antennae Search algorithm and promoted a parameter tuning approach of fractional-order PID controller to enhance optimization performance of algorithm according to the random perturbation of individual positions resulted from the logistic mapping formula [14]. As known that, BAS had been challenged by the local optimum and low precision due to its prematurity, Shijiao SHAN et al. had integrated the efficient BAS algorithm with the traditional bat algorithm and used it for the PID parameter optimization to achieve a faster response [15]. In addition, aiming at the problem of oscillation caused by excessive selection of learning rate in the learning process of the traditional BP neural network, Huangshui HU et al. had proposed a new adaptive tuning algorithm for PID parameters of BP neural network to alleviate the oscillation phenomenon effectively and accelerate the convergence speed of the algorithm [16].. The convergence speed and stability of the genetic algorithm were improved in literature [17] to realize the online adjustment of PID control parameters with the optimized initial weight of BP neural network employed. Liu and Chen [18] presented tuned PID parameters with high convergence accuracy and fast convergence speed by using cellular genetic algorithm (CGA). Cao and Feng [19] designed an adaptive fuzzy PID controller based on particle swarm optimization algorithm according to the urban rail train braking model. Ye [20] improved the searching ability of the particle swarm optimization algorithm by adjusting the adaptive inertia factor, which has been applied to adjust the PID parameters of the temperature control system of injection molding machine online and further improve the control accuracy. Considering the limitations of the conventional PID controller, Zhao and Fu proposed a scheme combining the fuzzy system and BP neural network [21]. Meanwhile, whale optimization algorithm (WOA) was adopted for further optimization in the improvement of dynamic performance and steady-state accuracy of the control system.


## 2. Improved Genetic Algorithm

The improved genetic algorithm refers to the random division of variable interval according to the setting interval number, while the initial population is generated according to the fitness value of the midpoint of the interval and roulette wheel selection. In the iterative process of the algorithm, the PSO algorithm was introduced into the crossover operation according to the probability. The individual with the lowest fitness value would be substituted by random individuals generated via the same method in developing the population.


### 2.1. Flow Diagram of Improved Genetic Algorithm

Step 1: setting the parameters in the improved genetic algorithm, including population numbers, interval numbers, maximum iterations, crossover probability, mutation probability, introduction probability of particle swarm optimization algorithm, learning factor, maximum inertia weight, minimum inertia weight, allowable error, etc.Step 2: dividing the variable intervals randomly according to the interval number settings in Step 1 and substituting the midpoint of the intervals into the fitness function of the algorithm to estimate the fitness value. On this basis, according to the algorithm parameters set in Step 1 and the roulette selection, the initial population of the algorithm has been generated.Step 3: calculating the fitness value of each individual among population to evaluate each individual and to complete the selection operation.Step 4: executing the crossover operation according to the crossover probability and the introduction probability of the particle swarm optimization algorithm which has been set in Step 1. The particle swarm optimization algorithm updates the speed and position abiding to equation (1).(1)Vik+1=ω×Vik+c1×rand1×pbesti−Xik+c2×rand2×gbestg−Xik,Xik+1=Xik+Vik+1,where the optimum algorithm population, global optimum, speed, and position of population size were denoted aspbesti, gbestg, V, and X, respectively. k referred to the iterations of the improved genetic algorithm, while c1 and c2 referred to the learning factors. rand1 and rand2 represented the random numbers uniformly distributed within (0, 1).The inertia weight has been labeled asω, which diminished with four different strategies associated to the probability to enhance the optimization ability during the iterative process in improved genetic algorithm, as revealed in equations (2)–(5) [22].(2)ω=ωmax−eramaxe⋅ωmax−ωmin,(3)ω=ωmin+ωmax−ωmin⋅maxe−eramaxe2,(4)ω=ωmin+ωmax−ωmin⋅maxe−eramaxe3,(5)ω=ωmin+ωmax−ωmin⋅maxe−eramaxe4.The maximum and minimum of inertia weights were marked asωmax and ωmin, where maxe and era represented the maximum and the current number of iterations in the improved genetic algorithm, respectively.Step 5: executing mutation operation according to the mutation probability set in Step 1.Step 6: calculating the fitness value for each individual in population and generating a random individual with the same method in generating the initial population of the algorithm described in Step 2, which would be used to substitute the individual with the lowest fitness value at present.Step 7: determining whether the termination condition of the algorithm has been met based on the number of iterations and the allowable error of the algorithm. And the algorithm would terminate or skip to Step 3 for cyclic calculation.


### 2.2. Experimental Results of Improved Genetic Algorithm

In order to verify the performance under the same experimental conditions, the improved genetic algorithm had been applied to the optimization of eight different kinds of typical test functions. The simulation experimental environment is MATLAB R2009 B version, in which numbers including 50 in the population of the algorithm, 12 in the number of intervals, 200 in the maximum number of iterations, 0.90 in the crossover probability, 0.01 in the mutation probability, 2 × 10−15 in the allowable error, 0.5 in the introduction probability of particle swarm optimization algorithm, and 0.90 and 0.10 in the maximum and minimum inertial weight, respectively, had been set. Different algorithms had been run 100 times each.The expressions of the eight kinds of test functions had been demonstrated in equations (6)–(13), and corresponding function images are given in Figure 1. The average convergence curves of different algorithms are presented in Figure 2 with the average convergence precision of different algorithms shown in Table 1. The average convergence algebras and the probabilities of convergence to the optimal value are compared in Tables 2 and 3 .(6)fx1,x2=−20e−1/2x12+1/2x22/5−ecos2πx1+cos2πx2/2+20+e,xi∈−50,50,(7)fx1,x2=x1sinx1+0.1x1+x2sinx2+0.1x2,xi∈−20,20,(8)fx1,x2=x1x2−x1+1.52+x1x22−x1+2.252+x1x23−x1+2.6252,xi∈−30,30,(9)fx1,x2=x12+2x22−0.3cos3πx1−0.4cos4πx2+0.7,xi∈−80,80,(10)fx1,x2=x12−12+x22−22,xi∈−70,70,(11)fx1,x2=7x12−63x1x2+13x22,xi∈−60,60,(12)fx1,x2=1−cos2πx12+x22+0.1x12+x22,xi∈−20,20,(13)fx1,x2=0.5+sin2x12−x222−0.51+0.001x12+x222,xi∈−80,80.Figure 1
Schematic diagrams of test function.
(a)(b)(c)(d)(e)(f)(g)(h)Figure 2
The average convergence curves of different algorithms.
(a)(b)(c)(d)(e)(f)(g)(h)Table 1
Comparison of average convergence precision of different algorithms.
Test functionAlgorithm 1Algorithm 2Algorithm 3Test function 106.9713 × 10−129.8716 × 10−13Test function 25.8970 × 10−113.8843 × 10−54.0453 × 10−5Test function 302.7837 × 10−34.0595 × 10−3Test function 403.8579 × 10−13.3787 × 10−1Test function 508.4037 × 10−53.4528 × 10−4Test function 603.4295 × 10−31.0409 × 10−3Test function 72.1673 × 10−112.0123 × 10−31.5920 × 10−4Test function 801.5393 × 10−34.8283 × 10−3Table 2
Comparison of average convergence algebras of different algorithms.
Test functionAlgorithm 1Algorithm 2Algorithm 3Test function 188159160Test function 2215962Test function 356152161Test function 4110200200Test function 588181197Test function 6111196195Test function 763121136Test function 875175160Table 3
Comparison of probability of convergence to the optimal value of different algorithms.
Test functionAlgorithm 1Algorithm 2Algorithm 3Test function 11008187Test function 2975545Test function 31006757Test function 41005552Test function 51004349Test function 61008382Test function 7946057Test function 81005046Among them, the improved genetic algorithm proposed in this paper was presented as algorithm 1, while algorithm 2 was the modified particle swarm optimization algorithm based on interval algorithm and modified elite strategy, and algorithm 3 belonged to the improved genetic algorithm promoted in literature [22].As revealed from Tables1–3, with the same parameter settings in eight different test functions, the average convergence values of algorithm 1, algorithm 2, and algorithm 3 were 1.008 × 10−11, 4.9460 × 10−2, and 4.3543 × 10−2 with the average convergence algebras of 77, 155, and 159 and average probability of converging to the optimal value of 98.8750%, 61.7500%, and 59.3750%, respectively.It is concluded that compared with algorithms 2 and 3, the improved genetic algorithm proposed in this paper improves the convergence accuracy, the convergence speed, and the probability of convergence to the optimal value of algorithm effectively, which is also implied in Figure2.


## 2.1. Flow Diagram of Improved Genetic Algorithm

Step 1: setting the parameters in the improved genetic algorithm, including population numbers, interval numbers, maximum iterations, crossover probability, mutation probability, introduction probability of particle swarm optimization algorithm, learning factor, maximum inertia weight, minimum inertia weight, allowable error, etc.Step 2: dividing the variable intervals randomly according to the interval number settings in Step 1 and substituting the midpoint of the intervals into the fitness function of the algorithm to estimate the fitness value. On this basis, according to the algorithm parameters set in Step 1 and the roulette selection, the initial population of the algorithm has been generated.Step 3: calculating the fitness value of each individual among population to evaluate each individual and to complete the selection operation.Step 4: executing the crossover operation according to the crossover probability and the introduction probability of the particle swarm optimization algorithm which has been set in Step 1. The particle swarm optimization algorithm updates the speed and position abiding to equation (1).(1)Vik+1=ω×Vik+c1×rand1×pbesti−Xik+c2×rand2×gbestg−Xik,Xik+1=Xik+Vik+1,where the optimum algorithm population, global optimum, speed, and position of population size were denoted aspbesti, gbestg, V, and X, respectively. k referred to the iterations of the improved genetic algorithm, while c1 and c2 referred to the learning factors. rand1 and rand2 represented the random numbers uniformly distributed within (0, 1).The inertia weight has been labeled asω, which diminished with four different strategies associated to the probability to enhance the optimization ability during the iterative process in improved genetic algorithm, as revealed in equations (2)–(5) [22].(2)ω=ωmax−eramaxe⋅ωmax−ωmin,(3)ω=ωmin+ωmax−ωmin⋅maxe−eramaxe2,(4)ω=ωmin+ωmax−ωmin⋅maxe−eramaxe3,(5)ω=ωmin+ωmax−ωmin⋅maxe−eramaxe4.The maximum and minimum of inertia weights were marked asωmax and ωmin, where maxe and era represented the maximum and the current number of iterations in the improved genetic algorithm, respectively.Step 5: executing mutation operation according to the mutation probability set in Step 1.Step 6: calculating the fitness value for each individual in population and generating a random individual with the same method in generating the initial population of the algorithm described in Step 2, which would be used to substitute the individual with the lowest fitness value at present.Step 7: determining whether the termination condition of the algorithm has been met based on the number of iterations and the allowable error of the algorithm. And the algorithm would terminate or skip to Step 3 for cyclic calculation.


## 2.2. Experimental Results of Improved Genetic Algorithm

In order to verify the performance under the same experimental conditions, the improved genetic algorithm had been applied to the optimization of eight different kinds of typical test functions. The simulation experimental environment is MATLAB R2009 B version, in which numbers including 50 in the population of the algorithm, 12 in the number of intervals, 200 in the maximum number of iterations, 0.90 in the crossover probability, 0.01 in the mutation probability, 2 × 10−15 in the allowable error, 0.5 in the introduction probability of particle swarm optimization algorithm, and 0.90 and 0.10 in the maximum and minimum inertial weight, respectively, had been set. Different algorithms had been run 100 times each.The expressions of the eight kinds of test functions had been demonstrated in equations (6)–(13), and corresponding function images are given in Figure 1. The average convergence curves of different algorithms are presented in Figure 2 with the average convergence precision of different algorithms shown in Table 1. The average convergence algebras and the probabilities of convergence to the optimal value are compared in Tables 2 and 3 .(6)fx1,x2=−20e−1/2x12+1/2x22/5−ecos2πx1+cos2πx2/2+20+e,xi∈−50,50,(7)fx1,x2=x1sinx1+0.1x1+x2sinx2+0.1x2,xi∈−20,20,(8)fx1,x2=x1x2−x1+1.52+x1x22−x1+2.252+x1x23−x1+2.6252,xi∈−30,30,(9)fx1,x2=x12+2x22−0.3cos3πx1−0.4cos4πx2+0.7,xi∈−80,80,(10)fx1,x2=x12−12+x22−22,xi∈−70,70,(11)fx1,x2=7x12−63x1x2+13x22,xi∈−60,60,(12)fx1,x2=1−cos2πx12+x22+0.1x12+x22,xi∈−20,20,(13)fx1,x2=0.5+sin2x12−x222−0.51+0.001x12+x222,xi∈−80,80.Figure 1
Schematic diagrams of test function.
(a)(b)(c)(d)(e)(f)(g)(h)Figure 2
The average convergence curves of different algorithms.
(a)(b)(c)(d)(e)(f)(g)(h)Table 1
Comparison of average convergence precision of different algorithms.
Test functionAlgorithm 1Algorithm 2Algorithm 3Test function 106.9713 × 10−129.8716 × 10−13Test function 25.8970 × 10−113.8843 × 10−54.0453 × 10−5Test function 302.7837 × 10−34.0595 × 10−3Test function 403.8579 × 10−13.3787 × 10−1Test function 508.4037 × 10−53.4528 × 10−4Test function 603.4295 × 10−31.0409 × 10−3Test function 72.1673 × 10−112.0123 × 10−31.5920 × 10−4Test function 801.5393 × 10−34.8283 × 10−3Table 2
Comparison of average convergence algebras of different algorithms.
Test functionAlgorithm 1Algorithm 2Algorithm 3Test function 188159160Test function 2215962Test function 356152161Test function 4110200200Test function 588181197Test function 6111196195Test function 763121136Test function 875175160Table 3
Comparison of probability of convergence to the optimal value of different algorithms.
Test functionAlgorithm 1Algorithm 2Algorithm 3Test function 11008187Test function 2975545Test function 31006757Test function 41005552Test function 51004349Test function 61008382Test function 7946057Test function 81005046Among them, the improved genetic algorithm proposed in this paper was presented as algorithm 1, while algorithm 2 was the modified particle swarm optimization algorithm based on interval algorithm and modified elite strategy, and algorithm 3 belonged to the improved genetic algorithm promoted in literature [22].As revealed from Tables1–3, with the same parameter settings in eight different test functions, the average convergence values of algorithm 1, algorithm 2, and algorithm 3 were 1.008 × 10−11, 4.9460 × 10−2, and 4.3543 × 10−2 with the average convergence algebras of 77, 155, and 159 and average probability of converging to the optimal value of 98.8750%, 61.7500%, and 59.3750%, respectively.It is concluded that compared with algorithms 2 and 3, the improved genetic algorithm proposed in this paper improves the convergence accuracy, the convergence speed, and the probability of convergence to the optimal value of algorithm effectively, which is also implied in Figure2.


## 3. Parameter Tuning of PID Controller for Liquid Level Control of Beer Filling Machine

### 3.1. Mathematical Modelling

Considering of the balance between inflow and outflow volume of liquid, the height of liquid level (H), the cross-sectional area of the liquid storage tank (A), and the inflow (Q1) and outflow (Q2) liquid obey the equation as follows [23, 24]:(14)AdHdt=Q1−Q2,which can be rewritten in the following form of increment:(15)AdΔHdt=ΔQ1−ΔQ2.To simplify the mathematical model of the control system, we assumed that the outflow increment was proportional to the liquid level increment and was inversely proportional to the valve resistance of the load valve, which has been shown in the following equation [23, 24]:(16)ΔQ2=ΔHR2.Based on equations (14) and (16),(17)RAdΔHdt+ΔH=RΔQ1.By using Laplace transformation, we get(18)Gs=HsQ1s=RRAs+1=KTs+1.Considering the hysteresis of liquid level changes in realistic engineering problems, the liquid level control system can be approximately seen as a first-order inertial hysteresis system with the transfer function shown in the following equation [23, 24]:(19)Gs=HsQ1s=KTs+1e−τs,where K, T, and τ are defined as 5, 160, and 3 in this paper.


### 3.2. Stability Analysis of Control System

Stability laid the foundation for the operation of the control system. Hence, it is a priority to determine the stability of a certain control system. Since the control system consisted of a nonlinear delay part, the analysis of stability has to be realized via the observation of the unit step response curves and calculation of the amplitude and phase angle margin of a control system, instead of the Routh–Hurwitz stability criterion. The unit step response curve of the control system is shown in Figure3, and the Bode diagram is shown in Figure 4.Figure 3
The unit step response curve of the control system.Figure 4
Bode plot of control system.Figure3 illustrates the convergence in unit step response curve of the control system. The amplitude margin of the control system (24.5dB) and the phase angle margin (96.3°) were both larger than zero, as shown in Figure 4, which confirmed the stability of the control system.


### 3.3. Parameter Tuning of PID Controller

In order to improve the performance of the control system, algorithms 1, 2, and 3 have been employed to correct PID controller parameters, and the fitness function is shown in the following equation:(20)FX=1ts+10×σ%PX,where X represented the variate of proportional coefficient (KP), integral coefficient (KI), and differential coefficient (KD) of the PID controller. ts, σ% were denoted as the adjustment time and overshoot of the control system, respectively. PX referred to the penalty function. Thus, the expression is shown in the following equation:(21)PX=1,ifess<10−10,0,ifess≥10−10,where ess is the steady-state error of the control system.The convergence curves of algorithms 1, 2, and 3 are presented in Figure5. Figure 6 shows the unit step response curves of the control system corresponding to the optimal results. Performance indexes of the control system are shown in Table 4.Figure 5
Convergence curves of different algorithms with equation (20) as the fitness function.Figure 6
The unit step response curve of the control system with equation (20) as the fitness function.Table 4
Comparison of performance indexes of control system with equation (20) employed as the fitness function.
Performance indexesBefore PID correctionAlgorithm 1Algorithm 2Algorithm 3Steady-state error,ess0.1669000Adjustment time,ts96.752012.731016.302016.4000Overshoot,σ%071.9570102.3144108.0654The steady-state error (ess) of the control system had been eliminated effectively and the adjustment time (ts) of the control system was reduced after PID correction, which were elucidated in both Figure 6 and Table 4. Moreover, among these three types of algorithms, algorithm 1 had been proved to have the most remarkable performance in this paper.However, it also caused a large oscillation which was responsible for a large overshoot. Moreover, fitness function presented in equation (22) can be applied to improve the stability of the control system.(22)FX=1σ%PX.Maintaining the simulation experimental environment and algorithm parameters, the convergence curves of algorithms 1, 2, and 3 are provided in Figure7. The unit step response curves of the control system corresponding to the optimal results are shown in Figure 8.Figure 7
Convergence curves of different algorithms with equation (22) as the fitness function.Figure 8
The unit step response curve of the control system with equation (22) as the fitness function.The overshoot of the control system corresponding to the optimal results for algorithms 1, 2, and 3 was 14.3807%, 20.2146%, and 19.1002%, respectively. For higher requirements in stability of the control system, the penalty functionPX can be modified, which will reduce the accuracy requirements simultaneously.


## 3.1. Mathematical Modelling

Considering of the balance between inflow and outflow volume of liquid, the height of liquid level (H), the cross-sectional area of the liquid storage tank (A), and the inflow (Q1) and outflow (Q2) liquid obey the equation as follows [23, 24]:(14)AdHdt=Q1−Q2,which can be rewritten in the following form of increment:(15)AdΔHdt=ΔQ1−ΔQ2.To simplify the mathematical model of the control system, we assumed that the outflow increment was proportional to the liquid level increment and was inversely proportional to the valve resistance of the load valve, which has been shown in the following equation [23, 24]:(16)ΔQ2=ΔHR2.Based on equations (14) and (16),(17)RAdΔHdt+ΔH=RΔQ1.By using Laplace transformation, we get(18)Gs=HsQ1s=RRAs+1=KTs+1.Considering the hysteresis of liquid level changes in realistic engineering problems, the liquid level control system can be approximately seen as a first-order inertial hysteresis system with the transfer function shown in the following equation [23, 24]:(19)Gs=HsQ1s=KTs+1e−τs,where K, T, and τ are defined as 5, 160, and 3 in this paper.


## 3.2. Stability Analysis of Control System

Stability laid the foundation for the operation of the control system. Hence, it is a priority to determine the stability of a certain control system. Since the control system consisted of a nonlinear delay part, the analysis of stability has to be realized via the observation of the unit step response curves and calculation of the amplitude and phase angle margin of a control system, instead of the Routh–Hurwitz stability criterion. The unit step response curve of the control system is shown in Figure3, and the Bode diagram is shown in Figure 4.Figure 3
The unit step response curve of the control system.Figure 4
Bode plot of control system.Figure3 illustrates the convergence in unit step response curve of the control system. The amplitude margin of the control system (24.5dB) and the phase angle margin (96.3°) were both larger than zero, as shown in Figure 4, which confirmed the stability of the control system.


## 3.3. Parameter Tuning of PID Controller

In order to improve the performance of the control system, algorithms 1, 2, and 3 have been employed to correct PID controller parameters, and the fitness function is shown in the following equation:(20)FX=1ts+10×σ%PX,where X represented the variate of proportional coefficient (KP), integral coefficient (KI), and differential coefficient (KD) of the PID controller. ts, σ% were denoted as the adjustment time and overshoot of the control system, respectively. PX referred to the penalty function. Thus, the expression is shown in the following equation:(21)PX=1,ifess<10−10,0,ifess≥10−10,where ess is the steady-state error of the control system.The convergence curves of algorithms 1, 2, and 3 are presented in Figure5. Figure 6 shows the unit step response curves of the control system corresponding to the optimal results. Performance indexes of the control system are shown in Table 4.Figure 5
Convergence curves of different algorithms with equation (20) as the fitness function.Figure 6
The unit step response curve of the control system with equation (20) as the fitness function.Table 4
Comparison of performance indexes of control system with equation (20) employed as the fitness function.
Performance indexesBefore PID correctionAlgorithm 1Algorithm 2Algorithm 3Steady-state error,ess0.1669000Adjustment time,ts96.752012.731016.302016.4000Overshoot,σ%071.9570102.3144108.0654The steady-state error (ess) of the control system had been eliminated effectively and the adjustment time (ts) of the control system was reduced after PID correction, which were elucidated in both Figure 6 and Table 4. Moreover, among these three types of algorithms, algorithm 1 had been proved to have the most remarkable performance in this paper.However, it also caused a large oscillation which was responsible for a large overshoot. Moreover, fitness function presented in equation (22) can be applied to improve the stability of the control system.(22)FX=1σ%PX.Maintaining the simulation experimental environment and algorithm parameters, the convergence curves of algorithms 1, 2, and 3 are provided in Figure7. The unit step response curves of the control system corresponding to the optimal results are shown in Figure 8.Figure 7
Convergence curves of different algorithms with equation (22) as the fitness function.Figure 8
The unit step response curve of the control system with equation (22) as the fitness function.The overshoot of the control system corresponding to the optimal results for algorithms 1, 2, and 3 was 14.3807%, 20.2146%, and 19.1002%, respectively. For higher requirements in stability of the control system, the penalty functionPX can be modified, which will reduce the accuracy requirements simultaneously.


## 4. Conclusion

Under the same experimental conditions, an improved genetic algorithm was proposed in this work to improve the convergence speed, accuracy, and the probability to converge to the optimal value. The performance of the proposed algorithm had been verified by eight different kinds of typical test functions. Furthermore, the improved genetic algorithm had been applied to the parameter tuning of PID controller for liquid level controlling of beer filling machine, which revealed the superiority in effectively improving the rapidity of the control system with the premise of steady-state error elimination.



---

*Source: 7287796-2021-07-24.xml*