An adaptive fuzzy PID controller for speed control of brushless direct current motor

Aiming at the problems of the poor adaptive ability in the current control methods for brushless DC motor, an adaptive fuzzy proportional integral derivative controller (AFPID) is proposed to realize the better control performance of speed for brushless DC motor. AFPID includes a conventional PID controller (C-PID) and PI + PD architectures with a configurable fuzzy logic controller (C-PID-FLC). The FLC in C-PID-FLC consists of two fuzzy inference engines, one is used to self-tune the parameters for PI control, the other is for the scaling factor self-tuning of PI control parameters. The PD structure in C-PID-FLC is mainly to reduce oscillation, overcome overshoot and speed up system response while effectively eliminating static errors. When the system reaches a certain stable state of rotation, AFPID adjusts the C-PID controller ground on the speed error, which saves control costs under the premise of ensuring control performance. AFPID adaptively realizes the respective advantages of C-PID and C-PID-FLC. Compared with other control methods, the merits of the proposed controller are highlighted. The results show that the AFPID controller has a better control performance regardless of changes in load disturbance and parameter variations. And through the change of mechanical parameters of brushless DC motor, the sensitivity of AFPID is analyzed.


Introduction
With the develop rapidly of electric power electronic technology, modern sensor technology, advanced manufacturing technology, and automatic control technology in recent years, the brushless DC motor (BLDCM) has been widely applied to servo, actuation, positioning, and variable speed applications for its many advantages such as high efficiency, high dynamic response, high reliability and low maintenance [1][2][3]. Moreover, speed regulation is a vital part of BLDCM drive for accurate speed and position control applications, which requires the design of a high-efficiency controller to achieve continuous control performance under diverse working conditions [4][5][6][7][8].
In recent decades, scholars have proposed many speed control methods to improve the operation performance of BLDCM.
Normally, the PID controller is an optimum choice for speed control of the BLDCM due to its simplicity, strong robustness, and widespread applicability [4,5]. Aiming at the speed control problem of BLDCM, a new variable speed pre-labeled value control strategy of PI controller is proposed in a previous paper [9], and the experiments showed that the speed controller could regulate the rotate speed accurately in a wide application range with prime cost and preferable stability. In [10], a PI-based controller for BLDCM is proposed to improve the sensitivity and reduce the speed overshoot by increasing the proportional gain. However, it can be seen from the simulation results that the overshoot of the speed response under load conditions is still very obvious. Due to various uncertainties and nonlinearity exist in the PID structure, which makes it difficult to determine the PID gain, thus reducing the control system's performance [11]. Therefore, scholars have proposed a large number of intelligent algorithms such as metaheuristic optimization algorithm, fuzzy logic, differential evolution algorithm and deep neural network to improve the robustness of the control system [4][5][6][7][8][12][13][14][15][16][17][18][19][20]. Moreover, fuzzy logic-based methods provide better results than neural network and sliding mode control algorithms most of the time due to their offline training and chattering phenomenon [16,[21][22][23].
In [22], the speed control of BLDCM is compared and realized by using traditional PI and fuzzy PI controllers, and the fuzzy PI controller improves over the conventional PI in terms of rise time and settling time under no-load and load conditions. In [23], there is a PI regulator for speed regulation of permanent magnet synchronous motor. The PI gain is adaptively adjusted by using the fuzzy logic controller to assure the good effect, and it can be seen from the results that the fuzzy PI regulator outperforms the PI regulator in the presence of mechanical parameter variations and load disturbances, etc. As can be seen from [22,23] that all parameters are based on the fuzzy logic controller. Although the performance of the fuzzy logic controller depends on the proportional factor of the input and output of the fuzzy logic controller, it also affects the performance of the control system. To overcome these problems, some intelligent algorithms such as genetic algorithms, particle swarm optimization, and other algorithms are used to tune the proportional factor and optimize the constant parameters of PID and fuzzy logic controller [24][25][26][27][28]. In [24], the scale factor of the PID controller based on fuzzy logic is adjusted by a genetic algorithm, and it is applied to speed control of BLDCM. The experimental results show that the speed response is uncertain due to the change of load. In [25], the PI coefficient of the speed controller of BLDCM is also optimized by using a genetic algorithm. However, the velocity response has a big overshoot in the transient phase and a big fluctuation in the steady-state phase. In [26], genetic algorithm is used to optimize the rule base and membership function of fuzzy PID controller, and its superiority is verified under no-load and variable speed conditions, but its steady-state error is slightly larger and needs to be further improved. In [27], the particle swarm algorithm is applied to the PID controller of the direct current drive system. The simulation and experimental results show that the speed response has large over harmonic oscillations in the steady-state.
In addition, there are uncertainties due to load changes. In [29], the authors use a new deep perceptron neural network fuzzy adjusted PID controller to control the speed of BLDCM. The experimental results show that the proposed controller does have good robustness and stability to ensure the accurate operation of the motor. However, the iteration of its learning network is indeed a time-consuming project and still needs to be improved. In [30], a class II fuzzy controller based on wavelet neural learning (WNL) is presented to realize the effective control of BLDCM at the set speed. This control mode can well realize speed tracking under no-load, full load, and variable load conditions, but its steady-state error and response speed still need to be enhanced. In [31], a new hybrid control scheme for speed control of Brushless DC motor is proposed, which adopts an improved harmony search (HS) algorithm for parameter tuning of Fractional Order PID controller. The results show that the proposed control scheme can provide better and accurate speed control in a wide speed range, but its robustness is slightly poor.
To solve the problems mentioned above, an adaptive fuzzy proportional integral differential controller called AFPID is proposed in this paper. AFPID consists of a conventional PID controller (C-DIP) and PI + PD architecture with a configurable fuzzy logic controller (C-PID-FLC). C-DIP and C-PID-FLC can realize adaptive switching according to the speed error and give full play to their advantages. The FLC of C-PID-FLC contains two fuzzy reasoning engines, one is the parameter self-tuning of PI control, the other is the scale factor self-tuning of PI control parameters. The PD structure in C-PID-FLC is mainly to reduce oscillation while effectively eliminating static error, overcome overshooting and improve the response speed of the system. When the system reaches a certain stable state of rotation, AFPID adaptively adjusts to the C-PID controller ground on the speed error, which saves the control cost on the premise of ensuring the control performance. Finally, there build a simulation model of the brushless DC motor control system in Matlab/Simulink environment. The performance of AFPID is compared with the traditional PID control method [11], Fuzzy Logic PID control method [22], Genetic algorithm optimized fuzzy PID control method [26], and deep perceptron neural network fuzzy PID control method [29]. The results show that AFPID has a better control effect under the influence of different load disturbances and variable speeds. There are the sensitivity analyses of AFPID under the conditions of changing the resistance, inductance, inertia and flux linkage mechanical parameters of the BLDCM. When the mechanical parameters change, the method responds smoothly and without vibration in the steady-state, indicating that the method has good stability and robustness.
By substituting Eqs. (3) and (4) into (2), the following equation can be obtained: According to Eq. (6), the internal structure of BLDCM can be described as an equivalent circuit diagram [33] given in Fig. 1.
In general, the characteristic equation of BLDCM can be expressed as [29,34]: where u(t) is the applied voltage, R is the stator resistance, i(t) is the circuit current, L is the stator inductance, e(t) is the electromotive force, K emf is the electromotive force constant, in (t) is the motor speed or angular velocity, T e (t) is the motor torque, J is the moment of inertia, B is the viscosity coefficient, T m is the load torque.

