1. Introduction
Electromechanical and robotic systems are most currently used in Euler-Lagrange equations. In this formalism, canonical coordinates such as position and velocity are used to develop control. Historically, the Hamiltonian approach has its roots in analytical mechanics and starts from the principle of least action, and proceeds, via the Euler-Lagrange equations and the Legrende transform, towards the Hamiltonian equations of motion. On the other hand, the network approach stems from electrical engineering and constitutes a cornerstone of mathematical systems theory. While most of the analysis of physical systems has been performed within the Lagrangian and Hamiltonian framework, the network point of view is prevailing in the modeling and simulation of (complex) physical engineering systems. Several authors approached the formulation of Hamiltonians for the control of mechanical systems in the phase space using matrix algebra and tensor calculus [Reference Aguilar-Ibáñez, Moreno-Valenzuela, García - Alarcón, Martinez-Lopez, Acosta and Suarez-Castanon.1–Reference Wanxie, Zhigan and Shujun5].
A first attempt to model electromechanical and robot systems using Hamiltonian equations was just for 2 degree of freedom (DOF) [Reference Ortega, van der Schaft, Maschke and Escobar3, Reference Ortega, van der Schaft, Castanos and Astolfi6]. For a geometric approach, Hestenes [Reference Hestenes7] and Abou El Dahab [Reference Abou El Dahab8] and Pappas [Reference Pappas and eds.)9] for the formulation of Hamiltonian mechanics used the geometric algebra framework and show the extension of the invariant formulation for rigid-body mechanics and in Hestenes [Reference Hestenes10] to a phase space formulation for systems of linked rigid bodies. In the article [Reference Bayro-Corrochano and Osuna-Gonzáles11], we present in detail the screw theory, moments and wrenches for Newton–Euler dynamic modeling, and control and quadratic programming-based tracking of robots. The geometric constraints for the quadratic programming are designed using the conformal geometric algebra framework. This paper has a tutorial value for self-study on the Newton–Euler dynamic modeling.
The interest in design stabilization and follow-up controllers for Hamiltonian systems has grown in recent years. Many researchers use passivity as a tool, see Romero et al. [Reference Romero, Ortega and Sarras12], Yaghmeaei and Yazdanpanah [Reference Yaghmeaei and Yazdanpanah13], and Reyes-Baez et al. [Reference Reyes-Baez, Van der Schaft and Jayawardhana14]. The idea to use a structure is to take advantage of its properties and be able to guarantee better results, as in the case of robotics, see, for example, Kelly et al. [Reference Kelly, Santibánez and Loriá15] or in general Euler–Lagrange systems in Ortega et al. [Reference Ortega, Loria, Nicklasson and Sira-Ramirez16].
In the last decades, researchers presented different approaches to solve the problem for systems with port-Hamiltonian structures. Fujimoto et al. [Reference Fujimoto, Sakurama and Sugie17] proposed to design an error system employing canonical transformations generalized to convert the problem to one on stabilization. However, same as the interconnection and injection of damping (IDA-PBC) (Ortega et al. [Reference Ortega, Van Der Schaft, Maschke and Escobar18]), the method requires the solution of a partial differential equation (PDE) to perform these transformations. Moreover, it is not an easy task to design a follow-up controller that preserves the port-controlled Hamiltonian structure (PCH) in the closed loop. This is because for the energy function to transform, it must be variant in time, which implies that the passivity property is not fulfilled in general and requires a stabilization technique for Hamiltonian systems through time-variants controllers (Fujimoto and Sugie [Reference Fujimoto and Sugie19]).
Following the results of Fujimoto et al. [Reference Fujimoto, Sakurama and Sugie17], Mulero-Martinez [Reference Mulero-Martinez20] presented a strategy of control for robot manipulators represented by the port-Hamiltonian structure utilizing canonical transformations and control based on passivity, proposing a new modification methodology of energy through the introduction of nonhomogeneous virtual fields which allow obtaining standard laws of control for robot manipulators such as the PD controller with gravity compensation (PD+) or the PD controller with pre-compensation (PD with feed-forward).
In Dirksz and Scherpen [Reference Dirksz and Scherpen21], an adaptive control is combined with canonical transformations to build control, which is then applied to port systems Hamiltonians. A follow-up control that preserves closed-loop PCH structure is shown by Donaire et al. [Reference Donaire, Perez and Bartlett22], where global asymptotic stability is verified in the error system whose equilibrium point is the origin. To improve robustness in control, the law of control is extended with the addition of the integral action to cancel constants disturbances exploiting the procedure proposed by Donaire and Junco [Reference Donaire and Junco23]. In a different approach, Romero et al. [Reference Romero, Ortega and Sarras12] combined a passivity-based controller with a new observer of immersion and invariance.
Our paper deals with the modeling and control of robotic manipulators, where the robot dynamics are described by employing Hamiltonian mechanics. This way leads to different physical descriptive quantities used in control design. In this paper, the model-oriented Lyapunov-based control is considered. It is introduced in the novel formulation using Hamiltonian mechanics and compared with the use of a conventional controller. The theoretical results, generally applicable to usual articulated industrial robotic manipulators, are demonstrated on a planar 2 DOF robot arm and a spherical pendulum of 4 DOF.
The contribution of this work consists of the following: we compute the Hamiltonians, dynamics, and applied controllers using screw theory in motor algebra. By using the recursive Newton–Euler dynamics, we can compute the Hamiltonians for each joint. There is no paper in the literature where the authors show that they can compute Hamiltonians at each joint for more than 2 DOF. Thanks to the screw theory, it is possible to compute recursively the Hamiltonian and the dynamics for each joint for robot manipulators of n DOF. As a result, we can apply local controllers to each joint. In the experimental analysis, using simulations, we compute via the Newton–Euler dynamics and the Hamiltonians for a planar 2 DOF robot arm and for a spherical pendulum of 4 DOF. We apply and compare four controllers: Bang–Bang, PD, basic sliding modes, and integral sliding modes together with super-twisting. We show that the sliding-mode-based controllers diminish chattering and reject matched perturbations.
The organization of this paper is as follows: Section 2 gives a brief introduction to motor algebra. Section 3 explains the concepts of screw lines, twists, and momenta and the Lie bracket and co-bracket. Section 4 presents the Lagrangian and Hamiltonian formalisms. In Section 5, we explain the dynamics of $n$ -robot links and their local Hamiltonian mechanics on phase space using the geometric algebra framework. In Section 5, we explain the dynamic of $n$ robot links. In Section 6 using screw theory, the iterative Newton–Euler algorithm is introduced to compute locally at each joint the dynamic and its Hamiltonian. Section 7 is devoted to the experimental part comparing the controllers: Bang–Bang, PD, and sliding modes, which are formulated in the phase space. Section 8 presents the conclusion.
2. Motor algebra
For a gentle introduction to geometric algebra see ref. [Reference Bayro-Corrochano24]. The word motor is an abbreviation of “moment and vector.” Clifford introduced motors with the name bi-quaternions [Reference Clifford25]. Motors are isomorph to dual quaternions with the necessary condition $I^2=0$ , by dual quaternions $\epsilon ^2=0$ . They can be found in the special 4D even subalgebra of $G_{3,0,1}$ . This even subalgebra is denoted by $G^+_{3,0,1}$ and is only spanned via a bivector basis, as follows:
This kind of basis allows us to represent spinors, which are composed of scalar and bivector terms. A motor represents a special kind of rotor. Because a Euclidean transformation includes both rotation and translation, we will show below that a motor involves both rotation and translation transformations. But first, we must show the relationship between motors and screw motion theory.
Note also that the dual of a scalar is the pseudoscalar $I$ and that the duals of the first three basis bivectors are the following three bivectors $(e_2e_3)^*=e_2e_3I=e_4e_1$ .
2.1. Motors, rotors, and translators in $\textbf{G}^+_{3,0,1}$
Since a rigid motion consists of the rotation and translation transformations, it should be possible to split a motor multiplicatively in terms of these two transformations, which we will call a rotor and a translator. The equation of a rotor in its Euler representation for a rotation with an angle $\theta$ is given by
where $\boldsymbol{n}$ is the unit 3D bivector of the rotation axis spanned by the bivector basis $e_2e_3$ , $e_3e_1$ , $e_1e_2$ , and $a_c$ , $a_s$ $\in \mathbb{R}$ . A 3D translation in motor algebra is defined by $\boldsymbol{T}_c=1+I\dfrac{\boldsymbol{t}_c}{2}$ and called a translator. If we apply a translator from the left to rotor $\boldsymbol{R}$ , and then apply the translator’s reversion from the right, we get a modified rotor,
Since a motor is applied from the left and conjugated from the right, we should use the half of $\boldsymbol{t}_s$ in the spinor expression of $\boldsymbol{T}_S$ when we define the motor in its Euler representation
2.2. Properties of motors
A general motor can be expressed as
where $\alpha \in \mathbb{R}$ and $\boldsymbol{M}$ is a unit motor, as explained in the previous sections. In this section, we will employ unit motors. The norm of a motor $\boldsymbol{M}$ is defined as follows:
where $\widetilde{\boldsymbol{M}}$ is the conjugate motor and 1 is the identity of the motor multiplication.
Now we can show that the combination of two rigid motions can be expressed using two consecutive motors. The resultant motor describes the overall displacement, namely,
3. Screws, twists, and momenta
The dynamic motor equation is given by
Assuming that the screw motion of the body is constant through time, the dynamic motor Eq. (8) can be integrated to give
This represents a motor that rotates with a constant-frequency rotation in the right-hand sense and has a constant linear velocity as well.
Having described finite motion in terms of motors to represent the Lie group of rigid motion $SE(3)$ , the logical question of infinitesimal motions or the velocities arises. These are described by elements of the Lie algebra $se(3)$ . There are two most useful interpretations to describe the relation between $SE(3)$ and $se(3)$ , one as the tangent vectors to the identity element or another as the set of left-invariant vector fields on the group.
3.1. Twists
From Eq. (9), one can derive the spatial velocity or twist $\boldsymbol{s}$ as follows:
where the angular-velocity bivector $\boldsymbol{\omega}$ is the dual of the linear-velocity bivector $\boldsymbol{v}$ .
3.2. Momenta and wrenches
The affine transformation via the matrix $\textbf{N}$ of the twist $\textbf{s}$ yields the momentum which written using $6\times 1$ vectors reads
where $\boldsymbol{I}$ is the pseudoscalar, $\texttt{I}$ is the inertia, m is the mass, and $\it I$ is the 3 $\times$ 3 identity matrix. Note that inertia matrix ${\texttt{N}}$ acts as a dualizing matrix.
The kinetic energy of the body is given by an inner product of the momentum co-twist and the twist
The time derivative of a twist $\boldsymbol{s}$ is the bivector acceleration $\dot{\boldsymbol{s}}$
and for ${\texttt{N}}$ time invariant, the time derivative of a momentum $\boldsymbol{\wp}$ is the wrench $\boldsymbol{w}$ , namely
where $\boldsymbol{\tau}$ and $ \boldsymbol{f}$ stand for the bivectors torque and force, respectively. This equation of the wrench written using $6\times 1$ vectors reads
The inner product between the wrench and the twist is a scalar
The significance of the wrench is that it can be used to represent the momentum of a rigid body, and similarly, they can describe the action of a wrench on a rigid body, that is, a torque/force bivector.
Finally, the group action on the twist and wrenches using motors are given by
3.3. Lie bracket
Consider the twist $\boldsymbol{s}_j$ attached to a $j$ -joint of a moving rigid body; as a function of the time, the equation of an infinitesimal motion in terms of an instantaneous velocity twist $\boldsymbol{s}_i$ is given by
where $\boldsymbol{s}_i= \boldsymbol{\omega} _i+I \boldsymbol{v}_i$ and $\boldsymbol{s}_j= \boldsymbol{\omega} _j+I \boldsymbol{v}_j$ . Differentiating and setting $t=0$ , we get the action of $\boldsymbol{s}_i$ on $\boldsymbol{s}_j$ , namely
where $[\boldsymbol{s}_i, \boldsymbol{s}_j]$ is known as the Lie bracket of $\boldsymbol{s}_i$ and $\boldsymbol{s}_j$ . Since this result does not depend on where the measurement time begins, in general for two instantaneous twists $\boldsymbol{s}_i$ and $\boldsymbol{s}_j$ we can write
3.4. Lie co-bracket
In general for instantaneous twist $\boldsymbol{s}_i$ and wrench $\boldsymbol{w}_j$ , we can write
Note that a co-bracket can be expressed in terms of a Lie bracket as follows, since a wrench is $\boldsymbol{w}_j= N(\boldsymbol{s}_j)$ then
4. Lagrangian and Hamiltonian formalisms
Hamiltonian mechanics was first formulated by William Rowan Hamilton in 1833, starting from Lagrangian mechanics, a previous reformulation of classical mechanics introduced by Joseph Louis Lagrange in 1788.
The Euler–Lagrange equation of an electromechanical or robot systems is given by [Reference Craig26]
where $M(\theta )$ , $C(q,\dot{q})$ , $G(q)$ , and $\tau$ stand for the inertia matrix, Coriolis matrix, the gravity, and the torque, respectively.
The Lagrange’s equation for electromechanical or robot systems is given by
where $L$ is the Lagrangian of the system that is computed as the difference between the kinetic and potential energies as follows:
The generalized momentum is defined as
The Hamiltonian of canonical coordinates i is given by
The partial derivation with respect to $p_i$ gives the first Hamilton equation
To compute the second equation, it is necessary to take the partial derivation of Eq. (27) with respect to $q_i$ :
Using the Legendre’s transformation, the Hamiltonian of canonical coordinates of Eq. (27) is transformed to the Hamiltonian in the phase space
Taking the derivative of Eq. (30), we get
henceforth
Using Eqs. (24, 26, 30), we obtain
Now taking Eqs. (24, 32, 33), the derivative of the momentum reads
Similarly,
so
Eqs. (34, 36) are known as the Hamilton’s equations.
In an autonomous system, it is possible to represent the Hamiltonian and the Lagrangian equations as follows:
From Eqs. (34, 38), one obtains
So considering Eq. (26) and the Euler–Lagrange Eq. (23), one can derive
where the velocity $\dot{\theta }$ is transformed affine to the momentum via the inertia matrix $I(\theta )$ , thus the velocity is
The kinetic energy in terms of coordinates reads
so using Eq. (40 ), it can be written in terms of the moment
5. Dynamics of $\textbf{n}$ robot links
In this section, first the Newton–Euler algorithm for the computing of dynamics is explained. Next, we show the iterative computing of the local Hamiltonian and the derivative of the momenta.
5.1. Newton–Euler recursive algorithm for dynamics
Selig [Reference Selig27] formulated an iterative algorithm using screw theory but in terms of vectors and matrices. In this work, the Newton–Euler for $n$ links robots is easily formulated as an iterative algorithm using screw theory in the motor algebra framework $G_{3,0,1}^+$ .
Let us show the equations for N = 5, first, we write the equation of motion for each link, and then we can conveniently group them.
These equations can be rearranged as we did with the two-link robot, namely
where the velocity screw or twist $\boldsymbol{s}_j$ at the $\{1,2,\ldots,5\}$ -link is computed as follows:
The accelerations at each link are computed taking the time derivative of the velocities $\boldsymbol{s}_i$
The momentum is computed as follows:
According to Eq. (46), a $i$ -wrench is computed as follows:
Pairing each Eq. (46) with its respective screw line $\boldsymbol{L}_i$ to get rid of the reaction wrenches, we get the five joint torques as follows:
Since the wrench due to the gravity on the $j$ -link is a force acting on the link’s center of mass, considering that the $z$ -axis of the coordinate system is parallel to the gravity vector, the gravity wrench can then be written as
Considering the following screw:
one can show that the gravity screw $\boldsymbol{G}_j$ can be expressed in terms of the inertia matrix ${\texttt{N}}$ as follows:
Using this result, one can write the equations of motion even in a more compact manner as
Note that the use of the Newton–Euler iterative algorithm makes it easy to compute the local Hamiltonians of more complex robot systems as n DOF robot arms or n-DOF inverted pendulums.
5.2. Iterative computing of the local Hamiltonian and the derivative of the momenta
The next equations are derived according to Eqs. (24–34). The local Lagrangian $L_i$ of the robot manipulator at the $i$ -joint can be computed as the difference between the kinetic and potential energies as follows:
The momenta $p_i$ is defined as
The Hamiltonian of canonical coordinates at the $i$ -joint is given by
Using the Legendre’s transformation, the Hamiltonian of canonical coordinates of Eq. (58) is transformed to the Hamiltonian in the phase space at the $i$ -joint
Taking the derivative of Eq. (59), we get
henceforth
Using Eqs. (24, 57, 59), we obtain
Now taking Eqs. (33, 56, 61), the time derivative of the $i$ -momentum reads
Thus using these last equations, we can compute iteratively locally at each joint of the robot manipulator the wrench $\boldsymbol{w}_i$ Eq. (50), torque $\tau _i$ Eq. (51), the Hamiltonian $H(\theta _i,p_i)$ Eq. (59), and the time derivative of the $i$ -momentum $\dot{p}_i$ Eq. (63). These equations computed by the Newton–Euler iterative algorithm are presented in the next subsection. Moreover, we will use the computed time derivative of the $i$ -momentum to derive a local decentralized controller in terms of a screw theory.
6. Recursive computing of Hamiltonians for n DOF robot Mmanipultors
The Lagrangian of the system is defined as the difference between the kinetic energy $T$ and potential energy $V$ .
The total Hamiltonian of the system shown in Fig. 1(a) is computed via the Legendre transformation as follows:
For the Bang–Bang control, one requires to compute $n$ Hamiltonians and $n$ control signals $u_{j}$ for each DOF of the system. The $n$ Hamiltonians are computed as follows:
The sum of the Hamiltonians $H_j$ gives the total Hamiltonian of the system.
The recursive Hamiltonians should fulfill the condition $H_{j}(0)=0$ . The Hamiltonians are functions of the control $u_{j}$ for each DOF $H_{j}(p_{j},q_{j},u_{j})$ . The computed Hamiltonian depends on the control signal $u_{j}$ and then applying the maximum Pontryagin principle one gets two Hamiltonians a maximum and a minimum. Thus, one obtains 2 $n$ Hamiltonian, $n$ are maximums and $n$ are minimums.
For the Bang–Bang control, all the control signals are
where $q_{j_{ref}}$ is the reference for the control related to each DOF $q_{j}$ , and the error $e=q_{j}-q_{j_{ref}}$ .
On can use the Newton–Euler recursive method of Subsection 5.1 to easily compute the Hamiltonians $H_j$ at each joint of any DOF robot manipulator
This method can be applied for the case of $n$ -D spherical pendulums shown in Fig. 1(b), which have in each joint 2 DOF. Since each joint has 2 DOF, each Hamiltonian $H_j$ is related with two angles $\phi _{j}$ and $\theta _{j}$ , thus one split the Hamiltonian $H_j$ in the other two Hamiltonians.
In total, one gets for the system $2n$ Hamiltonians.
7. Experimental analysis
In this section, we study the application of localized controllers derived using the local Hamiltonian Eq. (59) and local derivative momenta Eq. (62) for robot systems. The used localized controllers are the PD, slide modes, and Bang–Bang controllers. Since this work focuses on the control of spherical or serial robot manipulators, we cover the most important structures of robot arms. For the comparison, we used three well-known controllers, this is enough to validate the modeling and control using the motor algebra framework.
7.1. Bang–Bang control for a 2 DOF robot manipulator
Using the Newton–Euler iterative algorithm, we can compute the tensors of the Euler–Lagrange state equation with control signals as follows:
where
Furthermore, using the Newton–Euler iterative algorithm of subsection (5.1), we can compute inward for each joint the following local Hamiltonians using generalized coordinates:
Since the $H_1(0)=0$ and $H_2(0)=0$ , Eq. (76) becomes
A control algorithm that checks for the process variable exceeding or falling below the set point is called on/off control. This kind of control is also known as Bang–Bang control because the manipulated variable output of the controller rapidly changes between fully on and fully off involving no intermediate state. It has been shown that Bang–Bang control usually provides imprecise control of the process variable. In this work, we applied control only to revoluted joints. A rotation unit is geometrically speaking a dual of a prismatic joint because for the modeling of its rotation one uses rotors for revoluted joints and translators for the prismatic joints, thus it is possible to apply Bang–Bang control to prismatic joints.
In this work, Bang–Bang control is applied in a localized manner at each joint using the local Hamiltonians similar to in the state Eq. (75). These control signals $u_i=\pm 1, i=1,2$ switch between the scalar functions of $H_1$ and $H_2$ .
Applying in Eqs. (80-82) the maximal principle of Pontryagin and setting the angle references $\theta _{1_{ref}}=20^o$ and $\theta _{2_{ref}}=30^o$ and $u_i=\pm 1, i=1,2$ for the switching in the Hamiltonians so that the Hamiltonians reach the zero value, we obtain the following equations:
where $u_1=$ if $H_{12}\gt H_{11}$ then -1 else 1 and
where $u_2=$ if $H_{22}\gt H_{21}$ then -1 else 1. The control signals $u_i=\pm 1, i=1,2$ switch between the Hamiltonians $H_1$ and $H_2$ surfaces. Figure 3 shows the control signals and the error figures to reach a reference point. Note that even though that the controllers reach the references, they keep switching very rapidly between $\pm$ 1.
7.2. PD and sliding mode controller for a 2 DOF robot manipulator
Before constructing the law of control, it is necessary to compute Hamilton’s equations in the screw theory framework. The Hamiltonian on the phase space can be computed using Eqs. (25, 27) as follows:
where $\boldsymbol{S}_i$ is the twist $\boldsymbol{s}_i$ written as a 6 $\times$ 1 vector and the momentum ${{\textbf{P}}}_i$ is a 6 $\times$ 1 vector as well.
According to Eq. (63), the derivative of the momenta at $i$ -joint is
A serial robotic system will track a desired smooth function applying the following decentralized PD law of control:
where $\widetilde{p}_i={p_d}_i-p_i$ is the error between the desired momentum and the measured momentum and $\widetilde{\theta }_i={\theta _d}_i-\theta _i$ is the error between the desired joint position and the measured joint position and ${K_p}_i,{K_v}_i \in \mathbb{R}^+$ .
A robotic system will reach the home position by applying the following decentralized sliding modes law of control:
where $\{\boldsymbol{S}_i,N_j{ L}_i\}=N_j\left [\boldsymbol{S}_i,{ L}_i\right ]$ and in each joint, $\mathcal{S}_i=-\sum _{j=i}^{n}{ L}_i^T N_j\boldsymbol{S}_j+\widetilde{\theta }_i$ is the sliding surface and $K_i,{K_{\mathcal{S}}}_i \in \mathbb{R}^+$ .
Consider the two-link manipulator with revolute joints illustrated in Fig. 2. In addition, the manipulator link lengths are $l_1$ and $l_2$ , and the link masses are $m_1$ and $m_2$ , where these masses are concentrated at the end of each link.
The dynamic of the proposed robot is computed using (55). Hence, the dynamic of each joint can be written as the following:
Considering $V_1=L_1 \dot{\theta }_1$ and $V_2=L_1 \dot{\theta }_1+L_2 \dot{\theta }_2$ . Thus, the accelerations are constructed by
Taking the previous accelerations $(\dot{V}_1,\dot{V}_2)$ and velocities $(V_1, V_2)$ into (92) and (93), the dynamic of the robot can be written as follows:
7.2.1. PD controller
Given the state variables $x_1,x_2 \in \mathbb{R}^2$ , where $x_1=\left (\theta _1,\theta _2\right )^T$ and $x_2=\left ( \dot{\theta }_1,\dot{\theta }_2 \right )^T$ , the closed-loop system can be represented using Eq. (90) as follows:
where
To simulate the results of the example, it is necessary to implement the parameters in Table I with ${K_p}_1,{K_p}_2=150$ and ${K_v}_1,{K_v}_2=50$ . The simulations were conducted using the Euler integration method, with a step size of $0.001 s$ . The initial conditions were selected as $x_1(0)=x_2(0)=0$ and the desired values as ${\theta _d}_1=20^{\circ },{\theta _d}_2=30^{\circ }$ . Hence, the results of the example are presented in Fig. 4.
7.2.2. Sliding mode controller
Suppose $x_1,x_2 \in \mathbb{R}^2$ , where $x_1=\left (\theta _1,\theta _2\right )^T$ and $x_2=\left ( \dot{{\theta }}_1,\dot{{\theta }}_2 \right )^T$ . Then, the closed-loop system using Eq. (91) can be represented by
where
To simulate the results of the example, it is necessary to implement the parameters in Table I with $K_1,{K}_2 = 1$ and ${K_{\mathcal{S}}}_1,{K_{\mathcal{S}}}_2 =50$ . The simulations were conducted using the Euler integration method, with a step size of $0.001 s$ . The initial conditions were selected as $x_1(0)=[45^{\circ },10^{\circ }]^T$ and $ x_2(0)=[0,0]^T$ . Using the sliding mode controller [Reference Utkin, Guldner and Shi28], we carry out a tracking experiment. Moreover, it is necessary to take care with the adjustable gains because a small variable cannot easily converge to the position for the case of different robots. Therefore, it is important to adjust the gain depending on the application.
Figure 5(a) and (b) presents the evolution of the angles and angular velocities of the two joints during the tracking. These experiments show that our sliding mode controller performs very well in both stability and tracking. Figure5(c) and (d) shows how well the sliding mode controller manages the 2 DOF robot arm to follow a nonlinear curve.
7.3. Bang–Bang control for a 4 DOF double spherical pendulum
The Lagrangian associated with the double spherical pendulum is given by
where
The motion equations can be obtained from the Lagrangian of the double spherical pendulum
As we showed in the previous example of the double pendulum by applying the V.M. Yepez theorem, it is extremely difficult to compute the Hamiltonian for manipulators of more than 2 DOF. This shows that it is better to compute the Hamiltonian of the system via the Legendre transformation and in a local manner apply the V.M. Yepez theorem.
For the double spherical pendulum, the Hamiltonian of the system is given by
Based on the Hamiltonian of the 4 DOF of the system, we can derive four Hamiltonians for each DOF which are obtained using the Newton–Euler recursive algorithm explained in Subsection 5.1, so the computed Hamiltonian $H_j$ at the j-join is
The computed four Hamiltonians are
One applies the maximum principle of Pontryagin to $H_{1}$ , $H_{2}$ , $H_{3}$ y $H_{4}$ to obtain two Hamiltonians a maximum and a minimum for each function, resulting then in eight Hamiltonians, where one has to impose the condition $H_{j}(0)=0$ . The motion equations are obtained from the system Hamiltonians of the double spherical pendulum including the Bang–Bang control.
Figure 7 shows the control signals and the error figures to reach a reference point. Note that even though the controllers reach the references, they keep switching very rapidly between $\pm$ 1.
7.4. Sliding mode controller for a 4 DOF double spherical pendulum
Consider the two-link manipulator with four revolute joints as illustrated in Fig. 6. The manipulator link lengths are $l_1$ and $l_2$ , and the link masses are $m_1$ and $m_2$ , where these masses are concentrated at the end of each link.
The Newton–Euler iterative algorithm is based on Eq. (55), accordingly the resulting wrench at each is given by
To formulate the sliding-mode-based control, first, we require to represent in state variables the dynamics of the robot arm. This procedure is an extension as presented for the 2 DOF robot arm of Subsection 7.2. We use Eq. (55) and extend Eqs. (100)–(101) of the 2 DOF manipulator to the 4 DOF double spherical pendulum. To simplify the equation, we gather all the terms in matrices as follows:
where $M$ is the inertia matrix, $C$ is the Coriolis and centripetal matrix, $G(x)$ is the gravity vector, $\tau$ is the actuating torque vector, $x$ is the vector state corresponding with the angular displacement of each joint, and $\dot{x}$ and $\ddot{x}$ are the first and second derivatives of the state vector corresponding to the velocity and acceleration, respectively. The relation between the Hamiltonian and the Euler–Lagrange equations can be established by using the Legendre’s transformation as mentioned in Subsection 4.
Using the previous Eq. (118), the space state model for the angular displacements and their velocities of the joints is defined as follows:
where $x_1 = [\phi _1, \theta _1, \phi _2, \theta _2]^\top$ and $x_2 =[\dot{\phi }_1, \dot{\theta }_1, \dot{\phi }_2, \dot{\theta }_2]^\top$ are the state variables (angular displacements and velocities, respectively), $f(x_1,x_2)= -M^{-1}(x_1) \left ( C(x_1,x_2)x_2 + G(x_1) \right )$ , $B(x_1,x_2) = M^{-1}(x_1)$ , $u = \tau$ the signal control laws.
Since the purpose of the controller is to track trajectories, if we define the tracking error as $e_1 = x_d-x_1$ and using (119-120), the error system is described as
Because the system can contain uncertainties attributed to parametric variations, unmodeled dynamics, and external disturbances, it is necessary to add a term that contains these uncertainties, so our error system is redefined as
where $h(x_1, x_2, t)$ satisfies the matching condition [Reference Utkin, Guldner and Shi28]. Besides, $h(x_1, x_2, t)$ must be bounded by known positive defined scalar functions such that
Once the error system model of our robotic system is obtained, we proceed to design the law of control. The law of control is defined as
where $u_0$ is computed using the inverse dynamic algorithm [Reference Spong, Hutchinson and Vidyasagar29] for the nominal system and $u_1$ is an integral sliding mode control algorithm that deals with external disturbances and parametric variations.
First, we describe $u_0$ as follows:
where $a_d$ is the desired dynamics that will be designed later.
Substituting the control law $u_0$ (124) in the second equation of the error system (122), we have the following:
which cancels the internal dynamics. To ensure the tracking of the references, we then define $ a_d$ as follows:
where $x_d$ , $\dot{x}_d$ y $\ddot{x}_d$ are the position, velocity, and acceleration references, and $K_p$ y $K_d$ are $4 \times 4$ matrices. Then, the error system with $u_0$ is proposed as follows:
A simple way to design the gain matrices $K_p$ and $K_d$ is
which, leaving aside the term $h(x_1, x_2, t)$ , results in a decoupled closed-loop system, where each response of each joint is equal to the response of a critically damped second-order system with natural frequency $\omega _i$ , which determines the velocity response of the joints, or equivalently, the decay rate of the tracking error.
It is noteworthy that to compute $u_0$ , the inverse dynamics can be calculated using the Newton–Euler algorithm described in Section 5. To deal with the term $h(x_1, x_2, t)$ , which includes parametric variations and disturbances of the system, the control law $u_1$ is designed by using the integral sliding mode algorithm as mentioned above. This algorithm presupposes the existence of a previously designed controller for the nominal plant (without disturbances), $u_0$ , adding to this existing controller a discontinuous term to force the occurrence of sliding modes and thus obtaining a response as if the plant was the nominal system with its closed-loop controller, despite external disturbances and parametric variations of the system.
For $u_1$ , we define the sliding surface
where $\sigma (x)=Ce_1+e_2$ and $z$ is the integral term that will be determined later. Then, if we derive (130) and substitute (122) and (123) in the result, we have
and defining
Eq. (131) reduces to
Now it is necessary to propose the control law $u_1$ , which will be designed using the super-twisting algorithm
Substituting previous Eq. (134) in (133), the dynamics of the sliding surface is described as
It is possible to probe that the dynamics of the sliding surface is globally asymptotically stable [Reference Moreno and Osorio30] with certain conditions of gains $\alpha _1$ and $\alpha _2$ . With the explained control above, it will be achieved that the control $u_1$ rejects the disturbance $h(x_1, x_2, t)$ , that is, $B(x_1, x_2)u_1=-h(x_1,x_2,t)$ and even more, achieve the error system has the form
which is equivalent to the nominal system with control signal $u_0$ . It should be noted that $u_0$ was designed such that the nominal system tracks the desired references.
In order to show the performance of the proposed controller, two simulation experiments were developed. The parameters for the two-link manipulator are the same as described in the previous section. The values of the parameters of the controller used are as follows: $\alpha _1 = \textrm{diag}(3,3,1.5,1.8)$ , $\alpha _2 = \textrm{diag}(0.3,0.3,0.3,0.3)$ , $C = \textrm{diag}{1,1,1,1}$ , $K_p = \textrm{diag}(25,25,25,25)$ , $K_d = \textrm{diag}(10,10,10,10)$ .
For the first simulation experiment, the reference is described as $x_d = \left[\dfrac{\pi }{12},\dfrac{5\pi }{36},\dfrac{\pi }{6},\dfrac{\pi }{9}\right]^T$ , which corresponds to fixed point in the space.
Figure 8 shows the double pendulum reaching a 3D point. It shows the control signals, the states, and angles evolution as their errors. Compared with the Bang–Bang control of the previous subsection, the integral sliding modes with super-twisting diminish chattering and reject matched perturbations.
Figure 9 shows the results for tracking a nonlinear trajectory. It shows the control signals, the states, and angles evolution as their errors. The integral sliding modes with super-twisting diminish chattering and reject matched perturbations.
8. Conclusion
In this work, the authors show the importance of the Hamiltonian in control theory. Instead of using the Lagrangian formulation of electromechanical or robotic systems, our work is focused on robot dynamics by its Hamiltonian. We compute the Hamiltonians, dynamics, and applied controllers using screw theory in the motor algebra. By using the recursive Newton–Euler dynamics, we can compute the Hamiltonians for each joint. Thanks to the screw theory, it is possible to compute recursively the Hamiltonian and the dynamics for each joint for robot manipulators of n DOF. As a result, we can apply local controllers to each joint.
In the experimental analysis, using simulations, we compute via the Newton–Euler dynamics and the Hamiltonians for a planar 2 DOF robot arm and a spherical pendulum of 4 DOF. We apply and compare four controllers: Bang–Bang., PD, basic sliding modes, and integral sliding modes together with super-twisting. We show that the sliding-mode-based controllers diminish chattering and reject matched perturbations. In future work, we will continue to relate geometric algebra and nonlinear control. We will develop observers ad new nonlinear controllers using the motor algebra framework and conformal geometric algebra.
Compliance with ethical standards
This study was funded by Mexican Conacyt Grant A1-S-1042.
Conflict of interest
The authors declare that they have no conflict of interest.
Authors participation
All authors have contributed in an equal manner to the elaboration of the article.