Fuzzy Supervised PID controller.pdf

51
DESIGN OF FUZZY-SUPERVISED PID CONTROLLER FOR MAGLEV SYSTEMS B.Tech. Project By MIRZA ABDUL WARIS BEGH (10289) AAKASH AGRAWAL (10288) GOPAL BHARADWAJ (10265) MOHAN LAL (09223) DEPARTMENT OF ELECTRICAL ENGINEERING NATIONAL INSTITUTE OF TECHNOLOGY, HAMIRPUR - 177005 (INDIA) May, 2014

description

The magnetic levitation system is a mechatronic system already acknowledged and accepted by the field experts. For such a system it is desired to propose a suitable controller for positioning a metal sphere in air space by the help of an electromagnetic force. In the ideal situation, the magnetic force produced by the current from an electromagnet counteracts the weight of the metal sphere. Nevertheless, the electromagnetic force is very sensitive, and presence of noise induces accelerating forces on the metal sphere, causing the sphere to move into the unbalanced region. Fuzzy logic controller (FLC) is an attractive alternative to existing classical or modern controllers for designing the challenging Non-linear control systems. Fuzzy rules are very easy to learn and use, even by non-experts. It typically takes only a few rules to describe systems that may require several lines of conventional software code, which reduces the design complexity. By considering these advantages, this project presents the design and analysis of a Fuzzy logic based supervision controller for the magnetic levitation system. Additionally, a classical PID controller is also designed to compare the performance of both types of controllers. Results reveal that Fuzzy supervised PID controller is found to give better transient and steady state results compared to the classical PID.

Transcript of Fuzzy Supervised PID controller.pdf

Page 1: Fuzzy Supervised PID controller.pdf

DESIGN OF FUZZY-SUPERVISED PID

CONTROLLER FOR MAGLEV SYSTEMS

B.Tech. Project

By

MIRZA ABDUL WARIS BEGH (10289)

AAKASH AGRAWAL (10288)

GOPAL BHARADWAJ (10265)

MOHAN LAL (09223)

DEPARTMENT OF ELECTRICAL ENGINEERING

NATIONAL INSTITUTE OF TECHNOLOGY,

HAMIRPUR - 177005 (INDIA)

May, 2014

Page 2: Fuzzy Supervised PID controller.pdf

II

DESIGN OF FUZZY-SUPERVISED PID

CONTROLLER FOR MAGLEV SYSTEMS

A PROJECT

Submitted in partial fulfilment of the

requirements for the award for the degree

of

BACHELOR OF TECHNOLOGY

by

MIRZA ABDUL WARIS BEGH (10289)

AAKASH AGRAWAL (10288)

GOPAL BHARADWAJ (10265)

MOHAN LAL (09223)

Under the Guidance

of

Dr. Bharat Bhushan Sharma

DEPARTMENT OF ELECTRICAL ENGINEERING

NATIONAL INSTITUTE OF TECHNOLOGY,

HAMIRPUR - 177005 (INDIA)

May, 2014

Page 3: Fuzzy Supervised PID controller.pdf

III

Copyright © NIT HAMIRPUR, 2014

Page 4: Fuzzy Supervised PID controller.pdf

IV

CANDIDATE’S DECLARARTION

We hereby certify that the work which is being presented in the project report entitled

“DESIGN OF FUZZY-SUPERVISED PID CONTROLLER FOR MAGLEV

SYSTEMS,” in partial fulfillment of the requirements for the award of degree of the

Bachelor of Technology and submitted in the Department of Electrical Engineering,

National Institute of Technology, Hamirpur H.P. is an authentic record of our own

work carried out during a period from January 2014 to May 2014 under the

supervision of Dr. Bharat Bhushan Sharma, Assistant Professor, Department of

Electrical Engineering, N.I.T. Hamirpur.

The matter presented in this project report has not been submitted by us for the award

of any other degree of this or any other university/institute.

Sd/-

MIRZA ABDUL WARIS BEGH (10289)

AAKASH AGRAWAL (10288)

GOPAL BHARADWAJ (10265)

MOHAN LAL (09223)

This is to certify that above statement made by the candidate is correct to the best of

my knowledge.

The project Viva-Voce Examination of the Candidates Mirza Abdul Waris Begh

(10289), Aakash Agrawal (10288), Gopal Bharadwaj (10265), Mohan Lal (09223) has

been held on____________________.

Date: Sd/-

Dr. Bharat Bhushan Sharma

Assistant Professor, EED

Dr. Bharat Bhushan Sharma

Project Supervisor

Electrical Engg. Dept.

----------------------------------

External Examiner

Page 5: Fuzzy Supervised PID controller.pdf

V

ACKNOWLEDGEMENT

First things first we find it hard to express our gratefulness to Almighty GOD in words

for bestowing upon us His deepest blessings and providing us with the most wonderful

opportunity in the form of life of a human being and for the warmth and kindness he

has showered upon us.

We feel great pleasure in acknowledging our deepest gratitude to our revered guide

and mentor, Dr. Bharat Bhushan Sharma, Assistant Professor, Electrical

Engineering Department, National Institute of Technology Hamirpur, under whose

firm guidance, motivation and vigilant supervision we succeeded in completing our

work. He infused into us the enthusiasm to work on this topic. His tolerant nature

accepted our shortcomings and he synergized his impeccable knowledge with our

curiosity to learn into this fruitful result.

We would sincerely thank Prof. Y. R. Sood, HOD, Electrical Engineering Department

who suggested many related points and is always very helpful and constructive.

Words are inadequate to express our heartfelt gratitude to our affectionate parents

who have shown so much confidence in us and by whose efforts and blessings we have

reached here.

We would also like to thank all the faculty members of Department of Electrical

Engineering for their continuous moral support and encouragement.

Last but not the least we wish to express heartiest thanks to our friends and colleagues

for their support, love and inspiration.

Date:

MIRZA ABDUL WARIS BEGH (10289)

AAKASH AGRAWAL (10288)

GOPAL BHARADWAJ (10265)

MOHAN LAL (09223)

Page 6: Fuzzy Supervised PID controller.pdf

VI

Abstract

The magnetic levitation system is a mechatronic system already acknowledged and

accepted by the field experts. For such a system it is desired to propose a suitable

controller for positioning a metal sphere in air space by the help of an electromagnetic

force. In the ideal situation, the magnetic force produced by the current from an

electromagnet counteracts the weight of the metal sphere. Nevertheless, the

electromagnetic force is very sensitive, and presence of noise induces accelerating

forces on the metal sphere, causing the sphere to move into the unbalanced region.

Fuzzy logic controller (FLC) is an attractive alternative to existing classical or modern

controllers for designing the challenging Non-linear control systems. Fuzzy rules are

very easy to learn and use, even by non-experts. It typically takes only a few rules to

describe systems that may require several lines of conventional software code, which

reduces the design complexity. By considering these advantages, this project presents

the design and analysis of a Fuzzy logic based supervision controller for the magnetic

levitation system. Additionally, a classical PID controller is also designed to compare

the performance of both types of controllers. Results reveal that Fuzzy supervised

PID controller is found to give better transient and steady state results compared to the

classical PID.

Keywords: Fuzzy Logic; PID controller; Fuzzy supervised PID controller; PID

tuning; Maglev; Magnetic Levitation;

Page 7: Fuzzy Supervised PID controller.pdf

VII

Contents Page No.

List of Figures………………………………………………………………... IX

List of Abbreviations…………………………………………………............ X

List of Tables……………………………………………………………..... X

List of symbols……………………………………………………………..... XI

1 Introduction……………………………………………………….... 1

1.1 Overview……………………………………….................................. 1

1.2 Magnetic Levitation………………………………………................. 2

1.3 Maglev………………………………………...................................... 3

1.4 Objective……………………………………….................................. 4

1.5 Motivation………………………………………................................ 5

1.6 Organisation of the report………………………………………........ 5

2 Magnetic Levitation System……………………………………….. 6

2.1 Maglev Systems………………………………………....................... 6

2.2 Principle………………………………………................................... 7

2.3 System Model Description………………………………………....... 7

3 Fuzzy Logic………………………………………............................. 12

3.1 Fuzzy Sets………………………………………................................ 12

3.1.1 Linguistic variables……………………………………….................. 12

3.2 Fuzzy control………………………………………............................ 13

3.2.1 Fuzzy control system design……………………………………….... 13

3.3 Fuzzy reasoning………………………………………....................... 14

3.3.1 Fuzzy rules………………………………………............................... 14

3.3.2 Fuzzy inference system………………………………………............ 15

3.3.3 Fuzzification………………………………………............................. 15

3.3.4 Inference………………………………………................................... 16

3.3.5 Defuzzification………………………………………......................... 17

3.4 Different types of Fuzzy Logic controllers………………………….. 18

3.5 Discussion………………………………………................................ 19

4 Fuzzy Controller………………………………………..................... 20

4.1 Fuzzy supervisory control………………………………………........ 20

4.2 Supervision of conventional controllers……………………………... 21

4.3 Fuzzy tuning of PID controllers……………………………………... 21

4.4 Fuzzy gain scheduling……………………………………….............. 22

4.4.1 Construction of a heuristic schedule gain…………………………… 23

4.4.2 Construction of a schedule gain by fuzzy identification…………….. 23

Page 8: Fuzzy Supervised PID controller.pdf

