Sie sind auf Seite 1von 24

1.

FUZZY LOGIC

1.1 Introduction Basically, its an intelligent version of a no-frills rice cooker. Instead of just an on/off button, a fuzzy-logic rice cooker has a micro-computer that lets the machine regulate time and temperature according to the type of rice being cooked (brown rice, for example, cooks at a lower temperature than white rice). It can cook more kinds of rice than youve ever heard of including sweet and germinated brown and some models can even cook oatmeal or polenta, steam vegetables, and make stew. But what really sold us on the cookers was how well they handle the white and brown rice we use every day. Fuzzy-logic rice cookers have computer chips that direct their ability to make proper adjustments to cooking time and temperature. Unlike basic rice cookers, which complete tasks in a single-minded, mechanical manner, the process behind the fuzzylogic rice cookers needs a bit more explanation. The fuzzy sets theory, first proposed by UC Berkeley professor Lotfi Zadeh in 1965, laid the groundwork for fuzzy logic, which he also put forward in 1973. Fuzzy sets theory has to do with mathematical sets, or groups of items known as elements. In most mathematical sets, an element either belongs to the set or it does not. Fuzzy logic is basically a way to program machines so they look at the world in a more human way, with degrees of truth. Instead of cold, hard parameters and strict data sets, fuzzy logic assumes a more practical approach. Using numbers, it incorporates non-definitive words like "slightly" or "almost" into its decision-making processes. As a result, the use of fuzzy logic in rice cookers helps to ensure properly cooked rice because it gives the appliances the ability to make judgment calls similar to those a person might make, albeit typically better than those a hungry, impatient person might make. An example of when fuzzy logic might be called into action is when the rice is cooking too fast on a hot day. In a typical scenario, the fuzzy logic algorithm will take the form of an if/then statement such as, "If the rice is too hot, and it is continuing to heat up fairly quickly, then the heating element needs to be turned down."

1.2 Problem Statement Rice needs two things to evolve from a hard, little grain to big, fluffy morsels. In order rice to be cooked, it needs lots of water and lots of heat. For this reason, cooking rice happens in four phases: 1. Sitting in water 2. Boiling 3. Absorbing water (steaming) 4. Resting

Rice cookers automatically guide rice through these four stages. The appliance consists primarily of a main body, an inner cooking pan, an electric heating plate, a thermal-sensing device and some buttons. Water and rice sit inside the cooking pan while it's inserted into the rice cooker's shell. The pan's weight depresses the thermal-sensing device, and the heating plate quickly brings the water to a boil. The sensing device is a small, spring-

loaded thermometer that gauges the temperature of the pan's contents. It's set into the bottom of the rice cooker's main body. Simple rice cookers usually warm their contents by transferring heat from the heating plate to the cooking pan, and the type of metal used can improve that transfer. Some metals copper and aluminum for example, there are highly conductive. In other words, they transfer their heat easily. A wide range of materials can be used for the cooking pan, and each type may affect the overall time it takes to cook the food. The process for cooking the rice is simple. Water boils at 212 degrees Fahrenheit (100 degrees Celsius), and once it reaches a steady boil, it won't get hotter. As long as there is water in the pan, the temperature should be stable. Once the rice absorbs all the water in the pan, the temperature will start to rise. The rice cooker senses this change and will either switch off or switch to a warming cycle. At this point, the rice has finished cooking and entered the resting stage.

1.3 Project Description This project has four steps of processes to make perfect rice. In order to reduce the human effort, we let the machine to operate some of works to make rice. This project has two mode of cooking which is normal rice and congee or porridge. 1.1 Cleaning Process 1.2 Measuring Process 1.3 Heating Process 1.4 Keep Warm Process

We identified the inputs and outputs for this project. And we described it with a simple block diagram and flow chart for this project.

Figure 1: Block Diagram

Flow chart for Smart Rice Cooker:

Figure 2: Flow Chart

1.4 Fuzzy Rules

Cleaning Process For this process, the inputs are light sensor and water level. The light sensor will detect the cleanliness of the water. If the light sensor detects a high output it means the water is clean. The outputs for this process are water in, water out (drain) and motor spin for rinse. The sensor of water level will control the process of water in and out together with the motor. The motor has been set to spin for 30 second. The fuzzy rules for this process are: Water In IF light is low AND water level is very_low THEN water in is true IF light is high OR water level is very_high THEN water in is false

