Research on motor speed control based on the improved genetic algorithm to optimize fuzzy PID

This study aims to optimize the speed control effect of fuzzy PID controller in brushless DC motor control, and improve the traditional genetic optimization algorithm to improve fuzzy PID algorithm, mainly for genetic algorithm coding, crossover, and mutation process. In the three processes of the genetic algorithm, real number field coding is used, Taguchi orthogonal table is introduced into the cross-process, and Gaussian variation is applied to the mutation process. In the part of model construction and verification, this study uses Simulink software to build a brushless DC motor model and sets the same conventional parameters for simulation. The simulation results show that the algorithm overshoot and stability time of the fuzzy PID controller optimized by the improved genetic algorithm are obviously improved.


Introduction
The fuzzy PID controller is widely used in speed control of the brushless DC motor.However, how to optimize its control effect is still a challenging problem [1] .To solve this problem, this study aims to optimize the speed control effect of fuzzy PID controller in brushless DC motor control, and further optimize the performance of the controller by improving the genetic algorithm coding, crossover, and mutation processes.In the brushless DC motor control, a fuzzy PID controller is a control method based on fuzzy logic and the PID control principle [2] .It has the advantages of strong adaptability and high control accuracy, so it is widely used in many motor control applications.However, due to the complexity and uncertainty of the motor system, the performance of the fuzzy PID controller is limited to some extent [3] .Therefore, the goal of this study is to optimize the performance of the fuzzy PID controller by improving the genetic algorithm, so as to improve the speed control effect of the brushless DC motor.
In order to achieve this goal, the traditional genetic optimization algorithm is improved in this study, mainly for the genetic algorithm coding, crossover, and mutation process.Specifically, we adopt real field coding, introduce Taguchi orthogonal tables into the crossover process, and apply Gaussian variation to the variation process.These improvements can increase the searchability and optimization effect of the genetic algorithm, and thus improve the performance of the fuzzy PID controller [4] .To verify the effectiveness of the improved algorithm, a brushless DC motor model is built in Simulink software, and the same conventional parameters are set for simulation.The simulation results show that the algorithm overshoot and stability time of the fuzzy PID controller optimized by the improved genetic algorithm are obviously improved.This shows that the improved genetic algorithm is effective in optimizing the fuzzy PID controller.

BLDC simulation model
The core framework of the genetic algorithm includes four elements: coding, optimization, crossover, and mutation.In the coding phase, the solution to the problem is transformed into chromosomes that make up the initial population.Then, through operations such as selection, crossover, and mutation, the population continuously evolves in the optimization phase to find the optimal solution.The selection operation evaluates the quality of the solution based on the fitness function, the crossover operation swaps parts of the chromosome, and the mutation operation makes random changes to the chromosome to increase diversity [5,6] .However genetic algorithms often play roulette and tend to increase the proportion of high-fitness individuals in the next-generation population.With the iteration of the algorithm, this selection strategy may lead to a large number of individuals with similar fitness in the population, so that the whole population becomes simple and it is difficult to reach the real optimal solution.The traditional genetic algorithm often falls into the problem of local optimal solutions, which limits its ability to explore the global search space [7] .Therefore, on the basis of the genetic algorithm, this paper improves the steps of coding, selection, and mutation, aiming at enhancing the searchability, speeding up the convergence speed, and effectively overcoming the problem of falling into the local optimal solutions in the iterative process [8,9] .The improved genetic algorithm is optimized in the following three aspects.
(1) Individual coding gives up the use of traditional binary coding and tries to use real number field coding.
(2) The introduction of the Taguchi orthogonal table in the crossing process can effectively generate offspring with the individual characteristics of the parent, thus significantly improving the convergence speed and global optimization ability of the genetic algorithm.The implementation process of this method includes the following steps: the method of orthogonal experiment is introduced, the element segments in two cross entities are divided, and the element segments with obvious characteristics are screened.These filtered element segments are combined to generate the next generation of individuals.Two randomly crossed individuals are taken: Its corresponding solution space is: Then the group value F is randomly set, the segment points are x1, x2, where F is a positive integer, and the experiment is conducted according to the orthogonal table Y to obtain M new individuals: Orthogonal crossover is an effective genetic algorithm operation, which splits two crossover individuals in the original population, and then evaluates the fitness integral between the newly generated individual and the original.Higher moderation scores as a part of a new generation of individuals [10]  .This cross operation does not need to be carried out for all individuals, so the efficiency of the cross and the global searchability are greatly improved, and the iteration time of the algorithm is significantly shortened.
(3) Gaussian variation.The traditional GA algorithm mostly uses fixed value variation, and sets the variation probability too subjectively, which is mostly based on experience.The basic idea of Gaussian variation is to add a random deviation quantity to a certain element of the original individual, and the variation law of this deviation quantity satisfies the normal distribution.The Gaussian variation formula is as follows:

BLDC simulation model
This section introduces the mathematical model of BLDC, which adopts pairwise conduction and square wave drive.Considering that the actual system has the characteristics of multi-variable, strong coupling, and nonlinear, in order to facilitate the calculation, a lot of literature is referred to in this topic, and a series of assumptions are made in the actual system: (1) The three-phase stator windings of the motor are 120° different and completely symmetric; (2) The induced electromotive force of the three-phase winding is an ideal square wave of 120°; (3) Three-phase mutual inductance has nothing to do with the spatial position; (4) The internal air gap magnetic field is not considered and permanent magnet magnetic field distribution is not uniform; (5) The eddy current loss, hysteresis loss, power loss and other phenomena of the motor are not considered.In order to test the effect of the improved genetic algorithm to optimize fuzzy PID, this study uses Simulink to model brushless DC motors and the fuzzy PID algorithm.The fuzzy PID optimization of the traditional genetic algorithm is compared with that of the improved genetic algorithm.The BLDC default parameters are shown in Table 1.

BLDC simulation model
The genetic algorithm improves fuzzy PID only for the output parameters, membership function, and rule base of fuzzy PID, and has no influence on the external framework of the model.Figure 2

Results & Discussion
This simulation compares three control algorithms.The total model is shown in Figure 3.The simulation results of fuzzy PID, fuzzy PID optimized by genetic algorithm, and fuzzy PID optimized by improved genetic algorithm are respectively compared.The simulation parameters, set speed value, initial PID value, membership function, and rule base of the brushless motors in the three groups are consistent.The motor is set to run at a load of 1 N and a speed of 10000.The simulation results of the three control algorithms are shown in Figure 4.All three algorithms have overshoot, but the fuzzy PID algorithm has the largest overshoot, and it takes a long time to turn into a no-load operation, so it can be stable for a long time.The improved genetic algorithm optimizes the fuzzy PID controller to have the lowest BLDC overshoot and the shortest rise speed and stationary time.As shown in Table 2, fuzzy PID optimized by the improved genetic algorithm is superior to fuzzy PID and the traditional genetic algorithm in overshoot, rise time, and stationary time.In addition, this study also monitors the iteration curves of GA-PID algorithm and GA-P-FPID algorithm.The relationship between the objective functions of the two algorithms and the number of iterations is shown in Figure 5, 6.It can be clearly seen that the improved genetic algorithm (GA-P) has advantages in faster convergence rate, compared with the traditional genetic algorithm.

Conclusions
This observation has several implications: (1) Better optimal solutions: improved genetic algorithms can converge faster to better solutions.This means that within the same number of iterations, the improved algorithm can find a solution that is closer to the global optimal solution, thus improving the efficiency of the optimization problem.(2) Faster convergence speed: the improved genetic algorithm quickly converges in the early iteration, so that high-quality solutions can be found faster.These observations prove the effectiveness of the improved genetic algorithm, indicating that the algorithm has a strong performance in optimizing fuzzy PID controllers.
It should be pointed out that although the model is built and verified in Simulink software in this study, the complexity and uncertainty of the actual system should be taken into account in practical application.Therefore, future research needs to conduct experiments and validation in actual systems to further verify the feasibility and validity of the results of this study.In addition, the improvement measures of genetic algorithm coding, crossover, and mutation process can be further discussed and studied to further improve the performance of the controller.
In short, this study provides a way to optimize the speed control effect of fuzzy PID controllers in brushless DC motor control.It is of great significance and application value to improve the performance of the controller by improving the genetic algorithm.Future research can further explore and improve the relevant technology, and make greater contributions to the development of the motor control field.
of Pole-pairs4  The BLDC fuzzy PID system model is shown in Figure1.The simulation model mainly consists of a DC source, three-phase inverter, BLDC, fuzzy PID controller, PWM generator, Hall position module, driver signal module, etc.
shows the simulation model.In the fuzzy PID controller simulation model, the input is speed deviation e and speed deviation change rate c e , the output is  p k ,  i k ,  d k and J(ITAE) fitness index.

Figure 4 .
Figure 4. Simulation results of three control algorithms.

Table 2 .
Comparison Results of Three Algorithms.