An anti-windup self-tuning fuzzy PID controller for speed control of brushless DC motor

ABSTRACT This paper presents an anti-windup self-tuning euzzy proportional-integral-derivative (PID) controller for the speed control of brushless direct-current (BLDC) motor. The proposed controller consists of a self-tuning fuzzy PID controller and an snti-windup controller, which combines the merits of these two controllers. The anti-windup controller is designed as a fuzzy proportion controller and is switched by a logic function based on the output of proposed controller and the speed error. A detailed simulation study in MATLAB/Simulink is performed to investigate the performance of proposed controller, and the simulation experiments are conducted on different conditions. The control system parameters of the proposed controller such as overshoot, settling time and rising time are compared with that of the conventional PID controller. The simulation results show that the proposed controller can accelerate the response speed of BLDC motor, strengthen the ability of anti-windup and make motor runs smoothly, it is proven that anti-windup self-tuning fuzzy PID controller has better performance than conventional PID controller.


Introduction
As a typical permanent magnet synchronous motor, the brushless direct-current (BLDC) motors show a famous performance in terms of high power density, high torque, long operating life, noiseless operation and excellent control properties [1,2]. Due to these satisfactory properties, BLDC motors are widely used in many occasions such as instrumentation, robotics, machine tools, industrial automation equipment and automotive [3]. The BLDC motors are driven by DC voltage, the speed of BLDC motors is regulated by the stator voltage and the characteristic of speed is a significant factor to measure the BLDC motors' working performance [4][5][6].
Generally, the speed closed-loop is used to control the BLDC motors and the speed controller based on proportional-integral-derivative (PID) is widely adopted in practical application. PID control is one of the most popular control strategies and has been commonly used in industrial control systems because of its simplicity, clear functionality, robustness and effectiveness [7,8]. However, BLDC motor is a multivariable nonlinear system, the conventional PID controller using in this system always exist some deficiencies. It is so sensitivity to the system uncertainties that the control performance can be seriously degraded under parameter variations. Moreover, the conventional PID controller is also difficult to tune the control parameters to adjust the high precision and rapid speed of system dynamic performance and static performance [9][10][11]. In order to make a better control of the BLDC motors, many researchers have studied and proposed some advanced control strategies.
Chang hyun kim et al. [12] reported an enhanced PID controller for speed control of BLDC motors based on convex set optimization. It was shown that the enhanced PID controller could achieve a better speed performance of time domain comparably with the conventional PID controller. Mohq Tariq et al. [13] presented an anti-windup PI speed controller of BLDC motor drive, it was proved that the anti-windup PI controller has better anti disturbance ability, less overshoot and less settling time of the system than the conventional PI controller, furthermore, the antiwindup PI controller also can improve the speed response ability of BLDC motor. Recently, a number of researchers have proposed their improved PID controllers and these controllers often showed some better properties than the conventional PID controller. But all of these PID controllers still exist the problem that they cannot coordinate with the real-time parameters of BLDC motors, and it is also hard to select the optimum control values for these controllers [14].
With the development of intelligence control technology, many intelligence control algorithms have been combined to the conventional PID controller. And these intelligence algorithms are used to find out the real-time optimum control value of PID controller to adjust the system of BLDC motor [15]. Fuzzy control is one of the most commonly used intelligence control technologies as its excellent control performance and it is easy to be designed and implemented [16]. In recent years, many researchers have done their work in this field. Kandiban et al. [17] studied the speed control of BLDC motor using adaptive fuzzy PID controller, it was provided an overview of performance conventional PID controller, fuzzy PID controller and adaptive fuzzy PID controller. Kandiban et al. attested that the adaptive fuzzy PID controller could lead to a less overshoot and a less settling time than the conventional PID controller and fuzzy PID controller. It is also shown that the adaptive fuzzy PID controller had obvious advantages when the BLDC motor was working at lower and higher speeds, in addition, the motor speed to be constant when the load varies. Ramya et al. [18] investigated a hybrid self-tuning fuzzy PID controller for speed control of BLDC motor. The hybrid self-tuning fuzzy PID controller includes a conventional PID controller at steady state and a self-tuning fuzzy PID controller at transient state. It was found that the hybrid self-tuning fuzzy PID controller had less speed ripple, less steady-state error and it is robust to load perturbation. Adel A. EI-samahy et al. [19] compared the performance of self-tuning fuzzy PID controller and model reference adaptive controller with PID compensator. It was shown that the model reference adaptive controller with PID compensator has better performance, which indicated that self-tuning fuzzy PID controller could be further improved possibly. The speed response of BLDC motor using fuzzy PID controller under varying load condition was researched by Akash Varshney et al. [20]. The research analysed the performance of fuzzy PID controller when the BLDC motor was subjected to the most commonly encountered sudden load variations and gradual load variations under constant speed operation. It was proved that the transient response in terms of overshoot, undershoot, peak time and settling time were improved with the use of fuzzy PID controller. It was also found that the commonly experienced major drawback of the jerks of BLDC motors at the time of load removal was reduced by about 50% in case of sudden load removal and by about 80% in case of gradual load removal by applying fuzzy PID controller as against the use of the conventional PID controller.
To our knowledge, the previous researches have shown the outstanding performance of fuzzy PID controller for the speed control of BLDC motors. However, the integrator windup of fuzzy PID controller has rarely been researched and reported. As the speed control system of BLDC motors has a characteristic with strong saturation, the integral function of PID controller would cause the typical windup phenomenon and may result in a poor performance when the system is saturated [21,22]. It is worth to study and improve the anti-windup property of fuzzy PID controller.
In this paper, an anti-windup self-tuning fuzzy PID controller was proposed. This modified fuzzy PID controller actually included two controllers, a self-tuning fuzzy PID controller and an anti-windup controller that was designed as a proportion controller. These two controllers were switched by a switching function which based on the output of the proposed controller and the speed error of BLDC motor, thereby, the proposed controller could combine the merits of both controllers. The paper is organized as follows: the model of BLDC motor is discussed in Section 2, the proposed controller and the model of proposed controller in MATLAB/Simulink are described in Section 3, the simulation experiments in MATLAB/Simulink and the simulation results are presented in Section 4. Section 5 shows the experimental verification and Section 6 concludes the paper.

