Abstract
In this article, a genetic algorithm–based proportional integral differential–type fuzzy logic controller for speed control of brushless direct current motors is presented to improve the performance of a conventional proportional integral differential controller and a fuzzy proportional integral differential controller, which consists of a genetic algorithm–based fuzzy gain tuner and a conventional proportional integral differential controller. The tuner is used to adjust the gain parameters of the conventional proportional integral differential controller by a new fuzzy logic controller. Different from the conventional fuzzy logic controller based on expert experience, the proposed fuzzy logic controller adaptively tunes the membership functions and control rules by using an improved genetic algorithm. Moreover, the genetic algorithm utilizes a novel reproduction operator combined with the fitness value and the Euclidean distance of individuals to optimize the shape of the membership functions and the contents of the rule base. The performance of the genetic algorithm–based proportional integral differential–type fuzzy logic controller is evaluated through extensive simulations under different operating conditions such as varying set speed, constant load, and varying load conditions in terms of overshoot, undershoot, settling time, recovery time, and steady-state error. The results show that the genetic algorithm–based proportional integral differential–type fuzzy logic controller has superior performance than the conventional proportional integral differential controller, gain tuned proportional integral differential controller, conventional fuzzy proportional integral differential controller, and scaling factor tuned fuzzy proportional integral differential controller.
Keywords
Introduction
Owing to the high reliability, high efficiency, noise-free operation, long operating lifetime, and low maintenance, brushless direct current (BLDC) motors have been widely used in robots, 1 underwater glider, 2 electric vehicles,3–5 aerospace, 6 and other fields. Precise speed regulation has always been a major challenge in the field of BLDC motor drive, which necessitates the design of an efficient controller to achieve optimal performance under varying operating conditions, and during the last few decades, many different controllers have been developed to enhance the performance of BLDC motors.7–11
Generally, proportional integral (PI), proportional differential (PD), or proportional integral differential (PID) controller is the preferable method for speed control of BLDC motors7,10–13 because of its simple structure, strong robustness, and good applicability. However, the existing uncertainties, nonlinearity, and manually tuned parameters of a typical PI, PD, or PID controller make it difficult to determine the appropriate gains to achieve the optimal performance of the control system.9,13 Therefore, intelligent algorithms such as particle swarm, 7 fuzzy logic control, 10 differential evolution, 11 neural network,14,15,16 neuro fuzzy, 9 and sliding mode control17,18 are proposed to adjust the gains of the PID controller so as to improve the performance of the BLDC motors. However, sliding mode control has an inevitable drawback chattering, which leads to the decline in the overall system performance. In addition, the neural network needs offline or online training, which leads to high computational complexity and degrade the time domain specification of the speed response. Furthermore, particle swarm or differential evolution is difficult to find the optimal solution by particle or individual iteration. But for fuzzy logic control, it does not need the accurate system model and needs less calculation only based on expert knowledge rule base. Therefore, the adjustment method based on fuzzy logic control has better control effect than the other approaches such as neural network and sliding mode control in most cases. 10
Recently, some fuzzy tuned PID controllers have been studied to improve the performance of conventional proportional integral differential (C-PID) by adjusting the parameters according to the speed error and the rate of change of error. In Fereidouni et al. 19 and Arulmozhiyal and Kandiban, 20 a fuzzy tuned PID controller was presented for speed control of BLDC motors, and the comparative analysis showed that it not only outperformed the C-PID controller but also produced large overshoot, undershoot, and settling time. In Lv and Gao, 21 another type of fuzzy logic controller is proposed, but it also has been observed overshoot, undershoot and oscillatory speed response. This is because the aforementioned controllers adopt fixed and static parameters such as scaling factor, membership function, and fuzzy rule. In order to solve the aforementioned problems, advanced fuzzy logic control schemes have been proposed to improve the overall control performance of BLDC motors. In Premkumar and Manikandan 10 and Valdez et al., 22 the adaptive fuzzy PID controller was proposed, which used stochastic hybrid bacterial foraging particle swarm optimization algorithm and bat, particle swarm optimization, and cuckoo search algorithms to dynamically adjust its scale factor. In Rubaai and Young, 23 the adaptive fuzzy algorithm was presented to adjust the input weight of the neural network. In Rubaai et al., 24 a genetic optimization algorithm was used to determine the optimal values of the scaling factors for the output variables of the fuzzy PID controller. The simulation results showed that the performance of the aforementioned schemes was better than that of the conventional fuzzy PID. However, the remarkable influence of membership function and control rules on control performance was neglected.
The objective of this article is to design a new fuzzy PID controller for the speed control of the BLDC motor, and an improved genetic algorithm (GA) is used to choose the optimal membership functions and control rules, so as to make the fuzzy PID controller simpler and more efficient compared to C-PID controller, 13 conventional fuzzy proportional integral differential controller (C-PID-FLC), 7 gain tuned proportional integral differential (G-PID) controller 19 and scaling factor tuned fuzzy PID based on GA (tuned fuzzy proportional integral differential controller (T-PID-FLC)). 24 To validate the performance of the proposed controller, comparisons with the aforementioned controllers are made in terms of several parameters including overshoot, undershoot, settling time, recovery time, and steady-state error under different operating conditions of the BLDC motor. The main contribution of this article consists of proposing a method for accurate speed control of BLDC motors, and the proposed approach is based on a robust PID-type fuzzy control method using the GA technique.
The remainder of this article is organized as follows: the speed controller of the BLDC motor is given in section “The speed controller of the BLDC motor,” detail design of the GA-based fuzzy gain tuner is explained in section “Design of the GA-based fuzzy gain tuner,” and simulation results are presented in section “Simulation results.” Finally, concluding remarks are outlined in section “Conclusion.”
The speed controller of the BLDC motor
The mathematical model of the BLDC motor can be described as follows 10
where
The advantage of the fuzzy inference system has been proved in nonlinear, complex, time-varying dynamic processes.10,18 Mamdani fuzzy inference system is used to tune the gains of the PID controller in the proposed scheme. The structure of the proposed speed control system is shown in Figure 1.