Motor Spin (Rinse) IF water in is false AND water level is very_high THEN motor spin is true

Water Out (Drain) IF motor spin is false AND water level is very_high THEN water out is true IF water level is very_low THEN water out is false

Measuring Process After the cleaning process, this rice cooker will go to the measuring process. In order to get the right ratio between rice to water, we set up a mass sensor to detect the weight of rice so it can be measured. The water or stock will come in and will be drain out based on the measurement. The rice to water ratio is 1:2 for normal mode and for congee mode is 1:5. The fuzzy rules for this process are: IF mass is very_low THEN water_level is very_low IF mass is low THEN water_level is low IF mass is medium THEN water_level is medium IF mass is high THEN water_level is high IF mass is very_high THEN water_level is very_high

Heating Process The heating process is the main part of this project. The idea is to control the heating process. The inputs are temperature and water level. The water level for this process is not same with the measurement process or cleaning process. This water level is based on the amount of water that has been measured before. We decided to divide into two modes which are normal mode and congee mode. This is because each mode needs the different amount of water. The temperature is very high at 100C boiling point. The fuzzy rules for this process are: Normal Mode: IF temperature is very_high AND water level is very_low THEN heat is false

Congee Mode: IF temperature is very_high AND water level is medium THEN heat is false

Keep Warm The last process is to keep warm of rice or congee that we made. From our researched, we find that the temperature should be maintained between 60C to 80C. If the temperature goes up to 100C it will boil the water once again and make the rice too dry. The inputs are temperature and water level. This process also has been divided into two modes because of the need of different amount of water. The fuzzy rules for this process are: Normal Mode: IF temperature is medium AND water level is very_low THEN heat is true IF temperature is high AND water level is very_low THEN heat is false

Congee Mode: IF temperature is medium AND water level is medium THEN heat is true IF temperature is high AND water level is medium THEN heat is false

1.5 Fuzzy Tech Simulation

By using the Fuzzy Tech 5.54 Professional Edition, we can make the fuzzy rules of all process much easier. For the first process which is cleaning process, we decided not to use fuzzy seen it just more logic gate compare to other process. For heating and keep warm process, we find that it can be combined together since they have the same inputs. Therefore only three processes will simulate using this software.

Figure 3: Input and Output Variables

There are three rule blocks for this simulation. For each rule blocks we have to make some rules to vary the desired output. The inputs and outputs should be decided how many level of membership functions. The minimum of membership function is 2 and the maximum is 5.

Figure 4: Fuzzy Rules for Measurement

Figure 5: Fuzzy Rules for Heating Rice

Figure 6: Fuzzy Rules for Heating Congee

1.6 Results

After some couples of run test done for the simulation, we find that we have to make some tuning to get the desired output. For example, we have to tune temperature input so that it can vary the medium and high as 60C and 80C respectively. For the measuring process, we get the exact output that we want for both normal and congee modes.

Figure 7: Ratio of mass to water level From Figure 7, we can see that if mass or weight of rice is approximately 2 cups, then the water for each outputs match to its ratio. For normal mode, we get approximately 4 cups of water and for congee mode is approximately 10 cups. For other results, one can be refer to software file given in the CD attachment.

10

1.7 Defuzzification

There are a lot of types and method to use for defuzzification. For this project we decided to use Weighted Average Method. Weighted Average Defuzzification uses the individual clipped or scaled output fuzzy sets. The method takes the peak value of each clipped/scaled output fuzzy set and builds the weighted (with respect to the peak heights) sum of these peak values. The formula is:

Figure 8: Weighted Average Method

11

For this project, we actually do not have to do the defuzzification seen the Fuzzy Tech already did the job for us. However, for the purpose of study, we decided to test the method on our measuring process.

Figure 8: Weighted Average Method for Measuring Process From Figure 8 is the congee mode that has a ratio 1:5. The mass input is set at approximately 2 cups. As a result, we can see that low part has height of 0.39 and medium is 0.61. While the peak value for low is 6.25 and medium is 12.50. By using formula above, we can find the value of output. ( ) ( )

Cups By comparing from calculation and simulation we find that it is just a slightly or minor different. We can say that the method prove to be right and give the approximately the same output.