Design of AFPID
Fuzzy logic control is formed of three main parts, namely membership functions, control rules and control tuning parameters [35]. The prospective target can be achieved by adjusting parts. Especially, the adjustment method of the scaling factor has a great influence on the change of parameters [36]. AFPID is a simple method to adjust the scaling factors, as shown in Fig. 2. AFPID is composed of C-PID with C-PID-FLC. C-PID-FLC locks the proportional gain ( K P1 ) and integral gain ( K I1 ) of PI control in a large range through Fuzzy Logic Controller 1 and then obtains the scaling factors of K P1 and K I1 through Fuzzy Logic Controller 2. Fuzzy Logic Controller 2 adaptively and dynamically adjusts the output result of Fuzzy Logic Controller 1 according to the scaling factor obtained from the system speed error and the change of error, so that the PI control parameters can be adaptively adjusted twice to ensure the optimality of the control parameters. The PD structure in C-PID-FLC is mainly to reduce oscillation, overcome overshoot and speed up system response while effectively eliminating static errors. When the system reaches a certain stable state of rotation, AFPID can be adjusted to C-PID controller according to the speed error, which saves control costs under the premise of ensuring control performance. The main advantage of this method is to reduce the response overshoot/undershoot phenomenon, shorten the response settling time, and improve the anti-interference ability. According to the structure in Fig. 2, the control signal U PID can be expressed as: where E is the error between the system speed output and input, i.e., E = m − ref . When the speed error is less than the critical value r/min, the C-PID controller is in the active state; When the speed error is greater than the critical value r/min, the C-PID-FLC is in the active state. The control switch realizes reasonable speed control by selecting an appropriate controller ground on speed error.
The control signal of C-PID-FLC consists of U PI−Fz �� and U PD , where K P−FZ �� and K I−FZ �� , respectively, represent the proportional gain and integral gain in the dual fuzzy PI control structure.
where K P and K D , respectively, represent the proportional gain and differential gain in PD control structure. The control signal ( U PID ′ ) of C-PID is where K P ′ , K I ′ and K D ′ , respectively, represent the proportional gain, integral gain and differential gain in C-PID control.

