How Fuzzy Control can Bene t from Classical

0 downloads 0 Views 149KB Size Report
Ralf Salomon and Reinhard Riedl. Department of Computer Science, ..... speed v, makes the system more robust with respect to external disturbances.
To appear in: Proceedings of Second International ICSC Symposium on Fuzzy Logic and Applications (ISFL'97), to be held in Zurich, Switzerland, February 12-14, 1997.

How Fuzzy Control can Bene t from Classical Control Theory: The Fuzzy State Controller Ralf Salomon and Reinhard Riedl Department of Computer Science, University of Zurich Winterthurerstrasse 190, 8057 Zurich, Switzerland FAX: +41-1-363 00 35 Email: fsalomonjriedlg@i .unizh.ch

Abstract

ϕ, ω

Fuzzy control is more than just an alternative to classical control theory. As a core principle, fuzzy control provides the designer with an easy-to-use framework for incorporating expert knowledge, and it acknowledges the fact that, in the real world, everything is a matter of degree. While it is easy to design a fuzzy controller with only a few input variables, the designer encounters diculties when the number of input variables of the controller increases, since the size of the rule set can grow exponentially. Even though classical control theory has been applied very successfully, its major drawback is that it requires a lot of mathematical insights. But classical control theory has developed the notion of the state controller, which grows only linearly in the number of input variables. Also, the concept of the state controller allows for an easy design process. This paper shows how the notion of the state controller can be transferred to fuzzy control without using any of the typical mathematical issues, such as di erential equations or Laplace transformation. This transfer proposes a new design principle that has the following advantages: (1) instead of having to keep the number of inputs small, it is easy to consider as many input variables as seem useful, (2) the number of parameters, needed to specify all rules grows only linearly in the number n of input variables, and (3) the controller behaves more robust with respect to disturbances abound in the real world.

force f x

Figure 1: The well-known cart-pole problem. The task is to apply a force f such that the angle ' becomes zero.

work for incorporating expert knowledge. In contrast to \hard" methods, such as crisp logic, fuzzy control expresses the matter-of-degree by membership functions as opposed to binary values, such as \false" or \true". To further simplify the design process, fuzzy control provides the concept of linguistic terms, such as \small", \high", or \very high" [4, 6]. Besides providing appropriate, user-friendly descriptions, linguistic variables also allow for directly incorporating expert knowledge into the design process. In summary, fuzzy control tries to provide the end user with principles that allow for an easy design without emphasizing too much on mathematical issues. For any control methodology, the well-known cartpole problem is a typical application. As can be seen from Figure 1, the task is to apply a force f such that both the angle ' and the angular velocity ! become zero. Section 2 gives a brief overview of fuzzy control related design issues. A collection of other cart-pole controllers, including neural networks and genetic programming can be found in [7, 4, 6, 10].

1 Introduction Fuzzy control is more than just an alternative to classical control theory. As a core principle, fuzzy control acknowledges the fact that, in the real world, everything is a matter of degree. Furthermore, fuzzy control provides the designer with an easy-to-use frame-

While it is easy to design a fuzzy controller with only a few input variables, the designer encounters diculties when the number of input variables of the controller increases. Section 3 discusses both the 1

The TSK model:

µ(x)

P

rule 1: if . . . and . . . then output = P wi1xi + c1 rule j: if . . . and . . . then output = P wij xi + cj rule n: if . . . and . . . then output = winxi + cn

Figure 3: A simple TSK model, where the output

is approximated by a linear hyper plane that is determined by the rule with the highest activation [9]. left

right

Next, for each input variable, the designer has to choose both the shape and the number of the membership functions. For the shape of the membership functions, the designer can choose from many options. An example is given by triangular membership functions, which are easy to implement by two or three parameters, i.e., center and width or center, left, and right respectively (cf. Figure 2). The number of the membership functions for a particular input variable depends on the system's characteristics, the expected control accuracy, and other performance criterions.

x

center

Figure 2: A triangular membership function (x). problem of an exponentially increasing number of fuzzy rules for fully speci ed controllers and a few approaches for tackling this problem. Even though classical control theory typically uses a lot of mathematical tools, such as Laplace transformation and di erential equations, it also provides some results that can be used very bene cially in fuzzy control; especially the notion of the state controller [3], provides an elegant way to solve the problem of an exponentially increasing number of fuzzy rules. Therefore, Section 4 presents a brief overview of classical control theory.

Last, the designer is concerned with the reasoning method and the output parameters. In the conventional model [4], the output parameters are the consequent parameters and, in the Takagi-Sugeno-Kang (TSK) model [9], the output parameters are the coecients wij ; ci of the linear equations respectively. A simple example of the TSK model with triangular membership functions is depicted in Figures 2 and 3. Figure 4 shows an example of a reduced rule set taken from [4, p. 320].

Section 5 then demonstrates how to use principles from classical control theory in fuzzy control design. This transfer makes the design of a fuzzy controller much easier, it drastically reduces the number of rules, and it makes the controller much more robust with respect to disturbances abound in the real world. Finally, Section 6 concludes with a short discussion.

3 Problems As long as the number of input variables is relatively small (e.g., 3), the design of a fuzzy controller is relatively easily. In this case, the designer can use graphical tools, such as tables (cf. Figure 4), in which each position speci es a particular combination of the input variables, to which an action might be speci ed. Alternatively, the designer can directly use compact rule descriptions, such as \if x1 medium and x2 not high then output =   ", because the combinatorical space is moderate.

2 A Typical Fuzzy Controller When developing a fuzzy controller, the designer is concerned with several design issues. First of all, the designer has to determine the relevant input variables. The identi cation of the relevant system variables is not always easy and, in the general case, requires in-depth knowledge of the problem at hand. A minor problem associated with this design decision is that the number of input variables should be small in order to allow a small and compact fuzzy controller; otherwise the controller could become too large (see Section 3).

While it is easy to design a fuzzy controller with only a few input variables, the designer encounters diculties when the number of input variables of the controller increases. The main problem is that the combinatorical space grows exponentially in the 2

ω

ϕ

NL

NM NS

ZE

PS

NL

PL

NM

PM

NS

PS

NS

ZE

NS

ZE PS

PL PM

PS PS

PM

PL

NM

NL

The reader might object that, in the cart-pole problem for example, it is necessary to consider any other input variable but ' and !, and that it is necessary to fully specify a fuzzy controller. Indeed, the question is whether it is of practical use to consider some additional variables. Consider, for example, the card-pole problem and assume a small external force that pushes the pole to the right. Such an external force can origin from manufacturing imprecisions or an environmental disturbance, such as a light wind blowing from left to right. A (fuzzy) controller as speci ed in Figure 4 would not work properly; the external force would cause the cart going to the right. Eventually, the cart would hit a boundary. Hence, a more robust controller that could survive in the real world would also take the current x-position into account. Furthermore, to avoid any damage at the cart's motor, a more robust controller would also consider the cart's speed. As can be seen, considering more input variables can make a controller more robust. But on the other side, most design techniques prefer a small number of input variables. Therefore, the designer has to nd a good compromise between these two design goals. In other words, fuzzy control design would bene t from methods that allow for an easy use of many more than just two input variables. To this end, Section 4 discusses the classical state controller, which size grows only linearly in the number of input variables, and Section 5 demonstrates how to implement this controller typ with fuzzy rules.

NS

PM

NM

PL

NL

NL : negative large PL : positive large NM: negative medium PM: positive medium NS : negative small PS : positive small ZE : zero

Figure 4: An example of a reduced fuzzy controller taken from [4, p. 320]. The controller's output is speci ed by the labels, e.g., NL, NM, etc., and zero in all blank segments. number of input variables. Therefore, the designer would typically try to reduce the number of rules by short cuts or rule clusters. However, for more than three or so input variables, this approach becomes quite dicult. The same problem is wellknown in hardware and VLSI design. Therefore, a typical fuzzy control design tries to keep the number of input variables small.

Runtime problems are a second reason why fuzzy controllers should be small. At run time, the activation of all fuzzy rules must be evaluated. The evaluation process can be speeded up by using special hardware called fuzzy chips. Fuzzy chips evaluate many fuzzy rules in parallel and also speed up the de-fuzzi cation phase to generate an appropriate output signal. However, the use of extra hardware is an additional cost factor that should be taken into account and, if possible, should be avoided.

As was investigated in [5], using genetic algorithms is another way of trying to keep the number of rules as small as possible. By applying a genetic algorithm, the rule set of a fuzzy controller can be reduced signi cantly. For such a multi-objective optimization problem, the tness function considers two terms, i.e., the control quality and the number of rules. Depending on the relative importance, the GA evolves a compromise between both objectives. The disadvantage of this approach is that the designer can loose his intuitive interpretation of the fuzzy controller, since the optimization task can change the rule set too much.

4 Classical Control Theory

Alternatively, rule reduction can be done by hand as is exempli ed in Figure 4 (taken from [4, p. 320]). In this case, the designer leaves out several table positions. Such decisions can be based upon expert knowledge, mathematical insights, physical constraints, or other facts. But for a larger number of input variables, this approach is rather erroneous.

Classical control theory provides a mathematical framework for describing and controlling a dynamical system. At its beginning, both digital computers and adequate sensors were very expensive. Classical control theory tried to come up with cheap solutions. Analog computers were the best choice at that time, since they are able to calculate linear dif3

Controller Steering

Input -

PID

Output

System

Signal

Figure 5: An example of a simple classical controller. The output signal is fed back, and the controller compares the current output with the input signal. Depending on the di erence between these two signals, the controller generates an appropriate output signal. ferential equations very eciently. But analog computers are limited to the analysis of linear system and linear controllers (time-invariant, linear di erential equations); for an analog computer, it is very hard to incorporate any non-linearity. The result of this e ort is a complete theory of simple, linear controllers.

users, and most application engineers refrain from such a cumbersome mathematical treatment. Consequently, most engineers seek for alternatives, such as fuzzy control. However, classical control theory has also developed a theory for problems, in which more than the output signal is observable. This became more and more important, especially in the last decades, when sensors became much less expensive. One major development from classical control theory is the notion of the state controller . This concept states that any fully controllable system can be made stable by feeding back all its state variables. Such a control system is depicted in Figure 6. A system is fully controllable, if, roughly speaking, the input signal directly or indirectly e ects all state variables. State variables are all variables that represent energy quantities. A state controller can be formalized as follows

The most widely-known structure of a classical controller is depicted in Figure 5. It can be seen that the system's output is fed back to the controller. The controller compares the output with the input, and uses the di erence between these two signals to generate an appropriate output signal for the system. Examples for internal control elements, which are responsible for the generation of the output signal, are PID, PD, PI, or P controllers, lead or lag elements, or any combination of such basic components. PID, for example, is an abbreviation for p ropotional-i ntegrald i erential. In the example of the cart-pole problem, the controller's input would be the angle ', which would be set to constant zero, and the output signal would be the force f .

n X control(x ; . . . ; x ) = ? s p 1

n

i=1

i i

;

(1)

where the si 's denote the state variable and the pi 's denote constant factors.

In classical control theory, the designer has to model the system by coupled di erential equations and has to apply further techniques, such as Laplace transformation, in order to develop a good controller. Once the system is modeled and analyzed, the designer can choose and con gure the internal control elements, e.g., PID or PD controller. The modeling process requires a lot of deep, mathematical insight, which can be seen as the major drawback of classical control theory. This design process also requires very speci c knowledge about the particular system at hand. These requirements make the use of classical control theory cumbersome for end

In the cart-pole example, the angle ' and the angular velocity ! are the system's state variables. The cart-pole is a fully controllable system, since the input represented by the force f in uences both state variables1 . Thus, the cart-pole system can be made stable by feeding back both state variables and generating a proportional output signal. It should be clear that it is very easy to incorporate additional input variables, such as the cart's position x and the 1 The force f in uences the angular velocity ! directly and, thus, the angle ' indirectly, since ' is the integral of ! over time t.

4

System Controller

s1

s4

Steering

Input

-

Output

s3

Signal

s2

s5

State Variables

Figure 6: An example of a classical controller that is based on the feedback of all state variables si . By feeding

back all state variables si and multiplying these variables with appropriate constants pi (omitted in the gure), the complete system becomes stable. appropriate constants pi; 1  i  n is sucient for the design of a stable system. 2. The constants pi ; 1  i  n can be determined by expert knowledge, by trial and error, or by mathematical analysis. Only if the pi 's are calculated, the designer needs a mathematical model of the system; in all other cases, the designer can neglect any mathematical treatment and can concentrate on the design process. 3. The concept of the state controller is appropriate in the neighborhood of the system's working point, which would be, in the cart-pole example, the condition ' = 0, ! = 0 and preferably x = 0 as well as v = x_ = 0.

cart's velocity v = x_ . The advantage of the state controller is that the designer has to determine only four constants for a controller with for input signals. The number of parameters of a classical state controller grows only linearly in the number of input variables n, whereas, as already discussed in Section 3, the number of fuzzy rules might grow exponentially in the number of input variables. The next section shows how the notion of the state controller can be used in fuzzy control.

5 The Fuzzy State Controller Section 3 has discussed the problem that the number of fuzzy rules might grow exponentially in the number of input variables, and Section 4 has discussed one major development of classical control theory, i.e., the state controller, in which the number of parameters grows only linearly in the number of input variables. This section shows how both approaches can be bene cially combined. The goal is to develop a methodology that yields compact solutions like the state controller while preserving a user-friendly, mathematical-free design process like in fuzzy control. As a side e ect, the so designed fuzzy controller is very compact, which in turn allows for a much cheaper implementation, which makes special fuzzy hardware unnecessary.

The rst two results can be directly used in fuzzy control, whereas the third point is a disadvantage, which can be appropriately tackled by fuzzy control. In fuzzy control, it is easy to compensate any nonlinearity, which is exempli ed in the following rule base: rule 1: if x small force = very small rule 2: if x medium force = small rule 3: if x high force = very high Adopting these results in fuzzy control, a fuzzy state controller can be designed in the following way and the structure of the fuzzy state controller is depicted in Figure 7. 1. Select all input variables that might be useful for the controller. 2. For each input variable, design a (onedimensional) fuzzy controller by an appropri-

The development of the classical state controller, which is unfortunately not very well-known, yields the following results: 1. Feeding back all state variables and determining 5

System

Fuzzy State Controller Rule set 1

De-fuzzification engine 1

p

1

s

s

1

Rule set 2

De-fuzzification engine 2

p

4

2

s3 Rule set n

De-fuzzification engine n

p

n

Figure 7: The concept of a fuzzy state controller that processes each input variable by an independent fuzzy controller. The output of the entire controller is determined as the (fuzzy) sum of all n sub-results yielded by each sub-controller. ate rule set, while assuming that all other input variables are zero. That is, for each variable, a fuzzy controller can be speci ed that does not take into account any other input variable. In other words, the designer constructs n independent controllers, one for each input independent of all other inputs.

be used. For the x component, the rule set could be designed as follows: \if x zero then output = zero", \if x positive then output = positive small", \if x negative then output = negative small". Finally, the speed v and perhaps other state variables can be controlled similarly. The importance factors could be set to p' = 1:0, p! = 0:3, px = 0:1, and pv = 0:1. Setting the importance parameters to particular values is rst of all a design decision and re ects the designer's opinion of an appropriate controller. In any case, all parameters pi are subject to an additional scaling, due to technical characteristics of the system. Such a compact fuzzy state controller is similar to the controller presented in [7], which has been evolved by genetic programming and is essentially a state controller with an additional quadratic term.

3. De-fuzzify the output of each of the n fuzzy controllers separately, and, in the nal processing stage, calculate the output as the sum of all n sub-results (de-fuzzi cation of the consequent parts) multiplied by an importance factor pi . Obviously, the resulting set of fuzzy controllers grows only linearly in the number n of input variables. In addition, the designer has some more options for incorporating expert knowledge. For instance, the summation to be done in step 3 can be replaced by more appropriate operators, such as a fuzzy sum, a max or min operator, a fuzzy product etc. By these means, the fuzzy designer can better deal with additional interactions and non-linearities of the input variables. Also, this framework allows for the speci cation of exception rules that override the output of the pure fuzzy state controller.

As indicated earlier, the use of additional variables, such as the cart's position x and the cart's speed v, makes the system more robust with respect to external disturbances. For example, an external force that would push the pole to the right would result in a temporarily positive position x. The fuzzy state controller would recognize this o set and would drive back to the initial position. Finally, the cart adopts a position around x = 0, and an angle ' that compensates the external force. As a side e ect of using x as an input, the fuzzy state controller would avoid crashing into the boundaries of arena.

The design of a fuzzy state controller for the cart-pole problem is very easy. For the most important variables, i.e., the angle ' and the angular velocity !, the rule sets for ' = 0 and ! = 0 as already speci ed in Figure 4 can

It should be clear that this way of constructing 6

References

a controller is much di erent from the usual way of constructing a fuzzy controller, and it probably takes some time to get used to the design perspective. The major bene ts of this design approach are (1) the design becomes much easier, since the designer can handle the input variables independently, (2) the number of parameters grows only linearly in n as opposed to an exponential growth of parameters in the conventional fuzzy approach, (3) the much compacter fuzzy controller makes the use of special fuzzy hardware unnecessary, and (4), very important, the concept of the fuzzy state controller is justi ed by the classical control theory, and consequently, the designer does not need to mathematically analyze the entire system. Furthermore, this way of viewing the design of a fuzzy controller allows for incorporation of other control elements, such as integrating or di erentiating components. For example, a fuzzy controller could be enhanced by a @!=@t component, which would lead to a faster reaction of the controller. In case of the cart-pole problem, such a di erential component would yield a faster balancing of the pole.

[1] Chen, C.-T.: Introduction to Linear System Theory , Holt, Rinehart, and Winston, New York. (1975) [2] Follinger, O.: Regelungstechnik , Huthig Verlag, Heidelberg. (1985) [3] Hartmann, I.: Lineare Systeme , SpringerVerlag, Berlin. (1976) [4] Kosko, B.: Neural Networks and Fuzzy Systems, a dynamical systems approach to machine intelligence . Prentice-Hall International Englewood Cli s, NJ. (1992) [5] Lee, M.A.: Automatic Design and Adaptation of Fuzzy Systems and Genetic Algorithms using Soft Computing Techniques , Ph.D. Thesis, University of California, Davis. (1994) [6] Mendel, J.M.: Fuzzy Logic Systems for Engineering: A Tutorial, Proceedings of the IEEE , 83(3), pp. 345-377. (1995) [7] Stebler, R.: Evolving a Rule Set for the Inverted Pendulum by Means of Genetic Programming , Master thesis at Swiss Federal Institute of Technology (ETH), written in German. (1996) [8] Tong, R.M.: A Control Engineering Review of Fuzzy Systems, Automatica , pp. 559-569, Pergamon Press, Great Britain. (1977) [9] Takagi, T., Sugeno, M.: Fuzzy Identi cation of Systems and Its Application to Modeling and Control, IEEE Transactions on Systems, Man and Cybernetics , 5(3), pp. 116-132. (1985) [10] Zadeh, L.A.: Fuzzy Sets, Information and Control , 8, pp. 338-353. (1965)

6 Conclusion This paper has compared typical fuzzy controllers with controllers developed in classical control theory. Among other things, the comparison has discussed the problem that the number of rules in a fuzzy controller might grow exponentially in the number of input variables, whereas a classical state controller grows only linearly. In Section 5, it has been shown how to transfer the notion of the state controller to fuzzy control. The result is the concept of a fuzzy state controller . Furthermore, it has been argued that the fuzzy state controller has several advantages. First, the controller's size grows only linearly in the number of input variables, second, it is easy to use as many input variables as seem appropriate, which make the controller much more robust with respect to environmental disturbances, and third, the fuzzy state controller can be easily parallelized.

Acknowledgements This work was supported in part by a Human Capital and Mobility fellowship of the European Union, grant ERBCHBICT941266, and by ESPRIT III, project Lydia III P8144. Thanks are due to Rolf Pfeifer and Christopher Lueg for discussion. 7