pulchowk campus department of electronics and...

69
TRIBHUVAN UNIVERSITY Institute of Engineering Pulchowk Campus Department of Electronics and Computer Engineering A FINAL YEAR REPORT ON “DC Motor Control using Fuzzy Logic” By: Ansu Man Singh (23303) Deep Sherchan (23309) Kabin Shrestha (23315) Shrenik Kothari (23338) Kathmandu, Nepal February, 2008

Upload: lymien

Post on 27-May-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

TRIBHUVAN UNIVERSITY Institute of Engineering

Pulchowk Campus Department of Electronics and Computer Engineering

A FINAL YEAR REPORT

ON “DC Motor Control using Fuzzy Logic”

By: Ansu Man Singh (23303) Deep Sherchan (23309) Kabin Shrestha (23315) Shrenik Kothari (23338)

Kathmandu, Nepal February, 2008

Page 2: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

TRIBHUVAN UNIVERSITY Institute of Engineering

Pulchowk Campus Department of Electronics and Computer Engineering

A FINAL YEAR REPORT

ON “DC Motor Control using Fuzzy Logic”

By:

Ansu Man Singh (23303) Deep Sherchan (23309) Kabin Shrestha (23315) Shrenik Kothari (23338)

A PROJECT WAS SUBMITTED TO THE DEPARTMENT OF ELECTRONICS AND COMPUTER ENGINEERING IN PARTIAL FULLFILLMENT OF THE

REQUIREMENT FOR THE BACHELOR OF ENGINEERING

Kathmandu, Nepal

February, 2008

Department of Electronics and Computer Engineering

Page 3: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

i

ACKNOWLEDGEMENT We are highly indebted to the Department of Electronics and Computer Engineering for

providing us an opportunity to employ our theoretical knowledge into practice in form of

our 4th year project.

We are highly thankful to our project co-coordinator, Associate. Prof. Rajendra Lal

Rajbhandari, for his useful suggestions on selection of project. We would also like to

thank our project supervisors Asst. Prof Surya Prasad Aryal and Asst. Prof Niraj

Tamrakar for their continuous support and suggestions regarding the implementation of

the project. We would also like to thank the Department of Electrical Engineering for

allowing us to use the Electrical Machine Lab for our experiment. We also like to thank

Prof. Indra Man Tamrakar, Associate Prof. Uttam Mali and Prof. Sashidhar Ram

Joshi for his valuable suggestion regarding our project.

We would also like to show our gratitude towards Mr. Bijaya Man Sherchan, M.Sc, MD

Of MAILUN KHOLA HYDROPOWER COMPANY, Mr. Ashok Raj Panday, MD of

NEPAL ELECTRIC VEHICLE INDUSTRY, Mr. Bibek Chapagain, M.Sc, Coordinator

of KATHMANDU ELECTRIC VEHICLE ALLIANCE, Mr. Umesh Shrestha and Mr,

Sachendra Dhakwa, Shri Eco Visionary, Dr. Peter Fereer, Reasearch Fellow Monash

University, Australia. We also like to thank Mr Prakash, Mahesh and Sabin of DigiTech

for sharing their know-how in the technical detail of Curtis Controller.

We would also like to thank our particular friends Aashish Poudel, Anjan Narsingh

Rayamajhi, Anup Shrestha, Bikash Sharma, Jeewan Shrestha and Siruja Maharjan for

their support during the development of the project.

Finally, we want to thank the valuable readers for utilizing their time in studying this

document.

Page 4: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

ii

ABSTRACT

The Electric Drive technology is not a new technology but it has been gaining interest

due to its capability of contributing in the reduction of green house gas in the

environment. Moreover, it has a promising future in Nepal which can be justified by the

presence of SAFA tempos.

The project deals with the main aspect of the Electric Vehicle (EV) that is controlling the

speed accurately and efficiently. The project focuses itself in designing the high current

driver circuit and an efficient algorithmic based control (Fuzzy Logic) to track the

velocity. The design problem of the project is appropriate for a motor of 0.75 KW. The

necessary parameter of the motor was calculated and used for designing the system.

The motor driver circuit has been constructed using the MOSFET and employing the H-

bridge circuit due to its simplicity. The MOSFET implemented was chosen considering

the maximum current it can draw.

The control system uses the concept of FUZZY SET to control the error signal fed back

to the system, which is obtained by employing optical encoder as a speed sensor. Unlike

the traditional analog PID control system, where OPAMPs are used, the project utilizes

the concept of the discrete control system by employing the controlling algorithm in the

FPGA. The VHDL has been used to describe the digital system.

In summary, this project hopes to demonstrate the capability of Fuzzy Logic in designing

a control system for speed controller of DC Motor. It also signifies the importance of the

need for further research in the field of DC motor speed controller design in Nepal.

Page 5: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

iii

TABLE OF CONTENTS ACKNOWLEDGEMENT ............................................................................................................................... I ABSTRACT ................................................................................................................................................... II LIST OF FIGURES ........................................................................................................................................ V LIST OF ABBREVIATIONS ...................................................................................................................... VI 1 ................................................................................................................................ 1 INTRODUCTION

1.1 ..................................................................................................................................... 1 OBJECTIVES

1.2 ......................................................................................................................... 1 LITERATURE REVIEW1.3 .............................................................................................................................. 2 PRESENT SYSTEM

2 ...................................................................................................... 4 THEORETICAL BACKGROUND

2.1 ......................................................................................................... 4 FUNDAMENTALS OF DC MOTOR

................................................................................................... 6 Separately excited dc motor ............................................................. 9 Analysis of the Starting of Separately Excited Motor ....................................................................................... 11 Speed Control of Excited DC motor ........................................................................................... 12 Mode of Operation of DC motor

2.2 ...................................................................................................................... 13 SWITCHING ELEMENT

............................................... 13 Metal oxide semiconductor field effect transistor (MOSFET) ............................................................................... 14 Insulated Gate bipolar transistor (IGBT) ......................................................................................... 15 Comparison of IGBT and MOSFET .................................................................................................................. 16 Gate Drive Circuit

3 ................................................................................................ 18 DESIGN AND IMPLEMENTATION

3.1 ......................................................................................................... 18 PROPOSED SYSTEM OVERVIEW

3.2 ............................................................................................................................. 19 DRIVER CIRCUIT3.3 ............................................................................................ 21 FUZZY IMPLEMENTATION IN THE PROJECT

3.4 .............................................................................. 23 IMPLEMENTATION OF FUZZY CONTROLLER IN VHDL3.5 ................................................................................................................. 29 PWM IMPLEMENTATION

3.6 ................................................................................................................... 31 FEEDBACK MECHANISM

4 ............................................................................................................ 33 EXPERIMENTAL RESULTS

4.1 ................................................................................................. 33 RESULT FOR THE GATE DRIVE CIRCUIT.4.2 .............................................................................................................. 35 RESULT FOR SPEED SENSOR.4.3 .............................................................................................. 36 RESULT OF EXPERIMENT ON DC MOTOR

5 .............................................................................................................. 42 FINANCIAL STATEMENT

6 ................................................................................................................................... 43 LIMITATIONS

7 ......................................................................................... 44 CONCLUSION AND FUTURE WORKS