Membership functions (MFs)
The  The fuzzification operation is equivalent to the transformation between actual variables and fuzzy variables. In this paper, the isosceles triangle is selected as the membership function of the fuzzy variables, due to its convenient representation, easy calculation, and fast response speed. The rule base of the Fuzzy Logic Controller 1 is shown in Table 1. The rule base is mainly obtained by expert experience and practical inspection. When the actual accurate variables and fuzzy variables are converted to each other, there is the quantitative factor, i.e.,   where K e2 , K ce2 , K uF2−u1 and K uF2−u2 , respectively, represent the quantization factors of the input and output variables of Fuzzy Logic Controller 1. x e2 , x ce2 , y u1 and y u2 , respectively, represent the actual range of the input and output variables of Fuzzy Logic Controller 1.

Scaling factors (SFs)
To adjust SFs adaptively, this paper proposes an online adjustment method of independent model fuzzy rule base (Table 2) to update u s (s = 1, 2) in real-time. The computational connections between SFs and the input and output variables of C-PID-FLC are as below: where K P1 and K I1 are the output variables of Fuzzy Logic Controller 1, u 1 and u 2 are the output variables of Fuzzy Logic Controller 2.

Fuzzy rule base
The rule base of Fuzzy Logic Controller 2 in Table 2 is mainly used to calculate u s . In designing the fuzzy rule base, the following important aspects are considered. To reduce the overshoot/undershoot and decrease the settling time of speed response, the controller output will be adjusted to a smaller value when the error E is small, while E and CE give opposite symbols. For instance, if E is NS and CE is PM, then u 1 is S.
The fuzzy rules can also be written in the following form:  where E i , CE j and u ij are the fuzzy sets defined on E, CE and u s , respectively. These fuzzy sets conditional statements can be reduced to a fuzzy relationship R, namely Each fuzzy rule has a corresponding fuzzy relation, that is R1, R2, … R mn . Therefore, the fuzzy relation R corresponding to the total control rule is: After obtaining R T , the corresponding control variable change fuzzy set U is obtained according to the quantitative values of E and CE in the theory of domain range and the operation of fuzzy reasoning synthesis rules, Then the membership function of the control variable is: where R , E and CE , respectively, represent the membership function of fuzzy rules, error signal and change of error.
The output U of fuzzy control is a fuzzy subset, which is a combination of different values of response control language, but the actual controlled object can only accept one control quantity, so it is necessary to transform the fuzzy set into an accurate control quantity. In this paper, the weighted average method is used to calculate the corresponding accurate control quantity.
Then, the conversion from the fuzzy domain of output variables to the basic domain also requires the following conversion of quantization factors: where u * is the accurate control quantity determined by the fuzzy set of the control quantity, u a is the actual control quantity, and K u is the quantization factor of the output variable.

