speed control of dc motor by using fuzzy logic

24
SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC CONTROLLER KHAIRUL AFIQ BIN ZAKARIA A thesis submitted in fulfillment of the requirements for the award of degree of Bachelor of Electrical Engineering (Power System) Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang JUNE 2012

Upload: hoangtruc

Post on 10-Dec-2016

234 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC CONTROLLER

KHAIRUL AFIQ BIN ZAKARIA

A thesis submitted in fulfillment of the

requirements for the award of degree of

Bachelor of Electrical Engineering (Power System)

Faculty of Electrical & Electronics Engineering

Universiti Malaysia Pahang

JUNE 2012

Page 2: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

v

ABSTRACT

The automatic control has played a vital role in the advance of engineering and

science. Nowadays in industries, the control of direct current (DC) motor is a common

practice thus the implementation of DC motor of controller speed is important. The main

purpose of motor speed control is to keep the rotation of the motor at the present speed

and to drive a system at the demand speed. The DC Series Wound Motor is very popular

in industrial application and control systems because of the high torque density, high

efficiency and small size. The main purpose of this project is to control speed of DC

Series Wound Motor using four controllers which are PID, PI, P, and Fuzzy Logic

Controller (FLC). Initially all the controllers are developed by using MATLAB simulink

model. In this project, PID, PI, and P controller are developed and tuned in order to get

faster step response and the Fuzzy Logic Controller (FLC) is design based on the

membership function and the rule base. The expectation of this project is the Fuzzy Logic

Controller will get the best performance compared to other controllers in terms of settling

time (Ts), rise time (Tr), peak time (Tp), and percent overshoot (%OS). Finally a GUI of

these controllers are developed which allow the users to select any controller and change

its parameters according to the different conditions under loaded and unloaded scenarios.

Page 3: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

vi

ABSTRAK

Kawalan automatik telah memainkan peranan yang sangat penting dalam

memajukan bidang kejuruteraan dan bidang sains. Pada masa sekarang, setiap industri

menggunakan kawalan arus terus terhadap motor dan pelaksanaan dalam mengawal

kelajuan dc motor adalah sangat penting. Tujuan utama dalam pengawalan kelajuan dc

motor adalah untuk mengekalkan putaran motor pada kelajuan tertentu terhadap kelajuan

yang telah ditetapkan oleh industri. Penggunaan motor jenis DC Series Wound Motor

adalah sangat popular di dalam sistem aplikasi dan kawalan industri kerana motor jenis

ini menghasilkan tork yang tinggi, mempunyai kecekapan yang tinggi, dan juga

disebabkan saiz motor yang kecil. Tujuan utama projek ini adalah untuk mengawal

kelajuan DC Series Wound Motor menggunakan empat pengawal iaitu PID, PI, P, dan

Fuzzy Logic Controller. Pada mulanya, kesemua pengawal dibuat dan diaplikasikan

dalam model MATLAB. Dalam projek ini, cara penghasilan pengawal jenis PID, PI, dan

P adalah berdasarkan nilai yang telah diubah sehingga mendapat nilai ‘step response’

yang pantas, manakala Fuzzy Logic Controller dihasilkan berdasarkan ‘membership

function’ dan juga ‘rule’ yang telah ditetapkan. Jangkaan projek ini adalah pengawal

jenis Fuzzy Logic Controller mendapat prestasi yang terbaik berbanding dengan jenis

pengawal yang lain dari segi masa penetapan (Ts), masa naik (Tr), masa puncak (Tp),

dan percent overshoot (%OS). Akhirnya, MATLAB GUI dibina untuk membenarkan

pengguna memilih jenis pengawal yang ditetapkan dan melihat graf yang akan

dipaparkan dalam GUI ini dalam dua jenis keadaan yang berbeza iaitu antara situasi yang

menggunakan beban sebagai tambahan dan juga situasi yang tidak mengunakan beban

pada motor.

Page 4: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

vii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

DECLARATION ii

DEDICATION iii

ACKNOWLEDGEMENT iv

ABSTRACT v

ABSTRAK vi

TABLE OF CONTENTS vii

LIST OF TABLES x

LIST OF FIGURES xi

LIST OF ABBREVIATIONS xiv

1 INTRODUCTION

1.1 Background 1

1.2 Problem Statement 2

1.3 Objectives 3

1.4 Scope of Project 3

2 LITERATURE REVIEW

2.1 DC Motor 4

2.1.1 Brushed DC Motor 5

2.1.2 Brushless DC Motor 8

Page 5: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

