Energy-based Hamiltonian approach in H∞ controller design for n-degree of freedom mechanical systems

This paper studies the energy-based approach for controller design of -degree of freedom mechanical systems. In this approach, the Hamiltonian function, which is the sum of kinetic and potential energies of the system, is considered as the Lyapunov function for stability analysis. The stability analysis is done based on the port-controlled Hamiltonian (PCH) model. In this regard, two theorems are given and proved that the proposed controllers lead to disturbance attenuation for both absolutely known system model and unknown ones with parametric uncertainties. In the case of parametric uncertainties, the energy-based controller has an adaptive approach. Performance of proposed controllers is illustrated through simulations taken on a 2-link robot manipulator system, which validate the theoretical achievements of this paper.


Introduction
Control of mechanical systems has been an important topic that attracts the attention of researchers due to their vast application areas, such as industrial, medical, space and marine (Shafiei & Binazadeh, 2014. Mechanical systems require high precision control in order to achieve their desired performance (Hakimi & Binazadeh, 2017). Even though, several items cause a complicated controller design procedure, including the nonlinear dynamic feature of mechanical systems, unavoidable risk of being exposed to external disturbances and parametric uncertainties, which stem from environmental factors and system identification failures. Different robust methods have been proposed in Literature (Wang, Yang, & Yan, 2019;Wu, Lu, Shi, Su, & Wu, 2018). Among them, the H ∞ controller is not only known in attenuating the effects of matched and unmatched disturbances, but it also is capable to attenuate the impacts of model uncertainties (Acho, Orlov, & Solis, 2001;Erol & Delibaşı, 2018;Orlov & Aguilar, 2014;van der Schaft, 2001). While, general solutions have been presented for H ∞ controllers (Gholami & Binazadeh, 2019a, 2019bLi & Liao, 2018;Orlov & Aguilar, 2014;van der Schaft, 2001), the major drawback is the difficulty of solving HJI inequalities where in the design procedure leads to an infinite dimension problem (Krstic & Deng, 1998;Subbotin, 1995). This fact causes local solutions for CONTACT T. Binazadeh binazadeh@sutech.ac.ir many problems (Orlov & Aguilar, 2004). While global stability has been proved by means of other control methods (Chung, Fu, & Hsu, 2008;Kelly, Santibanez, & Loria, 2005). Mechanical systems are highly nonlinear systems which are dynamically coupled (Binazadeh & Shafiei, 2016). Some parameter approximations in the modelling of these systems result in parametric uncertainty. Furthermore, some dynamics of the system may not be considered due to model simplification. In addition, the effect of external disturbances on mechanical systems is unavoidable. Authors of (Chavez Guzmán, Aguilar Bustos, & Mérida Rubio, 2015) have designed adaptive H ∞ controller for n-degree of freedom robot manipulator system in spite of external disturbances. This goal is achieved by exploiting compensators or pre-compensators of gravitational forces. Furthermore, the design of adaptive tracking H ∞ controller for the mobile robot has been studied in (Sato, Yanagi, & Tsuruta, 2011) based on inverse optimal control strategy.
One of the important approaches in controller design for mechanical systems is energy-based control (Valentinis, Donaire, & Perez, 2015;Yang & Xian, 2019). Energybased control laws are based on the stored energy in the system. The stored energy acts as the Lyapunov function and the nonlinear control methods which are based on the Lyapunov function may be applied in the energybased control.
The essential step in exploiting the energy-based Hamiltonian approach is to transform the system into a PCH model. This issue firstly was introduced in (Maschke & Schaft, 1992). Generally, this technique uses properties of the internal structure of the actual system in designing controllers and gives a relatively simpler controller with better performance.
In this regard, this paper considers the design of H ∞ controller based on the energy concept for n-degree of freedom mechanical systems to attenuate the effects of external disturbances and parametric uncertainties via an adaptive approach. The equations of the foresaid systems are considered in two cases. First, all parameters of the system are assumed to be known. In the second case, parametric uncertainties are considered in the system model. In both, disturbance inputs with bounded energies are considered. As the first step, system equations are transformed into PCH structure. Then, by utilizing the energy concept, H ∞ controllers are designed. The key contributions of this paper are summarized below.
• This paper studies the energy-based H ∞ control design for disturbance attenuation which is applicable to a broad class of mechanical systems. • The proposed approach has also a robust manner in the face of parametric uncertainties. • The adaptive control is combined with the energybased control to improve the robust performance in the presence of parametric uncertainties. • The proposed approach leads to relatively simpler controllers with better performance over the other robust control strategies.
Furthermore, the validity of the proposed approach is verified by using the simulation of a 2-link robot manipulator system.

Preliminaries
In this section, some necessary definitions are briefly reviewed.
Definition 2.1 (PCH system): (Ortega, van der Schaft, Maschke, & Escobar, 2002): If dynamic equations of a system could be written in the following structure, then it is called a PCH system: where x = [x 1 , · · · , x n ] T is the state vector of the system and J(x) is a skew-symmetric matrix (J(x) = −J T (x)), called the interconnection matrix. Moreover, H(x) is the Hamiltonian function which is the sum of kinetic and potential energies of the system, R(x) is a symmetric matrix known as damping matrix and g(x) is the input matrix. One of the main benefits of the PCH system is that its Hamiltonian function H(x) can be used as the Lyapunov function for the stability analysis of the systems.
Definition 2.2 (Finite-gain L p stability): (Khalil, 2014): A dynamic system with the input signal u and the output signal y is L p stable with a finite-gain, if there exist a positive constant γ and a nonnegative constant β such that the following inequality holds: the constant γ is the L p gain and ||y(t)|| L p = ∞ 0 ||y(t)|| p p 1 p , ||y(t)|| p p = i |y i | p where y i is the ith component of vector y. For p = 2, the above inequality represents the L 2 stability between the input u and the output y of the dynamical system and, γ is called the L 2 gain of the system.

Problem statement
In general, the motion equation of n-degree of freedom mechanical systems is considered as below (Ortega, Loria, Nicklasson, & Sira-Ramirez, 1998): in which q(t) = [q 1 , q 2 , . . . , q n ] T ∈ R n is the position vector,q ∈ R n is the velocity vector, M(q) = M T (q) > 0 ∈ R n×m is the inertia matrix, C(q,q) is the coriolis and centripental forces vector, B(q) ∈ R n is the potential forces vector, G(q) ∈ R n×m is the input coupling matrix and u ∈ R m is the applied torque vector. In fact, there exist a variety of systems with the structure of Equation (3) such as quadrotor (Zheng, Zhu, Zuo, & Yan, 2015), wheeled inverted pendulum (Delgado & Kotyczka, 2016) and many other mechanical systems.
In the presence of the time-varying external disturbances δ(t), the dynamical Equations (3) can be written as In this paper, the goal is to design an appropriate control law such that q andq converge to the desired values in spite of unknown energy-bounded disturbances. A tool to achieve this, is using the energy-based Hamiltonian concept. In this regard, it is necessary to transform the dynamical Equations (3) into the PCH structure, firstly.

Construction of PCH form for the nominal system
In this section, it is aimed to transform the nominal system (3) into the PCH form. The Hamiltonian function of the system (3) is where p ∈ R n is the inertia vector of the system and M −1 (q)p =q. Moreover, K(q, p) and V 0 (q) are kinetic and potential energies of the system, respectively and where M(q) and B(q) are introduced in (3).
The following lemma is employed in the procedure of constructing the PCH form.

Lemma 4.1 (Wang & Ge, 2008): Assume that
is a matrix function and α&β ∈ R n are constant vectors, then: where E n (i, j) ∈ R n×n is the so-called row-swap matrix operator and is obtained by swapping the ith row with the jth row of the identity matrix I n×n .
Based on Lemma 4.1, the following equation is obtained: Furthermore, taking the derivative of the Hamiltonian function with respect to p and considering p = M(q)q, one has It is concluded that: Taking the time derivative of (12) and considering the nominal system (3) gives the following equation: according to (7), Replacing this relation in (13) results in: with regard to (10), (11), the above relation can be rewritten as belloẇ where (11) and (15), one may write: u (17) by using properties of Kronecker product it is proved that K C (q, p) ≡ 0 (the details is given by Wang and Ge (2008)) If we define: then, relation (17) has the PCH form as follows: where

Design of nonlinear H ∞ controller for the nominal system
In this section, by using the PCH structure obtained in the previous section, an energy-based H ∞ controller is designed to attenuate the impact of disturbances on the output of the system. In other word, a control law is designed such that, if δ be an unknown disturbance input with finite L 2 norm, then L 2 norm of the output y stays bounded and there exists an attenuation ratio γ > 0 between L 2 norm of the disturbance input and output (refer to Definition 2.2). In this regard the following assumption is given: This is a common assumption for H ∞ disturbance attenuation in the dynamical systems which states the external disturbance vector is energy bounded for all t ∈ [0, ∞).
By considering the output of the system as where y ∈ R q and h(x) ∈ R q×m is a weighting matrix with full coloumn rank, then according to the PCH structure of the system (3), equations of system (4) can be written in the following PCH form: where g d = [0 I n ] T and R(x) = 0.
where ||y(t)|| 2 2 = y(t) T y(t) and in what follows the notation ||.|| = ||.|| 2 is assumed. The above relation is also called as H ∞ performance index. The task is the design of control law u(t) for the system (21) such that the H ∞ disturbance attenuation property is satisfied for the closed-loop system. In this regard, the following theorem is given and proved.
Theorem 5.1: For a defined disturbance attenuation ratio γ > 0, if the following inequality holds: in which K u ∈ R n×n is a positive-definite matrix, then if G be invertible the following control law satisfies the H ∞ performance index for the system (21): where Q is a positive-definite matrix. Moreover, g † c is the pseudo-inverse of g c .
Proof: Substituting control law (24) into the system Equations (21) and taking into account that g c G −1 (q) = 0 n×n G(q) G −1 (q) = 0 n×n I n×n , the closed-loop system equa- Considering the Hamiltonian function as the Lyapunov function candidate and taking its derivative along the trajectories of the closed-loop system (26), results in: whereas J(x) is a skew-symmetric matrix (J(x) = −J T (x)), as Q is assumed to be positive-definite, − 1 ∂x ≤ 0 and Equation (28) leads to the following inequality: According to the predefined output for the system (25), the relation (29) can be rewritten aṡ Considering that y T y = ||y|| 2 and by adding and subtracting 1 ∂x and γ 2 2 ||δ|| 2 to the right-hand side of (30), one getṡ The right-hand side expressions of inequality (31) can be grouped aṡ On the other hand, one has Considering (32) and (33), one may write: According to (23), the relation ≥ 0 holds. Since the first and the second expressions of the right-hand side of inequality (34) is non-positive, thus: Taking an integral on inequality (34) over the timeinterval [0, ∞) leads to: Since H(x) is a positive function and by assuming H(x(0)) = 0, the following inequality is obtained: Therefore, the H ∞ performance index (22) is satisfied for the closed-loop system. This completes the proof.

Remark 5.1: The convergence speed of the proposed control algorithm can be controlled by appropriate selection of the design matrices Q and K u .
In what follows, the designed controller (24) is applied to a practical system and the simulation results are presented.

Design of nonlinear H ∞ controller for 2-link robot manipulator
In this section, the effective performance of the proposed controller is evaluated by applying on a 2-link robot manipulator. The schematic of this system is shown in Figure 1.
Considering (4), q = [q 1 , q 2 ] T ∈ R 2 is the vector of angular positions which are shown in Figure 1. u = τ is the control torque and δ is the external disturbance. Furtheremore, other parameteres of system motion equation is given as bellow (see Ge and Harris (1998) for more details): M(q) = m 1 +m 2 + 2m 3 cosq 2m2 +m 3 cosq 2 m 2 +m 3 cosq 2m2 C (q,q) = −m 3q2 sinq 2 −m 3 (q 1 +q 2 ) sinq 2 m 3q1 sinq 2 0 B(q) = m 4 gcosq 1 +m 5 gcos(q 1 + q 2 ) m 5 gcos(q 1 + q 2 ) where m P is the mass of load, m 1 and m 2 are the mass of the first and second links, and l 2 are the length of the first and second links, l c1 (l c2 ) are the distance from the first (second) node to the first (second) link center of mass which is illustrated in Figure 1. Moreover, it is assumed that K u = Diag{k u1 , k u2 } > 0. If γ 2 > max{k u1 , k u2 }, then condition (23) of Theorem 5.1 is satisfied.
The time-responses of angular positions are shown in Figure 3. As seen, the proposed controller has a robust manner in the face of external disturbances and the angular positions move toward their desired values. The time responses of the applied control vector are also illustrated in Figure 4 where

Construction of PCH form in the presence of parametric uncertainties
In this section, it is intended to design a control law such that in addition to disturbance attenuation be robust against parametric uncertainties of the system. For this purpose, it is necessary to transform equations of the system with parametric uncertainty to PCH structure. Dynamic equations of a system with uncertainty is similar to (3). In this case, it is assumed that matrix B(q) contains unknown parameters.
Assumption 7.1: The unknown part of B(q) is linearly dependent to the unknown vector θ ∈ R l . In the other word, the matrix ϕ(q) ∈ R n×l exists such that: where B 0 (q) is the known separable part.
In this case, the Hamiltonian function of the system is considered as follows: in whichθ(t) is the estimated value of θ which will be obtained through the appropriate adaptation law. Moreover, K(q, p) and V v (q) represent the kinetic energy (defined in (6)) and the virtual potential energy of the system where V v (q) is defined as Furthermore, ∈ R l×l and ∈ R n×n are positivedefinite matrixes. The following pre-feedback law transforms system equations to the desired PCH structure:  with the following adaptation law: where K u ∈ R n×n is a positive-definit matrix and must be determined. Moreover, u is an additive control term and is designed in the following such that guarantees the satisfaction of the H ∞ performance index.
According to (40) and (41) and by applying Lemma 4.1: Furthermore, ∂H(q,p,θ) ∂p = M −1 p =q, thus p = Mq. Therefore, according to system Equations (3) and the relation (38), it is concluded that: By substituting the control law (42) into (45), the following relation is obtained: Since ∂H(q,p,θ) ∂θ = (θ(t) − θ), the above relation can be rewritten as follows: Considering the relation (47) beside the relationq = ∂H(q,p,θ) ∂p and the adaptation law (47), one may write in which: and similar to the previous discussion K C (q, p) ≡ 0. By defining: equations of system (48) by considering the parametric uncertainties in the model are obtained aṡ where It is obvious that J(x) = −J T (x) and R(x) = R T (x) ≥ 0.

Design of the energy-based adaptive H ∞ controller
In this section, by means of the achieved PCH structure in the previous section, a control law is designed for the system to attenuate the L 2 disturbances. The obtained PCH structure (51) by considering disturbance in the system changes to: The task is the design of control law u (t) for the system (53) such that H ∞ disturbance attenuation property is satisfied for the closed-loop system. In this regard, the following theorem is given and proved.
Theorem 8.1: For a defined disturbance attenuation ratio γ > 0, if the following inequality holds: Then, control law (55) leads to L 2 disturbance attenuation for the system (53): where Q is a positive-definite matrix.
Proof: Applying the control law (55) to the system (53) gives the following closed-loop equations: Choosing the Hamiltonian function of the system as the Lyapunov function candidate and taking its derivative along trajectories of system (56) yields to: ∂H(x) ∂x Since J(x) is a skew symmetric matrix, then ∂ T H(x) ∂x J(x) ∂H(x) ∂x = 0. therefore:  of the right-hand side of (63) are non-positive, thus, the following inequality is obtained: Taking an integral on both sides of (64) gives: since H(x) is positive-definite and by assuming that H(x(0)) = 0, the relation (65) leads to: Therefore, it is inferred that: which means that the H ∞ performance index is satisfied for the closed-loop system. This completes the proof.
In what follows, the effectiveness of the proposed adaptive controller in attenuation of external disturbances is shown through simulations.

Design of nonlinear adaptive H ∞ controller for 2-link robot manipulator
In order to investigate the performance of the proposed adaptive controller, simulations are taken on the previous 2-link robot manipulator. In this case, m p is considered as an unknown parameter and one has B 0 (q) = (m 1 l c2 + m 2 l 1 )gcosq 1 + m 2 l c2 gcos(q 1 + q 2 ) m 2 l c2 gcos(q 1 + q 2 ) ϕ(q) = l 1 gcosq 1 + l 2 gcos(q 1 + q 2 ) l 2 gcos(q 1 + q 2 ) and B(q) = B 0 (q) + θϕ(q) where θ = m p . Simulations are done by similar parameters and disturbance inputs (refer to Figure 2) as those considered in Section 6. The demanded performance of the proposed adaptive controller in moving the system to the desired angular position despite disturbance inputs and parametric uncertainty. Figure 5 shows the timeresponses of the angular positions. As seen the proposed energy-based control has a robust manner and the control goal is achieved in the presence of parametric uncertainty and external disturbances. The time-responses of control inputs are also illustrated in Figure 6.

Conclusion
This paper studied the energy-based H ∞ controller for n-degree of freedom mechanical systems. Two different cases were considered and two theorems were given to guarantee the disturbance attenuation and satisfication of the H ∞ performance index based on the Hamiltonian function. In the case of parametric uncertainties, the adaptive approach was also used to obtain a robust manner. Moreover, simulation results on a 2-link robot manipulator were provided to evaluate the performance of proposed controllers in attenuation of applied L 2 disturbances. Studying the proposed method based on output feedback or observer-based control are suggested for future works.

Disclosure statement
No potential conflict of interest was reported by the authors.