You are on page 1of 6

ICVES 2009

Digital Implementation of Fuzzy Logic Controller for Wide Range Speed Control of Brushless DC Motor
R.Shanmugasundram, Member, IEEE, K.Muhammed Zakariah, and N.Yadaiah, Senior Member, IEEE
Gate Bipolar Transistor (IGBT) power hybrid IC, high speed buffers, and single supply op-amps with superior characteristics. The organization of the paper is as follows: Section II describes the modeling of BLDC motor; section III describes the features of ADUC812 microcontroller, design of fuzzy logic controller is discussed in section IV, experimental set-up is discussed in section V, PWM modulation technique is discussed in section VI, experimental results are presented in section VII and finally concluded in the last section. II. MODELING OF BLDC MOTOR The modeling of BLDC motor drive system is based on the following assumptions. 1. All the stator phase windings have equal resistance per phase and constant self and mutual inductances. 2. Power semiconductor devices are ideal. 3. Iron losses are negligible and the motor is unsaturated. Based on the above assumptions, the three phase input voltages [2] are expressed as follows.

Abstract The brushless DC motors find wide applications


such as in battery operated vehicles, wheel chairs, automotive fuel pumps, robotics, machine tools, aerospace and in many industrial applications due to their superior electrical and mechanical characteristics and its capability to operate in hazardous environment. Conventional controllers fail to yield desired performance in BLDC motor control systems due to the non-linearity arising out of variation in the system parameters and change in load. The main focus is now on the application of artificial intelligent techniques such as fuzzy logic to solve this problem. Another great challenge is to reduce the size and cost of the drive system without compromising the performance. In this paper, the design and digital implementation of fuzzy logic controller using a versatile ADUC812 microcontroller, and lowcost, compact, superior performance components are used in order to reduce the cost and size of the drive system. The experimental results are presented to prove the flexibility of the control scheme in real time. Index Terms BLDC motor, fuzzy logic, IGBT power hybrid IC.

HE brushless dc motors are gradually replacing dc motors and ac motors because of their small size, high operating speed, high efficiency, less maintenance and excellent speed torque characteristics. They are used in robotics, computer disk drives, machine tools, electric vehicle and battery powered applications. The conventional control schemes such as proportional (P), proportional integral (PI) and proportional integral derivative (PID) have been developed for speed control of BLDC motors. However, these controllers need an accurate mathematical model and can be applied only to highly linear systems. These controllers fail to yield better performance when the system becomes non-linear and it is a cumbersome process to tune these controllers. In practice, the BLDC motor control systems are non-linear because of the variation in their parameters and varying loads. Fuzzy logic controllers are well suited to control systems with uncertain, complex, inaccurate or non-linear dynamics such as BLDC motor control systems. Fuzzy logic controller (FLC) can be easily designed and implemented knowing the behaviors of the system and it can greatly reduce the effects of non-linearity on the BLDC motor control systems. Another major challenge is to reduce the size of the drive system, its cost without compromising its performance. To meet these requirements, BLDC drive system is designed using Insulated

I. INTRODUCTION

va = Ria + L
v b = Ri b + L

dia + ea dt
di b + eb dt

(1)

(2)

vc = Ri c + L
1

di c + ec dt

(3)

The electro magnetic torque is expressed as

Te =

( e a i a + eb ib + ec ic )

(4)

The electromagnetic torque can also be expressed as

Te =

2 EI

(5) (6) (7)

E = ea = eb = ec
I = i a = ib = ic

978-1-4244-5441-9/09/$26.00 2009 IEEE

119

Te =TL + J

d + B dt

Defuzzification

The electromagnetic torque can be expressed in terms of mechanical parameters as


Fuzzification E

Fuzzy Inference

(8)