Simulation results
To test the performance of AFPID, a speed control system of BLDCM is given in Fig. 5, which consists of double loops. The inner ring synchronizes the inverter gate signal with the electromotive force. The outer ring realizes the motor speed control through the change of DC bus voltage. Several tests have been carried out to compare the performance of AFPID with PID [11], Fuzzy PID [22], GA + Fuzzy PID [26] and DPNN + Fuzzy PID [29]. The selection of conventional parameters in each controller is mainly determined by expert experience and simulation tests. The specifications of BLDCM and inverter are shown in Table 3 [29,34].
Before the performance test of AFPID, we simulated and trained the critical value of the control switch in AFPID under no-load condition, and the training results are shown in Fig. 6. From the training results, it can be seen that AFPID has the best control effect when = 10 r/min. When is greater than 10 r/min, the system relies on C-PID too early and causes the overshoot phenomenon; when is less than 10 r/min, the system relies on C-PID-FLC too long and causes the delay phenomenon. When = 10 r/ min, the response curves of relevant control signals of the system are shown in Fig. 7.

Speed control of BLDCM with different load disturbance
First of all, the tests are carried out under the condition of fixed load disturbance. In addition, the rated power voltage and rated power of the motor are set by 500 Vdc and 1Kw, respectively. The target rotation speed of 3000 r/min is input to the system, then C-PID-FLC and C-PID are chosen to control the rotation speed by the switch according to the critical value of the rotation speed error E, and a lot of simulation experiments are implemented to obtain the critical value = 10 r/min. Moreover, a 3 N•m load disturbance is added at the time of 0.3 s. The performance indexes under the condition of fix load disturbance are given in Table 4, and the comparison of speed variation is shown in Fig. 8. It can be seen from Fig. 8a, b that the traditional PID control algorithm has the longest convergence time and overshoot, with a maximum overshoot rate of about 2.8%. The traditional fuzzy PID control algorithm has a long convergence time, however, there is no overshoot occurring. The convergence time of the DPNN + FuzzyPID control algorithm is obviously better than traditional PID and Fuzzy PID, and no overshoot phenomenon occurs. The convergence time of GA + FuzzyPID is second only to AFPID with no overshoot. AFPID has the shortest convergence time of 0.040 s, which is 69.47%, 68.25%, 20.00% and 58.76% higher than traditional PID, Fuzzy PID, GA + FuzzyPID and DPNN + FuzzyPID, respectively. In addition, from Fig. 8a, c, it can be seen that after the load disturbance is applied at 0.3 s, the traditional PID control algorithm is most affected by the load, the undershoot rate reaches 5.28%. Besides, it is not restored to a steady state until 0.067 s, accompanied by continuous fluctuation. The error peak value of the traditional fuzzy PID control algorithm by the load disturbance is less than 0.33%, and the algorithm returns to the steady-state after 0.038 s. The error peak value of the GA + FuzzyPID control algorithm by the load disturbance is less than 0.29%, and the algorithm returns to the steady-state after 0.022 s. The error peak value of the DPNN + FuzzyPID control algorithm by the load disturbance is less than 0.22%, and the algorithm returns to the steady-state after 0.029 s. However, AFPID returns to the steady-state very quickly only after 0.017 s while its error peak value by the load disturbance is 3.8 r/ min, which shows its excellent anti-interference as well as strong robustness performance.
Next, the tests are carried out under the condition of continuously varying load disturbance. The rated power voltage, rated power and the target rotation speed are the same as above. And the sinusoidal load disturbance is introduced during the speed control process, which is described as T m = 3 sin t, 0 ≤ t ≤ 0.5 s . The performance indexes under the condition of continuously varying load disturbance are given in Table 5, and the comparison of speed variation is shown in Fig. 9.
As can be seen from Table 5 and Fig. 9, under the change of sine wave load, the convergence time of the traditional PID control algorithm is still the longest, which is 0.133 s, and overshoot occurs. Moreover, it fluctuates greatly in the stable state, but the steady-state error is slightly less than FuzzyPID, GA + FuzzyPID and DPNN + FuzzyPID.   The convergence time of FuzzyPID, GA + FuzzyPID and DPNN + FuzzyPID are 0.129 s, 0.056 s and 0.099 s respectively, and the stable states are accompanied by slight fluctuation. Meanwhile, FuzzyPID and DPNN + FuzzyPID still have the tendency to reduce the error at this stage. In addition, AFPID not only has no overshoot phenomenon, but also has a fast convergence rate of 0.041 s, and the stable state also has a slight fluctuation. Compared with the other four algorithms, AFPID has a shorter stability time, faster response speed and minimum steady-state error.