12

2. NEURAL NETWORK

2.1 Introduction An Artificial Neural Network (ANN) is an information processing paradigm that is inspired by the way biological nervous systems, such as the brain, process information. It attempts to replicate the human brains functionality on a much smaller scale. It is a similar structure which is composed of neurons which are connected via dendrites. The human brain contains approximately 1011 neurons whilst each neuron would have 104 inputs. The key element of this paradigm is the novel structure of the information processing system. It is composed of a large number of highly interconnected processing elements (neurons) working in unison to solve specific problems. As in nature, the network function is determined largely by the connections (weights) between elements. ANNs, like people, learn by example. An ANN is configured for a specific application through a learning process. Learning in biological systems involves adjustments to the synaptic connections (weights) that exist between the neurons. This is true of ANNs as well. The ANN can be trained to perform a particular function by adjusting the values of the connections (weights) between elements. Commonly artificial neural networks are adjusted, or trained, so that a particular input leads to a specific target output. Such a situation is shown below. There, the network is adjusted, based on a comparison of the output and the target, until the network output matches the target. Typically many such input/target pairs are needed to train a network. Today, artificial neural networks can be trained to solve problems that are difficult for conventional computers or human beings such as to perform complex functions in various fields, including pattern recognition, identification, classification, and speech, vision, and control of nonlinear systems. In fact, neural networks have seen an explosion of interest over the last few years, and are being successfully applied across an extraordinary range of problem domains, in areas as diverse as finance, medicine, engineering, geology and physics.

13

2.2 Problem statement: Each type of rice needs different amount of water in order to cook perfectly. So for neural network project, we decided to design rice classification device. This device is attached to smart rice cooker, so the rice cooker can determine the correct amount of water need to add based on the amount of rice. For rice classification device, we decide to train the device for two types of rice plain rice and basmati rice. The system is trained up to 5 times in order to make the system learn to classify between plain rice and basmati rice. Each training set consist of 500 epochs, this is mean the system is trained 2500 times. For neural network architecture, we decided to use two hidden layers in order to reduce the error.

Figure 9: Multilayer Perceptron Architecture

14

The circles in the image represent neurons. This network topology is called feedforward multi layered neural network. The network is called multi layered because it consists of more than two layers. The neurons are arranged in a number of layers, generally three. They are input, hidden or middle and output layers. The names signify the function of the layer. This network is feed-forward, means the values are propagated in one direction only. The functions of various layers are explained below:

Input layer: As it says, this layer takes the inputs (every pixel for character painted by user at input box) and forwards it to hidden layer. Input layer never processes data, it just hands over it.

Hidden layer: This layer is the real thing behind the network. Without this layer, network would not be capable of solving complex problems.

Output layer: This layer consists of neurons which output the result.

Therefore, an intelligent classification system is needed to determine the right amount of water to add base on type of rice. This system is able to classify type of rice and auto adjusts to an appropriate amount of water.

15

2.3 Data Data set that we use to train the system is based on the length and colour of rice. As we know each type of rice has different length and colour. In this system two input variables and one output variable have been define. Some of data sets as listed in Table 1. Each data set contains 100 data of rice that have been obtained randomly. We trained the system to classify the between plain rice and basmati rice using this data set. colour length rice white normal plain white normal plain brown long basmati white normal plain white normal plain white normal plain brown long basmati brown long basmati brown long basmati white normal plain white normal plain white normal plain white normal plain white normal plain white normal plain Table 1: Data Sets During the training process on the system, we can see at first run the error quite high, the error is 11.612%. First run training result as shown in figure. Based on the result in figure, the system determines 59 out of 100 as plain rice and 41 out of 100 as basmati rice.

16

2.4 Results

Figure 10: First Run Result

Figure 11: Several Run Result

17

Then after the several rounds the system is trained, we can see the error has been reduced to 1.7265%. The second result as shown in Figure 11. After the second training is completed, the system determined 55 out of 100 as plain rice and 45 out of 100 as basmati rice.

Figure 12: Visualise Results

From Figure 12, we can see the visualise results as symmetrical to one and another. However, the plot has some jitters point if we look closely.

18