The control system of BLDC motor
The working principle of BLDC motor could be described as follows: electronic commutation controller receives the position signal of rotor by position sensors, and controls the inverter bridge to change the power-up state of windings. The continuous commutating will produce a rotating magnet at the stator windings and then drive the rotor to move [23]. The BLDC motor in this paper has three stator windings connecting in star model and a permanent magnet rotor, driving by the model of three-phase six-step and two-phase breakover with 120 electrical angle [24]. Figure 1 shows the BLDC motor control system.

Mathematical model of BLDC motor
dt þ E, the voltage equation of BLDC motor can be characterized by the following equation: where u a , u b , u c are the stator phase voltage, R a , R b , R c are the stators phase resistance, i a , i b , i c are stators phase current, L aa , L bb , L cc are winding self-induction of three-phase stators, L ab , L bc , L ba , L ac , L ca , L cb are mutual inductance between three-phase stators winding, E a , E b , E c are the back electromotive force of three-phase stators.
As the resistance of each stator is equal, and the structure of three stator windings is totally symmetrical, so there are equations: For a three-phase star winding motor, there is an equation: From (2)-(5), the voltage (1) can be rewritten as The torque equation of BLDC motor is described as where T e is the electromagnetic torque, v is the motor mechanical angular velocity. The motion equation of BLDC motor can be written as

Simulation model of BLDC motor in MATLAB/Simulink
There are three common ways to build the simulation model of BLDC motor in Simulink: model on transfer function, model on S-functions and graphical simulation in Simulink. In this paper, the simulation model of BLDC motor was built on graphical simulation. Figure 2 shows the Simulink model of BLDC motor. In the simulation model, the modified fuzzy PID controller was used to control the speed of BLDC motor, the load torque was controlled by a Lookup Table function module, and the stator current, rotor speed and electromagnetic torque were observed by using Scope modules. To simplify the simulation, the current controller was not considered in this model due to current determines the torque of BLDC motor but has little influence on the speed.