where va, vb, and vc are the stator phase winding voltages of phase a, b and c respectively, ea, eb , and ec are the back-emfs of phase a, b and c respectively, ia, ib, and ic are the phase currents of phase a, b and c respectively, TL is the load torque, J is inertia, is angular speed, B is viscous damping coefficient. III. ADUC812 DIGITAL CONTROLLER The die-size, low-cost Aduc812 microcontroller [5], [11] has a fully integrated 12-bit data acquisition system incorporating multi-channel ADC, dual DAC and programmable 8-bit microcontroller control unit on a single chip. The programmable 8051-compatible core is supported by 8K bytes Flash / EE program memory, 640 bytes Flash / EE data memory and 256 bytes data SRAM on-chip. The 8051-Compatible core with an internal clock source of 12 MHz has three 16-Bit Timer/Counters, 32 Programmable I/O lines out of which port 3 has high Current Drive Capability and Nine Interrupt Sources. The functions of the microcontroller include determining the rotor position from the hall sensor signals so as to switch ON the required power semiconductor devices at the appropriate rotor positions to produce a continuous unidirectional torque, measurement of speed, compute fuzzy output, and to generate PWM signal. The microcontroller not only reduces the cost and size of the circuit but also it performs computation at greater speed due to its high internal clock frequency and architecture design. IV. FUZZY LOGIC CONTROLLER DESIGN There has been a significant and growing interest in the application of artificial intelligence (AI) type control techniques such as neural network and fuzzy logic to control the complex, non-linear systems. Fuzzy logic is applied in applications like washing machines, sub way systems, video cameras, sewing machines, biomedical and finance. Having understood the general behavior of the system, fuzzy logic enables the designer to describe the general behavior of the system in a linguistic manner by forming IF-THEN rules which are in the form of statements. The general fuzzy logic controller [13]-[15] consists of four parts as illustrated in Fig.1. They are fuzzification, fuzzy rule-base, fuzzy inference engine and defuzzification. The design steps are as follows.

CE

Rule Base
Figure 1. Structure of fuzzy logic controller

Step 1: Define inputs, outputs and universe of discourse The inputs are error (E) and change in error (CE) and the output is change in duty-cycle (DC). The error is defined as the difference between the set speed (Nset) and actual speed (Nact) and the change in error is defined as the difference between the present error e(k) and previous error e(k-1). The output, Change in duty-cycle DC is which could be either positive or negative is added with the existing duty-cycle to determine the new duty-cycle (DCnew) in order to control the voltage applied across the armature windings. The inputs and new duty-cycle are described by,

E = e(k ) = N set N act


CE = e(k ) e(k 1) DC new = DC old DC

Output

Inputs

(9) (10) (11)

Where DCold is the existing duty-cycle. As mentioned in the appendix, the motor maximum range of speed is 0-4000 rpm. The possible range of error is -4000 to +4000 rpm. Therefore, the universe of discourse for error can be defined to span between -4000 rpm to +4000 rpm. Based on the study of this closed loop system, the universe of discourse for change in error is chosen in the range of +/-500 rpm. For the change in duty cycle, the maximum and minimum value are defined as 100 % and +100 % respectively. As it is difficult to handle these large values and reduce the computation time in order to achieve faster control action, the inputs and output are normalized to +/-100 rpm, +/-50 rpm and +/-100 respectively. Step 2: Defining fuzzy membership functions and rules To perform fuzzy computation, the inputs must be converted from numerical or crisp value into fuzzy values and the output should be converted from fuzzy value to crisp value. The fuzzy variables error, change in error and change in duty-cycle are quantized using the following linguistic terms negative (N), zero (Z) or no-change (NC) and positive (P). Fuzzy membership functions are used as tools to convert crisp values to linguistic terms. A fuzzy variable can contain several fuzzy subsets within, depending on how many linguistic terms are used. Each fuzzy subset represents one linguistic term. Each fuzzy subset allow its members to have different grade of membership, usually the membership value lies in the interval [0, 1]. Since microcontroller can handle only integer values, the range of membership is chosen in the range of [0, 10]. In order to define fuzzy membership function, the

120

designer can choose many different shapes based on their preference and experience. The popular shapes are triangular and trapezoidal because these shapes are easy to represent designers ideas and requires less computation time. In order to fine tune the controller for improving the performance, the adjacent fuzzy subsets are overlapped by about 25%. The membership functions used for inputs and output are illustrated in Fig. 2.

10

TABLE I. 3X3 FAM MATRIX E CE NE ZE PE

NCE ZCE PCE

N N N

N NC P

P P P

NE

ZE

PE

Finally the fuzzy output is converted into real value output i.e. crisp output by the process called defuzzification. Even though many defuzzification methods are available, the most preferred one is centroid method because its can easily implemented and requires less computation time when implemented in digital control systems using microcontrollers or DSPs. The formula for this method is given by,

-100

10

0 Error, E ZCE

+100 PE

z=

( x) x
x =1 n

NE

( x)
x =1

(12)