viii

2.2 Speed Control of DC Motor 8

2.3 Fuzzy Logic Controller (FLC) 9

2.3.1 Mamdani Fuzzy Inference 10

2.3.2 Sugeno Fuzzy Inference 12

2.4 PID Controller Design 12

2.4.1 PID Tuning Method 13

3 METHODOLOGY

3.1 Phase I: Project Preview 15

3.2 Phase II: Build a DC Series Wound Motor Model 17

3.3 Phase III: Build a Fuzzy Logic Controller (FLC) 20

3.4 Phase IV: Tuning PID, PI, and P Controller 27

3.5 Phase V: Matlab Simulink 31

3.6 Phase VI: Analysis the results from Matlab 34

3.7 Phase VII: Develop GUI for DC Motor Controller 34

4 RESULTS AND DISCUSSION

4.0 Introduction 36

4.1 Simulation on DC series wound motor without controller 37

4.2 Simulation on DC series wound motor with P controller 39

4.3 Simulation on DC series wound motor with PI controller 41

4.4 Simulation on DC series wound motor with PID controller 43

4.5 Comparison the data after analysis 46

4.6 Simulation on DC series wound motor with Tuned

PID Controller 47

4.7 Simulation on DC series wound motor with

Fuzzy Logic Controller 49

4.8 Comparison between Tuned PID Controller and

Fuzzy Logic Controller 51

4.9 GUI result 53

Page 6: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

ix

5 CONCLUSION AND RECOMMENDATIONS

5.1 Conclusion 54

5.2 Recommendations 55

REFERENCES 56

APPENDIXES

APPENDIX A 58

Page 7: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

x

LIST OF TABLES

TABLE NO. TITLE PAGE

2.1 Typical tuning methods and their advantages and disadvantages 14

3.1 DC series wound motor parameters 16

3.2 Input variable error (e) 20

3.3 Input variable change in error (ce) 21

3.4 Input variable output speed (du) 22

3.5 Dynamic signal analysis 24

3.6 Rule base for 5 membership function 25

3.7 Ziegler-Nichols second method tuning rules 29

3.8 Coefficients for PID, PI, and P using Ziegler-Nichols second

method rule 30

4.1 Analysis result for simulation without controller 38

4.2 Analysis results for simulation with P controller 41

4.3 Analysis results for simulation with PI controller 43

4.4 Analysis results for simulation with PID controller 45

4.5 Comparison of the data after analysis 46

4.6 Analysis results for simulation with Tuned PID controller 48

4.7 Analysis results for simulation with FLC 50

Page 8: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

xi

LIST OF FIGURES

FIGURE TITLE PAGE

NO.

2.1 DC motor parts 5

2.2 Shunt wound DC motor 6

2.3 Series wound DC motor 7

2.4 Compound wound DC motor 7

2.5 Fuzzy Mamdani inference system 11

2.6 Block Diagram of PID controller 13

2.7 Manual tuning systems 14

3.1 Block Diagram of the whole system 16

3.2 Dynamic model of DC series wound motor 18

3.3 Block Diagram representation DC motor 19

3.4 Block Diagram representation of equation DC series wound motor 19

3.5 Membership function editor for input variable error (e) 21

3.6 Membership function editor for input variable change in error (ce) 22

3.7 Membership function editor for output variable speed (du) 23

3.8 Output of motor speed and error analysis 24

3.9 Rule editor for 5 membership function (5x5 rule) 25

3.10 Simulink model of DC motor with PID controller 27

3.11 Tuning process for calculation of critical gain (Kcr) 28

3.12 Tuning process for calculation of critical period (Pcr) 28

3.13 DC series wound motor without controller simulink model 31

Page 9: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

xii

3.14 Controlling DC series wound motor using PID controller

simulink model 32

3.15 Controlling DC series wound motor using PI controller

simulink model 32

3.16 Controlling DC series wound motor using P controller

simulink model 33

3.17 Controlling DC series wound motor using FLC simulink model 33

3.18 MATLAB GUI window 35

3.19 MATLAB GUI for DC series wound motor control 35

4.1 Speed, current, torque load plots of DC motor without controller

at load = 0 N.m 37

4.2 Speed, current, torque load plots of DC motor without controller

at load = 0.1 N.m 38

4.3 Speed, current, torque load plots of DC motor with P controller

at load = 0 N.m 40

4.4 Speed, current, torque load plots of DC motor with P controller

at load = 0.1 N.m 40

4.5 Speed, current, torque load plots of DC motor with PI controller