Conventional PID controller
The conventional PID controller is a simple three-term controller, the letter P, I and D stand for proportion, integral, derivative. Figure 3 shows the structure of the convention PID controller, and the output of a conventional PID controller can be described as the following equation: is the speed error.
In modern control systems, for the sake of reliability, the continuous PID controller should not be applied directly and a discrete processing is needed. Then, the digital conventional PID controller can be expressed as: where e(k), e(k ¡ 1) are the error at the time of k and k ¡ 1.

Self-tuning fuzzy PID controller
The self-tuning fuzzy PID controller essentially consists of two parts: conventional PID controller and fuzzy controller. The parameters of PID controller are tuned by the Fuzzy controller according to the real-time system. Figure 4 describes the structure of the self-tuning fuzzy PID controller. The fuzzy controller in this paper is based on the mode of two-dimension and three-variable, which has two inputs and three outputs. The inputs of fuzzy controller are the error("e") and the rate of change of error("4e"), here, the error is the speed error of BLDC motor. The outputs are variables of K p1 , K i1 and K d1 , which are to tune the parameters of PID controller, the regulation rules are shown as follows: where, K p0 , K i0 and K d0 are initial value of PID controller. The structure of fuzzy controller is shown in Figure 5. As shown in Figure 5, the inputs, which are error and the rate of change of error, are converted  into fuzzy variables and divided into seven levels in this paper: Negative Big(NB), Negative medium(NM), Negative small(NS), Zero(ZO), Positive small(PS), Positive medium(PM) and Positive Big(PB). The range of the both inputs is from ¡3000 to 3000 and the membership functions for the error and the rate of change of error are represented with triangle-shaped function that is shown in Figure 6.
As each of the inputs is described with seven linguistic values, there are 7 £ 7 = 49 rules for each output. In total, 49 £ 3 = 147 rules are needed for K p1 , K i1 and K d1 . Table 1 shows the rule tables for them. The outputs are also divided into seven levels, which are NB, NM, NS, ZO, PS, PM and PB, and the range is from ¡1 to 1. Figure 7 shows the membership functions for the outputs.

Anti-windup controller
In the system of BLDC motor, it is tend to induce the phenomenon of windup due to the integral function, and the motor cannot respond the regulation of PID controller when this phenomenon happens. It is obvious that the windup should be prohibited and there are some anti-windup PID controllers which have already been designed and adopted in the system of BLDC motor. In this paper, a method of integral separation is used and a proportion controller is designed.
The designed anti-windup controller also includes two parts: fuzzy controller and proportion controller, the structure is shown in Figure 8. The fuzzy controller has two inputs and one output, the inputs are also the speed error and the rate of change of error, the output is a variable of K p2 . As mentioned above, the output is used to tune the parameter (K pt) of the proportion controller, and the regulation rules can be expressed as where K pt0 is initial value of proportion controller. The inputs of this fuzzy controller are divided into five levels: NB, NS, ZE, PS and PB, and the range of them is normalized from ¡1 to 1. The output is also   divided into four levels: Zero(Z), Small(S), Medium (M) and Big(B), that range is normalized from 0 to 2. Figure 9 shows the membership functions for e, 4e and K p2 . Table 2 is the rule Base of this fuzzy controller. Figure 10 shows the saturation characteristic of BLDC motor system. It can be found that the system will lose the ability to follow the control of controller when the output of controller exceeds the threshold, which is the phenomenon of windup. The proposed anti-windup self-tuning fuzzy PID controller could avoid the phenomenon of windup by switching the two controllers for the speed control of BLDC motor, the logic of the switch function can be expressed as