The proposed speed control system for the BLDC motor.
The system consists of three-phase voltage source pulse width modulated (PWM) inverter, three-phase BLDC motor, GA-based fuzzy gain tuner, C-PID controller, switching logic and motor measurement sensors. Furthermore, two closed loops namely inner loop and outer loop are established based on the aforementioned blocks. Particularly, the outer loop is used for controlling the speed of the BLDC motor, and based on error and rate of change of error, the GA-optimized fuzzy PID controller provides the control signal to the switching logic circuit so as to control the speed of the motor accordingly. Control signal (UPID) can be expressed as
where
where Kp, Ki, and Kd are the proportional gain, the integral gain, and the differential gain, respectively, and e is the speed error of the system; Kp0, Ki0, and Kd0 are initial values of Kp, Ki, and Kd; △Kp, △Ki, and △Kd are the deviation of Kp, Ki, and Kd, which are the outputs of the GA-based fuzzy gain tuner.
Design of the GA-based fuzzy gain tuner
Fuzzy gain tuner optimized by GA is basically modeled by the Mamdani fuzzy inference system with two inputs, that is, the speed error (e) and the rate of change of error (△e) and three outputs including the variable gains of the PID controller △Kp, △Ki, and △Kd, respectively. The GA-based fuzzy gain tuner involves a fuzzy logic controller and an improved GA optimization approach, which is used to optimize the shape of the membership functions and the contents of the rule base of the fuzzy logic controller.
Fuzzy logic controller
As shown in Figure 2, a Mamdani fuzzy logic controller7,10,19 is designed in GA-PID-FLC, whose basic components include fuzzifier, inference engine, rule base, and defuzzifier. Fuzzifier converts the crisp input e and △e into fuzzy linguistic variables NB, NS, Z, PS, and PB, and rule base consists of all the control rules describing the dynamic behavior of the controller. Moreover, based on the rules, inference engine completes reasoning and makes decisions. Finally, defuzzifier converts the fuzzy output of inference engine into crisp values of △Kp, △Ki, and △Kd. Moreover, the input and output values are scaled within the corresponding range by the scaling factors.

