REALIZATION OF FUZZY LOGIC CONTROLLED BRUSHLESS DC MOTOR DRIVES USING MATLAB/SIMULINK

- In this paper, an efficient simulation model for fuzzy logic controlled brushless direct current motor drives using Matlab/Simulink is presented. The brushless direct current (BLDC) motor is efficiently controlled by Fuzzy logic controller (FLC). The control algorithms, fuzzy logic and PID are compared. Also, the dynamic characteristics of the BLDC motor (i.e


INTRODUCTION
BLDC motors have some advantages over conventional brushed DC motors and induction motors.Some of these are; better speed versus torque characteristics, high dynamic response, high efficiency, long operating life, noiseless operation and higher speed ranges.In addition, BLDC motors are reliable, easy to control, and inexpensive [1].Due to their favorable electrical and mechanical properties, BLDC motors are widely used in servo applications such as automotive, aerospace, medical, instrumentation, actuation, robotics, machine tools, industrial automation equipment and so on recently [2][3][4].
Many machine design and control schemes have been developed to improve the performance of BLDC motor drives.The model of motor drives has to be known in order to implement an effective control in simulation.Some simulation models based on state-space equations, Fourier series, d-q axis model, and variable sampling have been proposed for the analysis of BLDC motor drives [5][6][7][8][9][10].Furthermore, fuzzy logic controllers (FLCs) are used to analyze BLDC motor drives in literature [11][12][13][14].
The previous studies have made a great contribution to BLDC motor drives.But as far as we know, a comprehensive approach has not been available for modeling and analysis of fuzzy logic controlled brushless DC motor drives using MATLAB/Simulink.In this paper, a comprehensive simulation model with fuzzy logic controller is presented.MATLAB/fuzzy logic toolbox is used to design FLC, which is integrated into simulations with Simulink.The control algorithms, fuzzy logic and PID are compared.Several simulation results are shown to confirm the performance and the validity of the proposed model.The model based on system-level simulation makes the simulation faster while it is able to provide greater details of the BLDC motor drive system.Besides, considering that the computational time without affecting the accuracy of the results obtained is very low, it can be said that the proposed method is promising.

MODELLING AND SIMULATION OF BLDC MOTOR DRIVE SYSTEM
The proposed control system, which contains two loops, is shown in Figure 1.The first loop is the current control loop that accomplishes torque control of BLDC motor and the second loop is the speed control loop that adjusts the speed of BLDC motor.
where; e T is the electromagnetic torque, L T is the load torque in Nm, J is the moment of inertia in kgm 2 , B is the frictional coefficient in Nms/rad, m ω is rotor speed in mechanical rad/s.and r ω is rotor speed in electrical rad/s.

Modeling of Trapezoidal Back EMF
The trapezoidal back-EMF wave forms are modeled as a function of rotor position so that rotor position can be actively calculated according to the operation speed.The back EMFs are expressed as a function of rotor position (θ), which can be written as: [15] ( ) where e k is back-EMF constant, ( ) 2 )  3)-( 4) into equation ( 5), the expression of the electromagnetic torque can be defined as: Based on the rotor position, the numerical expression of the back EMF can be obtained as Equation ( 3), and this is implemented as shown in Figure 4. Neglecting the damping factor, the speed and torque characteristics of BLDC motor can be stated as follows: and thus the speed and torque control circuit can be implemented as shown in Figure 5.
where i 1 , i 2 and i 3 are the loop currents, e ab , e bc , and e ca are the line-to-line back EMFs: e ab = e a − e b , e bc = e b − e c , e ca = e c -e a , and the phase currents: Using the switching function S_ a,b,c which is obtained from hysteresis block, v ao , v bo , and v co in reference to midpoint of DC supply voltage ( dc V ) can be calculated as; Then the inverter line-to-line voltages can be derived as , , The implementations of the above-explained numerical PWM inverter voltage and current equations [2] are shown in Figure 6 and 7. where ( ) u is the control signal obtained from fuzzy controller and t k is the torque constant of the BLDC motor.The reference phase currents given in Table 1 can be acquired from Figure 8.a.The function f(s) is defined according to Table 1.These currents are inputs to PWM current control block.i i i ).The current errors are calculated as shown in Equation (13).These errors are applied to inverter hysteresis band (±h b ) and the switching signals of three-phase PWM inverter system are generated according to the switching states.As shown in Figure 8.b, the hysteresis current control is performed in the function block fa(s) by using the measured phase current a i , the reference current Imax, and the rotor position θ, where the function block fa(s) is a term which consists of Equation ( 13) and (14).From the hysteresis block, the switching function S_a, S_b, and S_c are defined to model the operation of the PWM inverter [16].

Design of Fuzzy Logic Controller (FLC)
The block diagram of FLC with two inputs 1 2 ( , ) e e and one output ( ) u is shown in Figure 9.The error is calculated by subtracting the reference speed from the actual rotor speed as follows: is the previous error value.
e n e n (16) In the fuzzy logic control system, two normalization parameters 1 2

