Katholieke Universiteit Leuven Departement Elektrotechniek ESAT-SISTA/TR 1997-11 Accelerate Implementation of Forwaring Control Laws using Composition Methos 1 Yves Moreau, Roolphe Sepulchre, Joos Vanewalle 2 Octobre 1997 1 This report is available by anonymous ftp from ftp.esat.kuleuven.ac.be in the irectory pub/sista/moreau/reports/ 2 ESAT - Katholieke Universiteit Leuven, Karinaal Mercierlaan 94, 31 Leuven (Heverlee), Belgium, tel +32/16/32 18 6, fax +32/16/32 19 86, email: yves.moreauesat.kuleuven.ac.be, www: http://www.esat.kuleuven.ac.be/moreau/.
Accelerate Implementation of Forwaring Control Laws using Composition Methos Yves Moreau an Roolphe Sepulchre June 1997 Abstract We use a metho of integration by composition to solve the ierential equations of the ball an beam together with the equations of its nonlinear controller base on constructive Lyapunov techniques. 1 Introuction To accelerate the proceure of forwaring control, we consier the use of composition methos for the integration of ierential equations, instea of the stanar Runge-Kutta scheme. These methos arise from the theory of Lie algebras, an are base on the use of a formula calle the Baker-Campbell- Hausor formula. Although these methos are most popular in the el of Hamiltonian mechanics, they are also suitable for other problems. The main iea behin these methos is that if the vector el of an orinary ierential equation can be expresse as the sum of simpler terms, we can solve the ierential equations for these simpler terms separately an recombine these solutions by composition to get an approximation to the solution of the more complex system. When we compare a simple composition metho to a simple Runge- Kutta scheme, we see that the composition metho oes not isplay the same accuracy as the Runge-Kutta scheme, but it oers a signicant improvement in spee. The next section will present the ieas from constructive Lyapunov control that lea to the forwar esign. In the following section, we present basic notions of Lie algebra theory, together with the composition metho. After that, we present the etails of the application of these methos to the ball an beam. 2 Forwaring esign We briey summarize the technique from constructive Lyapunov control that we use to stabilize the ball an beam. You can n a etaile exposition of this metho an other relate methos in [1]. From the point of view of constructive 1
Lyapunov control, we can escribe the ball an beam as an augmente cascae. This means that we can write its state-space equations in the following form: _z = f(z) + (z; ) + g(z; )u ( u ) _ = a() + b()u The states z an are multiimensional, while the input u is one-imensional. Such a system is calle a cascae because the evolution of inuences the evolution of z, while it is itself inepenent of z. We say it is augmente because the evolution epens on an input u. The goal is to n a feeback law u(z; ) that achieves stability for the controlle system. We o this by esigning a Lyapunov function V (z; ) for the close-loop system ( u ; u). The main assumption is that we alreay have a Lyapunov function W (z) available for the system _z = f(z) an another Lyapunov function U() available for the system _ = a(). Thus, the erivative of W along any trajectory of _z = f(z) is negative semi-enite: _W ; 8t. This means that rw (x):f(x) ; 8x or, if we use the notation of Lie erivatives (which is equivalent), L f W (x) ; 8x. The same thing hols for U an _ = a(), namely L a U(x) ; 8x. Now, we rst look at the cascae system without input: _z = f(z) + (z; ) () _ = a() We want to buil a Lyapunov function V (z; ) for using the knowlege of W (z) an U(). We pose the following form for V : V (z; ) = W (z) + (z; ) + U(): We will choose the cross-term so that we can guarantee that V is nonincreasing along the trajectories of (), hence that V is a Lyapunov function. We can now compute the time-erivative of V, leaving the contribution of _ asie: _V = L f W + L W + _ + L a U: We obtain this expression by noticing that W only epens on z an that its erivative will thus only epen on f an ; while U only epens on z an its erivative only epens on a. The terms L f W an L a U are non-positive. Thus, we are left with making sure that the sum of the two other terms L W an _ is nonpositive. Suppose we coul choose the cross-term (z; ) such that _ =?L W: Then V woul inee be negative semi-enite an thus a Lyapunov function. For this to happen, woul have to be the line-integral of L W along the solution of which starts at (z; ). It we enote the solution by (~z(s; z; ); (s; ~ )) (recall that the evolution of is inepenent of z), we get the following expression for : 2
Z 1 (z; ) = L W (~z(s; z; ); (s; ~ ))s: The following theorem [1] tells us uner what conition this integral is wellene, an thus V is a Lyapunov function, which justies our choice of the cross-term. Theorem 1. If the function (z; ) satises a linear growth assumption, that is, there exists two class-k functions 1 (:) an 2 (:) ierentiable at zero, such thatj jj (z; )jj 1 (jjjj)jzj + 2 (jjjj): An if, for the Lyapunov function W (z), there exists constants c an M such that, for jjzjj > M, W z jjzjj cw (z): Then, the following hols: 1. (z; ) exists an is continuous 2. V (z; ) is positive enite 3. V (z; ) is raially boune This theorem gives us a way to n a Lyapunov function for, but recall that our objective is to n a feeback law that stabilizes u. Of course, setting u = will let the system evolve accoring to its autonomous ynamics, which is at least stable since we have shown that V is a Lyapunov function for. But we can achieve asymptotic stability of the controlle system with the following control law, calle amping control [1]: u(z; ) =?L G V (z; ) =? V V (z; )g(z; )? (z; )b() (1) z where G T (z; ) = [g T (z; ); b T ()]. It achieves better stabilization because of the following argument. We know that the time-erivative of V uner the action of u is V _ = LF +Gu V, if we ene F T (z; ) = [f T (z) + T (z; ); a()]. Because of the linearity of the Lie erivative, we have V _ = LF V + L G V u. But, since V is a Lyapunov function for, V _ LG V u. So, V _ can be mae more negative if we use the control law u =?(L G V ) T ; > since then V _?j LG V j 2. The control law (1) uses the partial erivatives of V an therefore also the partial erivatives of z = = Z 1 Z 1 z (L W ) ~z z + (L W ) ~ z z (L W ) ~z + (L W ) ~ z 3 (2) (3)
To evaluate the integrals (2) an (1) at a given point (z; ), we nee to integrate the following set of equations (where = ~z an = ~ ): z ~z = f(~z) + (~z; ) ~ ~ = a( ) ~ _ = f z + z + _ = a Using these integrate values an our knowlege of L W, we can integrate the partial erivatives of an thus recover the partial erivatives of V, which in turn gives us our control action u. We are going to apply the technique we have just escribe to the control of the ball an beam. But, instea of integrating the ierential equations using a stanar integration proceure like Runge-Kutta, we will integrate the equations using a composition metho that we escribe in the next section. 3 Composition methos for the integration of orinary ierential equations 3.1 Lie algebra theory Lie algebra theory has a prominent position in physics, mostly in the areas of classical mechanics [2] an partial ierential equations [3]. It is also an essential part of nonlinear system theory [4]. It will provie here the mathematical framework for the presentation of composition methos. We refer the reaer to classical textbooks (e.g., Arnol [2]) for a etaile presentation of Lie algebras an their applications to ynamical system theory. A Lie algebra A is a vector space where we ene a supplementary internal operation: the bracket [:; :] of two elements of the algebra. Bracketing is a bilinear, anti-symmetric operation; which also satises the Jacobi ientity: [A; B] =?[B; A] [aa; B] = a[a; B] [A; B + C] = [A; B] + [A; C] [[A; B]; C] + [[B; C]; A] + [[C; A]; B] = The Lie algebra we consier here is the vector space of all smooth vector els. The Lie bracket of two vector els is again a vector el. Recalling that we take the prouct of exponentials to enote the composition of these maps, we can ene the following vector el as the Lie bracket of the vector els A; B: [A; B] = 2 st j t=s=e?s:b e?ta e sb e ta : 4
The bracket [A; B] is calle the commutator of the vector els, as it measures the egree of non-commutativity of the ows of the vector els ([A; B] =, e ta e tb = e tb e ta ). In the case where the manifol is R n, we can specialize the bracket to [A; B] i = n A j B j i=1 B i? A i x i x i The last mathematical tool we shall nee is the Baker-Campbell-Hausor (BCH). This formula gives an expansion for the prouct of two exponentials of elements of the Lie algebra [8]: e ta e tb = e t(a+b)+1=2:t2 [A;B]+1=12:t 3 ([[A;[A;B]]+[B;[B;A]])+::: (4) It shoul be interprete as follows. Letting the ow of _x = B(x) act on the initial conition of the system for t, an then - from where we have arrive - letting the ow of _x = A(x) act for another t is equivalent to letting the ow of _x = ((A + B) + t 2 act on the initial conition for t. t2 [A; B] + ([A; [A; B]] + [[B; [B; A]]) + : : :)(x) 12 3.2 Integration of orinary ierential equations by composition methos We rst look at how to solve orinary ierential equations using compositions. Suppose we want to solve an ODE with vector el X, _x(t) = X(x(t)) (5) for a time-step of t. The problem then becomes that of builing an approximation for e tx as we have that x(t) = e tx x (6) This problem has recently been the focus of much attention in the el of numerical analysis, especially for the integration of Hamiltonian ierential equations [8, 6]. The basic iea is that, if you can split the vector el X into elementary parts for which you can solve the ierential equation irectly, you can recombine these solutions to approximate the solution of the more complex system. Suppose that the vector el X is of the following form: X = A + B where you can integrate A an B analytically or much more easily than X. Then we can use the BCH formula to prouce a rst-orer approximation to the exponential map: 5
Figure 1: e t:x (x ) e t:a :e t:b (x ): BCH: e tx = e ta e tb + o(t 2 ) (7) You can check this relation by multiplying the left- an right-han sies of Equation 4 by e tx (= e t(a+b) ), expaning it using the BCH formula itself (4), an simplifying it using the properties of the Lie bracket. This computation gives e ta e tb e?tx = e o(t2 ) The left-han sie is in fact equal to I +o(t 2 ), where I is the ientity map; an we get (7). The relation of rst-orer approximation (7) between the solution of A an B, an the solution of X is the essence of the metho since it shows that we can approximate an exponential map (that is the mapping arising from the solution of an ODE) by composing simpler maps (Fig.1). Flow of X Flow of B (8) Flow of A By using the BCH formula to eliminate higher-orer terms as we i for the rst-orer approximation, but on the composition of three terms, we can show that the following symmetric leapfrog scheme is secon orer: Leapfrog : e tx = e t 2 e tb e t 2 A + o(t 3 ) (9) = S(t) + o(t 3 ) (1) Using this leapfrog scheme as a basis element, we can buil a fourth-orer scheme: Fourth? orer : e tx = S(ct)S(t)S(ct) + o(t 5 ) (11) = SS(t) + o(t 5 ) (12) with c =?2 1=3 =(2?2 1=3 )$ an = 1=(2?2 1=3 ). There exists other composition schemes than the repeate leapfrog [6], some of them being more ecient than others. Repeating the leapfrog strategy, Yoshia [9] showe that it is possible to prouce an approximation to e tx up to any orer: 6
Arbitrary orer 9k; 9w 1 ; v 1 ; : : : w k ; v k : (13) e tx = e w1ta e v1tb : : : e w kta e v ktb + o(t p+1 ) (14) Forest an Ruth [1] also showe that approximations can be built for more than two vector els (the use of repeate leapfrogs is the only known solution in this case). 4 The ball an beam 4.1 Lyapunov control of the ball an beam The equations of the ball an beam are the following: = r + G sin + _r? r _ 2 r = (r 2 + 1) + 2r _r _ + Gr cos where r is the position of the ball, is the angle of the beam, is the torque applie to the beam (which is here the control variable), G is the gravity (G = 9:81m=s 2 ), an is the viscous friction constant ( = :1s?1 in the simulations). Applying the feeback transformation = 2r _r _ + Gr cos + k 1 + k 2 _ + (r 2 + 1)u an ening z 1 = r; z 2 = _r; 1 = 2 = _, we obtain the state equations: _z 1 = z 2 _z 2 =?z 2? G sin 1 + z 1 2 2 _ 1 = 2 _ 2 =?k 1 1? k 2 2 + u We see that, when u =, the -subsystem is exponentially stable with the Lyapunov function U() = 1(k 2 1x 2 1 + x 2 2). We also see that, when =, the z-subsystem is globally stable with the Lyapunov function W (z) = 1(z 2 1 + z 2 ) 2 + 1 2 z2 2. Following the notation use for the system u, we have f(z) = [z 2 ;?z 2 ] T ; (z; ) = [;?G sin 1 + z 1 2] 2 T ; a() = [ 2 ;?k 1 1? k 2 2 ]; g(z; ) = [; ] T ; b() = [; 1] T. We also enote the solution of the ball an beam starting at (z 1 ; z 2 ; 1 ; 2 ) by (~z 1 (s); ~z 2 (s); ~ 1 (s); ~ 2 (s)). Because of the theorem presente in the rst section, the cross-term Z 1 = (~z 1 (s) + 2~z 2 (s))(?g sin ~ 1 (s) + ~x 1 (s) ~ 2(s))s 2 makes the function V (x; ) = W (x)+ (x; )+U() a Lyapunov function for the 7
ball an beam together with its controller; thereby guaranteeing the stability of the controlle system. To achieve asymptotic stability, we apply amping control as also escribe in the rst section. The control law for the ball an beam is thus u =?L G V, which in this case reuces to u =?? U =?? 2 because of the zeros in g an b. Thus, we nee to evaluate u. If we ene the following variational variables: 1 = z1 an if we further notice that (s) ~ = e As with A = ~ 1 = e As an ~ 2 (12) = e As (22); we have 1?k 1?k 2 to compute an 2 = z2, an thus, = Z 1 ( 1 + 2 2 )C 1 (~z 1 ; ~ 1 ; ~ 2 ) + (~z 1 + 2~z 2 )C 2 (~z 1 ; ~ 1 ; ~ 1 ; ~ 2 )s where C 1 (~z 1 ; ~ 1 ; ~ 2 ) =?G sin ~ 1 + ~z 1 ~ 2 2 an C 2 (~z 1 ; ~ 1 ; ~ 1 ; ~ 2 ) =?G cos ~ 1 e A (12) + 1 ~ 2 2 + 2~z 1 2 ~ e A (22). To compute this integral, we nee to have the values of ~z 1 ; ~z 2 ; 1 ; an 2. We obtain them by integrating the following set of ierential equations (recall 1 = z1 an 2 = z2 ): ~z s 1 = ~z 2 ~z 1 () = z 1 ~z s 2 =?~z 2? G sin ~ 1 + ~z 1 ~ 2 2 ~z 2 () = z 2 s 1 = 2 1 () = s 2 =? 2? G cos ~ 1 e As + (12) ~ 1 2 2 + 2~z 1 2 ~ e As (22) 2 () = s = ( 1 + 2 2 )C 1 + (~z 1 + 2~z 2 )C 2 () = Since we cannot integrate the equations for an innite time, we truncate the integration at s = T an we use the approximate value for the control law. For the computer simulations, we have place both eigenvalues of A at?2 with k 1 = 4; k 2 = 4. Base on the ecay rate associate to these eigenvalues, we have set T = 1 secons. An we look at the close-loop response of the system starting at the initial conition (1,,-1.57,), this correspons setting the beam upright ( =?=2) with the ball at 1 meter of the pivot of the ball an beam. 4.2 Integration by composition Controlling the ball an beam means that at each time we want to upate our control action u, we nee to integrate the above variational equations for T secons. We then set the control to u =? T (T ; z 1 ; z 2 ; 1 ; 2 )? 2. For the purpose of simulation, we nee to integrate the equations of the ball an beam itself between two control upates, we use a Runge-Kutta metho to o this. We o not try to replace this integration by a composition metho since 8
in practice, the evolution is the result of the physical process itself, not of a simulation. But we will integrate the variational equations with a composition metho. Each time the equations of the ball an beam have been integrate for a step, we integrate the variational equations for T = 1 secons an compute the new control; this new control is use to further integrate the equations of the controlle ball an beam. We will compare the result of the integration by composition of the variational equations with the results of a Runge-Kutta metho for these variational equations. To integrate the variational equations by a composition metho, we nee to Fin a splitting of the equations Choose an integrator Choose a time-step t B We choose the following splitting: s ~z 1 s ~z 2 s 1 s 2 s 1 C = B A ~z 2?~z 2 2? 2 1 C+ B A C 1 (~z 1 ; ~ 1 ; ~ 2 ) C 2 (~z 1 ; ~ 1; ~ 1 ; ~ 2 ) 1 C+ B A ( 1 + 2 2 )C 1 + (~z 1 + 2~z 2 )C 2 1 C A We split among the evolution of (it is inepenent of itself), the linear part, an the nonlinear part. Conensing the notation, we coul write (s) = s B(s) + C((s)) + D((s)). Recall that the evolution of ~ is given by exponentiation of the matrix A. So, the solution for the linear part is foun by exponentiation of the matrix e sb ( ) = e sb :. The solution for the nonlinear parts are trivial since all the variables on which C 1 an C 2 epen remain constant: e sc ( ) = + sc an e Ds ( ) = + sd. We choose the following secon-orer Leapfrog integrator: (t) e t=2b e t=2c e td e t=2c e t=2b ( ): We choose an integration step t = :2. The integration using rst Runge- Kutta an then the secon-orer Leapfrog integrator gives the following results. 9
Figure 2: Evolution of the ball an time using Runge-Kutta, top curve: position, mile curve:velocity, left curve:angular velocity, bottom curve: angle Figure 3: Evolution of the ball an beam using the composition integrator 25 2 15 1 5 5 1 1 2 3 4 5 6 7 8 9 1 3 25 2 15 1 5 5 1 2 3 4 5 6 7 8 9 1 We see that the composition integrator is able to control the ball an beam just as when we use a Runge-Kutta integrator. The performance of the composition metho is slightly worse, but the spee of the integration is multiplie by a factor of 4. A performance closer to that of the Runge-Kutta can be obtaine by using a higher-orer metho or a smaller time step, but at the expense of 1
spee. With gain in spee by a factor 2, the maximum eviation of the ball (the peak in the top curve) is the same as for the Runge-Kutta metho. This is usually taken to be the performance criterion for a controller for the ball an beam. Also, the behavior of the amping control in the stabilization phase after the peak is known to be sub-optimal an it woul be necessary to switch to a linear controller after the peak. 5 Conclusions We have shown an application of amping control to the ball an beam, together with a metho of integration by composition that permits a faster integration of the ierential equations associate to the controller of the ball an beam. The amping controller guarantees global asymptotic stability of the ball an beam. The composition methos arise from the theory of Lie algebras, an are base on the use of a formula calle the Baker-Campbell-Hausor formula. The main iea behin these methos is that if the vector el of an orinary ierential equation can be expresse as the sum of simpler terms, we can solve the ierential equations for these simpler terms separately an recombine these solutions by composition to get an approximation to the solution of the more complex system. When we compare a simple composition metho to a simple Runge-Kutta scheme, we see that the composition metho oes not isplay the same accuracy as the Runge-Kutta scheme, but it oers a signicant improvement in spee. This makes the composition metho an attractive alternative for the evelopment of a amping controller for the ball an beam. 6 Conclusions References [1] R. Sepulchre, M. Jankovic, an V. Kokotovic, Constructive Nonlinear Control, Springer-Verlag, Lonon, 1997 [2] V.I. Arnol, Mathematical methos of classical mechanics, Springer-Verlag, New York, 1989. [3] P.J. Olver, Applications of Lie groups to ierential equations, Springer, New York, 1985. [4] A. Isiori, Nonlinear control theory, Springer-Verlag, New York, 1989. [5] H. Nijmeijer, A.J. van er Schaft, Nonlinear ynamical control systems, Springer-Verlag, New York, 199. [6] R.I. McLachlan, \On the numerical integration of orinary ierential equations by symmetric composition methos", SIAM J. Sci. Comput., Vol. 16, No. 1, pp. 151-168, 1995. 11
[7] M.C. Irwin, Smooth Dynamical Systems, Acaemic Press, New York, 198. [8] P.-V. Kosele, Calcul formel pour les methoes e Lie en mecanique hamiltonienne, Ph.D. thesis, Ecole Polytechnique, Paris, 1993. [9] H. Yoshia, \Construction of higher orer symplectic integrators", Phys. Lett. A, Vol. 15, pp. 262-269, 199. [1] E. Forest, R. Ruth, \Fourth-orer symplectic integration", Physica D, Vol. 43, pp. 15-117, 199. [11] M. Suzuki, \Convergence of General Decompositions of Exponential Operators", Commun. Math. Phys, Vol. 163, pp. 491-58, 1994. 12