Proposed fuzzy logic controller.
The membership functions of the inputs speed error (e) and rate of change of error (△e) and three outputs the variable gains △Kp, △Ki, and △Kd are given according to the convention fuzzy logic controller.7,10,19 Fuzzy language variables NB, NS, Z, PS, and PB in membership functions represent negative big, negative small, zero, positive small, and positive big, respectively. The membership functions of the inputs and outputs are the same as shown in Figure 3.

Membership functions for inputs and outputs.
The if–then rule base consists of 75 rules which are specified in Table 1.
Fuzzy if–then rules.
In GA-PID-FLC, the fuzzy output values from the inference engine are defuzzified to crisp values by the center of area method like in Xie et al., 7 Premkumar and Manikandan, 10 and Fereidouni et al. 19
Improved GA optimization approach
The GAs can provide an effective way of searching a large and complex solution space to give close to optimal solutions and avoid local minima based on the concepts of the evolutionary theory. Therefore, they are widely used to tune the fuzzy controller parameters. 24 In GA-PID-FLC, an improved GA optimization approach is adopted to determine the shape of the membership functions and the contents of the rule base, so as to obtain optimal or near optimal fuzzy rules and membership functions. The steps of the proposed approach are given as follows.
Parameters encoding
Usually, different coding methods such as binary or real coding can be used to define the string of searching parameters for the optimization problem. In GA-PID-FLC, real coding is chosen, so each rule and each membership function are converted into a real string. Moreover, these strings are concatenated to be a chromosome which represents a possible solution, and the genetic operations are performed on this chromosome to obtain the optimal parameters of the fuzzy logic controller.
In GA-PID-FLC, the triangular membership function is used, which can be expressed as
It is obvious that the parameters a, b, and c determine the shape of the triangle, so they are chosen to be optimized. Moreover, the distribution of membership functions for the error and the rate of change of error and the variable gains of the PID controller △Kp, △Ki, △Kd are shown in Figure 4.

Equivalent distribution of membership functions.
As can be seen that there is
The encoding length of membership functions for the fuzzy logic controller with two inputs and three outputs is 5 × 5 = 25. By using this encoding method, the chromosomes can be arranged in increasing order after crossover and mutation operation, and a large number of invalid coding strings can be avoided. In addition, the value of x1, x2, x3, x4, and x5 is still within the width range after genetic manipulation.
Real coding is also used for encoding of the fuzzy control rules, and the corresponding digital table of the fuzzy variables in Table 1 is expressed in Table 2, which can be represented by a two-dimensional array.
Digital encoding of fuzzy if-then rules.
As shown in Table 2, each fuzzy rule parameter is encoded into a real number that covers the range from 1 to 5. The rules considered here have 25 parameters that range over five fuzzy levels and are coded by 1 = NB, 2 = NS, 3 = Z, 4 = PS, and 5 = PB.
Then, the coded string produced by concatenating all the encoded parameters forms a chromosome of (5 center point positions × 1) × 5 inputs/outputs + (25 rules × 1) × 3 outputs = 100 real numbers. Each chromosome specifies an individual number in the population, and the chromosome coding diagram is depicted in Figure 5.