at load = 0 N.m 42

4.6 Speed, current, torque load plots of DC motor with PI controller

at load = 0.1 N.m 42

4.7 Speed, current, torque load plots of DC motor with PID controller

at load = 0 N.m 44

4.8 Speed, current, torque load plots of DC motor with PID controller

at load = 0.1 N.m 44

4.9 Speed, current, torque load plots of DC motor with Tuned PID

controller at load = 0 N.m 47

4.10 Speed, current, torque load plots of DC motor with Tuned PID

controller at load = 0.1 N.m 48

4.11 Speed, current, torque load plots of DC motor with FLC controller

at load = 0 N.m 49

Page 10: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

xiii

4.12 Speed, current, torque load plots of DC motor with FLC controller

at load = 0.1 N.m 50

4.13 Comparison between Tuned PID and FLC 52

4.14 GUI result 53

Page 11: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

xiv

LIST OF ABBREVIATIONS

AC - Alternating Current

DC - Direct Current

FLC - Fuzzy Logic Controller

GUI - Graphical User Interface

P - Proportional

PI - Proportional-Integral

PID - Proportional-Integral-Derivative

SISO - Single Input Single Output

MIMO - Multi Input Multi Output

Page 12: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

1

CHAPTER 1

INTRODUCTION

1.1 Background

The speed control is one of important component in Direct Current motor (DC

motor) operation. In controlling the speed of a DC motor, some improvement needs to be

done toward speed regulation during transient loading conditions. The control includes a

regulating circuit that having an output for controlling the armature voltage to the motor.

An input speed reference signal corresponding to the desired speed is provided to the

regulating circuit. A feedback signal proportional to armature voltage is also provided to

the regulating circuit to establish an error signal for operating the control to regulate the

voltage to the motor and therefore the motor speed.

This project approaches many type of controller which are PID, PI, and P

controller, but fuzzy logic controller is the best tool in controlling the speed of the DC

motor. Fuzzy Logic is based on the theory of fuzzy sets, where an objects membership of

a set is gradual rather than just member or not. Fuzzy Logic uses the whole interval of

real numbers between zero (False) and one (True) to develop logic as a basis for rule of

interference enables computers to make decisions using fuzzy reasoning rather than

Page 13: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

2

exact. The employment of fuzzy control is commendable for very complex processes,

when there is no simple mathematical model and for highly nonlinear processes. Then, if

the processing of linguistically formulated expert knowledge is to be performed the fuzzy

control can be employed.

For acquire an accurate of fuzzy, Fuzzy Logic Toolbox 2.1 which is one of the

applications in MATLAB software is used. Generally in fuzzy logic system, it is most

important to define the range of input and output membership function in the fuzzy

interference engine. Then, with the appropriate fuzzy rules, the accurate controlling

system will be developed for the DC motor speed control. Therefore, the speed of DC

motor that used Mamdani-style fuzzy inference system, which is composed of each one

input, and output variable.

1.2 Problem Statement

There are some problems occur while controlling the DC Series Wound Motor,

the problem is this type of motor does not provide excellent speed control [3]. To

encounter this problem, the controller is needed and this project Fuzzy Logic Controller

will be used. The selection of series wound motor because it provides excellent torque

load properties to the system which other motor of this class cannot provide.

There are many types of controllers nowadays, each one of them have its own

advantages and disadvantages, so in this project four controllers are used which are PID

controller, PI controller, P controller, and Fuzzy Logic Controller (FLC).

Page 14: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

3

1.3 Objectives

The objectives of this project are:

i. To control the DC series wound motor speed with PID, PI, P, and Fuzzy

Logic Controller (FLC) in MATLAB simulink.

ii. To compare and analyze the performance of each controllers.

iii. To develop GUI (Graphical User Interface) for DC series wound motor

control using MATLAB software.

1.4 Scope of Project

Scopes of the project are:

i. Simulation of DC series wound motor.

ii. Analyze the performance of each controller : Settling time (Ts), Rise Time

(Tr), Peak Time (Tp), and Percent Overshoot (%OS)

Page 15: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

4

CHAPTER 2

LITERATURE REVIEW

2.1 DC Motor

The electric motor is a motor that convert electrical energy into mechanical

energy. There are two types of motor which are AC motor, and DC motor. A simple DC

motor use electricity and magnetic field for producing torque which rotate the motor.

Permanent magnet DC motor (PMDC) outperforms to AC motor because it provides

better speed control on high torque loads and use in wide industrial application. DC

motors are more usable as it designed to use with batteries and solar cells energy sources,

