0% found this document useful (0 votes)
48 views

Explanation of The Simple Implementation of IT2FLC

This document presents a simple method for implementing interval type-2 fuzzy logic controllers (IT2-FLCs) in MATLAB. It provides two MATLAB function files that implement different IT2 fuzzy inference mechanisms. These controllers use three Gaussian membership functions each for two inputs to control an inverted pendulum in a Simulink simulation. The functions and simulation provide a way to experiment with IT2 FLCs and understand how changing various gains affects the system response.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Explanation of The Simple Implementation of IT2FLC

This document presents a simple method for implementing interval type-2 fuzzy logic controllers (IT2-FLCs) in MATLAB. It provides two MATLAB function files that implement different IT2 fuzzy inference mechanisms. These controllers use three Gaussian membership functions each for two inputs to control an inverted pendulum in a Simulink simulation. The functions and simulation provide a way to experiment with IT2 FLCs and understand how changing various gains affects the system response.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Simple Implementation of Interval Type-2 Fuzzy Logic Control.

Introduction

Here we present a simple method of implementing interval type-2 fuzzy logic controllers (IT2-FLCs) in
MATLAB. The method is based on simplifying the representation of the IT2-FL inference mechanism.

For detailed explanation of the method, please refer to the following article (reference [1]); [Abuelenin,
Sherif M., and Abdel-Kader, Rabab F. "Closed-Form Mathematical Representations of Interval Type-2
Fuzzy Logic Systems." arXiv preprint arXiv:1706.05593 (2017)].

The Simulink file provides a simulation of balancing an inverted pendulum using the discussed IT2-FLC
mechanisms.

IT2 FLCs MATLAB implementation

Two different m-files are provided, each of them implements a different IT2 fuzzy inference mechanism.
Each file is programmed as MATLAB function that has two inputs and one output.

All the controllers provided use three membership functions for each input, as seen in the figure below.
To control the spread of the membership functions (i.e. their positions) you may use gains, as explained
later. Alternatively, or if you would like to add more membership functions, you may modify the m-files.

The three used Gaussian membership functions (for each input) have the following properties;

• They have uncertain means and certain standard deviation.


• They are centered at μ1 = -1, μ2 = 0, μ3 = 1 (this can be changed from the codes or by changing the
gains)
• The uncertainty in each direction is given by ∆𝜇 = 1/8 (can be changing in the m-files by changing
the value of ‘delta_mu’).
• The standard deviation σ = 0.418)

The rule base is defined as;


Rule Corresponding bi
1st input 2nd input Output
number value
1 N N P 1
2 N Z P 1
3 N P Z 0
4 Z N P 1
5 Z Z Z 0
6 Z P N -1
7 P N Z 0
8 P Z N -1
9 P P N -1

This is shown in the m-files as;


%The rule-Base
%
% \ Change in error
% \ 1 2 3
% error\-------------------- rule order: 1 2 3
% 1 | b1 | b2 | b3 4 5 6
% ------------------------- 7 8 9
% 2 | b4 | b5 | b6
% -------------------------
% 3 | b7 | b8 | b9
% --------------------------

Where bi indicates the positions of the ith output (the centers of the output membership functions). The
values for these can be changed in the code according to your own rule-base.

Explanation of the different m-files

1. ‘IT2FLCgenExct.m’ provides an implementation based on approximating the GC method, see


Eq. (13) and (14) in Ref. [1]. The input membership functions are Gaussian with uncertain means.
The outputs are singletons.

2. ‘IT2FLCgenNTExct.m’ provides an implementation based on approximating the NT method, see


Eq. (17) in Ref. [1]. The input membership functions are Gaussian with uncertain means. The
outputs are singletons.

Simulink simulation of balancing an inverted pendulum

The controllers can be called in Simulink using the “interpreted MATLAB function” block. Inside the
block, enter either “IT2FLCgenNTExct(u(1),u(2)) or IT2FLCgenExct(u(1),u(2)) .
Please note the following;

• To simplify the design, the poisitions of the input fuzzy membership functions are fixed, and
distributed uniformally between -1 and +1.

• The two saturation blocks ‘Saturation’ and ‘Saturation1’ are used to limit the inputs to a maximum
and minimum values of +1 and -1, consecuitively.

• The scaling gains are used to tune the fuzzy controller.

• The input gains ‘Gain1’ and ‘Gain2’ are used to control the spread of the input membership
functions. Changing them will rescale the axes. (For gains < 1, the membership functions are
uniformly spread-outand for gains > 1, the membership functions are uniformly contracted
[Passino, Chapter 2]).

• The output gain ‘Gain’ is used to control the spread of the output membership functions. Changing
it will scale the vertical axis of the controller surface.

• Increasing ‘Gain1’ is analogous to increasing the proportional gain in a PD controller (i.e., it will
often make the system respond faster). Increasing the gain ‘Gain2’ is analogous to increasing the
derivative gain in a PD controller. See [Passino, Chapter 2] for detailed explanation.

References:

[1] S. M. Abuelenin, and R. F. Abdel-Kader, "Closed-Form Mathematical Representations of Interval Type-


2 Fuzzy Logic Systems." arXiv preprint arXiv:1706.05593 (2017).

K. M. Passino, S. Yurkovich, and M. Reinfrank, Fuzzy control, Vol. 2725. Reading, MA: Addison-Wesley,
(1998).

You might also like