VIII

4.4.3 Construction of a gain schedule using the PDC method…………….. 23

5 Tuned PID Controller………………………………………............ 25

5.1 Overview……………………………………….................................. 25

5.1.1 Tuning and its Purpose………………………………………............ 25

5.2 Trial and error method………………………………………............. 25

5.3 Pole placement method………………………………………............ 26

5.4 Ziegler Nichols method………………………………………............ 27

6 Fuzzy Supervised PID-Controller………………………………… 29

6.1 Fuzzification………………………………………............................. 29

6.2 Inference engine………………………………………....................... 30

6.3 Rule Base………………………………………................................. 31

6.4 Defuzzification………………………………………......................... 33

6.5 Adjusting fuzzy membership functions and rules…………………… 34

6.6 Results and Discussion………………………………………............. 35

7 Conclusion........................................................................................... 38

References........................................................................................................ 39

Page 9: Fuzzy Supervised PID controller.pdf

IX

LIST OF FIGURES

Fig (1.1) Trans-rapid 09 at the Emsland test facility in Germany.

Fig (1.2) SC-Maglev in Yamanashi Prefecture, Japan.

Fig (2.1) Principle of Magnetic Levitation.

Fig (2.2) Close view of the levitating steel ball.

Fig (2.3) Schematic Diagram of the Magnetic Levitation Unit.

Fig (2.4) A magnetic ball bearing system.

Fig (2.5) Block diagram of Magnetic levitation system.

Fig (3.1) Conventional sets and fuzzy sets.

Fig (3.2) Terms of fuzzy logic.

Fig (3.3) Different shapes of membership functions.

Fig (3.4) Fuzzy controller diagram.

Fig (3.5) The structure of the fuzzy logic inference system.

Fig (3.6) Fuzzification of a crisp input and a fuzzy input

Fig (3.7) The fuzzy inference using the Min-inference.

Fig (3.8) Defuzzification methods

Fig (4.1) Fuzzy Supervisory controller

Fig (4.2) Fuzzy PID auto-tuner

Fig (4.3) Conventional fuzzy gain scheduler

Fig (4.4) Tank

Fig (4.5) PDC concept

Fig (5.1) Unit step response of the system G(s) tuned with trial and error method.

Fig (5.2) Response of a system tuned with Pole Placement Method.

Fig (5.3) Control Scheme for Ziegler Nichols Method.

Fig (5.4) Unit step response of the system G(s) tuned with ZL method

Fig (6.1) Triangular Membership functions of input variable „error‟.

Fig (6.2) Triangular Membership functions of input variable „error-rate‟.

Fig (6.3) Triangular Membership functions of output variable „KP‟

Fig (6.4) Triangular Membership functions of output variable „KI‟.

Fig (6.5) Triangular Membership functions of output variable „KD‟.

Fig (6.6) Fuzzy Logic Rule-Base in SIMULINK®.

Fig (6.7) Surface plot of Fuzzy Logic Rule-Base for variable KP.

Fig (6.8) Surface plot of Fuzzy Logic Rule-Base for variable KI.

Fig (6.9) Surface plot of Fuzzy Logic Rule-Base for variable KD.

Fig (6.10) Structure of fuzzy logic controller.

Fig (6.11) Block diagram of self-tuning Fuzzy Supervised PID controller.

Fig (6.12) SIMULINK® model of self-tuning Fuzzy Supervised PID controller.

Fig (6.13) Error rate (de) v/s time response of Fuzzy tuned PID controlled system.

Fig (6.14) Output v/s time response of Fuzzy tuned PID controlled system.

Fig (6.15) Error (e) v/s time response of Fuzzy tuned PID controlled system.

Page 10: Fuzzy Supervised PID controller.pdf

X

LIST OF ABBREVIATIONS

DC Direct Current

PID Proportional, Integral and Derivative

PI Proportional & Integral

PLC Programmable Logic Controller

MagLev Magnetic Levitation

MJ Mega Joules

mph Miles per hour

CO2 Carbon Dioxide

FIS Fuzzy inference system

Max Maximum

Min Minimum

COA Center of Area

WA Weighted average

PDC Parallel Distributed Compensation

ZN Ziegler Nichols Method

FL Fuzzy Logic

NL Negative Large

NM Negative Medium

NS Negative Small

ZE Zero

PS Positive Small

PM Positive Medium

PL Positive Large

SSE Steady-State Error

FLC Fuzzy Logic Controller

LIST OF TABLES

Table 1 Parameters of the Magnetic Levitation system

Table 2 Rule base Parameters for KP.

Table 3 Rule base Parameters for KI.

Table 4 Rule base Parameters for KD.

Page 11: Fuzzy Supervised PID controller.pdf

XI

LIST OF SYMBOLS

ω Frequency (rad/sec)

Fm Magnetic force

I Electromagnetic current

X Air gap length

Vs Sensor output

Tr Rise time

Mp Maximum overshoot

H0 Equilibrium height of ball (m)

M Mass of ball bearing (kg)

R Resistance (Ω)

L1 Inductor (H)

β Constant related to magnetic force (Nm2/A

2)

I0 Equilibrium current of the coil (A)

Ks Sensor gain factor (V/m)

K1 constant (N/A)

K2 constant (N/m)

u The control signal provided by the PID controller to the plant

e Error

de Differential of error

Kp Proportional gain

Kd Derivative gain.

Ki Integral gain

ζ Relative damping coefficient

*fuz Output fuzzy variable

Page 12: Fuzzy Supervised PID controller.pdf

1

Chapter-1

Introduction

1.1 Overview

In the control of plants with good performances, engineers are often faced to design

controllers in order to improve static and dynamic behavior of plants. Usually the

improvement of performances is observed on the system responses. For illustration, an

example of a DC machine is chosen. Two cases of study are presented:

I. In open loop, the velocity response depends on the mechanical time constant

of the DC machine (time response) and the value of the power supply. Indeed, for

each value of power supply, a velocity value is reached in steady state. Therefore

the DC machine can reach any value of velocity which depends only of the power

supply. In this case no possibility to improve performances.

II. For a specific need, the open loop control is not sufficient. Engineers are faced

to a problem of control in order to reach a desired velocity response according to

defined specifications such as disturbance rejection, insensitivity to the variation

of the plant parameters, stability for any operation point, fast rise-time, minimum

Settling time, minimum overshoot and a steady state error null. Also, the designed

control is related to other constraints such as the cost, computation complexity,

manufacturability, reliability, adaptability, understand-ability and politics [1].

In general the design of the control needs to identify the dynamic behavior of the

system. Therefore a dynamic model of the plant is developed in order to reproduce the

real response in open loop. Developing a model for a plant is a complex task which

needs time and an intuitive understanding of the plant‘s dynamics. Usually, on the

basis of some assumptions to choose, a simplified model is developed and the physical

parameters of the established model are identified using some experimental responses.

If the model is nonlinear, we need to linearize the model around a steady state point in

order to get a simplified linear model. Therefore a linear controller is designed with

techniques from classical control such as pole placement or frequency domain

methods. Using the mathematical model and the designed controller, a simulation in

closed loop is carried out in order to study and to analyse its performances. This step

of study consists to adjust controller parameters until performances are reached for a

given set point. In the last step, the designed controller is implemented via, for

example, a microprocessor, and evaluating the performance of the closed-loop system

(again, possibly leading to redesign).

In industry most of the time engineers are interested in linear controllers such as

proportional- integral-derivative (PID) control or state controllers. Over 90% of the

controllers in operation today are PID controllers (or at least some form of PID

controller like a P or PI controller). This approach is often viewed as simple, reliable,

and easy to understand and to implement on PLCs. Also performances of the plant are

on-line improved by adjusting only gains. In spite of the advantages of PID

controllers, the process performances are never reached. This is due mainly to the

accuracy of the model used to design controller and not properly to the controller.

Page 13: Fuzzy Supervised PID controller.pdf

2

In the development of analytical models, variation of physical parameters, operation

conditions and disturbances are not taken into account. This is due to the difficulty to

identify all the physical phenomena in the process and to find an appropriate model

for each. Therefore the closed loop specifications of the process are not maintained.

Engineers are however in the need to adjust permanently PID controllers even it‘s a

heavy task. For these different reasons, a new approach of control is proposed taking

into account the constraints related to the process, the parameter variation and

disturbances. This type of control, named fuzzy control, is designed from the operator

experience on the process over many years. Under different operation conditions,

linguistic rules are established taking into account constraints and environment

process. In this case, modelling the process is not necessary and the designed fuzzy

controller is sufficient to ensure the desired performances. Currently, Fuzzy control

has been used in a wide variety of applications in engineering, science, business,

medicine, psychology, and other fields [1]. For instance, in engineering some potential

application areas include the following:

1. Aircraft/spacecraft: Flight control, engine control, avionics systems, failure

diagnosis, navigation, and satellite attitude control.

2. Automated highway systems: Automatic steering, braking, and throttle

control for vehicles.

3. Automobiles: Brakes, transmission, suspension, and engine control.

4. Autonomous vehicles: Ground and underwater.

5. Manufacturing systems: Scheduling and deposition process control.

6. Power industry: Motor control, power control/distribution, and load

estimation.

7. Process control: Temperature, pressure, and level control, failure diagnosis,

distillation column control, and desalination processes.

