An Adaptive Fuzzy Sliding-Mode Controller for a Robot Arm R. G. Berstecher and R. Palm Siemens AG Corporate Technologies, Dept. ZT IK 4 81730 Munich, Germany email:
[email protected]
H. Unbehauen Ruhr-University Bochum Faculty of Electrical Engineering Control Engineering Laboratory 44780 Bochum, Germany email:
[email protected]
Abstract: This paper deals with a new adaptive sliding mode controller and its practical application to a robot manipulator arm. The theory for this new fuzzy sliding mode controller approach and for the heuristics-based linguistic adaptation is presented and a mathematical description is derived. Furthermore the application of this adaptive controller is shown for a simulated two-link robot arm and for the real time operation of a mobile three-link robot arm, respectively. The obtained results show the high eciency of the new controller type. Keywords: Adaptive control, fuzzy control, sliding mode, robotics
1 Introduction
Let b(x x_ : : : x(n;1)) > 0 and the state x = (x x_ ::: x(n;1))T has to follow the desired trajectory T xd = (xd x_ d ::: x(dn;1)) . Then we dene d + n;1e s = dt R nX ;1 n ; 1 i e(n;1;i) = (2) R i i=0 ; where e = x ; xd = e~ e_ ::: e(n;1) T . s = 0 represents a switching surface in the state space. R is a parameter specifying s and therewith the dynamics of the closed-loop behavior according to Slotine 1991, Hung 1993, Drakunov 1992]. Fuzzy controllers which use the switching variable s for calculating the manipulated variable u are called FSMCs Palm 1994, Sun 1996]. Their fuzzy rules have the form Rjc : If s is LS j Then u is LU j : (3) LS j , and LU j represent the linguistic values for the variables s and u, respectively. dened by corresponding membership functions. The manipulated variable u is the output of the FSMC while the switching variable s is its input. The shape of the nonlinear transfer characteristic of a FSMC depends not only on the values of u, but also on the membership functions of the rule antecedents (if-parts) and consequents (then-parts) and the defuzzication method. In what follows, gfc represents the transfer characteristic of the FSMC and describes the dependence of the manipulated variable u on the switching variable s and the
In this paper a linguistic, heuristics-based adaptation algorithm for a fuzzy sliding-mode controller (FSMC) is presented. The algorithm relies on linguistic knowledge in form of fuzzy if-then rules which reect how an experienced operator would adapt the controller in order to obtain a desired closed-loop behavior. The adaptation parameters are grouped into a parameter vector r. A linguistically dened adaptation law uses the switching variable s of the FSMC, its time derivative s_ , and the manipulated variable u in order to compute a resulting adaptation parameter change r_ . The analytic description of the adaptation law reveals similarities to conventional control theory and relates uncertainties in the system description with the expected adaptation parameter convergence. In Sect. 2, the basic principles of FSMCs are briey reviewed. In Sect. 3, the heuristics-based motivation for the linguistic adaptation law is presented and an equivalent mathematical description is derived. In Sect. 4, the adaptation law is applied to the control of a two-link robot arm in the simulation and in Sect. 5 to the real time control of a three-link robot arm. Concluding remarks are given in Sect. 6
2 The fuzzy sliding-mode controller In the following, we consider a nonlinear n-th order system of the form x(n) = f(x x_ : : : x(n;1)) + b(x x_ : : : x(n;1))u:(1) 1
adaptation parameters r = (r1 : : : ri : : : rN ). By choosing the center-of-sums defuzzication method, the output u of the FSMC is computed as N P i (s )Mi =1 (4) u = gfc (s r) = iP N i(s )Ai
By inuencing the parameters ri only at the supporting points s i , coupling eects between the dierent parameters are avoided. Figure 1 illustrates that a change in ri by ri does not alter the output of the FSMC at the supporting points j , j 6= i.
i=1
where i is the degree to which the antecedent of the u i-th fuzzy rule is satised by a particular crisp value of s . Mi and Ai are the moment and area of the membership function dening the linguistic value of u in the i-th rule. sσ, i-1 sσ, i sσ, i+1 The point at which a triangular membership function has value 1 is called a supporting point. Here, sσ the N points s j , j = 1 : : : N, with membership 1 to ri-1 the membership functions dening the linguistic val- u i-1 ues of s , are the supporting points in the (u s ) diri ri+1 agram (see Fig. 1). At the j-th supporting point the u r ∆ i antecedents of the other N ; 1 rules have degrees of i satisfaction equal to zero and therefore these rules do u i+1 gfc not re. Thus, according to (4) and the j-th rule Rj in (6), the output of the FSMC at the j-th supporting point s j is Figure 1: Dependence of the FSMC characteristic on (s )M M j j j j u(s j ) = uj = (s )A = A : (5) the parameter value ri at s i j j j j The points (s j MA ) lie on the nonlinear transfer characteristic of the FSMC in the (u s ) diagram. . u NB N Z P PB j j
3 The linguistic adaptation law The adaptation law deals with the change of the values of the supporting points ri and is dened by heuristicsbased linguistic rules describing how an expert would adapt the FSMC to achieve a desired closed-loop behavior Astrom 1995]. The adaptation law uses the distance s of the error vector e from the switching surface s = 0 in accordance with (2), the approach velocity s_ of e to the switching surface s = 0, and the manipulated variable u in the antecedents of the fuzzy rules describing the linguistic adaptation strategy. Each fuzzy rule computes a parameter change r_i for the i-th component ri of the parameter vector r. Thus, the L rules Rji , dening the adaptation strategy for ri at s i , thus have the form If s is LS j and s_ is LS_ j and u is LU j Then r_i is LR_ ji : (6) LS j ,LS_ j , LU j and LR_ ji represent the linguistic values for the variables involved in the rule antecedent and consequent, respectively.
sσ
NB
PB
P
Z
N
NB
N
P
Z
N
NB
NB
Z
Z
N
NB
NB
NB
P
N
NB
NB
NB
NB
PB
NB
NB
NB
NB
NB
Figure 2: Linguistically dened adaptation algorithm for r_i where 's is PB' The switching variable s in Table 6 characterizes one supporting point of the transfer characteristic and therefore is identical for all adaptation rules. By representing s_ , u and r_i as in Table 6 and omitting s in the look-up table representation from Fig. 2, the similarity of the adaptation algorithm with the structure of a FSMC becomes apparent Berstecher (a) 1996, Berstecher (b) 1996]. This fuzzy rule base has the structure of a FSMC because, as shown in Fig. 2, in the cells parallel to the main diagonal (cells with values Z), the same output value r_i
is always chosen. This FSMC in the adaptation loop is used here for the adaptation of the FSMC in the underlying control loop. The FSMC in the adaptation loop is used for the adaptation of the parameter s i . In this case the switching line si = 0 is called an adaptation line with respect to the parameter ri . In analogy to s = 0 the adaptation line si = 0 can analytically be described by si = si (_s u) = i (s_ ; s_ i0 )+(u ; ui0 ) = 0:(7) Here, index i indicates the switching variable characterising the adaptation at the i-th supporting point whereas index characterizes the switching variable of the FSMC in the control loop. In the above expression, i > 0 indicates the slope of the adaptation line si = 0, and (_s i0 ui0 ) denes a point on the adaptation line si = 0. The adaptation law can analytically be expressed by r_ = ; fuzz sgn(s): (8) Fuzz = f (s s_ u) reects the control characteristic obtained by the rules (6)
4 The two-link robot arm
the cartesian coordinates x have to be transformed into joint coordinates according to = f ;1(x): (11) The function f describes the kinematic model of the robot and the geometric relations between cartesian coordinates and joint coordinates. An ecient approach to solve the inverse problem is the dierential method where by dierentiation of (10) with respect to time we obtain x_ = J( ) _ : (12) dx = J( ) is a m n Jacobi-matrix, m is the number d of cartesian coordinates, and n the number of joint coordinates. In order to avoid control osciallations, a continuously dierentiable velocity prole is chosen _d = 1 ; cos t : (13) In Fig. 3, the reference trajectory in the form of a square is given (;;). The task of the controller is to make the system ({) follow the desired system trajectory from an initial state which does not lie on the reference trajectory. In Fig. 4, the output values of the two angles of the robot arm 1 (;;) and 2 ({) and their respective velocities are given. At the same time, the manipulated variables u1 (;;) and u2 ({) are shown. In Fig. 5, the adaptation of the four parameters of the rst fuzzy sliding-mode controller are shown. Although the initial adaptation rate is limited the parameters converge quickly. By using the fuzzy sliding-mode controller in the adaptation block, a robust adaptation behavior can be introduced while the adaptation rate is limited. At the same time, the parameter convergence is fast enough. In Fig. 6 the respective values for the second FSMC are given.
The adaptation algorithm is rstly tested on a simulation example of a two-link robot arm. Let the basic equation describing the motion of a robot arm be M() + N( )_ = u (9) where is a (k 1) is the position vector, _ is a (k 1) velocity vector, is a (k 1) accelleleration vector, M() is a (k k) matrix of inertia (invertable), N( )_ is the (k 1) vector of damping, centrifugal, coriolis, gravitational forces, and u is the (k 1) vector of generalized forces. The quality of the controller design, consisting of a FSMC and fuzzy sliding-mode adapta- y[m] 0.08 0.06 tion block is examined for each link of a simulated twolink robot with the angles 1 and 2 . The results ob0.04 tained by two adaptive fuzzy sliding-mode controllers 0.02 are presented in the following. The sampling interval is chosen as 0.008s. Using planetary drives, the respec0 tive arms can be regarded as decoupled since they have -0.02 a high inertia due to the drives. The two-link robot -0.04 can then be regarded as being composed of two SISOsystems. Thus, every arm can be modelled eectively -0.06 as a double integrator. Nonlinear eects in the form -0.08 of position-dependent friction and remaining coupling -0.05 0 0.05 0.1 0.15 eects are neglected and will be rejected during conx[m] trol. According to the kinematic properties of the robot, i.e. Figure 3: Reference (; ;) and actual ({) trajectory x = f( ) (10)
1 θ ,θ 1
2
r11,r12 ,r13 ,r14
0 -1 -2
-4
0
1
2
1 .
-2
3
4
5
-6
t -8
.
θ1 , θ2 0
-10
-1
0
1
2
0.5
3
4
5
-12
t -14
u1, u2 0 -16
-0.5
0
1
2
3
4
0
1
2
3
4
5
5
t[s]
t[s]
Figure 4: State space and manipulated variable for the arm
5 Real time experiments with a three-link robot arm
Figure 5: Parameter adaptation for the rst controller
∆r21,∆r22,∆r23,∆r24 0.08 0.07 0.06
The described adaptive controller was also applied to a three-link robot arm. This robot arm is installed on a mobile platform and used for environmental exploration as well as for shifting of obstacles. Thus the position control system for the end eector at the third link has to cope with widely varying operation conditions. Therefore a robust adaptive controller was necessary. t[s] This is an ideal real time application for the here introduced control scheme of an adaptive fuzzy sliding mode controller. The robot arm is depicted in Fig. 7. The links are driven by special DC motors. The angles Figure 6: Parameter adaptation for the second conare measured by incremental sensors. In the following troller only the second and third link are considered. Figures 9 and 10 show the desired and the actual values of 2 und 3 of the second and the third link which occured when the end eector of the robot arm was tracking a reference square as indicated in Fig. 8. Obviously a good tracking behavior is achieved. The corresponding swiching variables s2 and s3 are depicted in Figs. 11 and 12, respectively. The width of the boundary layer (dashed line) was chosen to be = 0 2 1s . 0.05 0.04 0.03 0.02 0.01
0
-0.01
0
1
2
3
4
Figure 7: View of the robot arm
5
0.05
y [m]
0 -0.05 -0.1
s 2 [rad/s]
-0.15 -0.2
0.5 0.4 0.3
-0.25
0.2 -0.3
0.1
-0.35 -0.05
0
0.05
0.1
0.15
0.2
0.25
0.3
0
0.35
-0.1
x [m]
-0.2
Figure 8: Reference trajectory (;;) and measured trajectory (|)
-0.3 -0.4 -0.5 0
2
4
6
8
10
12
14
t [s] θ2 [rad]
Figure 11: Swiching variable s2 in the boundary layer
2.6
2.4
2.2
2.0
1.8
1.6
1.4
0
2
4
6
8
10
12
14
t [s]
Figure 9: Desired values (;;) and actual values of the second link (|)
s 3 [rad/s] 0.5 0.4 0.3 0.2
θ3 [rad]
0.1
-1.5
0 -0.1 -0.2 -0.3
-2
-0.4 -0.5 0
2
4
6
8
10
12
14
-2.5
t [s]
-3
Figure 12: Swiching variable s3 in the boundary layer 0
2
4
6
8
10
12
14
t [s]
Figure 10: Desired values (;;) and actual values of the third link (|)
6 Concluding remarks This paper has presented a new type of an adaptive fuzzy sliding mode controller. The mathematical description and the heuristics-based linguistic adaptation law as well as the practical application in simulation and real time experiments have been presented. Through the adaptation of the nonlinear controller characteristics the chattering of the controller has been suppressed and exellent performance of the tracking behavior has been achieved. Due to the very small sampling time the design is based on a quasi continuous approach. For larger sampling times, however, a discrete time approach should be developed in the future.
References
Astrom 1995] Astrom K.J., Wittenmark B. (1995). A survey of adaptive control applications. In Proceedings of the 34th IEEE Conference on Decision and Control, New Orleans, pages 649{654. Berstecher (a) 1996] Berstecher R., Palm R., Unbehauen H. (1996). Direct fuzzy adaptation of a fuzzy controller. In Proceedings of the International Federation of Automatic Control, IFAC, 13th World Congress, San Francisco, pages 39{44. Berstecher (b) 1996] Berstecher R., Palm R., Unbehauen H. (1996). Linguistic adaptation of a fuzzy controller. In Proceedings of the Sixth IEEE International Conference on Fuzzy Systems, New Orleans, pages 1794{1799.
Hung 1993] Hung J.H. , Gao W., Hung J.C. (1993). Variable structure control: A survey. IEEE Transactions on Industrial Electronics, 40(1):2{22. Palm 1994] Palm R. (1994). Robust Control by Fuzzy Sliding Mode. Automatica, 30(9):1429{1437. Slotine 1991] Slotine J.-J., W. Li (1991). Applied Nonlinear Control. Prentice Hall, Englewood Clis. Sun 1996] Sun F.C., Sun Z.Q. , Feng G. (1996). Design of adaptive fuzzy sliding mode controller for robot manipulators. In Proceedings of the Sixth IEEE International Conference on Fuzzy Systems, New Orleans, pages 62{67.
Drakunov 1992] Young K.D., Drakunov S.V. (1992). Sliding mode control with chattering reduction. In
Proceedings of the American Control Conference, Chicago, pages 1291{1292.