which provide portability where we required it and thus provide cost effective solution,

because it is not possible to have AC power supply in every place, DC motor show its

response at both voltage and current. The applied voltage describes the speed of motor

while current in the armature windings shows the torque. If applied load increased in the

shaft of motor, then in order to sustain its speed motor draws more current from supply

and if supply is not able to provide enough current then motor speed will be affected.

Generally, it can be said that applied voltage affect speed while torque is controlled by

current. DC motors provide more effective results if chopping circuit is used. Low power

DC motor usually use in lifting and transportation purposes as low power AC motors do

Page 16: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

5

not have good torque capability. DC motor used in railway engines, electric cars,

elevators, robotic applications, car windows and wide verify of small appliances and

complex industrial mixing process where torque cannot be compromised. There are

several types of DC motor but most common are brushed DC motor, brushless DC motor,

stepper motor, and servo motor. These DC motors have three winding techniques such as

shunt DC motor, series DC motor, and compound DC motor [5].

Figure 2.1 DC motor parts

2.1.1 Brushed DC Motor

The brushed DC motor has permanent magnets and its rotor has electrical

magnets which move and generate torque according to applied DC power. This motor

works on principle of Lorentz force, according to that if a current carrying conductor

placed in magnetic field then it experiences a force or torque. This motor has low initial

costs, high reliability and it is simple in speed control which considered its advantages

Page 17: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

6

while high maintenance, and low life time is its disadvantages. Cleaning and replacing of

brushes (carry current) and springs (attached to one end brushes so it attached to brushes)

involves in maintenance. [5] This motor use different wound techniques which are as

follows.

a) Shunt-Wound

This motor has shunt field coils in parallel with armature. So current is

independent of one another between armature and field coils as shown in Figure

2.2. This motor provides excellent speed control. This type of motor used where

the requirement of power needed is more [3].

Figure 2.2 Shunt wound DC motor

b) Series-Wound

This motor has shunt field coils in series with the armature as shown in Figure

2.3. So, the current is dependent of one another, this motor provide high torque

applications because current increased in armature and stator when high load is

applied to it. This motor does not provide excellent speed control. [3]

Page 18: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

7

Figure 2.3 Series wound DC motor

c) This type of motor is combination of a shunt wound and series wound motors as

shown in Figure 2.4. These motors provide the properties of both motors, it

provides high torque as well as speed control as compared to series-wound and

shunt wound.

Figure 2.4 Compound-wound DC motor

Page 19: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

8

2.1.2 Brushless DC Motor

Brushless motor is a type of synchronous electric motor run on DC current with

electronic communication system. This motor not has commentator or brushes like

mechanical parts. This motor has rotating permanent magnet in rotor and its stator have

no moving permanent magnets. Long life time, little maintenance and high efficiency are

its advantages while high initial costs and more complicated controller are its

disadvantages. This motor is similar to AC motor and required an external

communication to generate torque. This motor has two subtype motors which are stepper

motor, and reluctance motor [3].

2.2 Speed Control of a DC Motor

The speed of DC motors can be adjusted within wide boundaries so that this

provides easy controllability and high performance. DC motors used in many applications

such as still rolling mills, electric trains, electric vehicles, electric cranes, and robotic

manipulators require speed controllers to perform their tasks. Speed controller of DC

motor is carried out by means of voltage control in 1981 firstly by Ward Leonard. The

regulated voltage sources used for DC motor speed control have gained more importance

after the introduction of thyristor as switching devices in power electronics. Then

semiconductor components such as MOSFET, IGBT, and GTO have been used as

electric switching devices [6].

In general, the control of system is difficult due to their high nonlinearity

properties. To overcome this difficulty, Fuzzy Logic Controller can be developed. The

best applications of Fuzzy Logic Controller are the time variant system that is nonlinear

Page 20: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

9

[7]. One of the most important, FLC applications in real life is the metro system in the

city Sendai of Japan in 1987 [8]. Nowadays, Fuzzy Logic Controller applications are

successfully used in many fields including automatic focus cameras, household materials

such as dishwashers and also automobile industry.

The speed response of a DC motor exposed to fixed armature voltage was

investigated for both under loaded and unloaded operating conditions. The first, the DC

motor was operated for a required reference speed under loaded and unloaded operating

conditions using PI control method. Then, to make performance comparison, the speed of

the system designed for operating at fixed speed under different load conditions are

simulated at MATLAB/Simulink environment. In this study, chopper circuit was act as a

motor driver.

