14
CHAPTER 8 APPLICATION OF FUZZY LOGIC TO POWER PLANT 8.1 Introduction In this chapter the application of fuzzy logic for the control of reservior water level near a hydroelectric plant is discussed. In this hydroelectric power plant, water from a river is diverted and stored in a reservoir for further use. It is required that the water level in the reservoir be kept at a certain height. There are usually two valves (an inlet and an outlet valve) that control the reservoir water level. There are several assumptions made for this application to make the system simple as well as understandable. The assumptions are 1. The main river is never dry. 2. As we are concerned with the maintaining the reservoir water level, only the inlet valve is considered to control the water level. 3. The outflow is considered for different scenarios, i.e., constant, ramping up, ramping down and sinusoidal. These scenarios are described in detail in Appendix B . 8.2 Fuzzy Controller Architecture A simple layout of the power plant is shown in Figure 8.1. The block diagram of the fuzzy controller is shown in Figure 8.2.

Fuzzy of Dam

Embed Size (px)

DESCRIPTION

fuzzification sample

Citation preview

Page 1: Fuzzy of Dam

CHAPTER 8

APPLICATION OF FUZZY LOGIC TO POWER PLANT

8.1 Introduction

In this chapter the application of fuzzy logic for the control of reservior water level near a hydroelectric plant is discussed. In this hydroelectric power plant, water from a river is diverted and stored in a reservoir for further use. It is required that the water level in the reservoir be kept at a certain height. There are usually two valves (an inlet and an outlet valve) that control the reservoir water level.

There are several assumptions made for this application to make the system simple as well as understandable. The assumptions are

1. The main river is never dry.2. As we are concerned with the maintaining the reservoir water level, only the

inlet valve is considered to control the water level.3. The outflow is considered for different scenarios, i.e., constant, ramping up,

ramping down and sinusoidal. These scenarios are described in detail in Appendix B.

8.2 Fuzzy Controller Architecture

A simple layout of the power plant is shown in Figure 8.1. The block diagram of the fuzzy controller is shown in Figure 8.2.

Page 2: Fuzzy of Dam

Figure 8.1 Simple layout of the power station

Figure 8.2 Fuzzy Controller

The fuzzy variables are the error, e between the required water level and the actual water level, and the control output, u controls valve A.

8.3 Fuzzification

The fuzzy input variable is the error between the actual volume and the volume setpoint. The fuzzy output variable is the control action. The fuzzy variable error consists of three fuzzy sets, i.e., negative,zero and positive. The universe of discourse for the error fuzzy set is given as

Negative [0, -p]

Page 3: Fuzzy of Dam

Zero [-q, q] Positive [0, r]

where  p, q and r are real numbers, typically between 0 and 15. The above expression means that fuzzy set negative is active from -p to 0 , otherwise it is zero. Similarly, fuzzy set zero is active from -q to qand fuzzy set positive is between 0 to r. The membership function is shown in Figure 8.3.

Figure 8.3: Error Fuzzy Set

Example 8.1

Suppose the fuzzy set negative is defined from 0 to -15, zero fuzzy set from -5 to +5 and positive fuzzy set from 0 to 15 as shown in Figure 8.3. Let the actual water volume be 96.5 m3 and the volume setpoint be 100 m3, then the error is -3.5%. The fuzzified output for the three fuzzy sets is given by

These results are shown more clearly in Figure 8.4.

Page 4: Fuzzy of Dam

Figure 8.4: Fuzzified output as mentioned in Example 8.1.

8.4 Output Fuzzy Set

The control valve action is considered to be the fuzzy output set. It determines by what percentage the inlet valve should be open. The output fuzzy variable control action has the universe of discourse from 0% to 100%. The control action has two fuzzy variables, i.e., close and open. The universe of discourse for each member of the fuzzy set is

Close [-p, p] Open [0, q]

where p and q are real numbers, typically between 0 and 100. The membership function of control action is shown pictorially in Figure 8.5. The close control action is symmetric about the origin to insure that a zero-valued output is achievable during centroid defuzzification.

Figure 8.5 Membership function of output

8.5 Knowledge Base

The rules associated with the controller are shown in Table 8.1.

Page 5: Fuzzy of Dam

Table 8.1 Fuzzy control rules

Rule Error, e Control Action, u

1 negative open

2 zero close

3 positive close

Thus three rules associated with the controller are used to control the water level in the reservoir. The defuzzified output controls the proper operation of valve A. The defuzzification is done with the centroid method. The process of centroid defuzzification is shown in the Excel simulation.

8.6 Rule Implication

The Mamdani implication rule is used to map the input to the output. The Mamdani implication rule is given as

(8.1)

where µA(x) is the input membership function and µB(y) is the output membership function. The implication result is a fuzzy set, which is a minimum of the membership function of the input (error) and output (control action). The input is the fuzzified error signal. The minimum membership values for the antecedent (input) propagates through to the consequent and truncates the membership function for the consequent (output) of each rule.

Example 8.2

Here the data from Example 8.1 is used with Rule 2 to demonstrate the Mamdani implication procedure. Rule 2 states that "if the error between the actual volume of water and the volume setpoint is zero, then the control action is close." First, the minimum of the antecedent (error) is given by

The result of implication for Rule 2 is shown in Figure 8.6.

Page 6: Fuzzy of Dam

Figure 8.6: Implication Result for Example 8.2

8.7 Defuzzification

The implication result obtained for each rule should be aggregated and defuzzified to obtain a single crisp values. The centroid defuzzification technique (from section 6.3) is used here as shown by

(8.2)

where x* is defuzzified output, µoutput is the aggregated resultant membership function of the three output fuzzy sets, and x is the universe of discourse.

Example 8.3