7.1 ................................................................................................................................. 44 CONCLUSION7.2 ............................................................................................................................. 45 FUTURE WORKS

REFERENCES: ............................................................................................................................................ 46 APPENDIX A ........................................................................................................................................ XLVII

SPECIFICATION OF LUCAS‐TVS MOTOR ....................................................................................................... XLVII APPENDIX B ................................................................................................................................................. II

IRF540N ..................................................................................................................................................... II APPENDIX C ............................................................................................................................................... IV

Page 6: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

iv

IR2110 ....................................................................................................................................................... IV APPENDIX D .............................................................................................................................................. VI

OPTOINTERRUPTER ........................................................................................................................................ VI APPENDIX E ............................................................................................................................................. VIII

XSA BOARD ............................................................................................................................................... VIII APPENDIX F ................................................................................................................................................. X

ASM CHARTS ................................................................................................................................................ X ASMD CHART FOR SPEED SENSOR .................................................................................................................. XIII ASMD CHART FOR DIVIDER ........................................................................................................................... XIV FSM DIAGRAM FOR SYSTEM CONTROLLER .......................................................................................................... XV

Page 7: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

v

LIST OF FIGURES FIGURE 2-1COMMONLY USED DC MOTORS ..................................................................................... 4 FIGURE 2-2 STEADY STATE EQUIVALENT CIRCUIT OF THE ARMATURE ........................................... 5 FIGURE 2-3 TORQUE-CURRENT CURVES .......................................................................................... 6 FIGURE 2-4 SPEED-TORQUE CURVES ............................................................................................... 6 FIGURE 2-5 EQUIVALENT CIRCUIT OF THE SEPARATELY EXCITED DC MOTOR ................................ 7 FIGURE 2-6 SECOND ORDER MODEL .............................................................................................. 10 FIGURE 2-7 FIRST ORDER MODEL .................................................................................................. 10 FIGURE 2-8 ARMATURE VOLTAGE CONTROL................................................................................ 11 FIGURE 2-9 BRIDGE CIRCUIT ......................................................................................................... 12 FIGURE 2-10 POWER MOSFET (A) SYMBOL (B) VERTICAL CROSS SECTION ................................ 13 FIGURE 2-11 CHARACTERISTICS CURVE OF THE MOSFET (SOURCE INTERNATIONAL RECTIFIER

PD 91341B) .......................................................................................................................... 14 FIGURE 2-12 IGBT (A)SYMBOL (B) EQUIVALENT CIRCUIT MODEL (C) VERTICAL CROSS SECTION

.............................................................................................................................................. 14 FIGURE 2-13 CHARACTERISTICS CURVE OF THE IGBT (SOURCE FAIRCHILD SEMICONDUCTOR

FMG2G100US60) ................................................................................................................ 15 FIGURE 2-14 COMPARISON OF THE IGBT AND MOSFET (SOURCE INTERNATIONAL RECTIFIER

APPLICATION NOTES) ............................................................................................................ 16 FIGURE 2-15 SIMPLE GATE DRIVE CIRCUIT ................................................................................... 16 FIGURE 2-16 BOOTSTRAP CIRCUIT ................................................................................................ 17 FIGURE 3-1 BLOCK DIAGRAM OF THE WHOLE SYSTEM ................................................................. 18 FIGURE 3-3 MEMBERSHIP FUNCTIONS OF INPUTS .......................................................................... 22 FIGURE 3-4 MEMBERSHIP FUNCTION OF OUTPUT .......................................................................... 22 FIGURE 3-5 SIMULINK MODEL OF FUZZY CONTROLLER ................................................................ 23 FIGURE 3-6 SPEED SET BY FUZZY CONTROLLER (TOP) REFERENCE SPEED (BOTTOM) ACTUAL

SPEED .................................................................................................................................... 23 FIGURE 3-7 REPRESENTATION OF THE TRIANGULAR MEMBERSHIP FUNCTION ............................. 24 FIGURE 3-8 FLOWCHART OF FUZZIFICATION ........................................................................... 25 FIGURE 3-9 THE DIGITAL IMPLEMENTATION OF FUZZY RULE INFERENCE SYSTEM ..................... 27 FIGURE 3-10 MEMBERSHIP FUNCTION OF OUTPUT ........................................................................ 28 FIGURE 3-11 SAMPLE OF OUTPUT OF THE FUZZY RULE INFERENCE FOR OUTPUT MEMBERSHIP

FUNCTIONS ............................................................................................................................ 28 FIGURE 3-12 FLOWCHART REPRESENTING DEFUZZIFICATION ............................................... 29 FIGURE 3-13 PWM GENERATOR BLOCK ........................................................................................ 30 FIGURE 3-14 PWM GENERATION .................................................................................................. 31 FIGURE 3-15 OPTO – INTERRUPTER ............................................................................................... 31 FIGURE 3-16 SLOTTED DISK .......................................................................................................... 32 FIGURE 3-17 IMPLEMENTATION OF OPTO-INTERRUPTER .............................................................. 32 FIGURE 4-1 (A)VOLTAGE AT NODE 3 OF BOOTSTRAP CIRCUIT (B)VOLTAGE AT GATE(C)PWM

INPUT ..................................................................................................................................... 33 FIGURE 4-2 VOLTAGE ACROSS MOTOR (SINGLE MOSFET) .......................................................... 34 FIGURE 4-3 VOLTAGE ACROSS MOTOR (PARALLEL MOSFET) IN UPPER WAVEFORM .................. 34 FIGURE 4-4 OUTPUT OF OPTO-INTERRUPTER ................................................................................. 35 FIGURE 0-1 ASMD CHART OF SPEED SENSOR ............................................................................ XIII FIGURE 0-2 ASMD FOR DIVIDER ................................................................................................ XIV FIGURE 0-3 FSM FOR SYSTEM CONTROLLER ................................................................................ XV

Page 8: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

vi

List of abbreviations

EV Electric Vehicle PID Proportional – Integral – Derivative Hp Horse Power (1 Hp = 746 Watt)

ICEV Internal Combustion Engine Vehicle BJT Bipolar Junction Transistor

MOSFET Metal Oxide Semiconductor Field Effect Transistor IGBT Insulated Gate Bipolar Transistor FPGA Field Programmable Gate Array VHDL Very high integrated circuit Hardware Description Language

mmf magneto – motive force PWM Pulse Width Modulation RPM Revolution Per Minute FSM Finite State Machine

FSMD FSM with Datapath ASM Algorithmic State Machine

ASMD ASM with Datapath FIS Fuzzy Inference System

Page 9: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

1

1 Introduction 1.1 Objectives The main objectives of the projects are:

• to design driver circuit for a DC motor of 1 Hp

• to implement fuzzy logic in the speed control system

The project is mainly concerned with designing a working prototype of the controller. It

does not tend to claim itself superior to the Curtis Controller but it purposes an alternative

to the Curtis that can be employed if a further research on the system is made. The design

is not the alteration of the Curtis but instead is based on a completely new technology. It

employs the latest control system technology called the FUZZY Logic. Also, the

principle of project is targeted not only for the EV but for all the control of the DC motor.