8. Robotics: Position control and path planning.

1.2 Magnetic Levitation

Magnetic levitation, maglev, or magnetic suspension is a method by which an object

is suspended with no support other than magnetic fields. Magnetic force is used to

counteract the effects of the gravitational and any other accelerations. The two

primary issues involved in magnetic levitation are lifting force: providing an upward

force sufficient to counteract gravity, and stability: insuring that the system does not

spontaneously slide or flip into a configuration where the lift is neutralized. Magnetic

levitation is used for maglev trains, magnetic bearings and for product display

purposes. The Magnetic Levitation System (Maglev) serves as a simple model of

devices that have become more popular in recent years such as Maglev trains and

magnetic bearings. Maglev trains have been recently tested and some lines are already

available for example in Shanghai. Magnetic bearings are used in turbines for the

same reason as Maglev trains are being built, which is low friction in the bearing

itself. Already many turbines are in commercial used where the rotating shaft is

levitated with magnetic force. Some other magnetic bearing applications include

pumps, fans and other rotating machines.

Introduction

Page 14: Fuzzy Supervised PID controller.pdf

3

1.3 Maglev

Maglev is a completely new mode of transport that will join the ship, the wheel, and

the airplane as a mainstay in moving people and goods throughout the world. Maglev

has unique advantages over these earlier modes of transport and will radically

transform society and the world economy in the 21st Century. Compared to ships and

wheeled vehicles—autos, trucks, and trains—it moves passengers and freight at much

higher speed and lower cost, using less energy. Compared to airplanes, which travel at

similar speeds, Maglev moves passengers and freight at much lower cost, and in much

greater volume. In addition to its enormous impact on transport, Maglev will allow

millions of human beings to travel into space, and can move vast amounts of water

over long distances to eliminate droughts.

In Maglev—which is short for MAGnetic LEVitation—high speed vehicles are lifted

by magnetic repulsion, and propelled along an elevated guide-way by powerful

magnets attached to the vehicle. The vehicles do not physically contact the guide-way,

do not need engines, and do not burn fuel. Instead, they are magnetically propelled by

electric power fed to coils located on the guide-way. There are four basic reasons why

Maglev is important:

Maglev is a much better way to move people and freight than by existing

modes. It is cheaper, faster, not congested, and has a much longer service life.

A Maglev guide-way can transport tens of thousands of passengers per day

along with thousands of piggyback trucks and automobiles. Maglev guide-

ways will last for 50 years or more with minimal maintenance, because there is

no mechanical contact and wear, and because the vehicle loads are uniformly

distributed, rather than concentrated at wheels. Similarly, Maglev vehicles will

have much longer lifetimes than autos, trucks, and airplanes.

Maglev is very energy efficient. Unlike autos, trucks, and airplanes, Maglev

does not burn oil, but instead consumes electricity, which can be produced by

coal-fired, nuclear, hydro, fusion, wind, or solar power plants. At 300 miles

per hour in the open atmosphere, Maglev consumes only 0.4 MJ per passenger

mile, compared to 4 MJ per passenger mile of oil fuel for a 20-miles-per-

gallon auto that carries 1.8 people (the national average) at 60 miles per hour

(mph). At 150 mph in the atmosphere, Maglev consumes only 0.1 of a MJ per

passenger mile, which is just 2 % of the energy consumption of a typical 60-

mph auto. In low-pressure tunnels or tubes, like those proposed for

Switzerland‘s Metro system, energy consumption per passenger mile will

shrink to the equivalent of 10,000 miles per gallon.

Maglev vehicles emit no pollution. When they consume electricity, no carbon

dioxide is emitted. Even if they use electricity from coal- or natural-gas-fired

power plants, the resulting CO2 emission is much less than that from autos,

trucks, and airplanes, because of Maglev‘s very high energy efficiency.

Maglev has further environmental benefits. Maglev vehicles are much quieter

than autos, trucks, and airplanes, which is particularly important for urban and

suburban areas. Moreover, because Maglev uses unobtrusive narrow-beam

elevated guide-ways, its footprint on the land is much smaller than that of

highways, airports, and railroad tracks.

Maglev has major safety advantages over highway vehicles, trains, and

airplanes. The distance between Maglev vehicles on a guide-way, and the

Introduction

Page 15: Fuzzy Supervised PID controller.pdf

4

speed of the vehicles, are automatically controlled and maintained by the

frequency of the electric power fed to the guide-way. There is no possibility of

collisions between vehicles on the guide-way. Moreover, since the guide-ways

are elevated, there is no possibility of collisions with autos or trucks at grade

crossings.

Fig. 1.1: Trans-rapid 09 at the Emsland test facility in Germany

Fig. 1.2: SC-Maglev in Yamanashi Prefecture, Japan

1.4 Objective

If the model of a system is known with a good accuracy, industrialists prefer to

implement a fuzzy PID supervisor to their existing PID controllers where gains are

on-line adjusted taking into account different operation conditions, variation of plant

parameters and disturbances. Supervisory control is a type of adaptive control since it

seeks to observe the current behavior of the control system and modify the controller

to improve the performance. It is a multilayer (hierarchical) controller with the

supervisory at the highest level; the supervisor controller can use any available data

Introduction

Page 16: Fuzzy Supervised PID controller.pdf

5

from the control system to characterize the systems current behavior and generate

outputs that are not direct command inputs to the plant. Rather, they dictate changes to

another controller that generates these command inputs [2]. Because PID controllers

are often not properly tuned (e.g., due to plant parameter variations or operating

condition changes), there is a significant need to develop methods for the automatic

tuning of PID controllers. The supervisor is trying to recognize when the controller is

not properly tuned and then seeks to adjust the PID gains to obtain improved

performance. When there is heuristic knowledge available on how to tune PID

controllers while in operation, there is the opportunity to utilize fuzzy control methods

as the supervisor that tunes or coordinates the application of conventional controllers,

this approach shouldn‘t be confused with Fuzzy-PID controllers, which are PID

controllers realized by fuzzy control methods [3].

Overall, fuzzy PID auto-tuners tend to be very application dependent and it is difficult

to present a general approach to on-line fuzzy PID auto-tuning that will work for a

wide variety of applications [2]. There are different configurations that incorporating

fuzzy controllers with PID controllers, examples are: replacing PID with fuzzy

controller, using fuzzy controller to adjust PID parameters, and using fuzzy controller

to add to PID output [4 - 9]. In the method presented here, we use a PID controller to

create a stable equilibrium point of the position of a magnetically levitated rotor, and a

fuzzy controller to adjust gains of the PID controller based on the operating conditions

to improve the performance of the system. The controller is simulated using

SIMULINK®, and the performance of the PID controller alone is compared to the

performance of the hybrid controller.

1.5 Motivation

Design of controllers is an area of research that has been explored since the advent of

human intellect. In the initial stage of development of control theory most of the effort

was concentrated into algorithms and methods that constitute the classical control. It

did not incorporate real time or real life problems. In the last century a large effort was

put for designing controllers that can act like a human operator and imitate decisions

like humans. Thus the neural algorithms and fuzzy based approaches were discovered.

The key motivation behind this project has been the interesting field of Fuzzy based

controllers. Fuzzy controllers are designed to make decisions like a human but unlike

neural networks; fuzzy systems tend to be more domain specific.

1.6 Organisation of the Report

This work is organised as follows. In Chapter 2 the Magnetic levitation System and its

system model is presented. Chapter 3 discusses the Fuzzy Logic and a brief

description of fuzzy control is given. In Chapter 4 extensive description of how to

design a fuzzy controller is given. In Chapter 5 tuning of PID controller using

conventional methods is analysed. Chapter 6 presents a detailed discussion on Fuzzy

supervised PID controller and analysis of system using SIMULINK® model. Finally

conclusion and future scope is discussed in Chapter 7.

Introduction

Page 17: Fuzzy Supervised PID controller.pdf

6

Chapter-2

Magnetic Levitation System

2.1 Maglev Systems

Magnetic levitation systems are systems in which a rotor or a stationary object is

suspended in magnetic field. Magnetic levitation systems have practical importance in

many engineering systems such as in high-speed maglev passenger trains, frictionless

bearings, levitation of wind tunnel models, vibration isolation of sensitive machinery,

levitation of molten metal in induction furnaces, and levitation of metal slabs during

manufacturing. The maglev systems can be classified as attractive systems or

repulsive systems based on the source of levitation forces. Magnetic levitation of a

rotating disk typically incorporates four or more electromagnets to levitate a

ferromagnetic disk without contact with the surroundings, where levitation is

accomplished through automatic control of the electromagnet coils currents. Position

sensors are required to sense the position of the disk, and a controller uses position

sensor outputs to apply stiffness and damping forces to the rotor to achieve a desired

dynamic response.

Active magnetic levitation systems are being increasingly used in industrial

applications where minimum friction is desired or in harsh environments where

traditional bearings and their associated lubrication systems are considered

unacceptable, as discussed in [10, 11]. Such systems are inherently open-loop

unstable, and require means of control to stabilize their operation; this is generally

done by creating a closed loop system using feedback control. The requirement of

controllers introduces flexibility into the dynamic response of the systems, which can

also be designed to compensate for noises and vibrations that would affect the

operation. Also, these systems are highly nonlinear, and in order to obtain a transfer