( , )
e e N N for input and one denormalization parameter ( ) u N for output are defined.In normalization process, the input values are scaled between (-1, +1) and in the denormalization process, the output values of fuzzy controller are converted to a value depending on the terminal control element.( , ) e e and defuziffy output ( ) u of the fuzzy controller.For seven clusters in the membership functions, seven linguistic variables are defined as: Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero (Z), Positive Small (PS), Positive Medium (PM), and Positive Big (PB).

Figure 10. Membership functions of fuzzy controller
A sliding mode rule base used in FLC is given in Table 2.The fuzzy inference operation is implemented by using the 49 rules.The min-max compositional rule of inference and the center-of-gravity method have been used in defuzzifier process.
If e 1 is NB and e 2 is NB Then u is PB, If e 1 is NB and e 2 is NM Then u is PB, If e 1 is NB and e 2 is NS Then u is PM, If e 1 is NB and e 2 is Z Then u is PM, ………………………………………… and go on for all inputs.
MATLAB/Fuzzy Logic Toolbox is used to simulate FLC which can be integrated into simulations with Simulink.The FLC designed through the FIS editor is transferred to Matlab-Workspace by the command "Export to Workspace".Then, Simulink environment provides a direct access to the FLC through the Matlab-Workspace in BLDC motor drive simulation.Figure 11 shows the simulink diagram of Fuzzy logic and PID controllers.These control algorithms can be compared by using switch block.If the mid-point of switch block is '-1', FLC is selected, and in case the mid-point of switch block is '1', the PID is selected.currents waveforms based on the rotor position at 4050 rpm. Figure 13 shows the detailed operational characteristics of PWM inverter based on the switching function concept.The switching function for the phase A, S_a, is given in Figure 13.In order to hold the currents to be switched between the hysteresis upper and lower bands, the switching function signals are only produced during the 120• conduction periods.The positive and negative values represent the upper and lower switch or diode under the conducting state.The line-to-line voltage waveforms are obtained by using the switching function S_a.The produced line-to-line voltage (v ab ) according to the conduction modes is demonstrated in Figure 14.Since T1 and T6 are simultaneously active as seen in Figure 3, the phase A and the phase B currents are positive and negative, respectively  Figure 15 shows the dynamic responses of the speed, torque and Imax, respectively.The reference value of maximum current (Imax) is computed from the generated constant torque reference, consequently it is used in the hysteresis control block.Furthermore, the control algorithms, FLC and PID can be compared by using developed model.As shown in Figure 16 (a) and (b), if the PID controller is used, the real speed and torque reach the desired value in 6.5ms.On the other hand, if FLC is used, the real speed and torque reach the desired value in 5ms.In conclusion it can be said that unlike the classical controller, FLC is more effective in BLDC motor drives.CONCLUSIONS In this paper, a comprehensive analysis of brushless DC drive system has been performed by using fuzzy logic controller.The simulation model which is implemented in a modular manner under MATLAB/simulink environment allows that many dynamic characteristics such as phase currents, voltages, rotor speed, and mechanical torque can be effectively considered.Furthermore, the control algorithms, FLC and PID have been compared by using the developed model.It is seen that the desired real speed and torque values could be reached in a short time by FLC controller.The results show that MATLAB paired with simulink is a good simulation tool for modeling and analyze fuzzy logic controlled brushless DC motor drives.

Figure 3 .
Figure 3. Configuration of BLDC motor and voltage source inverter (VSI) system be determined in a similar way.The electromagnetic torque is redefined using back-EMFs as follows:

Figure 4 .
Figure 4. Simulink diagram for generating back EMF from rotor positions.

Figure 5 .
Figure 5. Simulink diagram for speed and torque control

Figure 6 .
Figure 6.The generation of inverter line-to-line voltages

Figure 8 . 2 . 4
Figure 8.(a) Simulink diagram for reference currents (b) Implementation of hysteresis current control for phase A change in error is calculated by Equation (16), where 1[ 1] − e n

Figure 9 .
Figure 9. Structure of fuzzy logic controller

Figure 11 .
Figure 11.Simulink diagram of fuzzy logic and PID controllers

Figure 12 .
Figure 12. (a)Back EMF waveforms based on the rotor position at 4050 rpm.(b) Phasecurrents waveforms based on the rotor position at 4050 rpm.Figure13shows the detailed operational characteristics of PWM inverter based on the switching function concept.The switching function for the phase A, S_a, is given

Figure 14 .
Figure 14.Phase currents and line to line inverter voltage

Figure 15 Figure 16 .
Figure 15 Electromagnetic torque, speed of BLDC motor, and maximum current (Imax)

Table 1
Reference currents of BLDC motor

Table 2
Rule base of fuzzy controller

Table 3
Parameters of BLDC motor e ) 0.0419 V/rad/s Torque constant (k t ) 4.19 Ncm/A Figure 13.Back EMF and switching function S_a for phase A.