Where z is the defuzzified value, (x) is the membership value of member x. This crisp value which is either positive or negative is added to the previous output to control the dutycycle of the switching devices in the power inverter so as to control applied voltage across the armature winding, hence the speed of the motor. -50 0 +50 Change in Error, CE V. EXPERIMENTAL SET-UP P The block diagram of the experimental set-up is shown is Fig.3. The experimental set-up consists of four components. They are IGBT power inverter, BLDC motor with loading arrangement, speed measuring circuit, and microcontroller. The BLDC motor is an electronically commutated motor. The built-in hall sensors generate three signals according to the rotor position. These signals are decoded to identify the rotor position and energize the appropriate windings by switching the appropriate switches in the power inverter. The commutation sequence is listed in Table II.
IGBT Inverter Input DC Supply
PWM Gating Signals BLDC Motor

10

NC

-100 0 +100 Change in Duty-cycle, DC


Figure 2. Membership functions for Error (E), Change in Error (CE) and Change in Duty-Cycle (DC).

Disk Load Speed Sensor F/V Converter Actual Speed Set Speed

Instead of using mathematical formula, FLC uses fuzzy rules to make a decision and generate the control action. The rules are in the form of IF-THEN statements. For example, IF the error (E) is positive and the change in error (CE) is positive THEN the change in duty-cycle (DC) is positive. The number of rules to be used to describe the system behavior is entirely based on the designers experience and the previous knowledge of the system. The performance of the controller can be improved by adjusting the membership function and rules. Fuzzy associative memories (FAM) are transformations which map fuzzy sets to fuzzy sets. A FAM matrix maps antecedents to consequents and is a collection of IF-THEN rules. Each composition involves three fuzzy variables and each fuzzy variable is further quantized into three. This has resulted in nine possible two input and single output FAM rules as illustrated in the Table I.

Hall Sensor Signals

Fuzzy Controller ADUC812 Microcontroller

Figure 3. Block diagram of the experimental set-up

121

TABLE II. COMMUTATION SEQUENCE Start


S.No Rotor Position Hall Sensor Signals H1 0 0 0 1 1 1 H2 1 1 0 0 0 1 H3 0 1 1 1 0 0 Conducting Devices T5, T6 T6, T1 T1, T2 T2, T3 T3, T4 T4, T5

1 2 3 4 5 6

0o- 30o 30o- 60o 60 - 90


o o

180o- 210o 210o- 240o 240 - 270


o o

Initialize I/O Ports, Timers, ADC, initial Duty-cycle & enable Timer Interrupts

Read Set Speed

90o- 120o 120o-150o 150o- 180o

270o- 300o 300o- 330o 330o- 360o

Measure Actual Speed

The duty-cycle of the devices are controlled based on the fuzzy controller output to control the armature voltage and hence the speed of the motor. A disk consisting of 60 holes near the outer periphery is attached to the motor shaft. A photo diode and photo transistor is place side by side allowing the disk to rotate in between them. The photo transistor generates number of pulses per second proportional to speed of the motor. These pulses are given as input to the F/V converter to convert the frequency into dc signal. This dc signal which is in the range of 0-5V is given as one of the input to analog to digital (A/D) converter of the microcontroller to determine the actual speed of the motor. The set speed is generated through a potentiometer and voltage follower and it is given as another input to the A/D converter to determine the set speed. The function of the microcontroller is to compute the error and change in error, store these values, compute the fuzzy controller output, determine the new duty-cycle for the switching devices and perform electronic commutation. The timer 0 interrupt subroutine generates PWM signals for the switching devices. The flowchart for the main program and interrupt service subroutine is shown in Fig. 4 - Fig.5. Initially, initialize the port1 of microcontroller as input port to read hall senor signals inorder to identify the rotor position and port 3 as output port for generating control signals for the IGBTs and a pulse width modulated signal. The control signals are given to IGBTs through their respective AND gate which has one of the input as PWM signal. The driver circuits are designed to operate at high frequencies. The duty cycle of the IGBTs is varied to vary the average voltage applied across the winding and hence the speed of the motor. The duty-cycle is initially set more than 50% so as to allow sufficient current through the motor windings to start and run the motor. The time period of the PWM signal is chosen such that it is greater than the time constant of the motor so as to allow sufficient current through the windings in order to produce the required torque during the normal operation [6], [7]. The PWM signal is generated at one of the pins of port 3 of the microcontroller using timer 0.

Calculate Error, E and Change in Error, CE

Compute Fuzzy Output, Duty-Cycle, DC

Update the Duty-Cycle DCnew=DCold+DC