Speed tracking of BLDCM with no load
The motor is in the no-load state with a speed of 3000 r/ min, which is lowered to 1500 r/min at 0.2 s, to 500 r/min at 0.4 s. Figure 10 shows the performance of the speed tracking, and the performance indexes under the condition of continuously varying speeds are given in Table 6. It can be seen from Fig. 10 and Table 6 that the five control methods can well achieve the speed tracking performance under the condition of no-load and variable speeds. The overshoot phenomenon of traditional PID decreases with the decrease of speeds. FuzzyPID, GA + FuzzyPID, DPNN + FuzzyPID, and AFPID maintain the previous control characteristics very well. However, compared to the other four algorithms, AFPID is still optimal in terms of response speed, recovery time and steady-state error, etc.

Speed tracking of BLDCM with varying mechanical parameters
In this section, the speed tracking and sensitivity analysis of AFPID are carried out according to the changes of mechanical parameters of BLDCM. Given the rotation speed of the motor at 3000 r/min, the mechanical parameter variation conditions are: (1) given the resistance ratio of 1:5:10:15, (2) given the inductance ratio of 1:5:10:15,    Through the sensitivity analysis, it can be seen that AFPID is a controller suitable for wide operating conditions, and when the mechanical parameters change of BLDCM, the AFPID responds smoothly and without vibration in the steady-state, which shows that AFPID has good stability and robustness.

Conclusion
In this paper, an adaptive fuzzy proportional integral and differential controller called AFPID is presented to control the speed of BLDCM, and the structure of AFPID is designed. AFPID consists of a conventional PID controller (C-DIP) and PI + PD architecture and a configurable fuzzy logic controller (C-PID-FLC). C-DIP and C-PID-FLC can realize adaptive switching according to the speed error and give full play to their advantages. AFPID and other controllers are simulated under different conditions. The results show that AFPID is superior to other control methods in terms of anti-interference ability, convergence time, overshoot/undershoot, response speed, steady-state error and robustness. And the sensitivity analysis of AFPID is carried out under the conditions according to the changes of mechanical parameters of the resistance, inductance, inertia, and flux linkage of the BLDCM. However, the proposed controller is still only a simulation test, the feasibility of practical application needs to be further verified, and we will build an experimental platform to verify its real-time performance in    if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.