Anti-windup self-tuning fuzzy PID controller
If U > U max or U < U min , and e U < 0; then the antiwindup controller works; If U min < U < U max , and e U > 0; then the selftuning fuzzy PID controller works; where U is the output of anti-windup self-tuning fuzzy PID controller (before current limiter), U max and U min are the maximum limit value and minimum limit value of the output, e is the speed error.
The Simulink models of self-tuning fuzzy PID controller, anti-windup controller and the proposed anti-windup self-tuning fuzzy PID controller are shown in Figure 11.

Simulation results and discussion
In this section, the speed response and electromagnetic torque characteristics of BLDC motor with antiwindup self-tuning fuzzy PID controller and conventional PID controller are researched, respectively in MATLAB/Simulink. The simulation is conducted on the different operating conditions such as sudden/ gradual change in load, start with different load, varying set speed. Here, the proportional gain, integral gain and derivative gain of the conventional PID controller are 0.016, 28 and 0.0001, respectively. Figure 12 shows the speed response of BLDC motor on condition of sudden application and removal of load with the proposed controller and conventional PID controller. The set speed is 3000 rpm, during the time from 0 to 0.2 s, the motor is running with no load, then a step load of 5 Nm is applied at the time of 0.2 s,   Table 3. when the proposed controller is used, the overshoot is 5.77%, settling time is 0.039 s with rising time of 0.011 s at the time of starting, the overshoot is ¡5.68% with the settling of 0.026 s when the sudden load is applied, at the time of sudden load is removed, the overshoot is 3.83%, settling time is 0.025 s. For that of conventional PID controller, the overshoot is 6.83%, rising time is 0.015 s and the settling time is 0.053 s during the starting, when the sudden load is applied, the overshoot is ¡7.56% and settling time is 0.043 s, while at the time of sudden load removal, the overshoot is 4.53% with settling time of 0.033 s. The waveform of electromagnetic torque with the proposed controller is sharper than that of conventional PID controller due to the shorter rising time and settling time. Figure 13 shows the electromagnetic torque response curve with the two controllers. It is clear that the anti-windup self-tuning controller has a better performance than conventional PID controller on this condition.

Sudden change in load
Here, the simulation also shows some irregular results: the steady-state error with proposed controller gives better results than that with conventional PID controller. This may due to the inappropriate parameters of conventional PID controller, which were given as fixed constants (0.016, 28 and 0.0001, respectively) according to previous experience. While the proposed controller can adapt the real-time system with fuzzy   algorithm by adjusting the control parameters more suitable.

Gradual change in load
The speed response of BLDC motor on the condition of gradual change in load with proposed controller and conventional controller is shown in Figure 14.    Table 4, from the results, the overshoot, settling time and rising time of the proposed controller are less than these of conventional PID controller when the load changes gradually. The overshoot is ¡0.97% and settling time is 0.037 s as the gradual application of load, while the load decreases linearly, the overshoot is 0.87% and settling time of 0.040 s with conventional PID controller. For the proposed controller, the overshoot is ¡0.57% with settling time of 0.031 s as the load is applied gradually, and the overshoot is 0.53% with settling time of 0.035 s on the condition of the gradual removal of load. From the results, it is safe to say that the proposed controller plays a more outstanding performance.

Starting characteristics
The starting characteristics of BLDC motor with the two controllers are investigated in Simulink by starting at four different loads, which are 0, 5, 10 and 20 Nm. The simulation results are shown in Figure 15 and Table 5. It can be found easily that for each controller, the overshoot decreases as the load increases, while setting time and rising time rise slightly. From Table 5, the overshoot of conventional PID controller changes apparently from 6.83% to 1.24% and that of the proposed controller changes from 5.77% to 0.93% as the load increases from 0 to 20 Nm. The rising time of conventional PID controller and that of the proposed controller rise from 0.015 to 0.033 s and from 0.011 to 0.021 s, respectively, and the settling time of both controllers changes little with the increase of load. The results also show that the overshoot, settling time and rising time of the proposed controller are less than that of conventional PID controller on the condition of each load. Figure 16 presents the response of BLDC motor with the proposed controller and conventional PID controller on the condition of sudden change in speed. There are two simulation experimental schemes which are designed as follows:

Varying set speed
(1) the motor starts with the speed of 3000 rpm and the speed changes suddenly from 3000 to 1500 rpm at the time of 0.2 s; (2) the motor starts with the speed of 1500 rpm and the speed suddenly increases from 1500 to 3000 rpm at the time of 0.2 s.
As shown in Figure 16, the proposed controller exhibits a better performance than conventional PID controller when the speed of BLDC motor changes in a sudden. It also can be found that the speed response of   Table 6 lists the results of simulation experiment that carried out with the motor starts at the speed of 3000 rpm, and the results of the other simulation experiment are shown in Table 7. Table 6 shows that the overshoot of both controllers increases significantly as the speed decreases from 3000 to 1500 rpm suddenly, specifically, the overshoot is ¡16.1% with conventional PID controller and ¡14.7% with the proposed controller. The overshoot, settling time and rising time at the starting speed of 1500 rpm are less than these at the starting speed of 3000 rpm. From Table 7, the overshoot is 5.13% at the starting speed of Figure 15. (a) Speed response curve at different loads by using conventional PID controller; (b) speed response at different loads by using the propose controller. 1500 rpm and 5.94% when the speed suddenly changes with conventional PID controller. For the proposed controller, the overshoot is 2.67% at the starting speed of 1500 rpm and 4.86% on the condition of speed changes from 1500 to 3000 rpm suddenly. The results also indicate that the overshoot, settling time and rising time with the proposed controller are obviously less than these with conventional PID controller, which shows the better performance of the proposed controller.

Experimental verification
Some experiments are conducted and the results are provided in this section to verify the performance of proposed controller. As Figure 17 shows, the speed Figure 16. Speed response curve of BLDC motor when speed changes suddenly, (a) speed changes suddenly from 3000 to 1500 rpm, (b) speed changes suddenly from 1500 to 3000 rpm.  Figure 17. Experimental setup of speed control for BLDC motor.
control of BLDC motor is implemented based on STM32. The rotor position of BLDC motor is measured by Hall sensor, and the rotor position is then converted into actual speed by derivative algorithm.
The output of Hall sensor and the phase voltage waveform are detected by an oscilloscope. Figure 18(a,b) shows the phase voltage waveform and output of Hall sensor, respectively at the speed of 1500 rpm, while   Figure 18(c) depicts the speed response curve on the condition that the BLDC motor starts at 1500 rpm and the speed suddenly changes from 1500 to 3000 rpm without any load. It is clear that the rotor speed with proposed controller increases to track the set speed and reach the stability more rapidly than which with the conventional PID controller. The speed response characteristics as load changes suddenly are depicted in Figure 19 when the load is applied suddenly, the speed with proposed controller decreases more lightly than that with the conventional PID controller, and recovers more quickly. From the experimentation studies, it is proved that the proposed controller has excellent performance for the speed control of BLDC motor.

Conclusion
The paper presented an anti-windup self-tuning fuzzy PID controller for speed control of BLDC motor, and the performance was compared with conventional PID controller in MATLAB/Simulink. The simulation experiments were conducted on some commonly encountered conditions, such as load changes suddenly or gradually, the motor starts with different loads and sudden change in speed. The results of these experiments proved that the anti-windup self-tuning fuzzy PID controller has more excellent performance than conventional PID controller. The system has less overshoot, steady-state error, shorter settling time and rising time by using anti-windup self-tuning fuzzy PID controller on various conditions. From the results, it was easy to reach the conclusion that the proposed controller could accelerate the response speed of the motor and strengthen anti-windup ability. It also indicated that the BLDC motor runs smoothly and the robustness of the system was optimized by the proposed controller. It is proved that the proposed controller has outstanding performance for the speed control of BLDC motor. However, the efficiency of proposed controller relies on fuzzy algorithm to a great extent, and the fuzzy controller always determines the performance of proposed controller. This may be the limitation of proposed controller, and some certain optimization algorithms could be used for tuning of fuzzy rule and input-output scaling factor to achieve effective and reliable performance of proposed controller, which is worthy to be researched as the future work.