The system is different in the sense that it abandons the traditional analog design and uses

the latest buzz in the embedded system- FPGA- to realize the discrete system.

1.2 Literature Review

The burgeoning interest in the environmental awareness has led to the different policy

amendments. It has largely affected the way engineers are designing their product. One of

the most important environmental issue concerning is the use of fossil fuels in the

Internal Combustion Engine Vehicle (ICEV). The ICEV plays the major role in the

production of green house gases resulting in the Global Warming. This technology has

been transforming the society in a negative way. But the problem can be only solved by

the use of new technologies. One of the technologies is the Electric Vehicle (EV).

In contrast to the ICEV, EV uses the electric motor to drive the vehicle. In EV, the motor

is powered by the array of batteries. Also some vehicle like trolley bus, get their power

directly from the power lines. The motor can be either be AC motor or DC motor. Due to

the zero emission of any gas, the system is very environment friendly and depends on the

renewable energy sources. But is this technology feasible in Nepal?

Page 10: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

2

Nepal has experienced this technology since 1977 by the introduction of the trolley bus in

the roads of Kathmandu Valley. In mid – 1990s, the government and the public became

increasing aware of the fact that the air quality of the Kathmandu valley was degrading.

This led to the introduction of SAFA tempos and other hybrid three wheelers.

1.3 Present system SAFA tempo is motored by the Prestolite Motor which is a DC motor running in series

configuration. The motor is controlled by the controller named the Curtis Controller,

manufactured in the USA. The SAFA tempo consists of other electronic equipment like

DC-DC converter and display system. It is powered by the array of 6 Torjan Batteries.

But among all the other system, the main core unit is the dc motor controller that actually

controls the flow of current from the battery to the motor.

Different SAFA tempo stations had been visited during the project time for studying the

feasibility of the technology. During the visits, it was found that the SAFA tempos,

usually fails due to the overflow of the current causing the MOSFET to blow out. The

maintenance cost of the controller is very high because the components used in the

controller are all custom-made, making them unavailable in the usual market. Therefore

most of the component has to be purchased directly from the manufacturer. The other

component that undergoes usual failure is power diode used for carrying the current away

from the MOSFET. Due to this, the future of the SAFA tempos is declining but the

SAFA tempo industries have been struggling hard to maintain the status of the system.

The controllers are repaired locally by substituting the original component by the

appropriate components. This alters the design and hence the system undergoes frequent

failure. The reason of this failure is also due to the rough construction of the roads. The

controller was not designed for the SAFA tempos but instead for the all common electric

drive purpose. This makes the controller overrated for the purpose.

The only research in the controller was carried out by the group of Electrical and

Electronic engineering students of Kathmandu University under the supervision of Mr.

Page 11: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

3

Peter Ferrer. The entire necessary manual, concerning the maintenance of the battery and

the operation of the controller had been generated by the group. The group was

undergoing a research on the alternative controller for the SAFA tempo. But due to

certain reasons the research was aborted. Since then no development has been seen

except for the fact that the Curtis controller has been thoroughly studied and an effective

repair and maintenance technique has been developed by the group of engineers of SAFA

tempo industry.

Due to findings of these situations of EV system in Nepal, this project focuses in

designing a new controller system that can control the current running SAFA tempos. As

already mentioned, the SAFA tempos is powered by the Prestolite Motor. The

specification of the motor is 48V, 4KW, Max current 106A. The design of system for this

specification requires high end power transistors which are very costly. Therefore, an

appropriate model of motor has been chosen whose specification can be found in the

Appendix. The motor used for the purpose is the LUCAS dynamo motor of

approximately 1 Hp.

The project has been the result of months of field visits to the different SAFA tempos

stations and talks with different technical experts. Many literatures concerning the

Electric drive have been studied extensively. The problem has been carefully analyzed

for the design of the efficient solution.

The project does not guarantee that the design is the most efficient of all the other design.

It might take more research on the topic for the finalization of the design. This is only a

prototype of the basic design carried out by the group. It covers all the necessary aspect

of the Electric drive.

The project hopes to illustrate the capability of the design in order to manufacture a

controller that can drive any Electric Vehicle running under the DC motor. It also hopes

to encourage future research on the topic and aware the concerning bodies of the

government for the necessity of the research.

Page 12: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

4

2 Theoretical background 2.1 Fundamentals of DC Motor

The commonly used configuration of the dc motors is shown below in figure . In a

separately excited motor, the armature and the field coil are connected to different dc

source. This gives the configuration total control over the armature and the field voltage

separately. In the shunt motor, both coils have a common source. In case of the series

motor, both the armature and the field current are the same. In the cumulatively

compound motor, the magneto-motive force of the series field is a function of armature

current and is in the same direction as mmf of the shunt field.

Figure 2-1Commonly used DC motors

Page 13: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

5

The steady state equivalent circuit of armature of a dc machine is shown in the figure 2-2.

Resistance Ra is the resistance of the armature circuit. In shunt and separate excited

motor it is the resistance of the armature coil whereas for series it is the sum of the field

and the armature coil. The basic equation of the system is as follows:

E = KeФwm [1.1]

V = E + RaIa [1.2]

T = KeФIa [1.3]

where,

E(V) = the back emf produced by the motor

Ф (Tesla,T) = the flux created by the field coil

and is dependent upon the field current

wm (rads-1) = the angular velocity of the motor

V(V) = supplied dc voltage

RRa (Ω)= the equivalent resistance of the

armature circuit

Ia (A) = armature current

Ke = the motor constant Figure 2-2 Steady state equivalent circuit of the armature

From these general mathematical equations of the dc motor, we can come to various

important conclusions. It can be seen that as the speed increases the back e.m.f also

increase. The torque provided by the motor is directly proportional to the field flux and

the armature current. In case of the shunt and separately excited motor, the field current

remains constant. Where as in series motor, the armature current and the field current are

equal and can be controlled by different mechanism. The series motor is usually used

when high starting torque is required.

The two most important characteristics of the dc motors are the Speed-torque

characteristics and the Torque-current characteristics. They play vital role during the

process of motor selection for a particular application. These are the dictionary of the

Page 14: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

6

motor through which engineers can compare between different motors and make an

appropriate selection. The profile for the different types of motors is different. The

characteristic curves are shown in the figure 2-3 and 2-4.

Figure 2-3 Torque-current curves Figure 2-4 Speed-torque curves

The nature of the curve can be justified by the nature of the equations. In shunt and

separate, the curve is linear due to the direct relationship between the variables i.e. the

constant field current. But in case of the series and the compound the torque is dependent

upon two changing variables the armature current and the field current.

Among these different types of motors, the project is concerned only with the separately

excited dc motor. Therefore from now onwards we will be dealing only with the

separately excited dc motor in greater depth. The transient and the steady response of the

motor will be analyzed with required mathematical details.

2.1.1 Separately excited dc motor

The mathematical and the circuit analyses of the separately excited and the shunt motor

are very similar. The only difference that exists between these two types is the way in

which the driver circuit of the motor is designed. In shunt, the change in voltage of the

armature coil will also affect the voltage across the field coil. But in separately excited,

the voltages are independent. The equivalent circuit of the dc separately excited motor is