This example shows the centroid defuzzification procedure for the fuzzy controller. The actual volume of water is 97.5 m3 and the volume setpoint is 100 m3, which equates to an error of -2.5 %. The result of the Mamdani implication is shown in Figure 8.7. The fuzzified error can be written as

The Mamdani implication applied to each rule given in Table 8.1 can be written as

For Rule 1:

For Rule 2:

Page 7: Fuzzy of Dam

For Rule 3:

The above results are shown graphically in Figure 8.7. The result obtained for each rule from the Mamdani implication operator is aggregated together as shown in Figure 8.8. The result of Figure 8.8 is defuzzified to obtain the crisp output. The centroid of the plot shown in Figure 8.8 is taken to obtain the centroid defuzzification. The centroid defuzzification is given by

The defuzzified output is found to be 34%, which means that the inlet valve is open by only 34% of its full capacity. The inflow is known to be 1 m3/min of water when the valve is fully open. Thus, for an error -2.5%, the inflow is 0.34 m3/min.

Page 8: Fuzzy of Dam

Figure 8.7 Mamdani Implication Rule

Figure 8.8: Aggregation of the result obtained in Figure 8.7

8.8 Simulation Description

A simulation of the power plant is provided using Excel. The water volume in the reservoir is controlled with the measured error between the actual volume of water and the volume setpoint. The outflow is considered to be one of the four given scenarios. The user may add their own scenario and examine the result. The simulation is interactive and flexible. The user can change various parameters and

Page 9: Fuzzy of Dam

investigate the changes in the results. A detailed description of the simulation is presented in Appendix B.

8.9 Remark

This is a very simple fuzzy level controller but it clearly explains how fuzzy logic can be used for automation. The simulation used in this chapter explains the concept of an adaptive fuzzy controller. The reader should use the simulation to understand the concepts explained in this chapter.

8.10 Reference

1. T. J. Ross, Fuzzy Logic with Engineering Applications, MacGraw-Hill, Inc, 1995.

8.11 Exercises

1. For the universe of discourse defined in Example 8.1, find the membership function values for each error fuzzy set given an error of -1.5%.

2. For the -1.5% error above, determine the Mamdani implication result for each of the three rules defined in Table 8.1.

3. Find the defuzzified result for -1.5% error using the centroid defuzzification technique described in Example 8.3.

4. For the universe of discourse defined in Example 8.1, find the membership function values for each error fuzzy set given an error of -2%.

5. For the -2% error above, determine the Mamdani implication result for each of the three rules defined in Table 8.1.

6. Find the defuzzified result for -2% error using the centroid defuzzification technique described in Example 8.3.

7. Find the defuzzified control action using the maximum defuzzification technique for an error of -2.5%.

8. Execute the Excel simulation for the constant outflow pattern, and give the values of the inflow, outflow, water volume and error at time = 20 min.

9. Execute the Excel simulation for the ramping up outflow pattern and give the values of inflow, outflow, water volume and error at time = 20 min.

10.Execute the Excel simulation for the ramping down outflow pattern and give the values of inflow, outflow, water volume and error at time = 20 min.

11.Execute the Excel simulation for the sinusoidal outflow pattern and give the values of inflow, outflow, water volume and error at time = 100 min.

12.Change the universe of discourse for negative error fuzzy set in the Error-Fuzzification worksheet of the Excel simulation to the following values.

Error µ(Negative) Error µ(Zero) Error µ(Positive)

-15 1 -15 0 0 0

Page 10: Fuzzy of Dam

-5 1 -5 0 0 0

0 0 0 1 10 1

0 0 5 0 15 1

15 0

Repeat Exercises 8.8, 8.9, 8.10 and 8.11 using the above error fuzzy set.

13.Change the universe of discourse for zero error fuzzy set in the Error-Fuzzification worksheet of the Excel simulation to the following values

Error µ(Negative) Error µ(Zero) Error µ(Positive)

-15 1 -15 0 0 0

-10 1 -2.5 0 0 0

0 0 0 1 10 1

0 0 2.5 0 15 1

15 0

Repeat Exercises 8.8, 8.9, 8.10 and 8.11 using the above error fuzzy set.

14.Change the universe of discourse for positive error fuzzy set in the Error-Fuzzification worksheet of the Excel simulation to the following values

Error µ(Negative) Error µ(Zero) Error µ(Positive)

-15 1 -15 0 0 0

-10 1 -5 0 0 0

0 0 0 1 5 1

0 0 5 0 15 1

15 0

Repeat Exercises 8.8, 8.9, 8.10 and 8.11 using the above error fuzzy set.

15.Change the universe of discourse for the open control action fuzzy set in the Rule-Activation worksheet of the Excel simulation into the following values

Control Action

µ(close) Control Action

µ(open)

-25 0 0 0

-20 0 0 0

0 1 25 1

20 0 100 1

Page 11: Fuzzy of Dam

100 0

Repeat Exercises 8.8, 8.9, 8.10 and 8.11 using the above control action fuzzy set.

16.Change the universe of discourse for the close control action fuzzy set in the Rule-Activation worksheet of the Excel simulation to the following values

Control Action

µ(close) Control Action

µ(open)

-25 0 0 0

-10 0 0 0

0 1 50 1

10 0 100 1

100 0

Repeat Exercises 8.8, 8.9, 8.10 and 8.11 using the above control action fuzzy set.

17.In this exercise, the user will add a new outflow pattern in the Measurement-Deviation worksheet of the Excel simulation. The user should add a sawtooth outflow, which is defined as follows:

          Outflow = 0                                        for t < 20

                      =                           for 20 min   t  100 min

                      = 0                                         for t > 100 min     

        Give the inflow, outflow, water volume and error at time = 75 min.

This page was last updated on 08/20/2004