Lab 3 - Implementation Tutorial Ce888 - Fuzzy Logic Hybrid Systems

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

LAB 3 IMPLEMENTATION TUTORIAL

CE888 FUZZY LOGIC HYBRID SYSTEMS


Tutorial on how to implement a Fuzzy Logic
Controller Part 1

Head of Module : Professor Hani Hagras


Lab Assistants : Aysenur Bilgin, Nur Naim
(abilgin@essex.ac.uk)(mnnurs@essex.ac.uk)

FLC Architecture

Inputs
1 , 2
Outputs
1 , 2
Antecedents, consequents
Fuzzy membership functions

Some Tips on Implementation

Write down the mathematical formulas in theory based on FLC architecture.

Design your data types for your membership functions.

Draw your membership functions for a better understanding.

Think through the steps in the architecture and make sure you understand and
reason.

Work out how to divide the complex task into smaller ones.

Implementation of Fuzzification

We will use singleton fuzzification.

Fuzzification output is the membership degree of input for the

antecedent membership function in rule .

: number of input
: number of rule
: antecedent membership function for input and rule
: input

Implementation of Membership Function

As a design decision, a membership function can have different shapes.

How to define a trapezoid in C++?

Think of a data type having members.

How to find DOM(x)?


Solve the line equation :

What if < < ?

Consider the overall shape of the MF.

struct structure_name {
member1
member2
member3
.
};

Further Thinking

How to implement a method that will get the membership function and the
input as a parameter and return the degree of membership?

What if the shape of the membership function is different?

What is the next step?

Useful To Do

Look after your pointers and make sure you pass by reference to the functions
in your code.

When finished with one task, test it to make sure that it is working properly.

It is more efficient to tune your membership functions when you are working on
the real application.

References

CE888 Lecture notes 1 <http://courses.essex.ac.uk/ce/ce888/>

You might also like