2.5 Back Propagation Back propagation an abbreviation for "backward propagation of errors is a common method of training artificial neural networks. From a desired output, the network learns from many inputs Before showing the mathematical derivation of the back propagation algorithm, it helps to develop some intuitions about the relationship between the actual output of a neuron and the correct output for a particular training case. Consider a simple neural network with two input units, one output unit and no hidden units. Each neuron uses a linear output that is the weighted sum of its input. Initially, before training, the weights will be set to random. Then the neuron learns from training examples, which in this case consists of a set of tuples (X1, X2, t) where X1 and X2 are the inputs to the network and t is the correct output (the output the network should eventually produce given the identical inputs). The network given X1 and X2 will compute an output y which very likely differs from t (since the weights are initially random). A common method for measuring the discrepancy between the expected output, t and the actual output, y is the squared error measure:

However, the output of a neuron depends on the weighted sum of all its inputs:

Where W1 and W2 are the weights of the connection from the input units to the output units. X1 and X2 is the first and second input value of neuron. Therefore, the error also depends on the incoming weights to the neuron, which is ultimately what needs to be changed in the network to enable learning.

19

3. SIMULATION

3.1 Proteus The rice cooker controlled by the rules of neuro-fuzzy reasoning is not only driven by induction heating, but the heat application is finely controlled according to the traditional controls which are reproduced. In this cooking process, the temperature proper to each of the cooking processes and the period at which each of the processes has to be maintained are finely controlled by the rules according to the given information, such as the preferred rice stiffness, the amount of cooked rice deduced from the temperature rise and the power consumption, etc. We use Proteus to simulate our neural network design for smart rice cooker. By using ATMEL 8051, we assemble the assembly language using file.a51. For the problem with rice to water ratio, we use Analog Digital Converter (ADC 0804) to come up as a solution for the problem stated. Our smart rice cooker will be function automatically and manually depend on consumer desire.

Figure 13: ATMEL 8051

20

Figure 14: Schematic Diagram

Figure 15: Analogue Digital Converter for Mass Sensor

21

3.2 Source Code

In attachment to this project, we already include the source code in the CD. The files are in .a51 and .HEX. The simulation is just for the theoretical part and it cannot be done in practical. Maybe in the near future, this project can be implementing in practical.

Figure 16: Source Code

22

4. CONCLUSION From this project, some of the applications of neural networks to home appliances have been described above. This project using Proteus to simulate smart rice cooker and hex code is generated using assembly language. Fuzzy control is based on fuzzy logic a logical system which is closer in spirit to human thinking and natural language than traditional logical systems. Fuzzy logic control system is based on fuzzy logic provides means of linguistic control strategy based on expert knowledge into an automatic control strategy. Crisp set is defined in such a way that all individuals in a given universe can be partitioned into two classes that those who belong to the set and those who do not belong to the set. The input variables in a fuzzy control system are in general mapped by sets of membership functions similar to this, known as "fuzzy sets". The process of converting a crisp input value to a fuzzy value is called "defuzzification". We believe that the real so-called heart ware can be realized only by creating the situations where the human beings can use machines and systems without consciousness of them. Therefore, it is essential to study profoundly the natures, living things and human beings which are equipped with providential highly developed intelligence and functions, and to apply the obtained knowledge to engineering. This means the fusion between the advanced technologies and the human science is indispensable. This project can be also implementing in the pharmaceutical industry. The cleaning process is very useful for pharmaceutical industry. Nowadays, there are a lot of type fuzzy neuro of rice cooker in the market. The rice cookers function under the same premise as basic models, their mathematical programming can deliver a slew of customized cooking options. The trick to these capabilities is the rice cookers' ability to react, making precise fluctuations in cooking time and temperature depending on the program selected. These may include different keep-warm and quick-cook cycles for the optimum cooking of rice varieties like sushi rice, porridge rice, mixed rice, white rice, sweet rice and brown rice. Some models also offer texture settings, allowing people to select hard or soft and sticky or wet rice.

23

5. REFERENCES 1. Michael Negnevitsky, Artificial Intelligence, Second Edition, Addison Wesley 2. Timoty J. Ross, fuzzy Logic With Engineering Application, Third edition, Wiley 3. LabVIEW, PID and Fuzzy Logic User Manual, June 2009 4. LabVIEW, PID and Fuzzy Logic User Manual, June 2007 5. http://www.ni.com/labviewse/

24

Das könnte Ihnen auch gefallen