sets and systems ELSEVIER
Fuzzy Sets and Systems 106 (1999) 49-59
Fuzzy Lyapunov-based approach to the design of fuzzy controllers Michael Margaliot, Gideon Langholz* Department o f Electrical Engineering - Systems, Tel Aviv University, Tel Aviv 69978, Israel Received July 1998
Abstract
In this paper we extend the classical Lyapunov synthesis method to the domain of computing with words. This new approach is used to design fuzzy controllers. Assuming minimal knowledge about the plant to be controlled, the proposed method enables us to systematically derive the fuzzy rules that constitute the rule base of the controller. We demonstrate the approach by designing Mamdani-type and Takagi-Sugeno-Kang-type fuzzy controllers for two well-known plants. @ 1999 Elsevier Science B.V. All rights reserved.
Keywords: Lyapunov functions; Fuzzy control; Computing with words
1. Introduction
The most difficult aspect in the design of fuzzy controllers is the construction of the rule base [2]. The process of extracting the knowledge of a human operator, in the form of fuzzy control rules, is by no means trivial, nor is the process of deriving the rules based on heuristics and a good understanding of the plant and control theory [7, 9]. We present a new method, based on extending the classical Lyapunov synthesis method to the design of fuzzy controllers. We show that it enables us to systematically derive the fuzzy rule base. Basically, we follow the classical Lyapunov synthesis method by constructing a Lyapunov function candidate V and then determining the conditions required to indeed make it a Lyapunov function of the closed-loop system. It turns out that, because we assume fuzzy knowledge about the plant to be controlled, the derived conditions can be stated as fuzzy if-then rules. We demonstrate our approach by applying it to the design of Mamdani-type stabilizing and tracking controllers for the inverted pendulum system, and by using it to design a Takagi-Sugeno-Kang-type controller for regulating the water level in a water tank. It should be noted that controllers for these plants were already synthesized by others (see, for example [1, 8]) using heuristics to derive the rule bases. In addition, properties such as stability and robustness have also been demonstrated but only through simulations. In contrast, we use the same examples in this paper to illustrate that our method can be used to derive the rule bases analytically (rather than heuristically). We also believe that our approach might lead to an analytical * Corresponding author. Tel.: + 9 7 2 3 6408764; fax: +972 3 6407095; e-mail:
[email protected]. 0165-0114/99/$ - see front matter @ 1999 Elsevier Science B.V. All rights reserved. PII: S 0 1 6 5 - 0 1 1 4 ( 9 8 ) 0 0 3 5 6 - X
M. Margaliot, G. Langholz/Fuzzy Sets and Systems 106 (1999) 49-59
50
study of the stability and robustness of the resulting controllers. However, in this paper the emphasis is on the presentation of the method and its use for deriving the rule bases. The rest of this paper is organized as follows: In Section 2 we describe the new approach in detail. In Section 3, we illustrate our approach by designing Mamdani-type stabilizing and tracking controllers for the inverted pendulum system. In Section 4 we use it to design a Takagi-Sugeno-Kang-type controller for regulating the water level in a water tank. The final section contains conclusions.
2. Fuzzy Lyapunov synthesis In this section we describe the proposed fuzzy Lyapunov synthesis method for controller design. We start with the conventional case, that is, when we have an exact mathematical description of the plant and then describe its extension to the fuzzy case. Consider the single-input, single-output system
Y;=F(x,u),
y:h(x),
(1)
where F(.)=(FI(.),F2(.) . . . . . Fn(.)) x with the Fi(.)'s being continuous functions, u E R and y E R are the input and output of the system, respectively, and x---(Xl,X2 .... ,xn) T E R n is the state vector of the system. The control objective is to stabilize the system around some working point xo (without loss of generality we may assume xo = 0). More specifically: Design a feedback control u(x) so that 0 will be a stable equilibrium point of (1). Alternative definitions of stability, (e.g., asymptotic stability, exponential stability) may be used. One way of achieving this goal is to choose a Lyapunov function candidate V(x) and then determine the conditions on u (note that V depends on x and therefore on u) necessary to make it a Lyapunov function. In this paper, we refer to a continuously differentiable function V(x) as a Lyapunov function if the following requirements are met: A1.
V(0) : 0,
V(x)>O, n
A3.
l ? = ~i=, ~x/:~i - e. The above observations lead to the following fuzzy rules for w: • IF e is positive and e is positive THEN w is negative big. • IF e is negative and ~ is negative THEN w is positive big. • IF e is positive and ~ is negative THEN w is zero. • IF e is negative and ~ is positive THEN w is zero.
M. Margaliot, G. Lanohoh/Fuzzy Sets and Systems 106 (1999) 49-59 •
0,15
55
0.15,
0.1
0.051-'/
,i
i
J
',1
q
~
Ll
7
~I
q
0,05
1,4
-0.1
30
-0.15' 0
-0.(1
-o.lF
~.'/
-0.150
5
I,,'/
10
~ ~/
15 t
LJl
20
25
Fig. 6. The pendulum's angle xfft) (solid line) and the reference signal ym(t)= 7r/30 sin(t) (dashed line) for initial condition (--n/60, 0).
5=
1'0
1r5 t
2 l0
25'
30'
Fig. 7. The pendulum's angle xl(t) (solid line) and the reference signal ym = n/30sin(t) (dashed line) for initial condition (-n/60,0). Here u t = u + 2~.
Using the membership functions (5), the center of gravity defuzzifier, and the product inference engine we obtain the following: w = - 5fl(e,6) + 5f2(e, 6),
(7)
where fj =
,t/positive(e)//positive(e) //positive(e)k/positive(e) -+-//positive(e)12negative(~') "+" ]-/negative(e)/-/positive(e) q-//negative(e)[/negative(e)' /2negative (e)//negative ( e )
f2 = [/positive(e)/-/positive(e) q- ]-/positive(e)12negative(e) -~- ]-/negative(e)/-/positive(e) q-//negative(e)[/negative(e)"
Now, to obtain the tracking controller, we combine w = ~2 to u; hence u = w + Pro-
tim with our knowledge that
X2
is proportional
(8)
Fig. 6 shows the simulation results for the closed-loop system given by (2) and (8). The reference signal is Ym = (re/30)sin(t) and the initial condition is x l ( 0 ) = -rr/60, x2(0)= 0. Fig. 7 shows the simulation results for the same conditions but with u t = u + 2¢, where ¢(t) is the normally distributed white noise considered in Section 3.1. We note that adequate tracking is achieved in both cases. As a final remark, note that we can ignore J)m altogether and set u=w.
(9)
This yields the tracking controller suggested in [8]. However, numerical calculation of the tracking error f03° e2(t)dt, yields 0.0105 when using (8) and 0.0125 when using (9). Hence, fuzzy Lyapunov synthesis leads not only to a systematic design but also to extra insight that leads to a better controller. Up to this point the rules necessary to make 17 negative were stated in the form leading to Mamdani-type fuzzy controllers. In the following section we use our fuzzy Lyapunov synthesis method to design a TSK-type fuzzy controller.
56
M. Margaliot, G. LanoholzlFuzzy Sets and Systems 106 (1999) 49-59
q(t) low
normal
high
1
0.8
0.6
f
0.4
0.2
,
v(z)u
/
\ Xs X
Fig. 8. Water tank system.
Fig. 9. The operating conditions.
4. Designing TSK-type controller In this section we use fuzzy Lyapunov synthesis to design a TSK-type fuzzy controller for regulating the amount of water in a cylindrical water tank [1]. Illustrated in Fig. 8, the system's dynamical behavior is governed by the following differential equation:
:~ = q(t) - p(x)u,
(10)
where x is the amount of water in the tank, q(t) is the inflow to the tank (we assume that q(t) varies around some nominal fixed flow qs), p(x)u is the outflow from the tank, where p(x)=av/2g(x/~zr 2) (a is a positive constant, r is the tank's radius, and g = 9.8 m/s 2 is the acceleration due to gravity), and u, the control variable, is the cross-sectional area of the drain opening. The control objective is: Design u to regulate x(t) to a desired nominal amount Xs. We assume that (10) is known but that p(x) is not explicitly known and the only knowledge we have about p(x) is • p ( x ) is positive. • The value Ps = p(Xs) is known. Following [1], we assume that the fuzzy partition of the domain of x is already given, namely, the system has three operating modes: x is low, x is normal, and x is high. Qualitatively, as depicted in Fig. 9, x is low when x is much smaller than xs, x is high when x is much larger than xs, and x is normal when Ix -Xs[ is small. To determine the control rules in each of the three modes we apply the fuzzy Lyapunov synthesis method. Consider the Lyapunov function candidate V = ½(x - xs)2 and differentiate it to yield
l? = (x - Xs)2 = (x - Xs)(q(t) - p(x)u).
(11)
Eq. (11) enables us to derive conditions for making /? negative in each of the operating modes: If x is low, then ( x - x s ) < 0 . Hence, to make /? negative, we require q ( t ) > p(x)u. But, we know that q(t) and p(x) are non-negative, therefore, we set u = 0 . Next, if x is high, then ( x - x s ) > 0 . Hence, to make 17 negative, we require q ( t ) < p(x)u and set u = Umax, where Umax is the maximal opening of the drain. Finally, we consider
M. Margaliot, G. LanoholzlFuzzy Sets and Systems 106 (1999) 49-59 1000
1(;00
90C
9OO
80C
!
!
.....
800
57
!.
.
.
.
.
.
.
.
i 7OC
700
600
60O
:~ 500
500
400
400
.
300
300
.
200
200
.................
100
. . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
i
.
i
!
IO0
~ .........
:
~. . . . . . . . . . . . . . . . . . . . . . . . . . . .
~
. . . . . . . . . . .
. . . . . . . .
:"
i 0
5
0
lo
l's
2o
2'5
ao
as
4'o
4's
O0
t
Fig. 10. The amount of water x(t) starting from x(0) = 0 for the nominal inflow.
5
I
I
10
15
20
25 t
i
,
i
30
35
40
~5
Fig. 11. The amount of water x(t) starting from x(0) = 1000 for the nominal inflow.
the case where x is normal. Since we are designing a TSK-type fuzzy controller, we substitute u = klx + k2 in (11 ) to obtain: = (x - Xs)(q(t) - p ( x ) ( k l x + k2)) = (x - Xs)(q(t) - p(x)(kl(x - Xs) + klxs + k2)) = - p ( x ) k l ( x - x~) 2 + (x - Xs)(q(t) - p(x)(klxs + k2)).
(12)
The first term in (12) is non-positive for any kl > 0 . AS for the second term, (x - X s ) ( q ( t ) - p(x)(klxs + k 2 ) ) , since we cannot determine its sign, we can try to make it as small as possible. In particular, we would like ( q ( t ) - p(x)(klxs + k2)) to vanish for x = x s because then the second term behaves approximately as ( x - Xs) 2 in the vicinity o f xs and, therefore, vanishes quickly. To this end, we set k2 = q s / P s - k l X s because then, if q(t) =q~ and p ( x ) = p ( x ~ ) = Ps (this is a logical assumption when x is normal) we obtain (q(t)-p(x)(klXs+k2))=
(qs-Ps(klxs+q-L-klXs))
So, when x is normal, u = klx + k2 = kl ( x - Xs )+-qs/Ps with kl > 0. Note, however, that the drain opening is always non-negative, hence kl must satisfy: kl ( 0 - x s ) + qs/p~ >>,O. Therefore,
0