Вы находитесь на странице: 1из 7

APPLICATION: FUZZY LOGIC WASHING MACHINE

Contents
1. Process control using Fuzzy Logic Systems
Creating the FLS for the control of the washing time
3. Generating the structure of the FLS and saving the file
4. Defining the fuzzy sets for the input variable degree of dirtiness
5. Defining the fuzzy sets for the input variable type of dirtiness
6.Defining the fuzzy sets for the output variable washing time
7. Defining the rule base
8. Operations of the FLS
9. Exercises
Each work team will create a directory named representatively, in which to save all the results from the exercises
(Matlab scripts and a Word file with the numerical and graphical results).
1. Process control using Fuzzy Logic Systems
One of the most important practical applications of FLSs is using them as "process control systems". Having a solid
theoretical background, FLSs as control sytems are integrated in many commercial applications. The example
chosen in this laboratory is also subject to a better insight into the defuzzification process, the last operation in a
FLS's computation flow.

When using a washing machine, the user manually sets the washing time, based on the volume of clothes and the
type and degree of dirtiness. In order to transform the washing process into an automatic one, we can use sensors to
detect the volume of clothes and their dirtiness. A certain washing time will be chosen, based on this data.

Unfortunatelly, a precise mathematical relation between the inputs (volume of clothes, dirtiness) and the output
(washing time) cannot be defined. Thus, the washing time is manually set by the user, based on previous experience
and trials.

Building a washing machine with automatic washing time determination means building the following two
subsystems:

the sensor system - collects data from the outer environment (the clothes) and send them to the controller
the controller system - sets the washing time, based on the information received from the sensor system.
Given the fact that there is no mathematical relation between the inputs and output, a "fuzzy logic
controller" will be used.
Creating the FLS for the control of the washing time
The goal is to create a fuzzy logic controller for a washing machine, that will compute the appropriate washing time,
based on certain information about the clothes that are to be washed. A schematic view of this system is deployed in
the figure below:

The inputs of the system are: degree of dirtiness - can be determined by examinating the transparency of the water
type of dirtiness - can be determined by examinating the soaking time needed for the water to get to a constant
transparency - transparency saturation. For example, for the clothes with fat stains, this period of time will be longer,
because the fat disolves slower in water than other types of dirt.
3. Generating the structure of the FLS and saving the file
Launch the graphical editor by typing the following command, in the Matlab command line:
fuzzy

- since the FLS has 2 inputs, another input needs to be added: "Edit/Add variable/Input"

- name the variables, by selecting them in the graphical interface and typing their name in the edit box

- export (save) the FLS "File/Export/To file.../[_FileName_]

The structure of the FLS is

4. Defining the fuzzy sets for the input variable degree of dirtiness
The universe of discourse for degree of dirtiness, denoted "deg_dirt", is defined as a percentage [0...100]% with
respect to the term "dirty".
Three fuzzy sets are defined, Low, Medium and High, in order to create a fuzzy partition over the universe of
discourse. The central values for these fuzzy sets are 0%, 50% and 100%.
The three fuzzy sets are defined by the following parameters:

'Low': [-40 0 50]


'Medium': [0 50 100]
'High': [50 100 140]
The fuzzy sets should be like depicted in the following figure:
5. Defining the fuzzy sets for the input variable type of dirtiness
The universe of discourse for type of dirtiness, denoted "type_dirt", is defined as a percentage [0...100]% with
respect to the term "fat".
Three fuzzy sets are defined, NonFat, Medium and Fat, in order to create a fuzzy partition over the universe of
discourse. The central values for these fuzzy sets are 0%, 50% and 100%.
The three fuzzy sets are defined by the following parameters:

'NonFat': [-40 0 50]


'Medium': [0 50 100]
'Fat': [50 100 140]
The fuzzy sets should be like depicted in the following figure: <tip.PNG>
6.Defining the fuzzy sets for the output variable washing time
The universe of discourse for washing time, denoted "t", is defined in minutes, between [0...60]min, considering that
the maximum washing time for really dirty clothes is one hour.
Five fuzzy sets are defined, VeryShort, Short, Medium, Long and ExtraLong, in order to create a fuzzy partition
over the universe of discourse, except for the edges. The fuzzy sets are presented in the figure:
The fuzzy sets are defined by the following parameters:

VeryShort - [0 8 12] Short - [8 12 20] Medium - [12 20 40]

Long - [20 40 60] VeryLong - [40 60 60]

7. Defining the rule base


The fuzzy rules for this application are:

IF deg_dirt is High AND type_dirt is Fat THEN t is ExtraLong.

IF deg_dirt is Medium AND type_dirt is Fat THEN t is Long.

IF deg_dirt is Low AND type_dirt is Fat THEN t is Long.

IF deg_dirt is High AND type_dirt is Medium THEN t is Long.

IF deg_dirt is Medium AND type_dirt is Medium THEN t is Medium.

IF deg_dirt is Low AND type_dirt is Medium THEN t is Medium.

IF deg_dirt is High AND type_dirt is NonFat THEN t is Medium.


IF deg_dirt is Medium AND type_dirt is NonFat THEN t is Short.

IF deg_dirt is Low AND type_dirt is NonFat THEN t is VeryShort.

Exercise
Edit the FLS's rules (Edit/Rules ...). Save the FLS in the current directory, as "washing_machine.fis".

The Rules window should look like this:

8. Operations of the FLS


The operations of the FLS are:

- fuzzification - turns the crisp input into a singleton fuzzy set

- inference - max-min (Mamdani) type

- defuzzification - centroid (COA - center of area) defuzzification is used, as presented in the figure:
The output values obtained by using this type of defuzzification guarantee a smooth control surface, which is a very
important demand in control processes. The crisp output of a centroid defuzzification is computed using:

9. Exercises
1. Analyze how the FLS works by examining the control surface (Wiev/Surface) and the operations.

1.1. Compare the control surfaces and the output values for:

- Implication: min; Defuzzification: centroid

- Implication: prod; Defuzzification: centroid

1.2. Compare the control surfaces and the output values for:
- Implication: min; Defuzzification: centroid

- Implication: min; Defuzzification: bisector

- Implication: min; Defuzzification: MOM

The results of these comparisons will be placed in a Word document, containing: - the control surfaces for the 4
situations - a table with output values, for at least 7 significant pairs of input values, for the 4 situations.

2. Why is it necessary for the control surface to be as smooth as possible? Which defuzzification method is the
most/least appropriate for this specific appplication?

3. For 2 pairs of input values, draw the operations performed by the FLS and the output fuzzy set, for centroid
defuzzification.

4. Repeat exercise 3 for MOM defuzzification.

5. Based on your intuition, specify a washing time for 2 of pairs of input values used in exercise 1. How close are they
to the output values computed by the FLS, for each defuzzification method?

Published with MATLAB R2012b

Вам также может понравиться