function to describe them, number of approximations have to be made; hence, the

design of linear controllers can produce the desired dynamic response only for the

region in which the linear model was created. Many non-linear control algorithms

were introduced in earlier research [12, 13] and a comparison between using linear

and non-linear methods of controlling magnetic levitation systems was discussed in

[14].

In recent years, a lot of works have been reported in the literature for controlling

magnetic levitation systems. The feedback linearization technique has been used to

design control laws for magnetic levitation systems [15, 16]. The input-output, input-

state, and exact linearization techniques have been used to develop nonlinear

controllers [17, 18]. Other types of nonlinear controllers based on nonlinear methods

have been reported in the literature [19]. Robust linear controller methods such as H∞

optimal control, μ-synthesis, and Q-parameterization have also been applied to control

magnetic levitation systems [20]. Control laws based on phase space, linear controller

design, the gain scheduling approach, and neural network techniques [21] have also

been used to control magnetic levitation systems.

In this project design and simulation of a new supervisory control strategy for

magnetic levitation systems that incorporates a fuzzy controller to tune the gains of a

discrete PID controller is studied.

Page 18: Fuzzy Supervised PID controller.pdf

7

2.2 Principle

The basic principle of a simple electromagnetic suspension system is shown in Fig.

2.1. The magnetic force applied by the electromagnet is opposite to gravity and

maintains the suspended steel ball in a levitated position. The magnetic force Fm

depends on the electromagnet current I, electro-magnet characteristics, and the air gap

X between the steel ball and the electromagnet.

Fig. 2.1: Principle of Magnetic Levitation

2.3 System Model Description

Fig. 2.2: Close view of the levitating steel ball

The Magnetic levitation system as shown Fig. 2.2 consists of a magnetic sphere

suspension system. The objective of the system is to control the vertical position of

the ball by adjusting the current in the electromagnet through the input voltage. The

metal sphere is suspended in air by the electromagnetic force generated by an

electromagnet. The Magnetic levitation system consists of an electromagnet, a metal

sphere and an infra-red sphere position sensor. The magnetic ball suspension system

can be categorized into two systems: a mechanical system and an electrical system.

The sphere position in the mechanical system can be controlled by adjusting the

current through the electromagnet where the current through the electromagnet in the

electrical system can be controlled by applying controlled voltage across the

electromagnet terminals.

Magnetic Levitation System

Page 19: Fuzzy Supervised PID controller.pdf

8

Fig. 2.3: Schematic Diagram of the Magnetic Levitation Unit

From Ampere‘s circuit law and faraday‘s inductive law, the magnitude of the force

f(h,i) exerted across an air gap h by an electromagnet through which current i flows

can be described as:

The total inductance L is a function of the distance and given by

Where L1 is the inductance of the electromagnetic (coil) in the absence of the levitated

object, L0 is the additional inductance contributed by its presence, and X0 is the

equilibrium position. The parameters are determined by the geometry and construction

of the electromagnet, and can be determined experimentally. Substituting equation (2)

into (1) yields:

Magnetic Levitation System

))2

