Application Notes

APN01V20-0792

Introduction
Fuzzy Controller
Objective
Input/Output of Controller
Definition of Input/Output Variables
Rules
FIU source code
Comments


Washing Machine

INTRODUCTION

When you use a washing machine, you generally select the length of wash time based on the amount of clothes you wish to wash and the type and degree of dirt you have. To automate this process, we use sensors to detect these parameters (i.e. volume of clothes, degree and type of dirt). The wash time is then determined from this data. Unfortunately, there is no easy way to formulate a precise mathematical relationship between volume of clothes and dirt and the length of wash time required. Consequently, this problem has remained unsolved until very recently. People simply set wash times by hand and from personal trial and error experience. Washing machines were not as automatic as they could be.

To build a more fully automatic washing machine with self determining wash times, we are going to focus on two subsystems of the machine: (1) the sensor mechanism and (2) the controller unit. The sensor system provides external input signals into the machine from which decisions can be made. It is the controller's responsibility to make the decisions and to signal the outside world by some form of output. Because the input/output relationship is not clear, the design of a washing machine controller has not in the past lent itself to traditional methods of control design. We address this design problem using fuzzy logic and FIDE.

Back to Top

FUZZY CONTROLLER

Objective

Design a washing machine controller which gives the correct wash time even though a precise model of the input/output relationship is not available.

Input/Output of Controller

Figure 1 shows a diagram of the fuzzy logic controller. There are two inputs: (1) one for the degree of dirt on the clothes and (2) one for the type of dirt on the clothes. These two inputs can be obtained from a single optical sensor. The degree of dirt is determined by the transparency of the wash water. The dirtier the clothes, the lower the transparency for a fixed amount of water. On the other hand, the type of dirt is determined from the saturation time, the time it takes to reach saturation. Saturation is the point at which the change in water transparency is close to zero (below a given number). Greasy clothes, for example, take longer for water transparency to reach saturation because grease is less water soluble than other forms of dirt. Thus a fairly straightforward sensor system can provide the necessary inputs for our fuzzy controller.

Figure 1 Fuzzy Controller

 

 

 Back to Top

Definition of Input/Output Variables

Before designing the controller, we must determine the range of possible values for the input and output variables. These are the membership functions used to translate real world values to fuzzy values and back. Figure 2 shows the labels of input and output variables and their associated membership functions. Values for the input variables dirtiness and type_of_dirt are normalized (range of 0 to 100) over the domain of optical sensor values.

Note that wash_time membership functions are singletons(crisp numbers) in this example. We can use fuzzy sets or singletons for output variables. Singletons are simpler than fuzzy sets. They need less memory space and work faster. If we could not be satisfied by the result when output values are given by singltons we could change them into fuzzy sets. Remember that when we use TVFI method for inference we can only use singltons as values of outputs. We should use Mandani's method for inference if we want to define output values as fuzzy sets. Details about TVFI and Mandani's method can be found in FIDE's User's Manual.

 Figure 2a Labels and Membership Functions of Input Variable dirtiness

 Figure 2b Labels and Membership Functions of Input Variable type_of_dirt

 

Figure 2c Labels and Membership Functions of Output Variable wash_time

 

 

Back to Top

 Rules

The decision making capabilities of a fuzzy controller are codified in a set of rules. In general, the rules are intuitive and easy to understand, since they are qualitative statements written in English like if-then sentences. Rules for our washing machine controller are derived from common sense, data taken from typical home use, and experimentation in a controlled environment. A typical intuitive rule is as follows:

If saturation time is long and transparency is bad,
then wash time should be long.

From different combinations of these and other conditions, we write the rules necessary to build our washing machine controller.

Back to Top

FIU source code

FIU stands for Fuzzy Inference Unit. This is the fundamental unit in which FIDE encodes controller information. The FIU includes input and output variable definitions and the rules of the application. The following is a listing of the FIU source for a possible washing machine fuzzy logic controller. Figure 3 shows the response surface of the input-output relation as determined by this FIU. FIU language syntax and the response function are fully explained in FIDE's User and Reference Manuals.

 To FIU source code

 

Figure 3 Input/Outpt Response Surface

 

Back to Top

 COMMENTS

A more fully automatic washing machine is straightforward to design using fuzzy logic technology. Moreover, the design process mimics human intuition, which adds to the ease of development and future maintenance. Although this particular example controls only the wash time of a washing machine, the design process can be extended without undue complications to other control variables such as water level and spin speed. The formulation and implementation of membership functions and rules is similar to that shown for wash time.

Back to Top

 For Further Information Please Contact:

 Aptronix Incorporated
2040 Kington Place
Santa Clara, CA 95051
Tel (408) 261-1898
Fax (408) 490-2729
FuzzyNet http://www.aptronix.com/fuzzynet
Email: fuzzynet@aptronix.com

Back to Home


Weijing Zhang, Applications Engineer.
Copyright © 1992 by Aptronix Inc.
Revised: October 20, 1996.