Figure 4. Flowchart of main program


Timer 0 interrupt subroutine

Is PWM output is HIGH?

YES

Load Timer Register with OFF time and set PWM signal LOW

NO Load Timer Register with ON time and set PWM signal HIGH

Return

Figure 5. Flowchart of timer interrupt service subroutine program

The low-cost, reliable power hybrid IC is integrated with high speed driver, thermal overload and short-circuits current limit protection circuits. The hybrid power module IC replaces the conventional bulky and expensive MOSFET/Transistor inverter and associated isolation and driver circuits. This IC requires low voltage nearly 3V and 0V to turn OFF and turn ON respectively. Moreover the effects of electromagnetic interference and noise signal are completely eliminated. The high-speed digital buffer IC 74HCT244 is used to interface microcontroller with hybrid power module IC and hall sensor circuit. The hall sensor signals are applied as input to the microcontroller through buffer IC and the gating signals generated by the microcontroller for the IGBT switches are also applied through buffer IC. Since Port 3 of microcontroller has high output driving capability, pins P3.0 to P3.5 are used for the generation of gating signals. The hall sensor signals are

122

applied to input port 1 pins P1.0 to P1.2 through buffer IC. The PWM signal is generated at pin 3.6 using timer 0. The program is written for microcontroller using Keil software and the output hex file generated is downloaded from personal computer to microcontroller. The experimental set-up is shown in Fig. 6.
IGBT HYBRID POWER MODULE IC +V T1 DC INPUT SUPPLY T3 T5 Current Sensors Ea Eb Ec T4 T6 T2

MotorGenerator Set

GND

T1

T3 T5 T2

T4 T6

Signal Conditioning and Filter Circuit Section

Hall Sensor Signals and Speed Signal

speed of the motor varies smoothly as the set speed is varied and the motor produces required torque to drive the load. The motor is subjected to step change in load and the transient and steady-state behavior is studied. It is found that there is no overshoot and system respond is faster. The step response for two different cases is shown in Fig. 10 - Fig. 11. The performance of the system with fuzzy logic controller is found be better as compared with conventional PI controller. The response of the system with PI controller is found to have large settling time with overshoot. Moreover, its response is poor when the system dynamics changes, particularly due to change in load. The photograph of the hardware set up is shown in Fig. 12. Current Ia

Gate Driver External Gate Driver


Phase Voltages Ea Eb Ec Phase Currents (Ia, Ib, Ic)

Ib 5 A/div

Figure 6. Experimental set-up

Ic 4 ms/div time

VI. PWM CONTROL TECHNIQUE The pulse width modulation control technique is used to control the applied voltage across the windings in order to control the speed of the motor. The duty cycle of the 10 KHz signal generated by the microcontroller is varied to control the current and average voltage in the windings and hence the torque produced by the motor. The motor if connected to load initially has to be started with maximum duty cycle in order to produce sufficient starting torque by allowing sufficient starting current in the windings. The choice of 10 KHz PWM signal is made because of the absence of acoustic noise during the motor operation. The expression for the average voltage applied across the winding is given by (13). The timer continuously generates PWM signal while the microcontroller is executing the main program. The main advantage of PWM control over resistive power controller is that variable power can be supplied to the motor by varying the duty-cycle without much power loss. Therefore, the system efficiency is high, while delivering average current in the form of pulses to the motor.

Figure 7. Phase Currents[Ia, Ib, and Ic]

Voltage

Ea

Eb 36 V/div Ec

4 ms/div

time

Figure 8. Phase Voltages with PWM [top to bottom: Phase a, b,and c]

Where ton is turn on time, T is total time period of PWM signal, Vdc is the dc input voltage applied to the bridge and Vo(avg) is the average dc voltage applied across the winding.

5A/div

Vo ( avg ) = Dutycycle * Vdc t % Dutycycle = on *100 T

(13) (14)

Current

500 s/div
Figure 9. DC Supply Current

time

VII. RESULT The observed phase currents, phase voltages and dc supply current waveforms when the motor is running at rated speed with 50% load are shown in Fig. 7 - Fig. 9. It is found that the

123

1000 rpm/div Speed

APPENDIX Parameters Of BLDC Motor


Rated Voltage Rated Current No. of Poles No. of Phases Rated Speed Rated Torque Torque Constant Mass Inertia Terminal Resistance Line-Line Inductance 36V 5A 4 3 4000 RPM 0.42 Nm 0.082 Nm/A 1.25 KG 23 KGM2 * 10-6 0.38 1 mH

