Control System & Fuzzy Logic - Lab Manual - 23 - 24
Control System & Fuzzy Logic - Lab Manual - 23 - 24
Engineering
Laboratory Manual
2023-24
Preface
Control Systems and Fuzzy Logic Laboratory
Fuzzy logic provides mathematical strength to the emulation of certain perceptual and
linguistic attributes associated with human cognition.
Fuzzy logic means approximate reasoning, information granulation, computing with words
and so on. Ambiguity is always present in any realistic process. This ambiguity may arise
from the interpretation of the data inputs and in the rules used to describe the relationships
between the informative attributes. Fuzzy logic provides an inference structure that enables
the human reasoning capabilities to be applied to artificial knowledge-based systems. Fuzzy
logic provides a means for converting linguistic strategy into control actions and thus offers a
high-level computation.
So in this laboratory we introduce various membership functions, fuzzy inference systems
and different methods of defuzzification. With the help of this information students can
develop their own knowledge based system and find the solution to real world problems with
and can design Fuzzy logic controllers.
A control system manages, commands, directs, or regulates the behavior of other devices or
systems using control loops. It can range from a single home heating controller using
a thermostat controlling a domestic boiler to large industrial control systems which are used
for controlling processes or machines. The control systems are designed via control
engineering process. The PID controllers compare the value or status of the process
variable (PV) being controlled with the desired value or setpoint (SP), and applies the
difference as a control signal to bring the process variable output of the plant to the same
value as the setpoint. So students can understand basics of PID controller and Fuzzy Logic
Controller.
After successful completion of the Lab, students will be able to write the programs based on
control system and fuzzy systems. Practicals can be performed using Python/ MATLAB /any
appropriate open source software. Students should perform all the experiments and 100%
attendance for practicals is must to appear for final University Examination.
Control System and Fuzzy Logic
INDEX
Sr. Date of Signature of
Name of the Experiment Page
No. Checking Batch I/C
To obtain Pole, Zero and gain Value of
1
given transfer function
To obtain the state space model from the
2
given transfer function
To obtain transient response of second
3
order system.
To control the closed loop system using
4 PID controller
CERTIFICATE
Experiment No: 01
Name of the Experiment: To obtain pole, zero and gain value of a transfer function.
Submitted on:
Prerequisite:
knowledge of various types of signals
Idea about software MATLAB
Objective:
To obtain
1. Pole, zero, gain values from a given transfer function
2. Transfer function model from pole, zero, gain values
3. Pole, zero plot of a transfer function
Theory:
A transfer function is also known as the network function is a mathematical
representation, in terms of spatial or temporal frequency, of the relation
between the input and output of a (linear time invariant) system. The transfer
function is the ratio of the output Laplace Transform to the input Laplace
Transform assuming zero initial conditions. Many important characteristics of
dynamic or control systems can be determined from the transfer function. The
transfer function is commonly used in the analysis of single-input single-
output electronic system, for instance. It is mainly used in signal processing,
communication theory, and control theory. The term is often used exclusively
to refer to linear time-invariant systems (LTI). In its simplest form for
www.mitwpu.edu.in
continuous time input signal x(t) and output y(t), the transfer function is the
linear mapping of the Laplace transform of the input, X(s), to the output Y(s).
Zeros are the value(s) for z where the numerator of the transfer function
equals zero. The complex frequencies that make the overall gain of the filter
transfer function zero.
Poles are the value(s) for z where the denominator of the transfer function
equals zero. The complex frequencies that make the overall gain of the filter
transfer function infinite.
The values of s for which N(S) = 0, are known as zeros of the system. i.e; at
s = z 1 , z 2 , … … . , zn .
The values of s for which D(S) = 0, are known as poles of the system. i.e; at s =
p1 , p2 , … … ., pn .
Procedure: Draw flowchart and Implement the program for given transfer function
Calculations: Calculate poles and Zeros for given transfer function
Conclusions:
2
www.mitwpu.edu.in
Post lab questions:
S. Y. B. Tech
3
www.mitwpu.edu.in
Semester: III Subject: Control System and Fuzzy logic
Name: Class:
Experiment No: 02
Name of the Experiment: To obtain the state space model from the given
transfer function
Performed on:
Submitted on:
Aim: To obtain the state space model from the given transfer function
Prerequisite:
Objective:
To find the multi output for multi input system for the given transfer function.
To obtain the state space model for given transfer function or vice versa.
Theory:
www.mitwpu.edu.in
can be applied to nonlinear systems or systems with non-zero initial conditions. They also
provide a convenient way to represent, analyze, and control multi-input/multi-output
(MIMO) systems.
State space modeling of dynamic LTI systems allows the control system designer to bring
the vast array of tools from linear system theory to bear on the design problem. In
addition to MatLab's standard selection of linear systems tools, a number of specialized
state-space design and analysis tools are available through the Control Systems Toolbox.
Key Commands:
ss - conversion to state-space
ssdata - extraction of state-space data from a SYS model
rss - random stable state-space models
ss2ss - state transformations
canon - canonical state-space realizations
ctrb - controllability matrix
obsv - observability matrix
A.model creation using ss(), ssdata(), rss()
To begin, consider the same spring-mass-damper system
An easy state-space form to convert this system into is the controllability canonical form
(CCF).
This conversion is done using the following state definitions:
x1 = x
x2 = dx/dt
In this manner, the CCF form of the system becomes:
The output equation in this state-space model assumes the system output is simply the
mass position, x(t).
www.mitwpu.edu.in
To create this state-space system within Matlab, use the ss() function, which generates
a SYS object, just like the tf() command for transfer function system representations:
A = [0 1; -2/3 -8/3]
B = [0; 1/3]
C = [1 0]
D=0
sys = ss(A, B, C, D)
Using this SYS object, all the MatLab system response tools such as step(), lsim(), etc.,
can be used on the state-space model of this system.
Given a SYS object, the component A, B, C, D matrices of the state-space model may be
extracted using the ssdata() command, which has the following syntax: [A,B,C,D] =
SSDATA(SYS) retrieves the matrix data A,B,C,D for the state-space model SYS. If SYS
is not a state-space model, it is first converted to the state-space representation.
Finally, the rss() command may be used to generate a random state-space model. For full
syntax, enter "help rss" within MatLab.
y = Cx + Du
where
• A is an (nx × nx) square matrix called the system matrix or state matrix
www.mitwpu.edu.in
• D is a (ny × nu) matrix which represents any direct connection between the input and
the output. It as called the feed through matrix.
State transformations are important for converting between various canonical state-space
forms, and for reconfiguring a given state-space models into a transformed model with
controllable, uncontrollable, observable, and unobservable components decoupled.
Consider a state transformation z = Lx, where x is the original state vector, L is a linear
transformation matrix, and z is the transformed state vector. Under this transformation,
the resulting system becomes:
Next, form the transform matrix T using the "eig()" function, which is defined as:
Abar = -0.2792 0
0.0000 -2.3874
Bbar = 0.1642
0.4093
7
www.mitwpu.edu.in
Cbar = 0.9632 -0.3863
Dbar= 0
Note that the A matrix has been converted to a diagonal form. Furthermore, the diagonal
elements are -0.2792 and -2.3874, which corresponds to the eigenvalues of the original
matrix A as was seen from the eig() command above. As discussed in lecture, this should
be expected due to the invariance of the system's characteristic equation under any given
similarity transformation.
Also, note that both eigenvalues of the system are negative. This implies that the
unforced (natural, homogeneous) response of the system is stable, i.e. if you pull the mass
to some initial position y(0) = x1(0) = yo, then both the displacement (x1) and velocity
(x2) of the system will decay exponentially to y=0.
The above approach works for any given transformation, i.e. transformation into CCF or
OCF. However, MatLab actually provides a more convenient method for converting a
system into diagonal canonical form, using the "canon()" function. This is just a shortcut
to what we did above, providing both the transformed system equations and the
transformation matrix itself in a single function. Try entering:
U1 = 0 0.3333
8
www.mitwpu.edu.in
0.3333 0.2222
U2 = ctrb(sys)
U2 =0 0.3333
0.3333 0.2222
Clearly, the output is the same. This can save a bit of effort for many important operations,
such as when forming transformation matrices for conversion to CCF or OCF which require
U and V, respectively.
sys2 = tf(sys)
Transfer function:
0.3333
----------------------
s^2 + 2.667 s + 0.6667
A3 = -2.6667 -0.6667
1.0000 0
B3 = 0.5000
0
C3 = 0 0.6667
D3 = 0
9
www.mitwpu.edu.in
From state-space transfer function can be obtained from following relation
To obtain:
1) state space from the given Transfer function:
2. PROCEDURE:
1) Write the program from transfer Function to State Space
%T.F = s/(s+10)(s2+4*s+16)
num = [0 0 1 0];
den = [1 14 56 160];
[A,B,C,D] = tf2ss(num,den)
Run the program and get the state space variables.
2) Write the program from State Space to transfer Function
A= [0 1 0; 0 0 1; -5 -25 -5];
B= [0; 25; -120];
10
www.mitwpu.edu.in
C = [1 0 0];
D = [0];
[num,den] = ss2tf(A,B,C,D)
Run the program and get the transfer Function.
3) Write the program to check the controllability and observability of given system.
3. CONCLUSIONS:
A = [ -6 -40 -16
1 0 0
0 1 0]
B= [1
0
0]
C = [ 0 1 0]
D= 0
S. Y. B. Tech
11
www.mitwpu.edu.in
Semester: III Subject: Control System and Fuzzy
logic
Name: Class:
Experiment No: 03
Name of the Experiment: To obtain transient response 2nd order system using
MATLAB
Submitted on:
Objective:
To understand the various orders of the system.
To understand the response of the system when nature of input signal is
changing.
Theory:
12
www.mitwpu.edu.in
2nd Order System is represented as
• The dynamic behavior of 2nd order system can be described in terms of ξ and
wn
• The systems are classified as
– Un-damped System(ξ=0)
– Under-damped System(0<ξ<1)
– Critically damped System(ξ=1)
– Over-damped System(1< ξ)
13
www.mitwpu.edu.in
This system can be represented as two arrays, each containing the coefficients
of the polynomials
in decreasing powers of s as follows:
Num=[wn2]
Den=[1 2*ζ*wn wn2]
An alternative representation is
Num=[0 0 wn2]
Den=[1 2*ζ*wn wn2]
In this expression zeros is padded, this is to make the dimensions of the
numerator and denominator vector (ie.num and den respectively) the same.
Obtaining the unit-step response of the transfer-Function using MATLAB: By
knowing the numerator and denominator of the closed loop transfer function,
commands such as step(num,den), step(num,den,t) can be used to generate the
unit-step response. t in the step command is the user specified time. Using the
step response with left hand side arguments, the X axis and Y axis labels can
be given to the response curves.
Step Response
The step response of different types of second order systems is dependant
on the value of ξ.
A family of unit-step response curve with various values of ξ is shown in
fig.1
Fig.1
14
www.mitwpu.edu.in
Transient Response Specifications
The performance characteristics of a control system are specified in terms of
the transient
response. The transient response of second order under damped system to unit
step is shown in
fig.2
Fig.2
PROCEDURE:
CALCULATIONS: For the underdamped cases (ζ < 1.0), calculate the theoretical
values of
15
www.mitwpu.edu.in
delay time, rise time, peak time, maximum overshoot and settling time using the
following
Formulae:
Where 1
T=
ζωn
Compare the values obtained from the program with the above theoretical values.
16
www.mitwpu.edu.in
CONCLUSIONS:
17
www.mitwpu.edu.in
S. Y. B. Tech (ECE)
Semester: III Subject: Control System and Fuzzy Logic
Name: Class:
Roll No: Batch:
Experiment No: 04
Name of the Experiment: To control the closed loop system using PID controller
Submitted on:
Objective:
1. To understand importance of PID controller ion Control Systems.
2. To understand Tuning of PID controller.
3. To find values of Kp, Ki, Kd
Theory:
PID Controller is a most common control algorithm used in industrial automation &
applications and more than 95% of the industrial controllers are of PID type. PID controllers are
used for more precise and accurate control of various parameters. Most often these are used for
the regulation of temperature, pressure, speed, flow and other process variables. Due to robust
performance and functional simplicity, these have been accepted by enormous industrial
applications where a more precise control is the foremost requirement.
18
www.mitwpu.edu.in
What is a PID Controller?
A combination of proportional, integral and derivative actions is more commonly referred as PID
action and hence the name, PID (Proportional-Integral-Derivative) controller. These three
basic coefficients are varied in each PID controller for specific application in order to get optimal
response.
It gets the input parameter from the sensor which is referred as actual process variable. It also
accepts the desired actuator output, which is referred as set variable, and then it calculates and
combines the proportional, integral and derivative responses to compute the output for the
actuator.
Combining all three modes of control i.e. proportional, integral & derivative produces a
controller known as three mode controller or PID controller. The equation describing as
action can be determined as.
Where kp is the proportionality constant, ki the integral constant & kd the derivative constant.
Taking the laplace, transfer function is dtermind.
19
www.mitwpu.edu.in
Deviation of actual value from the desired value in the PID control algorithm causes to produce
the output to the depending on the combination of proportional, integral and derivative
responses. So the PID controller continuously varies the output to the actuator till the process
variable settle down to the set value. This is also called as closed loop feedback control
system.
All modern industrial controllers are of automatic type (or closed loop controllers), which are
usually made to produce one or combination of control actions. These control actions include
ON-OFF Controller
Proportional Controller
Proportional-Integral Controller
Proportional-Derivative Controller
Proportional-Integral-Derivative Controller
In case of ON-OFF controller, two states are possible to control the manipulated variable, i.e.,
either fully ON (when process variable is below the set point) or Fully OFF (when process
variable is above the set point). So the output will be of oscillating in nature. In order to achieve
the precise control, most industries use the PID controller (or PI or PD depends on the
application)
A proportional controller (Kp) will have the effect of reducing the rise time and will reduce, but
never eliminate, the steady-state error.
An integral control (Ki) will have the effect of eliminating the steady-state error, but it may make
the transient response worse.
A derivative control (Kd) will have the effect of increasing the stability of the system, reducing
the overshoot, and improving the transient response.
Proportional Control
www.mitwpu.edu.in
The response becomes more oscillatory and needs longer to settle, the error disappears.
OVERSHOO SETTLING
CL RESPONSERISE TIME S-S ERROR
T TIME
Small Small
Kd Decrease Decrease
Change Change
Tips for
Designing a PID Controller
5. Adjust each of Kp, Ki, and Kd until you obtain a desired overall response.
TECHNICAL SPECIFICATION: -
PMDC Motor :- 12V DC, 1500 RPM, 1.5 Amp, Torque: ½ Kgcm, Mounting Horizontal
Optical Sensor / Inductive Proximity Sensor :- 3 Wire, Sensing Distance: 10cm/ 7mm, 24 VDC
RPM Indicator/ Tachometer :- Speed: 0-1500 RPM, Supply: 230V AC, Cut out size :92 X 92
Retransmission O/P: 4-20mA according 0-1500rpm, 3 ½ digital display.
DC Drive :- Power Supply: 230 V AC, Input : 4-20mA, Output Voltage. 0-12 V DC.
21
www.mitwpu.edu.in
Electrical Control Panel :- MS Powder coated panel with switches, indicator, test Points,
controller on front facia, UK 2.5 Terminal Connectors mounted on DIN rail channel, Use of 1sq
mm multi-strand wire with proper insulated Lugs, Feruling & Neat wire dressing & clamping.
Wires & power cables are seated through 1’’×1’’PVC cable tray.
PID Controller :-Input: 4-20mA, Output:4-20mA, 3½ Digit display, Display: Dual for PV & SP
, Bar graph Display for Output & Deviation, High-Low Alarm Annunciation, Cut Out Size:
92mmX92mmX144mm
22
www.mitwpu.edu.in
Observation Table :
Test Report for DC Motor Speed control
Date RPM PV RPM SP OUT %
Time
23
www.mitwpu.edu.in
GRAPH OF RPM
1600
1400
1200
1000 TIME IN
RPM
MINUTE
800
RPM
600
400
200
0
1 2 3 4 5 6 7 8 9 10 11 12 13
Conclusion:
24
www.mitwpu.edu.in
Post Lab Questions:
1) What is significance of Kp, Ki, Kd while designing PID controller?
2) Draw and explain block diagram of PID controller.
3) What are different applications of PID controller?
4) What is difference between Fuzzy Logic Controller and PID controller?
S. Y. B. Tech (ECE)
Semester: III Subject: Control System and Fuzzy Logic
Name: Class:
Roll No: Batch:
Experiment No: 05
Submitted on:
Objective:
1. To understand importance of membership functions in fuzzy logic.
2. To understand importance of the parameters of every membership function.
3. To plot all membership functions.
25
www.mitwpu.edu.in
Theory:
The membership function of a fuzzy set is a generalization of the indicator function in
classical sets. In fuzzy logic, it represents the degree of truth as an extension of
valuation. Degrees of truth are often confused with probabilities, although they are
conceptually distinct, because fuzzy truth represents membership in vaguely defined
sets, not likelihood of some event or condition. Membership functions were introduced
by Zadeh in the first paper on fuzzy sets (1965).
Formal Definition of membership function Let us consider fuzzy set A, A = {(x, µA(x))|
x Є X} where µA(x) is called the membership function for the fuzzy set A. X is referred
to as the universe of discourse. The membership function associates each element x Є X
with a value in the interval [0, 1]. In fuzzy sets, each elements is mapped to [0,1] by
membership function. That is, μA : X €[0, 1], where [0,1] means real numbers between 0
and 1 (including 0,1). Consequently, fuzzy set is with ‘vague boundary set’ comparing
with crisp set. The fuzzy set A can be alternatively denoted as follows:
If X is discrete then A = Σ μA(xi) / xi
If X is continuous then A = ʃ μA(x) / x
Here, μA (x) is the “membership function”. Value of this function is between 0 and 1.
This value represents the “degree of membership” (membership value) of element x in
set A. The members of a fuzzy set are members to some degree, known as a membership
grade or degree of membership. The membership grade is the degree of belonging to the
fuzzy set. The larger the number (in [0, 1]) the more the degree of belonging. (N.B. This
is not a probability).The translation from x to µA(x) is known as fuzzification. In the
fuzzy theory, fuzzy set A of universe X is defined by function µA(x) called the
membership function of set A.
Fuzzy Set: Fuzzy set, as the name implies is a set without a crisp boundary. That is, the
transition from “belong to a set”, to “not belong to a set” is gradual, and this smooth
transition is characterized by membership functions that give fuzzy commonly used
linguistic expressions, such as “the water is hot” or “the temperature is high”. Such
imprecisely defined sets or classes play an important role, in the domain of pattern
recognition.
26
www.mitwpu.edu.in
If X is a collection of objects denoted generally by x, then a fuzzy set A in X is defined
as a set of ordered pairs:
A={ (x,µa(x) | xεX };
where µa(x) is a membership function for the fuzzy set A.
27
www.mitwpu.edu.in
Figure 1.1: Various types of Fuzzy membership functions
Triangular Membership Function-
triangle(x;a,b,c)= 0 ; x<=a
= (x-a)/(b-a); a<=x<=b
= (c-x)/(c-b); b<=x<=c
= 0; c<=x
28
www.mitwpu.edu.in
Figure 1.2: Triangular Membership Function
trapezoid(x;a,b,c,d)=0 ; x<=a
=(x-a)/(b-a) ; a<=x<=b
= 1 ; b<=x<=c
=(d-x)/(d-c) ; c<=x<=d
= 0 ; d<=x
Trapezoidal(x;a,b,c,d)=max(min(min(((x-a)/(b-a)),1),((d-x)/(d-c))),0);
The parameters {a,b,c,d} (with a<b<c<d) determine the x coordinates of the four corners
of the underlying trapezoidal MF(x;10,20,60,95).
29
www.mitwpu.edu.in
Figure 1.3: Trapezoidal Membership Function
www.mitwpu.edu.in
A generalized bell MF (or bell MF) is specified by three parameters {a,b,c}.
bell(x;a,b,c)=1/(1+|(x-c)/a|2*b).
where the parameter b is usually positive (if b is –ve, the shape of this MF
31
www.mitwpu.edu.in
Figure 1.5.3: bell(x;20,10,50) ‘changing b’
Sig(x;a,c)=1/(1+e(-a*(x-c)).
32
www.mitwpu.edu.in
where a controls the slope at the crossover point x=c.
Algorithm:
Conclusion:
33
www.mitwpu.edu.in
Post Lab Questions:
1. What is membership function? State its importance in fuzzy logic?
2. List and explain various methods employed for membership value assignment.
3. Compare “Medium wave (MW)” and “Short wave (SW)” receivers according to their
frequency range. Plot the membership functions using intuition. The linguistic variables
are defined based on the following”
Medium wave receivers: frequency less than 1MHz
Short wave receivers: frequency greater than 1MHz
4. What are different features of a membership function?
5. Write short note on “degree of uncertainty”
6. Justify intuition is based on human reasoning. Give some suitable examples.
S. Y. B. Tech (ECE)
Semester: III Subject: Control System and Fuzzy Logic
Name: Class:
Roll No: Batch:
Experiment No: 06
Name of the Experiment: Implement Defuzzyfication.
Marks Teacher’s Signature with date
Performed on:
Submitted on:
www.mitwpu.edu.in
Weighted average method.
Objectives:
1. To understand and implement fuzzification.
2. To understand importance of defuzzification.
3. To implement real time application and defuzzify the output.
Theory:
Defuzzification:
Conversion of Fuzzy set into a single crisp value is called Defuzzification. The set of
rules is applied to the fuzzified input. The output of each rule is fuzzy. These fuzzy
outputs need to be converted into a scalar output quantity so that the nature of the action
to be performed can be determined by the system. The process of converting the fuzzy
output is called defuzzification. Before an output is defuzzified all the fuzzy outputs of
the system are aggregated with an union operator. The union is the max of the set of
given membership functions. There are many defuzzification techniques but primarily
only three of them are in common use. These defuzzification techniques are discussed
below in detail.
This method is also known as center of gravity or center of area defuzzification. This
technique was developed by Sugeno in 1985. This is the most commonly used technique
and is very accurate. The centroid defuzzification technique can be expressed as
--(equ.2)
35
www.mitwpu.edu.in
where x* is the defuzzified output, µi(x) is the aggregated membership function and x is
the output variable. The only disadvantage of this method is that it is computationally
difficult for complex membership functions.
1 1 1
0 0 0
0 5 10 0 5 10 0 5 10
Then using mean-max membership these membership functions are combined to form a
fuzzy rule set.
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
www.mitwpu.edu.in
Above resultant is divided in the shapes of triangles and trapezoids. Centroids and area
for each shape. Defuzzified value is determined using equ.2.
This method gives the output with the highest membership function. This defuzzification
technique is very fast but is only accurate for peaked output. This technique is given by
algebraic expression as
; for all x X --
(equ.1)
37
www.mitwpu.edu.in
In this method the output is obtained by the weighted average of the each output of the
set of rules stored in the knowledge base of the system. The weighted average
defuzzification technique can be expressed as
--
(equ.3) .
where x* is the defuzzified output, mi is the membership of the output of each rule,
and wi is the weight associated with each rule.
¿
x=
∑ ai --(equ.4)
∑i
¿
Where x is defuzzified output, ai is maximum value of membership rule.
Algorithm:
38
www.mitwpu.edu.in
Conclusion:
39
www.mitwpu.edu.in
Post Lab Questions:
1. Define Defuzzification process. What is the necessity to convert the fuzzy quantities into
crisp quantities?
2. Compare various defuzzification methods.
3. How is lambda cut method employed for a fuzzy relation?
4. For the given membership function as shown in Fig. 2.4 determines the defuzzified
output
value by seven methods
(1) Max-membership principle, (2) Centroid method, (3) Weighted average method, (4)
Mean–max membership, (5) Centre of sums, (6) Centre of largest area, and (7) First of
maxima or last of maxima
S. Y. B. Tech (ECE)
Semester: III Subject: Control System and Fuzzy Logic
Name: Class:
Roll No: Batch:
Experiment No: 07
Name of the Experiment: Implement Fuzzy Inference System with Mamdani Inferencing
mechanism
www.mitwpu.edu.in
Submitted on:
Objectives:
1. To understand fuzzification and defuzzification.
2. To implement Mamdani Fuzzy Inference System
Theory:
The Mamdani fuzzy inference system was proposed as the first attempt to control a steam
engine and boiler combination by a set of linguistic control rules obtained from experienced
human operators.
As an illustration of this model we would consider an example in which two input linguistic
variables, Temperature (T) and Pressure (P) are considered with following membership
functions:
41
www.mitwpu.edu.in
Figure 3.2: Pressure MF.
Legend: L: Low, BA: Below Average, A: Average, AA: Above Average, H: High.
The output linguistic variable is Heater Power (HP) whose membership functions are
given as follows:
Legend: L: Low, ML: Medium Low, M: Medium, MH: Medium High, H: High.
42
www.mitwpu.edu.in
R1: If the Temperature is BELOW AVERAGE and Pressure is BELOW
AVERAGE, then Heater Power is MEDIUM HIGH.
R2: If the Temperature is LOW and Pressure is LOW then Heater Power is HIGH.
Note: There exist 25 such rules in the Rule Base corresponding to:
5 (Ranges of Temperature) X 5 (Ranges of Pressure).
Now, let us consider a fact that is given as input to the fuzzy inference system:
T = 22.5o C (T falls in two ranges, L and BA).
P = 1.5 atm (P falls in two ranges, L and BA).
For this input Mamdani fuzzy inference system will work as follows:
Rule 1 Inference:
43
www.mitwpu.edu.in
Rule 2 Inference:
44
www.mitwpu.edu.in
Figure 3.6: Fuzzified output
Defuzzification Step:
Centre (uHPMH) = 4
Centre (uHPH) = 5
Centroid =
[ uHPMH (new) x Area (uHPMH) x Centre (uHPMH) + uHPH (new) x Area (uHPH) x Centre (uHPH) ] =
Thus, a heater power required to maintain the temperature and pressure is 4.4287 W
when the temperature reading of the boiler is 22.5o C and pressure reading is 1.5 atm.
Algorithm:
The steps in designing a simple fuzzy control system are as follows:
1. Identify the variables (inputs, states, and outputs) of the system.
2. Partition the universe of discourse or the interval spanned by each variable into a
number
of fuzzy subsets, assigning each a linguistic label (subsets include all the elements in
45
www.mitwpu.edu.in
the
universe).
3. Assign or determine a membership function for each fuzzy subset.
4. Assign the fuzzy relationships between the inputs or state’s fuzzy subsets on the one
hand and the outputs fuzzy subsets on the other hand, thus forming the rule-base.
5. Choose appropriate scaling factors for the input and output variables in order to
normalize the variables to the [0, 1] or the [−1, 1] interval.
6. Fuzzify the inputs to the controller.
7. Use fuzzy approximate reasoning to infer the output contributed from each rule.
8. Aggregate the fuzzy outputs recommended by each rule.
9. Apply defuzzification to form a crisp output.
Conclusion:
46
www.mitwpu.edu.in
Post Lab Questions:
1.With a suitable block diagram, explain the construction and working of fuzzy inference
system
2 Write a short note on the Mamdani method of fuzzy inference system
3. Write in detail about the Sugeno method adopted in fuzzy inference system.
4. The age of building is to be determined the linguistic terms are “old” and “young”
For the building in years, find the membership functions for the following expressions: (a)
Very old (b) Very old or very young (c) Not very old and fairly young ( [young]2/3) (d)
Young or slightly old.
S. Y. B. Tech (ECE)
Semester: III Subject: Control System and Fuzzy Logic
Name: Class:
Roll No: Batch:
Experiment No: 08
Name of the Experiment: Implement various fuzzy membership functions.
Submitted on:
47
www.mitwpu.edu.in
Aim: To implement Application of Fuzzy controller
Objective:
1. To implement any real time application of fuzzy logic controller.
2. To understand working of plant and formation of rules.
3. Design Fuzzy Association Memory
Theory:
Architecture and Operations of FLC System:
The basic architecture of a fuzzy logic controller is shown in Figure 1. The principal
components of an FLC system is a fuzzifier, a fuzzy rule base, a fuzzy knowledge base, an
inference engine, and a defuzz.ifier. It also includes parameters for normalization. When the
output from the defuzzifier is not a control action for a plant, then the system is a fuzzy logic
decision system. The fuzzifier present converts crisp quantities into fuzzy quantities. The fuzzy
rule base stores knowledge about the operation of the process of domain expertise. The fuzzy
knowledge base stores the knowledge about all the input-output fuzzy relationships. It includes
the membership functions defining the input variables to the fuzzy rule base and the out
variables to the plant under control. The inference engine is the kernel of an FLC system, and it
possesses the capability to simulate human decisions by performing approximate reasoning to
achieve the desired control strategy. The defuzzifier converts the fuzzy quantities into crisp
quantities from an inferred fuzzy control action by the inference engine.
48
www.mitwpu.edu.in
Fig 1: Basic architecture of a FLC System
The various steps involved in designing a fuzzy logic controller are as follows:
Step 1: Locate the input, output, and state variables of the plane under consideration. I
Step 2: Split the complete universe of discourse spanned by each variable into a number of
fuzzy subsets, assigning each with a linguistic label. The subsets include all the elements in
the universe.
Step 3: Obtain the membership function for each fuzzy subset.
Step 4: Assign the fuzzy relationships between the inputs or states of fuzzy subsets on one
side and the output of fuzzy subsets on the other side, thereby forming the rule base.
Step 5: Choose appropriate scaling factors for the input and output variables for
normalizing the variables between [0, 1] and [-1, I] interval.
Step 6: Carry out the fuzzification process.
Step 7: Identify the output contributed from each rule using fuzzy approximate reasoning.
Step 8: Combine the fuzzy outputs obtained from each rule.
Step 9: Finally, apply defuzzification to form a crisp output.
The above steps are performed and executed for a simple FLC system. The following design
elements are adopted for designing a general FLC system:
49
www.mitwpu.edu.in
2. Fuzzy knowledge base: Normalization of the parameters involved; partitioning of input
and output spaces; selection of membership functions of a primary fuzzy set.
3. Fuzzy rule base: Selection of input and output variables; the source from which fuzzy
control rules are to be derived; types of fuzzy control rules; completeness of fuzzy control
rules.
4. Decision· making logic: The proper definition of fuzzy implication; interpretation of
connective “and”; interpretation of connective “or”; inference engine.
5. Defuzzification materials and the interpretation of a defuzzifier.
Applications:
FLC systems find a wide range of applications in various industrial and commercial products
and systems. In several applications- related to nonlinear, time-varying, ill-defined systems and
also complex systems – FLC systems have proved to be very efficient in comparison with other
conventional control systems. The applications of FLC systems include:
1. Traffic Control
2. Steam Engine
3. Aircraft Flight Control
4. Missile Control
5. Adaptive Control
6. Liquid-Level Control
7. Helicopter Model
8. Automobile Speed Controller
9. Braking System Controller
10. Process Control (includes cement kiln control)
11. Robotic Control
12. Elevator (Automatic Lift) control;
13. Automatic Running Control
14. Cooling Plant Control
15. Water Treatment
16. Boiler Control;
17. Nuclear Reactor Control;
50
www.mitwpu.edu.in
18. Power Systems Control;
19. Air Conditioner Control (Temperature Controller)
20. Biological Processes
21. Knowledge-Based System
22. Fault Detection Control Unit
Conclusion:
51
www.mitwpu.edu.in