Chromosome coding diagram.
Evaluation of each chromosome is based upon a fitness function, which allows evaluating, discriminating, and classifying the individuals.
Definition of the fitness function
Fitness function is used to evaluate how much an individual fits the solution, so individuals with high fitness value have good performance and high probability of inheritance to the next generation, or otherwise. In order to find the optimum value for the adjustment parameters, the integral absolute error performance index is set as the objective function, which is described as
where e(t) is the speed error at time t.
Determination of the genetic operators
In GA, in order to generate an optimal next generation, the operations of reproduction, crossover as well as mutation are successively used for the current generation based on the relative operators. The function of reproduction operator is to select some good individuals from the current generation and copy them to the next generation. Here, an improved reproduction operator is proposed to ensure population diversity, which can find the excellent individuals based on Euclidean distance and the fitness function value. The improved reproduction procedure is described as follows.
Step 1. First, the fitness values of each individual are calculated for the initial population.
Step 2. The initial individuals are sorted and recorded according to the fitness values, which are expressed as
Step 3. The first m/2 individuals with high fitness are directly copied to the next generation.
Step 4. Taking out
where n denotes the number of genes in an individual. Adding fitness and Euclidean distance, the individual with maximum value is selected as the new individual, which is expressed as
Step 5. And so forth, m/2 new individuals
Afterward, the arithmetic crossover operator is used to perform crossover operation, which is described as
where
Finally, uniform bidirectional mutation operator is used to perform mutation operation, which is expressed as
where
Optimal parameters of fuzzy logic controller
Based on the parameters in Table 3 for GA, the corresponding operations are performed from generation to generation, the flowchart of the GA is given in Figure 6.
Parameters for the used genetic algorithm.

Flow chart of the improved genetic algorithm.
Then, the optimal solution is obtained and represented by the chromosome with the maximum fitness value, and then the optimal individual is {12345, 23567, 23456, 34567, 13456, 41352, 22521, 32512, 54435, 53223, 22343, 43553, 33424, 33151, 24112, 22525, 42435, 44545, 41142, 25535}, the optimized membership functions as well as rule sets are shown in Figure 7 and Table 4, respectively.

Membership functions after GA optimization: (a) membership function of e, (b) membership function of Δe, (c) membership function of ΔKp, (d) membership function of ΔKi, and (e) Membership function of ΔKd.
Rule sets after GA optimization.
Simulation results
To test the performance of GA-PID-FLC, the BLDC motor speed control system is modeled using MATLAB/Simulink tool box as shown in Figure 8, and the specifications of the BLDC motor like in Xie et al., 7 Premkumar and Manikandan 10 and Fereidouni et al. 19 are used in Table 5. The speed respond for different conditions is measured and analyzed for the considered BLDC motor.

The MATLAB/Simulink model of speed control for BLDC motor: (a) the model of the BLDC motor control system and (b) the model of the GA-PID-FLC controller.
Specifications of BLDC motor drive.
Speed response with the absence of load
First, the tests are performed under the condition of absence of load. The target rotation speed 2000 r/min is input to the system, and the comparison of speed response is shown in Figure 9, and the performance indexes are given in Table 6.

Comparison of speed response with no load.
The performance indexes under the condition of no load.
C-PID: conventional proportional integral differential; G-PID: gain tuned proportional integral differential; C-PID-FLC: conventional fuzzy proportional integral differential controller; T-PID-FLC: scaling factor tuned fuzzy proportional integral differential controller; GA-PID-FLC: genetic algorithm–based proportional integral differential–type fuzzy logic controller.
As can be seen from Figure 10 and Table 6, the peak overshoot is 2185 r/min, 512.2 r/min and the peak undershoot is 331 r/min, 332 r/min, respectively, for the C-PID controller and the G-PID controller during the transient period, while no obvious overshoot occurs for C-PID-FLC, T-PID-FLC, and GA-PID-FLC. During the steady-state period, the traditional fuzzy PID control algorithm has the longest convergence time 0.034 s and GA-PID-FLC has the shortest convergence time 0.024 s. Moreover, GA-PID-FLC has the lowest steady-state error. Therefore, GA-PID-FLC performs better than the controllers notified earlier.