2.3 Fuzzy Logic Controller (FLC)

Fuzzy logic is a type of multi valued logic. It deals with approximate reasoning

rather than precise. Fuzzy logic derived from fuzzy set theory [1]. Fuzzy logic was first

proposed by Lotfi Zadeh in 1965. Fuzzy controller is an innovative technology that

modifies the design of systems with engineering expertise. Fuzzy logic use human

knowledge to implement a system. It is mostly use in system where there are no

mathematical equations for handling system. Common sense, human thinking and

judgement are fuzzy rules. It helps engineers to solve non linear control problems. It

mathematically emulates human knowledge for intelligent control system and complex

application.

Fuzzy Logic Controller (FLC) has some advantages compared to other classical

controller such as simplicity of control, low cost, and the possibility to design without

Page 21: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

10

knowing the exact mathematical model of the process. Fuzzy logic incorporates an

alternative way of thinking which allows modelling complex systems using higher level

of abstraction originating from the knowledge and experience. Fuzzy logic can be

described simply as “computing words rather than numbers” or “control with sentence

rather than equations”.

There are two famous type of system currently used in fuzzy logic which are

Mamdani fuzzy inference, and Sugeno fuzzy inference.

2.3.1 Mamdani fuzzy inference

The most common method used currently is fuzzy inference system. In 1975,

Professor Ebrahim Mamdani of London University introduced first time fuzzy systems to

control a steam engine and boiler combination. He applied a set of fuzzy rules

experienced human operators. The mamdani system usually done in four steps (referred

Figure 2.5). The steps are fuzzification of the inputs, rule evaluation, aggregation of the

rules, and defuzzification [2]. Fuzzifications convert input data to degree of membership

functions. In this process data is matched with condition of the rule and determined how

well data is matched with rule at particular instance. Thus a degree of membership

function is developed.

Page 22: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

11

Figure 2.5 Fuzzy Mamdani inference system

Then in Rule-base block rules are written according to system requirement. In

case of DC motor, there are two input variables error and change in error is selected.

Usually rules are in if, and, then form. In inference engine aggregation is done in which

degree of fulfilment is calculated of the condition specifics by a rule. Defuzzification

block converted resulting fuzzy set into a number that is sent to the system and this

number is actually the control signal. There are seven defuzzification methods which are

Centre of gravity (COG), Centre of gravity method for singletons (COGS), Bisector of

area (BOA), Mean of Maxima (MOM), and Left most maximum (LM), and right most

maximum (RM).

Page 23: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

12

2.3.2 Sugeno fuzzy inference

Mamdani style is not computationally efficient as it find the centroid of two

dimensional shapes by integration of carrying function. Michio Sugeno proposed a new

method to use single spike, a singleton, as a membership function inputs. Its mean fuzzy

set is at unity point at one particular point on the universe of discourse and zero at

remaining area. This system is almost same of Mamdani method but with the exception

of consequent change and instead of fuzzy set it use a mathematical function as input

variable. [2]

2.4 PID Controller Design

PID (proportional integral derivative) control is one of the earlier control

strategies. Its early implementation was in pneumatic devices, followed by vacuum and

solid state analog electronics, before arriving at today’s digital implementation of

microprocessors. It has a simple control structure which was understood by plant

operators and which they found relatively easy to tune. It is a generic control loop

feedback mechanism and used as feedback controller. PID working principal is that it

calculates an error value from the processed measured value and the desired reference

point. The work of controller is to minimize the error by changing in the inputs of the

system. If the system or plant is not clearly known then applying PID controller provide

the best results if it is tuned properly by keeping parameters of the system according to

the nature of system. [13]

u(s)e(s)

= Gc (s) = Kp (1 + 1Tis

+ Tds) (1)

Page 24: SPEED CONTROL OF DC MOTOR BY USING FUZZY LOGIC

13

Figure 2.6 Block Diagram of PID controller

The PID measurement depends upon three parameters which are called proportional (P),

the integral (I) and derivative (D) part. For the P part, it determines the reaction to current

error. I part determines reaction to the sum of recently appeared errors. Then D

determines the reaction according to the rate of error changing. As derivative action is

sensitive to noise so mostly the controller are PI controller rather than PID as it is not

possible a system without the disturbances. Integral part helps the system to reach onto its

target value while P part is increase overshoot. [13]

2.4.1 PID tuning methods

There are many methods can be used in PID tuning. The most effective way is

that in which a model is developed and select P, I, and D values. Every method has some

advantages and disadvantages shown in Table 2.1 which discussed later.