250 ms/div

time

Figure 10. Speed response when the motor is started to run with set speed of 4000 rpm with 30% load

1000 rpm/div Speed

ACKNOWLEDGMENT We are extremely thankful to the management of Sri Ramakrishna Engineering College, Coimbatore and JNT University, Hyderabad for providing all necessary facilities, guidance and support for carrying out this work. 250 ms/div time REFERENCES
[1] [2] [3] [4] T. Kenjo, "Permanent magnet and brushless dc motors", Oxford, 1985 T.J.E. Miller, "Brushless permanent magnet and reluctance motor drive", Oxford, 1989 D. Lerdman, Electronically Commutated Motor, U.S. Patent 4 169 990, Oct. 2, 1979. D. M. Erdman, H. B. Harms, and J. L. Oldenkamp, Electronically commutated dc motors for the appliance industry, in Proc. 1984 IEEE Ind.Applicat. Soc. Ann. Mtg., 1984, pp. 13391345. F. Rodriguez, A. Emadi, "A Novel Digital Control Technique for Brushless DC Motor Drives," IEEE Trans. on Industrial Electronics, vol. 54, no. 5, pp. 2365-2373, May 2007. C. Berendsen, G. Champenois, and A. Bolopion, Commutation strategies for brushless dc motors: Influence of instant torque, IEEE Trans. Power Electron., vol. 8, no. 2, pp. 231236, Apr. 1993. D.Erdman, US Patent No.4654566, Control system, method of operating an electronically commutated motor, and laundering apparatus, March 1987. R. Calson, M. Lajoie-Mazenc, and J. Fagundes, Analysis of torque ripple due to phase commutation in brushless dc machines, IEEE Trans. Ind. Appl., vol. 28, no. 3, pp. 632638, May/Jun. 1992. S. J. Park, H. W. Park, M. H. Lee, and F. Harashima, A new approach for minimum-torque-ripple maximum-efficiency control of BLDC motor, IEEE Trans. Ind. Electron., vol. 47, no. 1, pp. 109114, Feb. 2000. D. K. Kim, K. W. Lee, and B. I. Kwon, Commutation torque ripple reduction in a position sensorless brushless dc motor drive, IEEE Trans.Power Electron., vol. 21, no. 6, pp. 17621768, Nov. 2006. J. Shao, D. Nolan, M. Teissier, and D. Swanson, A Novel micricontroller based sensorless brushless DC motor drive for automative fuel pumps, Conference Record of 37th IAS Annual Meeting, pp. 2386-2392, 2002. Y.S.Lai, F.S. Shyu and Y.H.Chang, Novel pulse-width modulation with loss reduction for small power brushless DC motor drives, Conference Record of the IEEE IAS Annual Meeting, pp. 2057-2064, October 2002. P.Guillemin, Fuzzy logic applied to motor control, IEEE Trans. Ind. Applicat., vol.32, no.1, pp.51-56,1996. N.Govind, A fuzzy rule based 5 HP dc motor speed controller, Fuzzy logic handbook, 1994, Intel Corporation, no. 272589-001, pp. 95112. Bay O.F. Bal, Demirbas.S, Fuzzy logic based control of brushless servo motor drive, Proceedings of 7th International Power Electronics and Motion Control Conference, Hungary, 1996, pp.448-52.

Figure 11. Speed response when the set speed is changed from 3000 rpm to 4000 rpm with 50% load

IGBT Power Inverter IC

[5]

[6]

Motor-Generator Set up
Figure 12. Photograph of Hardware Set up

[7]

[8]

[9]

VIII. CONCLUSION The proposed low cost, compact, robust, fuzzy logic speed controller for BLDC motor using a versatile Aduc812 microcontroller is designed, implemented and tested. The set speed is varied and the variation in the motor speed is measured and the performance of drive is found to be excellent. The motor is subjected to disturbances by changing the load and the transient and steady-state behavior of the system is studied. It is found that the system responds faster with no overshoot and the actual speed matches with the set speed under different load conditions. It is also found that this drive less is affected by electromagnetic interference and noise signals. Several protective functions like over current protection, over voltage, and thermal protection to protect the BLDC drive can also be implemented in the Aduc812 microcontroller. This entire drive can be put in a compact module and it can be used for speed control applications.
[10]

[11]

[12]

[13] [14]

[15]

124

You might also like