shown in the figure 2-5.

Page 15: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

7

Figure 2-5 Equivalent circuit of the separately excited dc motor

Recalling the Equations (1.1), (1.2) and (1.3), the equation of the separately excited

motor can be written as:

E = Kewm [1.4]

V = E + RaIa [1.5]

T = KeIa [1.6]

The variable Ф has been omitted from the equation because the field current remains

constant thus it in incorporated in the value of constant Ke (the motor constant). The

above equation is the steady state equation. In case of the transient analysis the equation

changes to:

V = RRaIa + La dIa/dt + Kewm [1.7]

Where,

La = armature inductance

The role of the field resistance and the inductance has been neglected, assuming that the

field voltage always remains unchanged during the variation of the armature current.

Thus the transient response of the dc motor will be dependent upon the armature

resistance and the armature inductance value. The response time will be governed by the

time constant value of the R-L circuit which is equal to La/Ra. The motor constant Ke

will also play a vital role in the mechanical response of the motor. It means the speed of

the motor. The motor consists of the two particular responses the speed and the current

Page 16: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

8

transient condition. The speed response is necessary to see if the motor is applicable in a

particular application. For example, in a particular application the motor may be required

to accelerate in a very short amount of time. The current response is necessary for the

engineer to understand the change in current and use it to design an efficient driver

circuit. For our project this response plays the vital role and is of the utmost importance.

Thus most of the project time was required to understand current transient response of the

selected motor. Thus the parameters of the motor must be found out accurately depending

upon the precision of your system. On the other hand both responses are necessary in

order to accurately generate the model of the motor and simulate them. The equations

describing the mechanical behavior of the dc motor is as follows:

T = Bwm + J dwm/dt +TL [1.8]

Where,

T (Nm) = Torque of the motor

B (Nms) = co-efficient of the friction of the motor

J (Nms2) = the moment of inertia of the motor

TL (Nm) = the Load Torque

Substituting Eq. (1.6) in (1.8), we have

KeIa = Bwm + J dwm/dt +TL [1.9]

Differentiation Eq. (1.9) gives

Ke 0]

T