2i dL(hf h( , idh

= − (1)

0 01L h( ) L= + L H

h (2)

2 20 0

2f L X i

⎜ ⎟⎝ ⎠h⎜ ⎟

⎝ ⎠h⎛ ⎞i β= ⎛ ⎞= (3)

Page 20: Fuzzy Supervised PID controller.pdf

9

Fig. 2.4: A magnetic ball bearing system

Eliminating higher order terms give

Evaluating equation (6) using (4) and (5) yields

Where, I0 is the equilibrium value. At equilibrium, the weight of the object is

suspended by the electromagnet force, f0. The force required to maintain equilibrium,

f1, is

Combining equations (7) and (8) gives

The voltage equation of the electromagnetic coil is given in equation 1.

Assuming the suspended object remains close to its equilibrium position, h=h0, and

therefore

Also assuming that L1 >> L0, equation (10) can be simplified as

Magnetic Levitation System

0 0

2β = L H

(4)

0 0 00 0

∂⎛ ⎞f ⎛ ⎞∂f ⎛ ⎞∂f ⎛ ⎞∂ff = f h⎝ ∂ ⎟

⎠H i hΔ +H ⎜ ⎟∂

Δ +i Δ+∂⎜ ⎟L

Δ +L ⎜ ⎜ ⎟⎝ ⎠∂⎝ ⎠⎝ ⎠

(5)

0=f f h⎝ ⎠∂i ⎟ ⎜ ⎟

⎝ ⎠∂h+ ⎛ ⎞Δi +∂ ∂f f⎛ ⎞Δ⎜ (6)

20 0 0

2 30 0 0

2f ⎟Δ ⎜−i hH H H

β⎛ ⎞I ⎛ ⎞ ⎛⎜ ⎟= + ⎜⎝ ⎠ ⎝ ⎠ ⎝

⎟⎠

Iβ β2 I ⎞Δ (7)

1 0f = −f f

20 0

1 2 30 0

⎟Δ − ⎜if β I ⎞ h

H H⎛ ⎞β I2 2⎛

⎟Δ= ⎜⎠⎝ ⎝ ⎠

(9)

(8)

V i= +R L( )h didt

(10)

1 0L( )h L= + L (11)

Page 21: Fuzzy Supervised PID controller.pdf

10

The principal equation for the suspended object comes by applying Newton‘s second

law of motion. For this one degree of freedom system, a force balance taken at the

centre of gravity of the object yields

The sensor can be modelled as a gain element,

Where Vs is the sensor output voltage and Ks is an experimental gain between the

object‘s position and the output voltage.

The Laplace transform of above equation obtained as:

The Laplace transform of equation (28) is

The overall transfer function of the Maglev system is obtained as:

Table 1 summarizes the variables and parameters use in this problem. Here the

problem is to maintain the ball at its operating point (position) of 0.03 meters from the

coil.

Magnetic Levitation System

1V i= +R L didt

(12)

2

12M d h = − fdt

(13)

s s=V K h (14)

2200

2 2 30 0

M d h ⎛ ⎞2 2β β⎛I I

⎞ h

dt H H − = ⎜ ⎟ −i ⎜ ⎟

⎝ ⎠ ⎝ ⎠

(15)

2

1 22M d h K i= K− hdt

− (16)

Where, 01 2

0

K = 2β IH

and2

02 3

0

K = 2β IH

(17)

(18)

1

1

2 2

1

G s( ) s= V s( )V s( )

sK KML

KRL M

−=

⎛⎞⎛ ⎞⎜ ⎟s s+ −⎜ ⎟

⎠⎝ ⎠⎝

(19)

I s( ) = V s( )L +s R

(Ms2 −K2)H(s) = −K1I(s)

Page 22: Fuzzy Supervised PID controller.pdf

11

Table1. Parameters of the Magnetic Levitation system

Parameters Description Values

H0 Equilibrium height of ball (m) 0.03

M Mass of ball bearing (kg) 0.225

R Resistance (Ω) 2.48

L1 Inductor (H) 0.18

β Constant related to magnetic force (Nm2/A

2) 7.93×10

-5

I0 Equilibrium current of the coil (A) 5

Ks Sensor gain factor (V/m) 200

K1 constant (N/A) 0.882

K2 constant (N/m) 147

Fig. 2.5: Block diagram of Magnetic levitation system

Magnetic Levitation System

Page 23: Fuzzy Supervised PID controller.pdf

12

Chapter-3

Fuzzy Logic

Fuzzy logic is a logical system providing a mathematical framework to capture the

uncertainties associated with human cognitive systems such as thinking and reasoning.

Simply, it simulates human thinking which operates more likely on symbols than

exact values. In fact, our daily thoughts and communication are full of these symbols

or fuzzy expressions. This chapter gives a brief introduction to the main concepts of

fuzzy logic.

3.1 Fuzzy sets

In conventional set theory, an element either belongs to the set or not. Fuzzy logic is a

generalization of the conventional logic. In fuzzy set theory, the element can belong to

the set partially with a certain degree. The difference between conventional crisp and

fuzzy sets is illustrated in Fig. 3.1. Let us consider tree example sets the poors, the

averages and the richs in the universe of discourse ‗wealth‘. In conventional logic,

persons are divided into these three groups crisply. The fuzzy sets have no crisp

boundaries, but a person can simultaneously be a member of several groups with

different degrees. For example, a person can be rich with degree of 0.1 and average

with 0.7.

Fig. 3.1: Conventional sets and fuzzy sets.

3.1.1 Linguistic variables

The main advantage of fuzzy logic is that words or sentences can be used as

expressions instead of numeric values. The associative expressions are called

linguistic variables. They are common in our daily life. Let us consider the fuzzy

variable velocity. It can be, for example, divided into three linguistic variables: slow,

medium, and fast which are fuzzy sets, as show in Fig. 3.2. Each linguistic variable is

represented by membership function in the universe of discourse. For example, the

membership function of the linguistic variable slow could be defined by

Page 24: Fuzzy Supervised PID controller.pdf

13

The membership function values can vary between zero and unity and they can have

many shapes, as shown in Fig. 3.3. The selection of the shape for a fuzzy set is

subjective and particular rules do not exist, but the singleton type of membership

function (fuzzy unit set) is usually employed only for the output variables of the fuzzy

reasoning.

Fig. 3.2: Terms of fuzzy logic.

Fig. 3.3: Different shapes of membership functions. (a) Z-shaped, (b) trapezoidal,

(c) bell-shaped, (d) triangular and (e) singleton.

3.2 Fuzzy control

Fuzzy control is useful in some cases where the control processes are too complex to

analyse by conventional quantitative techniques. Fuzzy control design is very

interesting for industrial processes where modelling is not easy to make or conception

of nonlinear controllers for industrial processes with models. The available sources of

information of a process are interpreted qualitatively, inexactly or uncertainly. The

main advantages of fuzzy logic control remains in [1]:

• Parallel or distributed multiple fuzzy rules –complex nonlinear

• Linguistic control, linguistic terms –human knowledge

• Robust control

3.2.1 Fuzzy control system design

Fig. 3.4 gives the fuzzy controller block diagram, where we show a fuzzy controller

embedded in a closed-loop control system. The plant outputs are denoted by y(t), its

Fuzzy Logic

µslow (v)1,

1 25-v----–-----3---5-

,–

v ∈ [0, 35] ,

v ∈ [35, 60] .

= (20)

Page 25: Fuzzy Supervised PID controller.pdf

14

inputs are denoted by u(t), and the reference input to the fuzzy controller is denoted by

r(t). The design of fuzzy logic controller is based on four main components [1]:

1. The fuzzification interface which transforms input crisp values to fuzzy

values

2. The knowledge base which contains knowledge of the application domain

and the control objectives

3. The decision-making logic which performs inference for fuzzy control

actions

4. The defuzzification interface which provides the control signal to the

process.

Fig. 3.4: Fuzzy controller diagram

3.3 Fuzzy reasoning

3.3.1 Fuzzy rules

Fuzzy reasoning is usually performed using if -then rules. The fuzzy rules define the

connection between input and output fuzzy (linguistic) variables. The rule consists of

two parts: an antecedent and a consequence part. The Inference block is used to link

the input variables to the output variable denoted XR and considered as a linguistic

variable given by a set of rules:

XR = (IF (condition 1), THEN (consequence 1) OR

IF (condition 2), THEN (consequence 2) OR

…………………………………………

…………………………………………

………………………………………… OR

IF (condition n), THEN (consequence n).

n corresponds to the product of the number of membership functions of each input

variable of the fuzzy logic controller.

In these rules, the fuzzy operators AND, OR link the input variables in the

―condition‖ while the fuzzy operator OR links the different rules. The choice of these

operators for inference depends obviously on the static and dynamic behaviours of the

Fuzzy Logic

Page 26: Fuzzy Supervised PID controller.pdf

15

system to control. The numerical processing of the inference is carried out by three

methods [22]:

1. max-prod inference method

2. max-min inference method

3. sum-prod inference method

3.3.2 Fuzzy inference system

The fuzzy inference system (FIS) performs fuzzy reasoning. The basic FIS is

composed of five functional blocks, as depicted in Fig. 3.5. The knowledge base

consists of the data base and the rule base. The fuzzy sets are defined in the data base

and fuzzy rules in the rule base. The decision-making unit executes fuzzy reasoning

rules taking fuzzified inputs of FIS as inputs and delivering the fuzzy result to the

defuzzifier, which produces the output of the FIS.

Fig. 3.5: The structure of the fuzzy logic inference system.

The operation of the FIS is illustrated in Fig. 3.7. First, crisp inputs x and y are fed into

a FIS. In the second stage, they are fuzzified. After that, the fuzzified inputs are

combined according to the fuzzy rules in the knowledge base. Finally, the results of all

rules are combined and defuzzified. In the following, each stage is described in more

detail.

3.3.3 Fuzzification

In the fuzzification, the crisp input values are transformed to fuzzy values. If the input

has a crisp value, the matching against the membership function of linguistic variable

is shown in Fig. 3.6(a). If the input contains noise, it can be modeled by using a fuzzy

input value. In this case the fuzzy output is the intersection of fuzzy input and the

linguistic variable member- ship functions as shown in Fig. 3.6(b). However, the crisp

input value fuzzification is mostly used because of its simplicity.

The fuzzification block contains generally preliminary data which are obtained from:

• Conversion of measured variables with analog/digital converters.

• Preprocessing of the measured variables in order to get the state, error,

state error derivation and state error integral of the variables to control

(output variables or other state variables).

Fuzzy Logic

Page 27: Fuzzy Supervised PID controller.pdf

16

• Choice of membership functions for the input and output variables namely

the shape, the number and distribution. Usually three to five triangular or

Gaussian membership functions are used with a uniform distribution

presenting 50% of overlapping. More than seven membership functions,

the algorithm processing becomes long and presents a drawback for fast

industrial processes.

Fig. 3.6: Fuzzification of a crisp input (on the left) and a fuzzy input (on the right).

3.3.4 Inference

The decision making unit performs the inference operations on the fuzzy rules. The

fuzzy values within a fuzzy rule are aggregated with connective operators like

intersection (AND), union (OR) and complement (NOT). Due to the use of the multi-

valued logic, the connective operators for fuzzy logic differ from the ones used in the

Boolean logic. The operators can be defined in several ways, but the following are the

best-established ones [23]:

Fig. 3.7: The fuzzy inference using the Min-inference.

Intersection

Fuzzy Logic

, (21)

, (22)

AND (µA, µB) = min µA, µB

AND (µA, µB) = µA µB

Page 28: Fuzzy Supervised PID controller.pdf

17

Union

Complement

Where µA and µB are membership values which are combined by operators. The firing

strengths of the fuzzy rules are computed by employing above operators. The

operation of the intersection is shown in Fig. 3.7. The final output fuzzy sets are

obtained either scaling (Max-Dot method) or cutting (Max-Min) according to the

firing strength of the fuzzy rules. If the output fuzzy sets are singletons, they are not

handled by the firing strengths in this stage.

3.3.5 Defuzzification

In the defuzzification stage, the outputs of the fuzzy rules are combined to a crisp

output value. Several defuzzification strategies have been suggested [24]. The most

common method is the center of area (COA) defuzzification strategy, illustrated in

Fig. 3.8. Assuming a discrete universe of discount, the crisp output Z is produced by

searching the center of gravity of consequence fuzzy sets according to

where m is the number of quantization levels of the output, zi is the amount of output

at the quantization level i, and µi(zi) represents its membership value in C.

If only singletons are used as the consequences of fuzzy rules, the natural

defuzzification method is the weighted average (WA). It can be considered as a

special case of COA defuzzification method is the weighted average (WA). The WA

method combines the consequences of the fuzzy rules to the out- put of the inference

system z according to

where n is number of fuzzy rules, µi is the firing strength of the rule, and is the output

value of the ith singleton.

Fuzzy Logic

, (23)

, (24)

OR (µA, µB) = maxµA, µB

NOT (µA) = 1 –µA

, (25)Z

m

µi (zi)i = 0∑

µC (zi) zi

= i----=----0m-------------------------

(26)Z

µi zii = 0

n

µii = 0

n

∑= ---------------------

Page 29: Fuzzy Supervised PID controller.pdf

18

Fig. 3.8: Defuzzification methods

On the left, three fuzzy rules which have singleton output fire. The output is computed

by using weighted average strategy. On the right, two fuzzy rules fires. The crisp

output is the centre of the area.

3.4 Different types of Fuzzy Logic controllers

On the basis of the consequence of rules given above, different types of fuzzy

logic controllers are presented.

1. If the consequence is a membership function or a fuzzy set, the fuzzy

controller is Mamdani type. In this case, the processing of inference uses often the

max-min or max- prod inference method while for defuzzification, the center of

gravity method is often used and in some cases we use the maximum value method if

fast control is needed.

2. If the consequence is a linear combination of the input variables of the fuzzy

logic controller. Indeed each rule corresponds to a local linear controller around a

steady state. Consequently, the set of the established rules correspond to a nonlinear

controller. In this case, we use max-min or max-prod inference method and for

defuzzification, we often use the weight average method.

Also, there exist other types of fuzzy logic controllers such as Larsen or Tsukamoto

[25]. Most of time Mamdani and TSK controllers are used in the design of controllers

for nonlinear systems with or without models [22]. The advantages of the design of a

fuzzy logic controller using Mamdani type are an intuitive method, used at a big scale

and well suited for translation of human experience on linguistic rules.

On the other hand, the advantages of a fuzzy logic controller using a Takagi-Sugeno

type are:

• Good operation with linear techniques (the consequence of a rule is linear)

• Good operation with optimization techniques and parameters adaptation of

a controller

• Continuous transfer characteristics very suited for systems with a model

fast processing of information

Fuzzy Logic

Page 30: Fuzzy Supervised PID controller.pdf

19

3.5 Discussion

The different steps followed in the processing of the input variables of the fuzzy logic

controller namely fuzzification, inference and defuzzification, allows obtaining a

nonlinear characteristic. Indeed it‘s an advantage when compared to the classical

control. The nonlinearity of this characteristic depends on some parameters. For

example the number, the type and the distribution of membership functions. Also,

other parameters can be considered such as the number of rules and inference

methods. Finally, the nonlinearity can be more or less pronounced depending on all

these parameters.

In this case we consider the fuzzy logic controller as a nonlinear controller. Another

possibility to get a nonlinear controller is to design and to add a fuzzy supervision to a

PID controller. Industrialists are motivated to keep PID controllers which are well

known and to add a fuzzy supervisor which modifies on-line PID parameters in order

to reach and to maintain high performances whatever the parameters change and

operations conditions maybe. In the design of the fuzzy supervision, the outputs are

the PID parameters to provide on-line to the PID controller.

Fuzzy Logic

Page 31: Fuzzy Supervised PID controller.pdf

20

Chapter-4

Fuzzy Controller

4.1 Fuzzy supervisory control

Fuzzy Supervisory controller is a multilayer (hierarchical) controller with the

supervisor at the highest level, as shown in Figure 4.1. The fuzzy supervisor can use

any available data from the control system to characterize the system‘s current

behavior so that it knows how to change the controller and ultimately achieve the

desired specifications. In addition, the supervisor can be used to integrate other

information into the control decision-making process.

Fig. 4.1: Fuzzy Supervisory controller

Conceptually, the design of the supervisory controller can then proceed in the same

manner as it did for direct fuzzy controllers (fuzzification, inference and

defuzzification): either via the gathering of heuristic control knowledge or via training

data that we gather from an experiment. The form of the knowledge or data is,

however, somewhat different than in the simple fuzzy control problem. For instance,

the type of heuristic knowledge that is used in a supervisor may take one of the

following two forms:

1. Information from a human control system operator who observes the behavior of

an existing control system (often a conventional control system) and knows how

this controller should be tuned under various operating conditions.

2. Information gathered by a control engineer who knows that under different

operating conditions controller parameters should be tuned according to certain

rules.

Fuzzy supervisor is characterized by:

1. The outputs which are not control signals to provide to the control system but

they are parameters to provide to the controller in order to compute the

appropriate control.

2. Fuzzy supervision associated to the controller can be considered as an

adaptive controller

Page 32: Fuzzy Supervised PID controller.pdf

21

3. Fuzzy supervisor can integrate different types of information to resolve

problems of control.

4.2 Supervision of conventional controllers

Most controllers in operation today have been developed using conventional control

methods. There are, however, many situations where these controllers are not properly

tuned and there is heuristic knowledge available on how to tune them while they are in

operation. There is then the opportunity to utilize fuzzy control methods as the

supervisor that tunes or coordinates the application of conventional controllers. In this

part, supervision of conventional controllers concerns only PID controllers and how

the supervisor can act as a gain scheduler.

4.3 Fuzzy tuning of PID controllers

Over 90% of the controllers in operation today are PID controllers. This is because

PID controllers are easy to understand, easy to explain to others, and easy to

implement. Moreover, they are often available at little extra cost since they are often

incorporated into the programmable logic controllers (PLCs) that are used to control

many industrial processes. Unfortunately, many of the PID loops that are in operation

today are in continual need of monitoring and adjustment since they can easily

become improperly tuned.

Because PID controllers are often not properly tuned (e.g., due to plant parameter

variations or operating condition changes), there is a significant need to develop

methods for the automatic tuning of PID controllers for nonlinear systems where the

model is not well known. In this method, the fuzzy supervisor knows, from a response

time, when the controller is not well tuned and acts by adjusting the controller gains in

order to improve system performances. The principle scheme of the fuzzy PID auto

tuner [1] is given by Fig. 4.2.

Fig. 4.2: Fuzzy PID auto-tuner

Fuzzy Controller

Page 33: Fuzzy Supervised PID controller.pdf

22

The block ―Behavior Recognition‖ is used to characterize and analyze the current

response of the system and provides information to the ―PID Designer‖ in order to

determine the new parameters of the PID controllers and to improve performances.

The basic form of a PID controller is given by:

Where u is the control signal provided by the PID controller to the plant.

e is the error deuced from the reference input r and the plant output y.

Kp is the proportional gain, Ki is the integral gain, and Kd is the derivative

gain.

In this case, the adjustment of PID parameters is carried out by some candidate rules

as follows

• If steady-state error is large Then increase the proportional gain.

• If the response is oscillatory Then increase the derivative gain.

• If the response is sluggish Then increase the proportional gain.

• If the steady-state error is too big Then adjust the integral gain.

• If the overshoot is too big Then decrease the proportional gain.

In these rules conditions are deal with the block ―Behavior Recognition" and

consequences are evaluated by the block ―PID Designer‖ of the fuzzy supervisor. In

some applications controller gains are quantified according to different types of

responses a priori identified from experiments on the real process and implemented on

the block ―Behavior Recognition‖ [1].

4.4 Fuzzy gain scheduling

Conventional gain scheduling involves using extra information from the plant,

environment, or users to tune (via ―schedules‖) the gains of a controller. The overall

scheme is shown in Figure 4.3. A gain schedule is simply an interpolator that takes as

inputs the operating condition and provides values of the gains as its outputs. One way

to construct this interpolator is to view the data associations between operating

conditions and controller gains.

Fig. 4.3: Conventional fuzzy gain scheduler

Fuzzy Controller

t D0

d u(t)=K e(t)+K e(τ) dτ+K e(t)dt

(27)P I

Page 34: Fuzzy Supervised PID controller.pdf

23

The controller gains are established on the basis of information collected from the

plant to control, the operator or the environment. Three approaches are proposed for

the construction of the fuzzy gain scheduling [1]:

• Heuristic Gain Schedule Construction

• Construction of gain schedule by fuzzy identification

• Construction of gain schedule using the PDC method (Parallel

Distributed Compensation method)

4.4.1 Construction of a heuristic schedule gain

This method is applied for plants with specific particularities not involved in the

design of classical controllers. The PID parameters are deduced intuitively and the

rules used for the adjustment of parameters are heuristic. This is for example the case

of a tank with an oval shape (Fig. 4.4). In the heuristic rules, the condition

corresponds to the water levels and the consequence corresponds to the values of the

controller gain [1]. Each rule covers a set of water levels taking into account the tank

section. For low levels, the gain is higher in order to get high flow rates and for high

water levels, the gain is small in order to get small flow rates. This approach is very

useful for systems without models.

Fig. 4.4: Tank

4.4.2 Construction of a schedule gain by fuzzy identification

This approach is useful for plants where we know a priori how to adjust the controller

gains under different operation conditions [1]. For example if a control engineer

knows how to adjust gain controller according to certain rules, he can represent this

data by a fuzzy model of Mamdani or TSK type. Indeed it‘s the equivalent of a set of

controllers which are active in terms of the operation points. Also, the gain controllers

are deduced on-line by the inference mechanism between controllers for any operation

point. Indeed it‘s a soft transition from controller to another one.

4.4.3 Construction of a gain schedule using the PDC method

This approach is applied particularly for processes that can be modelled. Most of time,

the established models are nonlinear. In this case, the nonlinear model is replaced by a

sum of linearized models around different operation points [1]&[26]. For each

Fuzzy Controller

Page 35: Fuzzy Supervised PID controller.pdf

24

linearized model, a linear controller is designed (Fig. 4.5). These linear controllers

could be PI, PD or PID state controllers. The set of the designed controllers is finally a

nonlinear controller which is a fuzzy controller.

In this approach the n linearized models and the n corresponding controllers are rules

which are active simultaneously two by two since the condition is similar for both,

thus the name of the method "Parallel Distributed Compensation‖.

In all the approaches presented above, performances are not used directly when

designing controllers. Also non linearity, disturbances and variation parameters of the

plant are not taken into account in the systems with models.

In some cases stability is not ensured particularly when a change set point occurs or

when a disturbance is present. In the case of the PDC approach, local and global

stabilities are checked using Lyapunov theory [1]. For the other approaches, stability

is checked when implementing fuzzy supervision for classical controllers.

Fig. 4.5: PDC concept

Usually specifications and performances in closed loop are a priori defined. Therefore,

it‘s more interesting to use them and to design controllers ensuring stability and same

performances in closed loop whatever the operation conditions maybe.

Fuzzy Controller

Page 36: Fuzzy Supervised PID controller.pdf

25

Chapter-5

Tuned PID Controller

5.1 Overview

Tuning of PID controllers has always been an area of active interest in the process

control industry. Ziegler Nichols Method (ZN) is one of the best conventional

methods of tuning. Though ZN tunes systems very optimally, a better performance is

needed for very fine response and this is obtained by using Fuzzy Logic (FL)

methodology which is highly effective.

5.1.1 Tuning and its Purpose

A PID may have to be tuned when:

Careful consideration was not given to the units of gains and other parameters.

The process dynamics were not well-understood when the gains were first set,

or the dynamics have (for any reason) changed.

Some characteristics of the control system are direction-dependent (e.g.

actuator piston area, heat-up/cool-down of powerful heaters).

You (as designer or operator) think the controllers can perform better.

Always remember to check the hardware first because there are many conditions

under which the PID may not have to be tuned. These conditions are when:

A control valve sticks. Valves must be able to respond to commands.

A control valve is stripped out from high-pressure flow where the valve‘s

response to a command must have some effect on the system.

Measurement taps are plugged, or sensors are disconnected. Bad

measurements may have you correcting for errors that don‘t exist. Once fix

these hardware problems then depending on the responses we obtain an

appropriate decision can be taken whether or not to tune a PID controller. [27]

5.2 Trial and error method

This process is a very time consuming process as a lot of permutations and

combinations are involved. Though much iteration is performed the final result is not

satisfactory. A balance is not obtained between the rise time and % overshoot even

though a lot of possible combinations of the gains are incorporated. Continuous

cycling may be objectionable because the process is pushed to the stability limit.

Consequently, if external disturbances or a change in the process occurs during

controller tuning, it results in unstable operation. The tuning process is not applicable

to processes that are open loop unstable because such processes typically are unstable

at high and low values of Kc but are stable at an intermediate range of values. It can be

observed in Fig. 5.1 that large overshoot is obtained as the program is written for

faster rise time hence compromising with overshoot. All the time response

specifications cannot be balanced using trial and error method.

Page 37: Fuzzy Supervised PID controller.pdf

26

Fig. 5.1: Unit step response of the system G(s) tuned with trial and error method.

5.3 Pole placement method

If the process is described by a low-order transfer function, a complete pole placement

design can be performed. Consider for example the process described by the second-

order model.

This model has three parameters. By using a PID controller, which also has three

parameters, it is possible to arbitrarily place the three poles of the closed loop system.

The transfer function of the PID controller in parallel form can be written as

The characteristic equation of the closed loop system becomes

A suitable closed-loop characteristic equation of a third-order system is

which contains two dominant poles with relative damping (ζ) and frequency (ω), and a

real pole at –αω. Identifying the coefficients in these two characteristic equations

determines the PID parameters K, TI and TD.

The solution is

Tuned PID Controller

) = ( )211+ sT 1+)( sTG(s K P (28)

)I

I DIC sT

G (s) = K s T T2(1+ sT + (29)

111

1 21 21 21 221

23 =+⎟⎟⎠

⎞⎜⎜⎝

⎛++⎟⎟

⎛⎜⎜ + +

TTTK K

TTK K

TTs

TTK KT

T Ts +s

I

PPP D 0 (30)

(s +αω )(s2 + 2ζωs +ω 2 ) = 0 (31)

( )PK

1K =T T ω 2 1+ 221 −ζα (32)

2

Page 38: Fuzzy Supervised PID controller.pdf

27

Fig. 5.2: Response of a system tuned with Pole Placement Method.

5.4 Ziegler Nichols method

Ziegler Nichols formula ensures good load disturbance attenuation, but it generally

provides a poor phase margin and therefore it produces a large overshoot and settling

time in the step-response. The overall control scheme for Ziegler Nichols Method is

shown in Fig 5.3.

Fig. 5.3: Control Scheme for Ziegler Nichols Method.

Tuned PID Controller

( )3

21

21 121αω

ζαωT T

T =T T

I−+ (33)

( )( ζα ) 121

22

21

2121

−+−T −

ωω α + ζ

T TTT =

T TD

(34)

(35)⎥⎦

(t)+

1∫e(τ)dτ

⎤⎢⎣

⎡ t

idp dt T

u(t)=K e(t)+T de

0

Page 39: Fuzzy Supervised PID controller.pdf

28

Fig. 5.4: Unit step response of the system G(s) tuned with ZL method.

Tuned PID Controller

Page 40: Fuzzy Supervised PID controller.pdf

29

Chapter-6

Fuzzy Supervised PID-Controller

The fuzzy logic controller for the given Maglev system is designed in the following

sections. The various blocks related to this controller and rules governing the

operation of the controller are also detailed in the subsequent sections.

6.1 Fuzzification

The success of this work, and the like, depends on how good this stage is conducted.

In this stage, the crisp variables „e‟ and „de‟ are converted in to fuzzy variables ‗e’ and

‗de’ respectively. The membership functions associated to the control variables have

been chosen with triangular shapes as shown in Fig. 6.1 - Fig. 6.5. The universe of

discourse of all the input and output Variables are established as the suitable scaling

factors are chosen to brought the input and output variables to this universe of

discourse. Each universe of discourse is divided into seven overlapping fuzzy sets: NL

(Negative Large), NM (Negative Medium), NS (Negative Small), ZE (Zero), PS

(Positive Small), PM (positive Medium), and PL (Positive Large). Each fuzzy variable

is a member of the subsets with a degree of membership μ varying between 0 (non-

member) and 1 (full-member). All the membership functions have asymmetrical shape

with more crowding near the origin (steady state). This permits higher precision at

Steady state [27].

Fig. 6.1: Triangular Membership functions of input variable ‗error‘.

Fig. 6.2: Triangular Membership functions of input variable ‗error-rate‘.

Page 41: Fuzzy Supervised PID controller.pdf

30

6.2 Inference engine

Knowledge base involves defining the rules represented as IF-THEN statements

governing the relationship between input and output variables in terms of membership

functions. In this stage, the variables ‗e’ and ‗de’ are processed by an inference engine

that executes 25 rules (5x5) as shown in Table 2. These rules are established using the

knowledge of the system behavior and the experience of the control engineers. Each

rule is expressed in the form as in the following example: IF e is Negative Large

AND de is Positive Large THEN *fuz is Zero. Different inference engines can be

used to produce the fuzzy set values for the output fuzzy variable ‗*fuz’. In this work,

the Max-product inference method [27] has been used.

Table 2: Rule base Parameters for KP.

de NL NS ZE PS PL

e

NL PVL PVL PVL PVL PVL

NS PML PML PML PL PVL

ZE PMS PS PVS PMS PMS

PS PML PML PML PL PVL

PL PVL PVL PVL PVL PVL

Fig. 6.3: Triangular Membership functions of output variable ‗KP‘.

Table 3: Rule base Parameters for KI.

de NL NS ZE PS PL

e

NL PM PM PM PM PM

NS PMS PMS PMS PMS PMS

ZE PS PS PVS PS PS

PS PMS PMS PMS PMS PMS

PL PM PM PM PM PM

Fuzzy Supervised PID-Controller

Page 42: Fuzzy Supervised PID controller.pdf

31

Fig. 6.4: Triangular Membership functions of output variable ‗KI‘.

Table 4: Rule base Parameters for KD

De NL NS ZE PS PL

e

NL PVS PMS PM PL PVL

NS PMS PML PL PVL PVL

ZE PS PMS PVS PL PVL

PS PML PVL PVL PVL PVL

PL PVL PVL PVL PVL PVL

Fig. 6.5: Triangular Membership functions of output variable ‗KD‘.

6.3 Rule Base

A decision making logic which is stimulating a human decision process, infers fuzzy

control action from the knowledge of control rules and linguistic variable definitions.

The rules are “If-Then” format and formally the If side is called the condition and the

Then side is called conclusion. The computer is able to execute the rules and compute

the control signals depending on the measured input error (e) and change in error (de).

In a rule based controller the control strategy is stored in more or less natural

language. A rule base controller is easy to understand and easy to maintain for a non-

specialist end user and equivalent controller could be implemented using control

techniques.

Fuzzy Supervised PID-Controller

Page 43: Fuzzy Supervised PID controller.pdf

32

Fig. 6.6: Fuzzy Logic Rule-Base in SIMULINK®.

Fig. 6.7: Surface plot of Fuzzy Logic Rule-Base for variable KP.

Fuzzy Supervised PID-Controller

Page 44: Fuzzy Supervised PID controller.pdf

33

Fig. 6.8: Surface plot of Fuzzy Logic Rule-Base for variable KI.

Fig. 6.9: Surface plot of Fuzzy Logic Rule-Base for variable KD.

6.4 Defuzzification

The reverse of fuzzification is called as defuzzification. The use of Fuzzy Logic

Controller (FLC) produces output in linguistic variables (Fuzzy number). According

to real world requirements, the linguistic variables have to be transformed to crisp

output.

In order to define fuzzy membership function, designers choose many different shapes

based on their preference and experience. There are generally four types of

membership functions used:

Fuzzy Supervised PID-Controller

νCOGS =

∑i µC(xi).xi∑i µG(xi)

(36)

Page 45: Fuzzy Supervised PID controller.pdf

34

Trapezoidal MF

Triangular MF

Gaussian MF

Generalized bell MF

Fig. 6.10: Structure of fuzzy logic controller.

Implementation of an FLC requires the choice of four key factors:

I. Number of fuzzy sets that constitute linguistic variables.

II. Mapping of the measurements onto the support sets.

III. Control protocol that determines the controller behavior.

IV. Shape of membership functions.

PID parameters fuzzy self-tuning is to find the fuzzy relationship between the three

parameters of PID and "e" and "de", and according to the principle of fuzzy control, to

modify the three parameters in order to meet different requirements for control

parameters when "e" and "de" are different, and to make the control object a good

dynamic and static performance [29].

6.5 Adjusting fuzzy membership functions and rules

In order to improve the performance of FLC, the rules and membership functions are

adjusted. The membership functions are adjusted by making the area of membership

functions near ZE region narrower to produce finer control resolution. On the other

hand, making the area far from ZE region wider gives faster control response. Also the

performance can be improved by changing the severity of rules. An experiment to

study the effect of rise time (Tr), maximum overshoot (Mp) and steady-state error

(SSE) when varying KP, KI and KD was conducted. The results of the experiment

were used to develop 25-rules for the FLC of KP, KI and KD are the output variables

and from error and change of error are the input variables. Triangular membership

functions are selected.

Fuzzy Supervised PID-Controller

Page 46: Fuzzy Supervised PID controller.pdf

35

Fig. 6.11: Block diagram of self-tuning Fuzzy Supervised PID controller.

6.6 Results and Discussion

Fig. 6.12: SIMULINK® model of self-tuning Fuzzy Supervised PID controller.

Fig.6.12 shows the SIMULINK® model of the Maglev system in addition to the

Fuzzy tuned PID controller. The results shows that the controlled electromagnet

current can stabilize the disturbances that otherwise, would cause the ball to either fall

or attach itself to the electromagnet. From the simulation results shown in Fig. 6.14, it

can be observed that the fuzzy controller has better transient response than the

classical controller. The overshoot of the FLC controller is 6% compared to 18% in

the classical case. Furthermore, FLC has a faster transient response; it reaches to

steady state in 0.9 sec to that of 2 sec in classical PID. In comparison to the steady

state value, both controllers satisfactorily attain the steady state value.

According to the different responses, it‘s clear that performances are better with the

fuzzy control (Fuzzy supervised PID controller) in comparison to the classical control.

Indeed, the designed Fuzzy PID supervisor provides on-line the PID parameters KP,

KI, and KD allowing to reach the desired position with good performances and we

consider the performances better because the PID parameters vary in order to control

the ball position very quickly and without overshoot.

Fuzzy Supervised PID-Controller

Page 47: Fuzzy Supervised PID controller.pdf

36

Fig. 6.13: Error rate (de) v/s time response of Fuzzy tuned PID controlled Maglev

System model.

Fig. 6.14: Output v/s time response of Fuzzy tuned PID controlled Maglev System

model.

Fuzzy Supervised PID-Controller

Page 48: Fuzzy Supervised PID controller.pdf

37

Fig. 6.15: Error (e) v/s time response of Fuzzy tuned PID controlled Maglev System

model.

Fuzzy Supervised PID-Controller

Page 49: Fuzzy Supervised PID controller.pdf

38

Chapter-7

Conclusion

In the control of a nonlinear process, classical control is robust but not optimal for the

complete range of operation conditions. Indeed, the design of one controller is not

sufficient to ensure good performances and stability for all the operation set points.

Also, the variation of physical parameters of a process over time affects the

performances. Therefore a continuous adjustment of controller gains is necessary to

improve and eventually to maintain performances. On the basis of the proposed

approach, performances are used a priori in the design of the fuzzy PID supervision

taking into account the variation of parameters and operation conditions. Indeed in

terms of both, the designed fuzzy PID supervision provides on-line the appropriate

gains to the PID controllers ensuring the same performances whatever the operation

conditions maybe. From the simulation results, it has been shown that the fuzzy

controller can stabilize the system efficiently. Also the performance during the

transient period of the fuzzy system is better in the sense that less overshoot was

obtained. Moreover, the fuzzy controller provides a zero steady state error. Based on

the simulation results it is concluded that the Fuzzy Logic supervision based controller

can stabilize the system efficiently and accurately compared to a classical PID

controller.

Further work in this direction could be the analysis of the Maglev system and design

of a controller using more advanced analysis techniques like GA, Ant Colony

algorithm, Neuro-Fuzzy algorithm and ultimately practical implementation of the

designed controller onto the magnetic levitation system.

Page 50: Fuzzy Supervised PID controller.pdf

39

References

[1] Passino, K.M. & Yurkovich, S. (1998). Fuzzy control, Addison-Wesley-

Longman, Menlo Park, CA.

[2] PASSINO, K.M., STEPHEN Y., Fuzzy Control, Book; Addison Wesley

Longman, Inc. 1997 ISBN 0-201-18074-X.

[3] MIZUMOTO, M., Realization of PID controls by fuzzy control methods.

ELSEVIER Fuzzy Sets and Systems 1995; 70:171-182.

[4] COPELAND, R.P., RATTAN K.S., A Fuzzy Logic Supervisor for PID Control

of Unknown Systems. In: Proceedings of IEEE international Symposium of

Intelligent Control, Ohio, USA. 1994; pp. 22-26.

[5] GARCIA-BENITEZ, E., YURKOVICH S, PASSINO K.M., Rule-based

supervisory control of a two-link flexible manipulator. Journal of Intelligent and

Robotic Systems 1993; 7(2):195–213.

[6] JANTZEN, J., Fuzzy Supervisory Control, Technical University of Denmark,

Denmark. Tech. report no 98-H-875 (proc), Nov. 1998.

[7] JIAN, L., YONG K, JIAN C., Fuzzy-Tuning PID Control of an Inverter with

Rectifier-Type Nonlinear Loads. In: Proceedings of the Third International

Power Electronics and Motion Control Conference, Beijing, China. 2000;

v1:381-384.

[8] LOU, K.N., KUO CY, SHEU L.T., A Novel Method for Fuzzy Self-Tuning PID

Controllers. In: Proceedings of the Asian Fuzzy Systems Symposium 'Soft

Computing in Intelligent Systems and Information Processing. Kenting, Taiwan,

1996; pp. 194-199.

[9] SONG, S., LIU W., Fuzzy Parameters Self-Tuning PID Control of Switched

Reluctance Motor based on Simulink/NCD. In: Proceedings of International

Conference on Computational Intelligence for Modelling, Control and

Automation, 2006.

[10] DE QUEIROZ, M.S., DAWSON D.M., Nonlinear control of active magnetic

bearings: a back stepping approach, IEEE Trans Control Sys Tech, 1996.

[11] HUNG, J.Y., Magnetic bearing control using fuzzy logic. IEEE Trans Indus

Appl 1995; 31: 1492-1497.

[12] DHAR, D, BARRETT L.E., KNOSPE C. R., Optimum design of decentralized

magnetic bearings for rotor systems. In: Proceedings of the third international

symposium on magnetic bearings, Alexandria Virginia. 1992; pp. 47-59.

[13] HERZOG, R., A comparison between passively and actively controlled

magnetic bearings. In: Proceedings of the third international symposium on

magnetic bearings, Alexandria Virginia. 1992; pp. 223-231.

[14] CHARARA, A, CARON B., Magnetic bearing: comparison between linear and

nonlinear functioning. In: Proceedings of the third international symposium on

magnetic bearings, Alexandria Virginia. 1992; pp. 451-460.

Page 51: Fuzzy Supervised PID controller.pdf

40

[15] ABDEL-HADY, F., EL-MOGAHZY Y., ABUELENIN S, ABDEL-KADER,

R., Innovative approach to high-speed spinning using magnetically-elevated

spinning ring AUTEX Res J, 2006; 6:113-121.

[16] D. L. Trumper, M. Olson, and P. K. Subrahmanyan, Linearizing control of

magnetic suspension systems, IEEE Transactions on Control Systems

Technology 5 (1997), no. 4, 427–438.

[17] Charara, J. DeMiras, and B.Caron, Nonlinear control of a magnetic levitation

system without premagnetization, IEEE Transactions on Control Systems

Technology 4 (1996), no. 5, 513–523.

[18] M. R. Filho and C. J.Munaro, A designmethodology of tracking controllers for

magnetic levitation systems, Proc. 2001 IEEE International Conference on

Control Applications, (Mexico City), 2001, pp. 47–51.

[19] S. A. Green and K. C. Craig, Robust, design, nonlinear control of magnetic-

levitation systems, Journal of Dynamics, Measurement, and Control 120 (1998),

no. 4, 488–495.

[20] M. Fujita, F. Matsumura, and K. Uchida, Experiments on the H∞ disturbance

attenuation control of a magnetic suspension system, Proc. 29th IEEE

Conference on Decision and Control, (Hawaii), vol. 5, December 1990, pp.

2773–2778.

[21] M. Lairi and G. Bloch, A neural network with minimal structure for maglev

system modelling and control, Proc. 1999 IEEE International Symposium on

Intelligent Control/Intelligent Systems and Semiotics, (Massachusetts), 1999,

pp. 40–45.

[22] Bühler, H. (1994). Réglage par Logique Floue. Presses Polytechniques et

Universitaires Romandes.

[23] C. C. Lee, ―Fuzzy logic in control systems: fuzzy logic controller – part I, IEEE

Trans. Syst., Man, Cybern., vol. 20, no. 2, pp. 404–418, 1990.

[24] C. C. Lee, ―Fuzzy logic in control systems: fuzzy logic controller – part II, IEEE

Trans. Syst., Man, Cybern., vol. 20, no. 2, pp. 419–435, 1990.

[25] Driankov, D., Hellendoorn, H. & Reinfrank, M. (1993) An Introduction to

Fuzzy Control, Springer Verlag, Berlin Heidelberg.

[26] Vermeiren, L. (1998), Proposition de lois de commande pour la stabilisation de

Modèles Flous, Thèse de Doctorat, Université de Valenciennes et du Hainaut

Cambrésis, France.

[27] I.J.Nagrath and M.Gopal. 1999 Control systems engineering.

[28] Zhang, N. Wang and S. Wang, ―A developed method of tuning PID controllers

with fuzzy rules for integrating process,‖ Proceedings of the American Control

Conference, Boston, 2004, pp. 1109-1114.

[29] Wang Xiao-kan, Sun Zhong-liang, Wanglei, Feng Dong-qing, "Design and

Research Based on Fuzzy PID-Parameters Self-Tuning Controller with

MATLAB," Advanced Computer Theory and Engineering, International

Conference on, pp. 996-999, 2008 International Conference on Advanced

Computer Theory and Engineering, 2008.

References