2.2.-Fuzzy Washing Machine: 2.2.1.-Introduction
2.2.-Fuzzy Washing Machine: 2.2.1.-Introduction
2.2.1.-Introduction
In this second application developed we’ve created a fuzzy washing machine. There
are a number of different ways in which this system could be developed [2][6], and
there’s a commercial fuzzy washing machine developed by a German company called
INFORM [7]. Now we try to develop a fuzzy washing machine using our experience
to create the fuzzy rules which carry out the process, that is trying to develop a fuzzy
logic controller.
The beginning to create the rules we think of what happens when we do the washing.
When we do it the most important aspects to determine which cycle we’ll use are the
softness of the laundry, how dirty the washing is and the quantity. Therefore, those are
the parameters we’ve taken as inputs in our system.
According to these parameters we choose either one wash programme or another and
that programme is related a cycle and a time which takes care of our laundry trying to
get the laundry as clean as possible and also, trying to ‘spoil’ the laundry as little as
possible. So as outputs we’ve determined cycle and time. Cycle regarding how hard
will be our automatic wash, and time regarding how long it will take.
We’ll get the inputs in an automatic way, obtaining them by calculating indirectly for
example from the characteristics of the wash load during the initial agitation,
computing the quantity of the laundry according to its weight and the dirt and softness
in terms of analysing the water in the initial agitation. Anyway if some of these
variables are impossible to get indirectly they could be obtained as a direct input from
the user. And as a further step, our system could work in conjunction with a neural
network in order to learn and develop the ability of analysing the laundry and learning
how to work according to the user experience. This was approached in the
commercial neuro fuzzy washing machine developed by INFORM [7].
We work with Matlab in order to implement our system. Besides knowing which are
our inputs and outputs, also we should decide which inference method we want to use,
and different parameters related with the inference process as the AND method, OR
method, Implication, Aggregation and Defuzzification.
The next figure shows the external structure of the fuzzy washing machine.
1
Figure 27: External structure of the fuzzy washing machine
Where,
LaundrySoftness, LaundryQuantity and LaundryDirt are INPUTS
WashingCycle and WashingTime are OUTPUTS
2.2.2.2.-Inference Method
We’ve used a Mamdani’s inference method (2.7.7), because it’s the most suitable for
our application, since we work from our experience and as we explained before
Mamdani’s method is better when the approach is based on experience.
As far as the parameters related with the inference method is concerned, we’ve chosen
the following ones:
These parameters are the most usual and suitable for most applications, and this was
the case for our application.
But the possibilities are broad and for example, in AND method you can choose
between ‘min’ and ‘prod’, in OR method between ‘max’ and ‘probor’, in Implication
between ‘min’ and ‘prod’, and so on. Besides in all those parameters there’s the
possibility to implement any other created by the user, so if the user needs some other
option it can make it by itself [1].
2
2.2.2.3.-Fuzzy Sets And Membership Functions
Once we’ve structured the inference method we want to use and its parameters, we
should define the fuzzy sets and their membership functions belonging to the inputs
and outputs.
→INPUTS:
We’ve summarized all the fuzzy sets used for the inputs in the table below.
Input Fuzzy Sets Range
Softness Hard - Medium - Soft 0 – 10
Quantity Small - Medium - Large 0 – 10
Dirty Small - Medium - Large 0 – 10
Figure 29: Table Input Fuzzy Sets
As far as Softness is concerned we defined three fuzzy sets. The input’s range is from
0 to 10. 10 being the softest one and 0 the hardest one. So always the input Softness
from the sensors or the logic which calculates this value will be a number between 0
and 10.
With Dirty and Quantity we defined three fuzzy sets also. It’s enough to get a good
result because with those sets we obtain a good mapping if the input space. Both have
the same input range as Softness and also the input will be always between 0 and 10.
10 being the most quantity and dirty and 0 the least one.
According to these fuzzy sets we have to define the membership functions which suit
us best. It’s in this moment when we have to decide between all the different types of
membership functions we can choose [1], for example triangular, trapezoidal,
gaussians, sigmoidals, etc.
In this case we’ve chosen triangular and trapezoidal membership functions because
they are simple and help us to optimise the calculation speed. They are the most used
membership functions, because of their simplicity and their good performance in a
very broad field of applications [1][2][6].
We’ve implemented the membership functions trying to divide all the input space
within our fuzzy sets, trying to map all the input space in the best way possible with
the fuzzy sets. In order to find the best performance for the fuzzy washing machine
we had to change, several times, our definition of the membership functions until we
found the best performance. What we did to achieve a better performance was
adjusting the values which defined the membership functions in order to change a bit
their shape and then obtaining a different output.
3
In the next figures we can see the final membership functions and fuzzy sets for each
input.
Also to show exactly how we’ve defined the membership functions the next figure
shows a table which summarizes exactly the parameters we should enter in Matlab to
built them. We chose these parameters in order to map the whole input space in the
best way possible. First we chose initial parameters, from our experience, that are
changed a bit in order to obtain the best performance possible.
4
SOFTNESS
Fuzzy Set Type of Membership Function Values
Hard Trapezoidal [-4 –1.5 2 4]
Medium Triangular [3 5 7]
Soft Trapezoidal [5.5 8 12.5 14]
QUANTITY
Fuzzy Set Type of Membership Function Values
Small Trapezoidal [-4.5 -2.5 2 4.5]
Medium Triangular [3 5 7]
Large Trapezoidal [5.55 8.05 12 14.5]
DIRTY
Fuzzy Set Type of Membership Function Values
Small Trapezoidal [-4.5 -2.5 2 4.5]
Medium Triangular [3 5 7]
Large Trapezoidal [5.5 8 12.5 15]
Table 1: Input Membership Functions values
→OUTPUTS:
We’ve summarized all the fuzzy sets used for the outputs in the table below.
In this case both output variables have five fuzzy sets because we want to have
perfectly mapped, and with a great accuracy, all the output space.
In this case, as in the inputs, we’ve chosen an odd number of membership functions to
map the space of possible values, the universe of discourse. It’s not normal practise to
use an even number of membership intervals because with an odd number we have
the medium values perfectly mapped and we have a membership function exactly in
the middle of the universe of discourse, and this is good for the performance of the
system.
We’ve created the membership functions trying to divide the whole output space
within our fuzzy sets. In order to find the best performance we redefined several times
the membership function definition until we found the best ones. We redefined the
membership functions changing the base width of them, what means to change how
we map the input space, what implies a different output. So if we wanted to change
the output of the fuzzy controller, one of the options is changing their base width. At
the beginning we chose a bad definition of the fuzzy sets ‘delicate’ and ‘strong’,
making their base width too wide, so we had to redefine them making them narrower
until we found the correct definition.
5
As with the outputs we chose triangular and trapezoidal membership functions to
implement the fuzzy outputs. In the next figures we can see the final membership
functions and fuzzy sets for each output.
In the case of Cycle which has a range between 0 and 10, 10 is the strongest wash and
0 the softest one, what it means is that with soft clothes the cycle will be the lower
values and the opposite if the clothes are quite hard.
As far as Time is concerned, it has a range between 25 and 90, as usual values.
Therefore with a large quantity of dirty clothes the time will be next to the higher
values and the opposite if conditions are reversed.
Also to show exactly how we’ve characterized the membership functions in the
following figure we can see a table which shows the values we should input in Matlab
to built them. We chose these parameters in order to map the whole input space in the
best way possible. First we chose initial parameters, from our experience, that are
changed a bit in order to obtain the best performance possible.
6
CYCLE
Fuzzy Set Type of Membership Function Values
Delicate Trapezoidal [-5.8 –2.8 0.5 1.5]
NormalDelicate Triangular [0.5 2.75 5]
Medium Triangular [2.75 5 7.25]
NormalStrong Triangular [5 7.25 9.5]
Strong Trapezoidal [8.5 9.5 12.8 15.2]
TIME
Fuzzy Set Type of Membership Function Values
Short Trapezoidal [-46.5 –25.28 22.3 39.9]
NormalShort Triangular [22.3 39.9 57.5]
Medium Triangular [39.9 57.5 75.1]
NormalLong Triangular [57.5 75.1 92.7]
Long Trapezoidal [75 92.7 111.6 130]
2.2.2.4.-Fuzzy Rules
Once we’ve defined the fuzzy values and membership functions it’s time to define the
fuzzy rules which will characterize the fuzzy system.
The fuzzy values and the membership functions are the nouns and verbs but we have
to make them make sense, we need to construct sentences, and that’s what fuzzy rules
do, they make sense to the fuzzy system joining variables and making them work
together.
In our case we have 27 rules, which combine all the different variables allowing the
system to take care of all the different possibilities that could happen (1.6.1). The list
of all of them is shown in the following table.
7
Additionally in the APPENDIX II, we can find all the features of the fuzzy system
washing machine: inputs, outputs, fuzzy rules, membership functions, and so on.
These rules implement all the different possibilities (2.6) we could have with the
different inputs and fuzzy sets we have, so we’ve defined 27 rules. It is not always
necessary to implement all the possibilities, all the different combinations between the
input parameters. Indeed, there are times when it is impossible because of the large
number of inputs and fuzzy sets, what, if we wanted to implement all the different
possibilities, takes us to a non manageable number of fuzzy rules, too many to get fast
calculations and good performance. In those cases it is necessary to make a decision,
assessing which rules are the most important in order to achieve the best
characterization of the system with less rules.
But in our case we can work with all the different possibilities because the number of
fuzzy rules obtained is not too large and as a result we have a very accurate
description of the system.
The main rules we’ve followed to conform the fuzzy rules have been, first to get a
wash as delicate as possible (in order to preserve the clothes and not spoiling them)
and second with no more time than is absolutely necessary.
The wash will be as delicate as possible taking care of the softness and amount of dirt
to be dealt with during the wash:
- The softer the laundry is the more delicate the wash will be
- The less dirty the laundry is the more delicate the wash will be
Thus according to these simple main rules, it is from the experience, we’ve conform
ed to the cycle. If we have soft laundry and it is not very dirty the cycle will be nearer
to the lowest values, and in the opposite situation if we have a hard and dirty laundry
we will have a cycle nearer to the highest values, which means harder wash.
As far as the time is concerned, the most important parameters to take into account are
the quantity and the amount of dirt:
So, if we have a large quantity of laundry we‘ll need longer and also if we have a very
dirty laundry we will also need more time. Thus we characterize time, longer with
dirty and large ‘wash’, and shorter with small and not very dirty ‘washing’. These are
the main rules to determine how time ‘works’.
We’ve worked based in these main rules which help us to establish the first set of
control rules, afterwards and to get the best performance, we’ve improved it so that, at
the end, we’d get the best set of control rules.
8
2.2.2.5.-Performance
At this point we have all the required system elements. In the following figures we
can see the output surfaces in terms of the inputs covering both the whole input space
and the whole output space, in order to show the interaction between inputs and
outputs.
In these figures we can observe how a determinate value of two input values affects
the one output, it’s very useful because just with one view we can see the interaction,
and it helps us to improve the fuzzy rules if some characteristic of performance isn’t
right.
àCycle; inputà
Figure 36: Surface: outputà àSoftness and Dirty
What the figure shows is nothing else than what we explained before. If the laundry is
soft (values close to 10) and not very dirty (values close to 0) the cycle will be delicate
(values close to 0). We can observe also that when we decrease the value of Softness
making the laundry less soft, the cycle increases its value, and the same for the Dirty,
when we increase it making the laundry dirtier implies an increase in the value of the
cycle. When the laundry isn’t neither soft or small dirty we achieve the highest value
for the cycle, this coincides with our performance goals.
àCycle; inputà
Figure 37: Surface: outputà àSoftness and Quantity
9
Here (see the figure above) we observe that the quantity isn’t very important in order
to determine which cycle the fuzzy system will use. That’s because the most
important variables to determine the cycle are softness and quantity of Dirt,
meanwhile Quantity of laundry helps us in order to determine the Time the laundry
will take.
àCycle; inputà
Figure 38: Surface: outputà àQuantity and Dirty
The Quantity doesn’t really affect the Cycle, only if we have a large and hard laundry
the Cycle is increased a bit; in order to get a better wash and cleaner clothes. The
amount of Dirt is the much more important than quantity when we choose cycle.
àTime; inputà
Figure 39: Surface: outputà àSoftness and Dirty
In this figure we can see how in order to determine the Time, the most important
parameter is amount of Dirt. Softness mainly affects what happens when we’re
washing delicate laundry, when we have to take care not to spoil the clothes, by
decreasing a bit the time for the wash.
10
àTime; inputà
Figure 40: Surface: outputà àSoftness and Quantity
In the figure above we observe that as we increase both variables the Time also
increases. We can see a smooth increment in the Time with higher values of the
variables. The larger the quantity of laundry we have the more time we need and the
less soft the laundry is the more time we use.
àTime; inputà
Figure 41: Surface: outputà àQuantity and Dirty
As in the previous figure, here we can observe also a smooth increment in the
laundry’s Time with higher values of the variables. This figure is very similar to the
last one, what it implies that we’ve achieved a very good interrelation between all the
different parameters implied in decision time, achieving a smooth interrelation
between all of them.
The next table shows which are the outputs for some specific values.
We’ve tried to include the widest possibilities we could find. For example, with large
quantity, very dirty and low softness, or normal softness, medium quantity and large
dirty, and so on.
11
SOFTNESS QUANTITY DIRTY CYCLE TIME
5 5 5 5.00 57.50
10 1 1 0 25
1 10 10 10 89.9
3 8 8 9.92 88.8
7 3 5 2.75 26.1
5.5 2 9 7.25 57.5
6 9 3 4.34 52.3
9 2.5 8.5 5 39.9
8.5 5.5 4.5 2.75 39.9
2 4 6 7.76 69.9
Table 4: Table of typical input-output for our fuzzy washing machine
The table shows just a few examples, and it’s just the result of how we’ve constructed
the fuzzy system, it’s the response to our fuzzy rules and membership functions, the
response to the background of the fuzzy system.
In conclusion, we’ve got a system that from three inputs, Softness, Quantity and
amount of Dirt, gives us two outputs, Cycle and Time. It’s as a black box which
knows how to work to obtain the best wash possible.
S o ftn e ss
5
LCycle
2 .5 Mux Dem u x
Q u a n n tity M u x1
Fuzzy Logic
3 9 .9
Controller
8 .5 L .T i m e
D i rty
And inside the fuzzy controller we have the whole fuzzy system and it would be the
brain of an automatic fuzzy washing machine.
12
Development and Testing of a number of Matlab Based Fuzzy System Applications
2.2.6.-Commercial Application
The fuzzy washing machine could become a real and commercial application. We’ve
got a system which works very well and improves the actual washing machines
because releases us from having to chose which cycle we have to use when we’re
going to do the laundry.
No
Is the Output
right?
Yes
13
APPENDIX II:
FUZZY WASHING MACHINE
APPENDIX II: FUZZY WASHING MACHINE
Here we have the main characteristics of the system. We obtain them with the Matlab
command type which gives us the main parameters of a fuzzy system.
We can see the name, number of inputs and outputs and their characteristics, and the
different rules created. The rules are shown in a shorthand way (how the fuzzy inference
system build them). To know about this method it is explained in [1] pp. 2-47->2-48.
[Input1]
Name='LaundrySoftness'
Range=[0 10]
NumMFs=3
MF1='Hard':'trapmf',[-4 -1.5 2 4.5]
MF2='Soft':'trapmf',[5.5 8 12.5 14]
MF3='Medium':'trimf',[3 5 7]
[Input2]
Name='LaundryQuantity'
Range=[0 10]
NumMFs=3
MF1='Small':'trapmf',[-4.5 -2.5 2 4.5]
MF2='Large':'trapmf',[5.55 8.05 12 14.5]
MF3='Medium':'trimf',[3 5 7]
[Input3]
Name='LaundryDirty'
Range=[0 10]
NumMFs=3
MF1='medium':'trimf',[3 5 7]
MF2='small':'trapmf',[-4.5 -2.5 2 4.5]
MF3='large':'trapmf',[5.5 8 12.5 15]
[Output1]
Name='WashingCycle'
Range=[-1 11]
NumMFs=5
MF1='Delicate':'trapmf',[-5.8 -2.8 0.5 1.5]
MF2='Strong':'trapmf',[8.5 9.5 12.8 15.2]
MF3='Medium':'trimf',[2.75 5 7.25]
MF4='NormalDelicate':'trimf',[0.5 2.75 5]
MF5='NormalStrong':'trimf',[5 7.25 9.5]
[Output2]
Name='WashingTime'
Range=[17.5 97.5]
15
APPENDIX II: FUZZY WASHING MACHINE
NumMFs=5
MF1='Short':'trapmf',[-46.5 -25.28 22.3 39.9]
MF2='Long':'trapmf',[75 92.7 111.6 130]
MF3='Medium':'trimf',[39.9 57.5 75.1]
MF4='NormalShort':'trimf',[22.3 39.9 57.5]
MF5='NormaLong':'trimf',[57.5 75.1 92.7]
[Rules]
2 1 2, 1 1 (1) : 1
2 1 1, 4 1 (1) : 1
2 1 3, 3 4 (1) : 1
2 3 2, 1 1 (1) : 1
2 3 1, 4 4 (1) : 1
2 3 3, 3 3 (1) : 1
2 2 2, 4 4 (1) : 1
2 2 1, 4 3 (1) : 1
2 2 3, 3 5 (1) : 1
3 1 2, 4 4 (1) : 1
3 1 1, 3 4 (1) : 1
3 1 3, 5 3 (1) : 1
3 3 2, 4 4 (1) : 1
3 3 1, 3 3 (1) : 1
3 3 3, 5 5 (1) : 1
3 2 2, 3 3 (1) : 1
3 2 1, 3 5 (1) : 1
3 2 3, 5 2 (1) : 1
1 1 2, 3 3 (1) : 1
1 1 1, 5 3 (1) : 1
1 1 3, 2 5 (1) : 1
1 3 2, 3 3 (1) : 1
1 3 1, 5 5 (1) : 1
1 3 3, 2 5 (1) : 1
1 2 2, 5 5 (1) : 1
1 2 1, 5 2 (1) : 1
1 2 3, 2 2 (1) : 1
16
References
[1] J. – S. Roger Jang, Ned Gulley, Fuzzy Logic Toolbox For Use With Matlab, 1995
The Math Work, Inc.
[2] John Yen, Reza Langari, Fuzzy Logic, intelligence, control and information, 1999
Prentice Hall, Inc., ISBN 0-13-525817-0
[3]Cornelius T. Leondes, Fuzzy Theory Systems, Techniques and Applications,
Volume 2, 1999 Academic Press, ISBN 0-12-443872-5
[4]Maureen Caudill, Charles Butler, Understanding Neural Networks, Volume 2, The
Mit Press, ISBN 0-262-53100-3
[5]Matlab, High Performance Numeric Computation and Visualization Software,
user’s Guide, 1993 The MathWork, Inc
[6]George Bojadziev, Fuzzy Sets, Fuzzy Logic, Applications, 1995 World Scientific
Publishing Co, ISBN 9810223899, pp 246-251
[7]F.Martin Mc Neill, Ellen Thro, Fuzzy Logic, a practical approach, 1994 Academic
Press, Inc, ISBN 0-12-485965-8, Chapter 5
[8]Timothy J. Ross, Fuzzy Logic with Engineering Applications, 1995 International
Edition, Mc Graw Hill, ISBN 0-07-113637-1, Chapter 10
[9]Bart Kosko, Fuzzy Engineering, 1997 Prentice Hall, Inc, ISBN 0-13-353731-5
[10]Robert E.King, Computational intelligence in Control Engineering, 1999 Marcel
Dekker, Ink, ISBN 0-8247-1993-X
[11]Ching-Teng Lin, C.S. George Lee, Neural Fuzzy Systems, Prentice Hall 1996,
ISBN 0-13-235169-2, pp 556-558
[12]David Steel, Neural Networks for communication, Project Computer Systems
Engineering, Department of Engineering, University of Warwick, 2001
[13]Cornelius T. Leondes, Fuzzy Theory Systems, Techniques and Applications,
Volume 3, 1999 Academic Press, ISBN 0-12-443872-5, Chapter 9
[14]Wildrow Bernard, Stearns Samuel D., Adaptive signal processing, Prentice Hall
1985, ISBN 0-13-004029-0, pp337-339, chapter 13-14
[15]Vaseghi Saeed V., Advanced Signal Processing and Digital Noise Reduction,
Wiley&Teubner 1996, ISBN 0-471-95875-1, pp 14-16, 294-312
[16]Zhao Li and W. Hoffman, Evaluation of Microphone Arrays for Enhancing Noisy
and Reverberant Speech for Coding”, IEEE Transactions on Speech and Audio
Processing, Vol. 7, No 1, January 1999, pp 91-95
[17] Whitaker J.C., 1996, The electronics handbook, CRC Press, p. 1395, 1396, 2050
[18] Yariv Ephraim, A signal subspace Approach for Speech Enhancement, IEEE
Transactions on Speech and Audio Processing, Vol. 3, No. 4., July 1995, pp. 251-265
[19]Regine Le Bouquin-Jeannes, Ahmad Akbari Azirani and Gerard Faucon,
Enhancement of Speech Degraded by Coherent and Incoherent Using a Cross-
Spectral Estimator, IEEE Transactions on Speech and Audio Processing, Vol. 5, No.
5, September 1997, pp. 484-487
[20]Soren Holdt Jensen, Per Christian Hansen, Reduction of Broad-Band Noise in
Speech by Truncated QSVD, IEEE Transactions on Speech and Audio Processing,
Vol. 3, No. 6, November 1995, pp. 439-447
[21]L. J. Griffiths and C. W. Jim, An alternative approach to linearly constrained
adaptive beamforming, IEEE trans. Antennas Propagat., vol. AP-30, pp 27-34, Jan
1982
[22]H.Cox, R. M. Zeskind and M. M. Owen, Robust adaptive beamforming, IEEE
Transactions on Speech and Audio Processing, Vol. ASSP-35, pp 1365-1376, Oct.
1987
17