dIa/dt = B dwm/dt + J d2wm/dt2 + dTL/dt [1.1

Substituting in Eq. (1.7) for dIa/dt from Eq. (1.10) and rearranging the terms we get

a d2wm/dt2 + (1 + Ta/Tm1) dwm/dt + wm/Tm2 = KeV/JRa – (TL + Ta dTL/dt)/J [1.11]

Differentiation Eq. (1.8) gives

Ke dwm/dt = dV/dt – Ra dIa/dt – La d2Ia/dt2 [1.12]

Page 17: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

9

Substituting in Eq. (1.8) for dwm/dt from Eq. (1.12) and rearranging the terms we get

T a d2Ia/dt2 + (1 + Ta/Tm1) dIa/dt + Ia/Tm2 = (V + Tm1 dV/dt + KeTL/B)/RaTm1 [1.13]

where

Ta = La/Ra armature circuit time constant [1.14]

Tm1 = J/B mechanical time constant [1.15]

Tm2 = JRa/(BRa + Ke2) second order term [1.16]

The above equations are second order linear differential equations and can be solved if

appropriate initial conditions are known.

The most parameter necessary for the designing of the driver circuit is the peak current or

the overshoot current in the armature circuit. This overshoot happens in the circuit during

the turning ON and OFF state. Therefore, we will be looking at these transient responses

in depth.

2.1.2 Analysis of the Starting of Separately Excited Motor

Here we will be doing two kinds of analysis, one considering the Ta and next making it

zero. Let us move on with the analysis. It must be clear that these analyses are true only

for separately excited motor. Initially, the speed of the motor is zero. Thus the back e.m.f

is also zero. The motor will start only when the Torque generated exceeds the load

torque. In other words, when the current in the armature circuit exceed IL where IL is

given by

IL = TL/Ke [1.17]

Therefore, we can conclude that the motor acts as a simple R-L circuit until its current is

IL. Hence the current is given by

Ia = V (1 – exp (-t/Ta)) [1.18]

Now, the second stage starts when the current reaches IL. Now, dV/dt and dTL/dt will be

zero because V and TL are assumed to be constant. So we have our initial conditions as

Wm(0) = 0, Ia(0) = IL and dwm/dt (0) = 0 (because T = TL)

Also, dIa/dt(0) = (V - RaIa)/La

Page 18: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

10

Solving the above equations will give us complicated second order solution. So the

second approach to the problem is to reduce the order by assuming that the relaxation

time of the electrical current is so small that it can be reduced i.e Ta = 0. The response

curve of the both method is shown in the Fig. 2-6 and Fig. 2-7.

Figure 2-6 Second order model

Figure 2-7 First order model

The response for the braking is also similar to that of the starting except for the swing of

the current in the negative axis. For further study refer to Fundamentals of Electrical

Drives, Page 80.

This ends our analysis of the transient response of the dc motor. The main point to

remember from the analysis is the peak current and the rate at which it is attained because

that will be important in design of the driver circuit, which is our main objective. Now we

will head to our next design consideration, the speed control method.

Page 19: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

11

2.1.3 Speed Control of Excited DC motor

There are different methods of controlling the speed of the dc motor. The methods are

listed below:

(i) Armature voltage control

(ii) Field flux control

(iii) Armature resistance control

Among theses control methods, the one that has been chosen is the armature voltage

control method. The profile for the change in the speed with respective to the armature

voltage is shown in figure 2-8

Figure 2-8 Armature Voltage Control

Vr is the rated voltage of the dc motor and the speed of the motor is the natural speed of

the motor. The reason for choosing this method is very obvious form the figure 2-8. The

control is simple and linear in nature.

In real control mechanism, different methods are employed in a hybrid nature to get the

maximum control of the dc motor. For example, Armature voltage and the Field Voltage

can be varied in a particular method to get high torque and maintain the particular

velocity of the motor. In our experiment, we have only employed the armature voltage

method as our requirement of the system can be met with in the control of the armature

voltage. Every motor has a nominal or rated velocity, but this velocity can be exceeded

Page 20: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

12

by controlling the flux and the armature together. In the project this variation of the

voltage is attained by the pulse width modulation technique.

2.1.4 Mode of Operation of DC motor

In electric drive, the motor has to be operated in different modes. These different modes

include forward motoring, backward motoring, forward breaking and backward braking.

These modes are can be attained through the implementation of H-bridge circuit. This

circuit includes composition of four switching element as shown in figure 2-9.

Figure 2-9 Bridge Circuit

In the figure 2-9 the switching element has been demonstrated by the use of MOSFET.

When the switch A and D are closed then the motor rotates in one particular direction

depending upon the polarity of the supply. When the switch B and C are closed the motor

rotates in reverses direction, due to the reverse in polarity.

In order to apply brake, al the switches are turned OFF except for the switch C where a

PWM signal is applied. In this way the H-bridge can be used to operate the motor in

different modes. This makes it the appropriate solution for the problem.

Page 21: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

13

2.2 Switching element Switching element are the important part of any electric drive. Switching element

provides the power to the load. The switching element should have following

characteristics.

• Minimum conduction loss

• Minimum switching loss

There are various types of switching element, among them MOSFET (Metal oxide

semiconductor field effect transistor) and IGBT (insulated gate bipolar transistor) are

mostly used in the electric drive.

2.2.1 Metal oxide semiconductor field effect transistor (MOSFET) Power MOSFETs are the voltage controlled device requiring small current to turn ON.

Switching speed of the Power MOSFET is very high (of the order of nanosecond). They

are mostly used in low and medium power and high frequency application. Figure 2-10

shows the symbol and the internal structure of the power MOSFET.

The characteristics curve of the MOSFET is given in figure 2-11.

Figure 2-10 Power MOSFET (a) Symbol (b) Vertical cross section

Page 22: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

14

Figure 2-11 Characteristics curve of the MOSFET (source International rectifier PD 91341B)

2.2.2 Insulated Gate bipolar transistor (IGBT)

IGBT is the combination of the MOSFET and the power BJTs. BJTs have low ON state

resistance as a result it has low conduction loss, but it suffer from the high switching loss.

On the other hand, MOSFET have low switching loss but due to its high ON state

resistance it has high conduction loss. IGBT combines the advantages of both BJT an

MOSFET, hence it has low conduction and switching loss. Figure 2-12(b) shows

equivalent circuit symbol of the IGBTs.

Figure 2-12 IGBT (a)Symbol (b) Equivalent circuit model (c) Vertical cross section

Page 23: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

15

Figure 2-13 Characteristics curve of the IGBT (source Fairchild semiconductor FMG2G100US60)

2.2.3 Comparison of IGBT and MOSFET

IGBT are suited for the high power application because they have higher break down

voltage. The switching loss of the IGBT is higher than the MOSFET so they are suitable

for the medium frequency application.

MOSFET has lower break down voltage in comparison to the IGBT so they are suited for

the medium and low power application. The switching loss of the MOSFET is small in

comparison to the IGBT so they are used in the high frequency application up to 100

KHz.

The figure 2-14 shows the comparison of the MOSFET and IGBT in term of the

operating voltage and the frequency.

Page 24: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

16

Figure 2-14 Comparison of the IGBT and MOSFET (source International rectifier Application

notes)

2.2.4 Gate Drive Circuit The Gate drive circuit provides control signal to the switching elements of any electric

drive .The simple gate drive circuit is shown in figure 16a. In this figure the switching

element consists of the MOSFET but actually it can be replaced by any power transistor

such as IGBT, BJT. Here the gate drive circuit consists of the simple source which

provides the control voltage between gate and source and turns ON the MOSFET and as

a result of which, current is provided to the load from

VBatt.

In the figure 2-9 C and D are known as Lower side

transistor. There are various gate drive circuits for the

lower side transistor. Fig 2-15 and 2-16 shows the

gate drive circuit for the lower side transistors. The

gate drive circuit implementing totem pole is better

than the gate drive circuit of figure 2-16 because the

switching time for the totem pole transistors is fast. Figure 2-15 Simple Gate Drive circuit

In the figure 2-9, A and B are known as the higher side transistors. The gate drive circuit

for the higher side transistors is different from the lower side transistors due to the

presence of the floating voltage. Transformer and the optocoupler are used to drive the

Page 25: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

17

higher side transistors, but they have their own disadvantages. The best gate drive circuit

for the higher side transistor is known as bootstrap circuit.

Figure 2-16 Bootstrap circuit

When VCC is applied at the PWM Input current from the bootstrap capacitor passes

through resistor R1 to turn ON the transistor Q3. When Q3 is ON (i.e. in active region)

gate charge to the transistor Q1 is provided by the Bootstrap capacitor. When 0V is

applied in the PWM Input, current flows through R1 and R2 as a result of which Q3

moves in cut off mode and Q4 in the active mode as a result of which gate charge of the

Q1 is discharge through Rgate.

Page 26: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

18

3 Design and Implementation 3.1 Proposed System Overview The system is a closed loop system which consists of a command signal, processing unit

plant and feedback as shown in figure 3-1.

The overall block diagram of our system is given below.

Figure 3-1 Block Diagram of the whole system

Curtis controller does not implement any control system theory. It relies on the input

command given by the user. In other words, it is an open loop control system. But the

system designed in the project is a closed loop as mentioned above.

In the system, the command is reference velocity given through the computer using

parallel port. The project is not concerned with the means of command signal but instead

with the controller only. Therefore the project mainly focuses on the design of the entire

block in the Fig 3-1. The main block of the system is the core of the system – the

controller. For the processing of the error signal fuzzy control has been employed due to

its efficiency in design and its ease of execution. The Fuzzy Controller is implemented in

Page 27: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

19

FPGA using VHDL using the concept of Digital System Design. In other words, the

system is a discrete control system. The controller generates a control signal i.e. PWM

output to the Full Bridge DC-DC Converter. The DC-DC converter drives the motor is

four quadrants (Motoring and Braking in both direction). The velocity feedback is

employed using the concept of optical encoder. The feedback signal is processed through

the FPGA and the required error signal is generated.

3.2 Driver Circuit The driver circuit used in this project is given in figure 3-2. In this circuit MOSFET has

been implemented as the switching element. The reasons for implementing MOSFET are

given below.

• MOSFET provides minimum switching and conduction loss.

• The availability of the MOSFET in the local market is greater than the

IGBT

• Since this driver circuit is of the medium power level, MOSFET is best

suited.

The circuit consists of the MOSFET in the parallel combination. By implementing in

parallel, the switching loss is minimized in the MOSFET. The gate drive circuit has been

implemented using the IC IR2110. This IC has the bootstrap circuit for the higher side

transistors and totem pole for driving lower side transistor.

Page 28: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

20

Figu

re 3

-2 F

inal

cir

cuit

impl

emen

tatio

n

Page 29: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

21

3.3 Fuzzy implementation in the project

In general, fuzzy controllers may be classified into two types according to fuzzy

controller input. For the first type, the fuzzy controller is based on the traditional control

theory, e.g. fuzzy PID controller; regarding the second type, the controller is constructed

with assistance of some useful approaches, such as fuzzy neural network and genetic

algorithms, etc.

In the project, the fuzzy PID control is used as the working method. This method requires

a mathematical model of the motor. Moreover we have used the fuzzy PI controller. The

input to the controller is velocity error (e) and the change of this error (de). The inputs are

then fuzzified, rule is applied and the fuzzy output is defuzzified to give a crisp output

which is the change in the PWM width.

Hardware implementation of the controller can be achieved in a number of ways. The

most popular method of implementing fuzzy controller is using a general-purpose

microprocessor or microcontroller. General, 8-bit microcontroller are more economical

and flexible, but often face difficulties in dealing with control systems that require high

processing and input/output handling speeds. As an option, the controller can be

implemented on a FPGA, which is suitable for fast implementation and quick hardware

verification. FPGA based systems are flexible and can be reprogrammed unlimited

number of times.

For designing the Fuzzy rules and simulating the rules Matlab® Ver. 7.4.0.287(R2007a)

was used. Rules were written using its fuzzy tool and the dc motor’s speed control using

the fuzzy controller was simulated using Simulink. The input and output membership

functions and rules used in the controller are shown below.

Page 30: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

22

Figure 3-3 Membership functions of inputs

Figure 3-4 Membership Function of output

Table 3-1Rule base for fuzzy inference system

Output=>PWM Error

Error Rate High velocity Stable Low velocity

Retardation decPWM incPWM boostPWM

Zero acceleration reducePWM no_change boostPWM

acceleration reducePWM decPWM incPWM

Figure below shows the Simulink model of the controller and the result obtained.

The result shows the desired speed and the actual speed obtained from the dc motor

model.

Page 31: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

23

Figure 3-5 Simulink model of Fuzzy controller

Figure 3-6 Speed set by fuzzy controller (top) Reference Speed (bottom) Actual Speed

3.4 Implementation of Fuzzy controller in VHDL The realization or the implementation of the fuzzy logic controller as described earlier

was done in Very high speed integrated-circuit Hardware Description Language (VHDL).

Each phase of the fuzzy inference system that is fuzzification, rule evaluation and

defuzzification were implemented sequentially in VHDL.

Page 32: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

24

Fuzzification A member function can be singleton, triangular, trapezoidal, etc. In the project triangular

menmbership function were implemented. A triangular membership function can be

effectively and simply described by three points and two slopes. Hence the each

membership function was divided into four segments by these three points namely

segment 1, 2, 3, 4.

Figure 3-7 Representation of the triangular membership function

The calculation of the ‘degree of membership’ can be hence different at these four

segments.

At segment 1, where ‘input value’ ≤ point1

Degree of membership (µ) = 0.

At segment 2, where ‘input value’ < point2

Degree of membership (µ) = (input value – point1) * slope1.

At segment 3, where ‘input value’ < point3

Degree of membership (µ) = 1 – (input value – point2) * slope2.

Page 33: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

25

At segment 4, where ‘input value’ ≥ point3

Degree of membership (µ) = 0.

The input value, three points, two slopes and the degree of membership were

implemented using an 9-bit resolution computation. So, µ = 1 equals 1ff h or 511d. The

fuzzification of the inputs was performed as shown below in the flowchart.

Figure 3-8 FlowChart of FUZZIFICATION

Page 34: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

26

Rule Inference After the inputs have been fuzzified, the necessary action i.e. output required is

determined from the linguistic rule. This method can also be termed as min-max

inference. A rule typically is in the IF – THEN form. For an example,

IF x is a AND y is b THEN z is c. It has "AND" operation between two fuzzy sets

x and y which is actually the minimum operation between them.

So, c = min (a, b)

Also, if a output is observed from two rules, the implied "OR" operation between the two

rules is used which is nothing more than simple maximum operation.

Example: IF (x is a1, AND y is b1) OR (x is a2 AND y is b2) THEN z is c.

c = max (min (a1, b1), min (a2, b2))

Implementation of the min-max inference is shown in the next page

.

Page 35: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

27

Figure 3-9 the Digital Implementation of Fuzzy Rule Inference System

Page 36: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

28

Defuzzification The result of the rule inference is also fuzzy and consists of no. degree of membership of

the output. Defuzzification not only has to defuzzify the output but also combine all the

output degree of membership into a single output value. The output from the

defuzzification process is hence crisp and not fuzzy. For simplicity and ease, output

membership functions have been taken as singletons (figure 3-10) that can be described

by only a single point (Sugeno or Takagi-Sugeno-Kang method of implication).

Figure 3-10 Membership function of output

Figure 3-11 Sample of output of the fuzzy rule inference for output membership functions

The calculation of the crisp output from the no. of degree of membership was done by

taking the weighted average. For the output as shown in figure 3-11,

Crisp output = Σ S f

Σ f

Page 37: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

29

Figure 3-12 FlowChart Representing DEFUZZIFICATION

3.5 PWM implementation The H-bridge configuration to drive the motor operates with the Pulse Width Modulated

(PWM) control signal. This signal is applied to the gate of MOSFETs building the bridge.

The duty cycle of this PWM signal is controlled by the fuzzy controller. The PWM

Page 38: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

30

generator was implemented into the FPGA. The PWM generator generates 9.765 KHz

PWM signal. The block diagram of the PWM generator is shown below.

Figure 3-13 PWM generator block

The PWM generator has three modules or segments within it, namely dutycycle_register,

clk_counter and count_comparator. When a new duty cycle is sent to the dutycycle

register from the Fuzzy controller and then setting the Reset pin high, the current count in

the clk_count is stopped and the counter resets to zero count (getting ready for next

count). Also the high on Reset pin latches the input new duty cycle into the

dutycycle_register. The count_comparator continuously compares the count value to the

register value and generates PWM output low after the count reaches the register value.

Before that the PWM output is high.

Page 39: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

31

Figure 3-14 PWM generation

3.6 Feedback mechanism The velocity feed back in terms of the revolution per minute (RPM) was sensed using an

opto-interrupter (also known as beam breaker). Opto-interrupter consists of a infrared

emitting diode and photo transistor aligned such that the emitted beam falls on photo

sensitive base of the photo transistor. A slotted disk as shown in the figure below breaks

the beam at regular interval and hence generates train of pulses. Then the no of system

frequency (10 KHz) clock pulses that fall on these pulses (high or low) is counted. This

count gives the width of a slot in terms of no of 10 KHz pulse ie, in terms of time. From

the already known slots count (30 open and 30 closed slots) time for one revolution is

determined by multiplying the slot width (in time) with slot count. Its reciprocal gives us

the revolution per sec, from where RPM can be determined by multiplication with 60.

Figure 3-15 Opto – interrupter

Page 40: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

32

Figure 3-16 Slotted disk

Figure 3-17 Implementation of Opto-interrupter

Equation for finding the RPM;

System frequency 2 x Count = Revolution per minute (RPM)

Where,

Count = no of system frequency clock pulses that fall on high or low pulse from

the opto-interrupter

Page 41: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

33

4 Experimental Results 4.1 Result for the gate drive circuit. Figure 4-1 shows the result of the gate drive circuit. Figure 4-1 c shows the PWM Input

which is TTL input. Figure 4-1b shows the voltage at the gate, the overshoot is due to

inductive coupling. Figure 4-1a shows the voltage at the node 3 of the bootstrap circuit

given in figure 2-16.

Figure 4-1 (a)Voltage at node 3 of bootstrap circuit (b)voltage at gate(c)PWM input

Voltage across motor is shown in the figure 4-2. There is the voltage swing of 10 V and

-0.812mV. The supply was 12 V There is 2 V drop in the MOSFET. These results are for

the single MOSFET.

Page 42: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

34

Figure 4-2 Voltage across motor (single MOSFET)

In the parallel configuration the voltage drops at the 11.88V. In this configuration the

voltage drop at the MOSFET is only 0.12V.

Figure 4-3 Voltage across motor (parallel MOSFET) in upper waveform

Page 43: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

35

4.2 Result for speed sensor. Figure below shows the output pulses from the speed sensor (from opto-interrupter and slotted disk assembly).

Figure 4-4 Output of opto-interrupter

Page 44: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

36

4.3 Result of Experiment on dc motor

Table 4-1Armature and Field Resistance

Armature using DC Supply

Va/volts Ia/amp Ra/Ohm

1.66 0.9 1.844444

1.09 0.56 1.946429

0.79 0.38 2.078947

0.54 0.26 2.076923

1.96 1.1 1.781818

2.66 2 1.33

3.35 3.3 1.015152

2.31 2.1 1.1

2.54 2.5 1.016

2.8 3 0.933333

3.08 3.4 0.905882

3.47 4.1 0.846341

3.81 4.9 0.777551

Ra/ohm 1.36 Field using DC Supply

Vf/volts If/amp Rf/Ohm

3.24 0.32 10.125

3.6 0.34 10.58824

4.1 0.4 10.25

4.58 0.44 10.40909

1.55 0.14 11.07143

1 0.1 10

Rf/ohm 10.4

Page 45: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

37

Table 4-2Armature and Field Impedance

Armature using AC Supply 50Hz

Va/volts Ia/amp Za/Ohm

1.85 1.3 1.42307692

2.82 2 1.41

2.88 2.1 1.37142857

3.49 2.5 1.396

4.26 3.1 1.37419355

4.44 3.3 1.34545455

5.5 4.1 1.34146341

6.77 5 1.354

1.376952

Field using AC Supply 50Hz

Vf/volts If/amp Zf/Ohm

4.91 0.1 49.1

8.88 0.16 55.5

20.2 0.32 63.125

21.8 0.34 64.1176471

26.4 0.4 66

28.6 0.44 65

3.34 0.06 55.6666667

3.97 0.08 49.625

4.98 0.1 49.8

9.08 0.16 56.75

57.46843

Page 46: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

38

Table 4-3Relationship between speed and voltage

For No Load Cond: div by 2 div by 10

V/volt I/amp Speed Speed/Ft/min Speed/meter/min

1.2 1.4

2.28 1.8 120 60 12

2.74 2 200 100 20

9.17 2.2 1900 950 190

13.3 2.3 3000 1500 300

Final Result:

La = 0.0007264 H, Lf = 0.1799031 H, Ra = 1.35791 ohm and Rf = 10.4 ohm

Page 47: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

39

Experiment on Armature Winding

-1

0

1

2

3

4

5

6

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

DC Voltage (V)

Cur

rent

(A)

Ra = 1.35 Ohm

Graph 1

Experiment on Field Winding

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

DC Voltage (V)

Cur

rent

(A)

Rf = 10.4 Ohm

Graph 2.

Page 48: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

40 Experiment on Armature Winding

0

1

2

3

4

5

6

0 1 2 3 4 5 6 7

50 Hz AC Voltage (V)

Cur

rent

(A)

La = 0.726 mH

Graph 3.

8

Experiment on Field Winding

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

0 5 10 15 20 25 30 35

50 Hz AC Voltage (V)

Cur

rent

(A)

Lf = 0.180 Ha

Graph 4.

Page 49: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

41

The above experiment results are concerned with the DC motor employed in the project.

Using the formula listed below, the parameters of the dc motor Ra, La, Rf, Lf has been

calculated.

RRa= V/Ia

RRf= V/If

La= (Za2 – Ra

2)1/2 / 2πf

Lf= (Zf2 – Rf

2)1/2 / 2πf

Where f = 50Hz

The result of the experiment is important while designing the driver circuit for the motor.

These parameters give the transient response of the dc motor, which shows the peak

current rise in the system. This maximum peak current is the current that flows through

the switching element of the H-bridge. Thus utilizing this result, an appropriate MOSFET

or IGBT can be chosen.

Page 50: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

42

5 Financial Statement

Table 5 Expenditure

Date Particulars Quantity Rate ( Rs. )

Debit ( Rs. )

Credit ( Rs. )

25/10/07 Cash received from College ( 4 x 3000 ) 12000.00

1/11/07 DC Motor purchased 1 1400.00 1400.00 IGBT 1 250.00 250.00 Capacitor ( 50V , 2200µF ) 2 30.00 60.00 Dual Diode ( SR1060 ) 4 35.00 140.00 MOSFET ( IRF540n ) 4 50.00 200.00 Mica Sheet 4 5.00 20.00 Heat Sink 1 35.00 35.00 Copper Plate 1 150.00 150.00

13/11/07 IC’s ( MCT2TE ) 4 20.00 80.00 Resistors ( 1K, 100Ω,10Ω ) - - 50.00 LCD 1 300.00 300.00 Matrix Board 3 70.00 210.00 Miscellaneous - - 500.00

22/11/07 Capacitor 1 115.00 115.00 IC ( 7404 ) 1 85.00 85.00

13/11/07 Battery ( Volta ) 1 3000.00 3000.00 Wire, Nuts & Bolts, Clamps - - 200.00

03/02/08 Motor repair - 150.00 150.00 09/02/08 Column Matrix Board 2 70.00 140.00

Heat Sink 8 25.00 200.00 MOSFET ( IRF540n ) 8 50.00 400.00 Mica Sheet 8 5.00 40.00 Capacitor 10 µF 4 10.00 40.00 Capacitor ( 50V , 2200µF ) 2 30.00 60.00 Capacitor 100 µF 4 10.00 40.00 Capacitor 0.1 µF 2 15.00 30.00 Total Expenditure 7895.00 Cash in Hand 4105.00 TOTAL 12000.00 12000.00

Page 51: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

43

6 Limitations The driver circuit design can only withstand a normal of 20 A of current, which means it

can only drive low power motor of about .75 KW. But, the motor used in the EV has very

high power rating of about 4KW; hence the design has to be upgraded. The design also

does not have a current sensing circuit that protects the system from the surge current of

the motor. The current sensing circuit plays a very important role in maintaining the

performance of the controller and ensuring the safety of the components.

The Fuzzy logic implemented in the project is concerned only with the possibility that the

motor can be controlled with this technique. Therefore, many compromises have been

done during the designing procedure. Only few rules have been generated that is

sufficient to control the motor’s speed. The input membership functions used to denote

velocity error and the rate of change in error consists of only three membership functions

each. As a result, the control was not smooth. Due to the mathematical complexity

involved in the defuzzification process, the simplest membership function for the output,

known as Singleton, was used. Henceforth, there was the loss in the smooth control.

Page 52: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

44

7 Conclusion and Future Works 7.1 Conclusion

The Electric Drive technology is an alternative to the current fuel crisis and the increasing

environmental issues. The EV is the future of the modern automobile. Furthermore, the

introduction of SAFA tempos in Kathmandu Valley has shown a promising future of the

EV in Nepal.

The main aspect of the EV is the presence of accurate and efficient speed controller.

Hence, the project has mounted itself to the fundamentals of the speed controller. It deals

with the problem of high current driver circuit and an efficient algorithmic based control

(Fuzzy Logic) to track the velocity.

The design of a very high current driver (of about 106 A) was not feasible for the

objective of the project. Hence, for the sake of prototyping the design, an appropriate

model of the motor that draws maximum of 11A was used. The necessary component for

this design was easily available in the local market. The design was based on the choice

of the MOSFET that could handle the required current. In order to drive the gate of the

MOSFET, a method known as Bootstrap was used. The circuit was successfully

implemented and tested.

The traditional analog control of the motor’s speed requires the knowledge of the

accurate mathematical model which is very difficult to determine and varies with each

motor, even with the same manufactures’ specification. This makes the design inflexible.

But in contrast, the discrete control system has the advantage of employing complex

mathematical algorithm that is efficient and accurate. Hence the choice of FPGA makes

the best solution for the objective of the project. In addition, the implementation of Fuzzy

Logic in FPGA makes the system design easier. Also, it increases the flexibility of the

controller to the change in system’s parameter.

Page 53: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

45

7.2 Future Works

There are many aspect of the controller designing in EV system that is necessary for the

EV to be successful in future. Some of the related topics are:

The driver circuit can be made more robust by including current sensing circuit, high

voltage protection circuit and prevention against overheating of the components. In

addition, there can be a cut off mode in the controller. These can be designed concerning

the actual high power motor, Prestolite Motor, used in SAFA tempo.

The controller has been design concerning only the efficient and accurate tracking of the

velocity. Whereas the design can include energy efficient control considering efficient

use of the battery by using techniques likes regenerative braking.

The Fuzzy Control System can be extending by employing the Adaptive Fuzzy Control

which will be more independent of the variation in the motor parameter. The Fuzzy

System can also be tested for other types of existing membership function that could give

more smooth control.

Lastly, the algorithm to realize the system can have a better VHDL implementation. This

requires revision of the algorithm used to code the system by improving the architecture

of the digital system.

Page 54: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

46

References: [1] www.fpga4fun.com

[2] F. Chevrie - F. Guély, “Fuzzy logic”, Cahier Technique, ECT 191 first issue,

December 1998

[3] Gene S. Monroe, Jr., “Robust Fuzzy Controllers Using FPGAs”, NASA LaRC.

[4] Bimal K. Bose, “Modern Power Electronics and AC Drives”, Prentice Hall of

India, 2005, pp. 556

[5] Roland S. Burns,“Advanced Control Engineering”,Butterworth-Heinemann, 2001,

pp. 331

[6] Douglas L. Perry, “VHDL: Programming By Example”, Fourth Edition,McGraw-

Hill, 2002

[7] Philip T. Vuong, Asad M. Madni and Jim B. Vuong, ”VHDL Implementation For

a Fuzzy Logic Contrtoller”

[8] Gopal K. Dubey, “Fundamentals of Electric Drives”

[9] W. Shepherd, L.N. Hulley and D.T.W. Liang, “Power Electronics and Motor

Control”, Second Edition

[10] Richard Munden, “ASIC and FPGA Verification: A Guide to Component

Modeling”

[11] T. Yamakawa, “High speed Fuzzy Controller Hardware System,” in Proc, 2nd

[12] Fuzzy System Symp.(Japan 1986), 122-130.

[13] K.Self, “Designing with Fuzzy Logic”

[14] Steven T. Karris, “Digital circuit Analysis and Design with Simulink R modeling

and Introduction to CPLDs and FPGA,” Second Edition

[15] Iqbal Husain, ”Electric and hybrid Vehicles Design Fundamentals”

[16] K.S Oh “IGBT Basics 1” Fairchild Application Notes 9016

[17] Jonathan Dodge, P.E. , John Hess “IGBT Tutorial” Advanced Power Technology

Application Notes ATP0201 Rev.2

[18] Pong P. Chu. “RTL Hardware Design”, John Wiley and Sons INC., Publication

[19] www.poerdesigners.com/infoweb/design_center/articles/IGBTs

[20] William Stallings, “Computer Organization and Architecture” Prentice – Hall of

India Pvt. Ltd., Sixth edition.

Page 55: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

47

Appendix A Specification of LUCAS-TVS Motor

Page 56: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

II

Appendix B IRF540N

Page 57: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

III

Page 58: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

IV

Appendix C IR2110

Page 59: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

V

4

Page 60: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

VI

Appendix D Optointerrupter

Page 61: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

VII

Page 62: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

VIII

Appendix E

XSA Board

Page 63: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

IX

Page 64: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

X

Appendix F ASM Charts Algorithmic State Machine is an alternative way of representing a Finite State Machine (FSM). Any FSM can be first illustrated through the use of state diagram and the Truth Table. The ASM approach is a better representation of FSM then any normal flow chart because it incorporates the timing information. The ASM block consists of the following elements as shown in the figure F1.

Figure F1 ASM Chart

An ASM chart is constructed of a network of ASM blocks. An ASM block consists of one state box and an optional network of decision boxes and conditional output boxes. The state box, as its name indicates, represents a state in an FSM. It is identified by a symbolic state name on the top left corner of the state box. The action or output listed inside the box describes the desired output signal values when the FSM enters this state. This output is known as Moore output as it only depends upon the state. The output will assume default value if it is not asserted inside the box. The notation for asserted output signal is:

Signal-name <= asserted value; (in VHDL code) A decision box tests an input condition to determine the exit path of the current ASM block. It contains a Boolean expression composed of input signals and plays a similar role to the logic expression in the transition arc of a state diagram. Because of the flexibility of the Boolean expression, it can describe more complex conditions, such as (a > b) and (c /= 1). Depending on the value of the Boolean expression, the FSM can follow either the true path or the false path,

Page 65: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

XI

which are labeled as T or F in the exit paths of the decision box. If necessary, we can cascade multiple decision boxes inside an ASM block to describe a complex condition. A conditional output box also lists asserted output signals. However, it can only be placed after an exit path of a decision box. It implies that these output signals can be asserted only if the condition of the previous decision box is met. Since the condition is composed of a Boolean expression of input signals, these output signals' values depend on the current state and input signals, and thus they are Mealy outputs. The output signal assumes the default, unasserted value when there is no conditional output box. Example of State Diagram and ASM Charts

Figure F2 (a) State Diagram (b)ASM Chart

For further information refer to RTL Hardware Design by Pong P. . Page 317. The ASM chart is further generalized into ASMD chart which means Algorithmic State Machine with a Data path. This chart is based on two particular aspect of FSM: Data path and the Control path. Data path: This includes data manipulation circuit, routing Network and the Register. Control path: This includes algorithm to describe the sequence of action. This means the circuit to control when and how Register Transfer (RT) operations should take place

Page 66: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

XII

FSMD (Finite State Machine with Data path) is the key to realize RT methodology performed in a state of the FSM inside a state box or in a conditional output box. The example of ASDM is given. in the figure F3.

Figure F3 Basic block diagram of FSMD

This is the box that shows the operation in the data path.

Figure 4 ASMD of repetitive-addition multiplier

Page 67: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

XIII

ASMD Chart for speed sensor

Figure 0-1 ASMD Chart of Speed Sensor

Page 68: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

XIV

ASMD Chart for divider The unsigned division process shown below, known as the restore method, was used in defuzzification process.

Figure 0-2 ASMD for divider

Page 69: Pulchowk Campus Department of Electronics and …flipkarma.com/.../dc_motor_control_using_fuzzy_logic_report.pdfDepartment of Electronics and Computer Engineering . A . FINAL YEAR

XV

FSM diagram for system controller System controller generates the control signal for the selection and operation of PWM generator and divider.

Figure 0-3 FSM for system controller