Comparison of speed response under varying load conditions.
Speed response with load
Next, the closed loop system of the brushless DC motor is operated with sudden change in load conditions to ascertain the superiority of GA-PID-FLC. The target rotation speed 2000 r/min is still input to the system, and load is varied from no load to load of 3 Nm at 0.1 s. Figure 10 shows the speed response curves under varying load conditions.
As can be seen from Figure 10, the minimum peak time, the minimum peak undershoot, and overshoot of GA-PID-FLC are 0.1005 s, 0.5 r/min, and 0, respectively. Moreover, the recovery time of GA-PID-FLC is 0.01 s, which is the shortest. Therefore, the GA-PID-FLC controller is better than the other considered controllers. The performance indexes in this condition are shown in Table 7.
The performance indexes under the condition of varying load.
C-PID: conventional proportional integral differential; G-PID: gain tuned proportional integral differential; C-PID-FLC: conventional fuzzy PID controller; T-PID-FLC: scaling factor tuned fuzzy proportional integral differential; GA-PID-FLC: genetic algorithm–based proportional integral differential–type fuzzy logic.
Speed response with varying set speed
Finally, tests are carried out under the condition of variable set speed to validate the effectiveness of GA-PID-FLC. Set speed is varied from 2000 r/min to 2500 r/min with no load. Figure 11 shows the speed response curves under varying set speed condition, and the relative performance indexes for this condition are presented in Table 8.

Comparison of speed response under varying set speed conditions.
The performance indexes for varying set speed condition.
C-PID: conventional proportional integral differential; G-PID: gain tuned proportional integral differential; C-PID-FLC: conventional fuzzy proportional integral differential controller; T-PID-FLC: scaling factor tuned fuzzy proportional integral differential controller; GA-PID-FLC: genetic algorithm–based proportional integral differential–type fuzzy logic controller.
As can be seen from Figure 11 and Table 8, when the set speed suddenly changes at 0.1 s, oscillation occurs for C-PID and G-PID controllers. Although T-PID-FLC and C-PID-FLC have the same tracking performance as GA-PID-FLC, the minimum recovery time of GA-PID-FLC is 0.018 s and the minimum steady-state error is 11 r/min, which shows that GA-PID-FLC performs better than the other considered controllers.
Thus, it can be seen from the aforementioned simulations that all the controllers are able to track the set speed correctly. However, the performance of C-PID and G-PID under sudden load variations is not satisfactory. Moreover, C-PID and G-PID generate oscillations in the speed response curves, while the others do not. Overall performance comparison is provided in Table 9 for all controllers at ease. From the summary of simulation results that all the control performance of the proposed GA-PID-FLC is better than the others, specifically in terms of steady-state error, settling time, and recovery time.
Performance comparison of the controllers.
C-PID: conventional proportional integral differential; G-PID: gain tuned proportional integral differential; C-PID-FLC: conventional fuzzy proportional integral differential controller; T-PID-FLC: scaling factor tuned fuzzy proportional integral differential controller; GA-PID-FLC: genetic algorithm–based proportional integral differential–type fuzzy logic controller.
Conclusion
The GA-optimized fuzzy PID controller has been presented for speed control of BLDC motors. The gains of the PID controller are tuned by a fuzzy logic controller whose membership functions and control rules are optimized by an improved genetic algorithm. The overall control system created and simulated using MATLAB/Simulink has been given to test the effectiveness of the proposed controller under various operating conditions such as constant load, varying load, and varying set speed conditions. Moreover, different performance indices such as overshoot, undershoot, settling time, recovery time, and steady-state error are measured and compared with C-PID, G-PID, C-PID-FLC, and T-PID-FLC controllers. From the results of the simulations, it has been ascertained that the GA-optimized fuzzy PID controller clearly outperforms other controllers under all considered operation conditions of the BLDC motor.
Footnotes
Handling Editor: Rebecca Margetts
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by Jilin Provincial Education Department “13th Five-Year” Science and Technology Project (grant nos JJKH20181013KJ and JJKH20181166KJ) and Capital construction funds in the Provincial Budget of Jilin Development and Reform Commission in 2019 (grant no 2019C054-4).
