Precise torques and sliding mode compensation for trajectory tracking of manipulator with uncertainty

The control based on dynamic model could improve the dynamic performance of manipulators and obtain better control effects than the control based on kinematic model. As manipulators are complex online multivariable systems, there are various uncertainties in different environments and working conditions. Accurate dynamic parameters are difficult to obtain in practical engineering applications. In this article, a controller is designed by combining the precise control torques obtained by the analytical dynamics method with the compensation control torques obtained by sliding mode method for trajectory tracking of the manipulator with bounded uncertainty. Precise control torques obtained from the Udwadia–Kalaba modeling method could be applied for the control of the ideal manipulator tracking the desired trajectory. Compensation control torques obtained from the sliding mode concept and the Lyapunov stability theory could be applied to compensate the uncertainties of parameters and external disturbances, thus enhancing the robustness of the system. By combining precise control torques with compensation control torques, the end point of the manipulator with uncertainty could track the end of the ideal manipulator and then track the desired trajectory. The simulation results of the three-link manipulator with uncertainty show that the control method can make the controlled target approach the desired trajectory in relatively small torque ranges and obtain high stability accuracy, and the chattering is effectively reduced at the stage of approaching the sliding mode surface.


Introduction
With developments of robot technologies, robot manipulators have been widely used in many fields in recent years. The end points of robot manipulators tracking desired trajectories have become one of research hotspots, due to high accuracy requirements for the end points movement of robot manipulators in various tasks such as welding, handling, assembly, and measurement. 1,2 The control of manipulator based on dynamic model could give full play to potential of the system and improve 1 Beijing Institute of Aeronautical Materials, Beijing, China 2 School of Mechanical and Electronical Engineering, Heze University, Heze, China 3 Hong Kong-Zhuhai-Macao Bridge Authority, Zhuhai, China dynamic performances, so as to obtain a better effect than the control based on kinematic model. 3,4 At present, the dynamic modeling methods of manipulators mainly include vector mechanics based on momentum and analytical mechanics based on energy. The calculation processes of the dynamic equations constructed by the vector mechanics method are complex, and the constraint torques should be obtained. [5][6][7] When the analytical mechanics method, which is based on Lagrange theory, is used to deal with the nonholonomic constraint system, there are two ways to construct the robot dynamic equation. One is to form augmented dynamic equations by Lagrange multiplier, [8][9][10] and the other is to form reduced dimensional dynamic equations without multipliers by embedding constraints into the dynamic expressions. [11][12][13] The unique solution of Lagrange multiplier could be obtained only when the given conditions are met, and the solution process is relatively complex. 14 The Udwadia-Kalaba equation could be used for dynamic modeling to complex mechanical systems with constraints. It is relatively simple to establish and to solve system motion equations, 15 is relatively simple for the precise tracking and controlling of nonlinear systems, [16][17][18] and has been widely used recently. By the Udwadia-Kalaba equation method, some scholars have studied and discussed some problems in the modeling and control of the planar three-link manipulator, 19,20 the planar multi-link manipulator, 21 the dual-arm cooperating manipulators, 22 the manipulator with redundant degrees of freedom, 23 the SCARA manipulator, 24 and so on.
As manipulators are complex online multivariable systems, there are various uncertainties in different environments and working conditions. Accurate dynamic parameters are difficult to obtain in practical engineering applications. 25 Control effect of the common PID method is difficult to meet the needs of various tasks when applied to the trajectory tracking of manipulator with nonlinearity and uncertainty. Adaptive control [26][27][28] and robust control 29 are generally used to solve the problem. The adaptive control method is often combined with other control methods such as neural network, 30-32 genetic algorithm, 33 and fuzzy control. [34][35][36][37] Trying to ensure that the uncertain manipulator systems could work in optimal states. However, adaptive control often requires a large amount of calculation in identifying, learning, and adjusting parameters. H1 robust control method is often used to design fixed structures that depend on the worst case to ensure the control performance in the range of bounded instability, 38,39 so they are often too conservative.
As a robust method, the SMC (sliding mode control) technology is simple and easy, so it could be widely used in uncertain manipulator control. [40][41][42] Chattering is always an unsolved problem in sliding mode control. The boundary layer method, 43 terminal sliding mode, 44,45 the exponential reaching law method, 46 and the power reaching law method 47,48 can reduce the influence of chattering to varying degrees. However, the above methods have the advantages of reducing chattering, which will reduce the control accuracy or increase the approach time. Or the approach speed could be fast, but the chattering will be serious when approaching the sliding surface. Some scholars have constructed dynamic models of manipulators by the Udwadia-Kalaba method and introduced the sliding mode control method to discuss the control of manipulators. 49,50 However, their control processes do not apply the constraint torques, which were easy obtained in the dynamic modeling process, but linearize the nonlinear manipulator model. This article analyzes the tracking control problem of robot manipulator in the form of constrained motion based on the idea of analytical dynamics. Combining the modeling method of analytical dynamics with the concept of sliding mode, the required control torques are regarded as the constraint torques which are applied to the robot manipulator, and the controller is designed to track the trajectory of the end of the robot manipulator with uncertainties. The implementation of the control could be divided into two steps. Firstly, the dynamics model of manipulator, which parameters are assumed to be known, is constructed by using the dynamics equation modified with the Baumgarte stabilization method. The desired trajectory is tracked by the end of the ideal manipulator to meet requirements of specific tasks. Then, considering uncertainties exist in the manipulator system, and upper bounds of uncertainties could be known. The uncertainties compensation controller is designed by the sliding mode concept and the Lyapunov stabilization theory, so that the uncertain manipulator could track the ideal manipulator. Finally, the manipulator with uncertainty could be under the control.
The main contributions of this article are as follows. (1) Combining the calculated torque results obtained in the process of constructing the dynamic model of the ideal manipulator by using Udwadia-Kalaba method with the sliding mode control method, a controller for the manipulator with uncertainty is designed. (2) The proposed control method could directly compensate uncertainty in the manipulator from the acceleration level, which could be applied to the situation that the inertial performance of the manipulator (mass matrices and/or moment of inertia matrices) may be uncertain and time varying. (3) The desired trajectory is regarded as the constraint of the ideal manipulator, and the trajectory tracking problem is analyzed from the perspective of analytical mechanics. (4) The modeling method comes from analytical dynamics, which could obtain the minimum control cost at each instant time. No linearization and approximation methods are adopted in the controller design process, which usually deal with the dynamic model of the manipulator, so it has high tracking accuracy. (5) The proposed control method is compared with the exponential approaching sliding mode direct (EASMD) control method by numerical simulation, which shows that the proposed control method could make the controlled target approach the desired trajectory in a relatively small torque range and effectively reduce the chattering in the approaching stage.
The remainder of this article is organized as follows. In the second section, the modeling of the ideal manipulator by the Udwadia-Kalaba equation is described, the stability method of the ideal manipulator is introduced when its initial position does not satisfy the constraint equation, and mathematical models are provided for direct control and compensation control of the uncertain manipulator. In the third section, the design process of sliding mode compensation controller is given for trajectory tracking control of the uncertain manipulator, and structures of the proposed controller and the EASMD controller are given. In the fourth section, the simulation and experimental results are explained in detail through the three-link spatial manipulator. Some conclusions are drawn in the fifth section.

Dynamic modeling of ideal manipulator
The dynamics model of a typical robot manipulator with n serial links can be expressed by a second order nonlinear differential equation as where q 2 R n , _ q 2 R n , and € q 2 R n are vectors of the link position, velocity, and acceleration, respectively. M q ð Þ 2 R nÂn is the symmetric positive definite inertia matrix, C q; _ q ð Þ 2 R nÂn is the Coriolis and centrifugal force matrix, G q ð Þ 2 R nÂn is the vector of gravity term, and t 2 R n is the vector of control torque applied to the joints.
If joint torques of the nominal manipulator is t ¼ 0, the system has no external constraints, and the equation of manipulator dynamics can be described as where Q ¼ ÀC _ q À G is a generalized torque term for the system without additional constraint.
The working task of the proposed manipulator could be described as a form of constraint, and the trajectory constraint equation can be described as where F 2 R m is a differentiable equation. Assuming that F is sufficiently smooth, equation (3) could be differentiated twice with respect to t, and the constraint equation for acceleration level could be recorded as To make the manipulator equation (2) move follow the constraint described by equation (3), Udwadia and Kalaba 13 have deduced the optimal control solution Q c at each instant of time from the Gauss minimum constraint principle. After the constraint torque Q c is applied to the unconstrained manipulator equation (2), the dynamic equation of the manipulator can be rewritten as To satisfy the movement of the manipulator along the work constraint equation (3), the generalized constraint torque, which is required to apply on joints of the manipulator, is (6) denotes the Moore-Penrose generalized inverse of AM À1=2 .

Remark 1.
Udwadia and Kalaba have proved that the constraint torque Q c can meet the constraint requirements at each instant of time with the minimum control cost. 13 The desired trajectory can be tracked by the ideal manipulator based on control torque Q c . The generalized acceleration equation of the manipulator under constraint equation (3) is where q n 2 R n and _ q n 2 R n , respectively, denote vectors of position and velocity for the manipulator.

Remark 2.
Integrating equation (7) twice, the manipulator could track the given constraint trajectory through equation (3). However, the solution of equation (7) requires initial states of the manipulator to satisfy the constraint equation (3), which is often difficult to achieve in practical applications. In addition, q n and _ q n cannot be completely consistent with q d and _ q d obtained from the given constraint trajectories of equation (3) due to the influence of integral cumulative errors.

Constraint reconstruction of ideal manipulator
In the process of the ideal manipulator tracking desired trajectory, the initial conditions of the manipulator are required to meet the constraint equation, which is difficult to achieve in practical application. In addition, the numerical solution of acceleration level would inevitably produce violation errors. The control of violation errors could be realized by correction at the level of acceleration, speed, or position. 51 To make the manipulator move asymptotically from the initial state to the desired trajectory and suppress integral accumulative errors, the existing constraint equation (3) can be reconstructed by the Baumgarte constraint stability method 52 as . . . ; b m ð Þ denote Baumgarte feedback parameter matrices with diagonal form. The stability effect of constrained violation is closely related to the choice of violation stability parameters. 53 By choosing a i > 0, b i > 0, i ¼ 1; 2; Á Á Á ; m, then F approach 0 asymptotically. The constraint equation with the form equation (4) can be reformulated from equation (8) as The generalized constraint torque of the ideal manipulator system is The equation of generalized acceleration for the system is Remark 3. Under the action of torque Q cB , the manipulator can be constrained from its position to the given trajectory in the workspace, and integral errors are suppressed simultaneously.
Due to the inevitable uncertainty in the practical manipulator system, its accurate model deviates from the original mathematical model. In practical application, the control torque Q cB could not control the manipulator track the desired trajectory. Therefore, for the purpose of controlling the uncertain manipulator, it is necessary to add compensation control torque to make the end point of the uncertain manipulator track the trajectory of the ideal manipulator. As the ideal manipulator would asymptotically track the task trajectory, the uncertain manipulator system would also meet this requirement after applying the compensation control torque.

Manipulator model with uncertainty
Due to the uncertainties of parameters in the actual manipulators, there are deviations between the actual manipulators and the ideal accurate systems. The dynamic parameters of the manipulator with uncertainties can be recorded as where M a 2 R nÂn is the symmetric positive definite inertia matrix of the uncertain manipulator, Q a 2 R n is the vector of the uncertain manipulator system without additional constraints, DM is the matrix describing the uncertainty of inertial parameters, and DQ is the uncertainty vector in Q a .
The equation for the uncertain manipulator without constraint is By combining with equation (12), the dynamic equation can be written as where Remark 4. F can be used for the assembly of uncertainty in manipulator system, including parameters uncertainty, external environment interferences, and so on. F is assumed to be bounded, the upper bound is F U , and Taking f as an estimate of F. To compensate the uncertainty in the manipulator, the compensation control force Q u is applied to control the manipulator, so that making the manipulator track the trajectory of the ideal manipulator. The dynamic equation of the uncertain manipulator with external constraints can be described as q c 2 R n , _ q c 2 R n , and € q c 2 R n , respectively, denote vectors of position, velocity, and acceleration for the uncertain manipulator.
Substituting equation (12) into equation (15), the following equation can be obtained where Q s ¼ Q cB þ Q u . (16) is basic mathematical models for designing the trajectory tracking controller.

Sliding mode compensation controller
Based on the concept of sliding mode, the uncertain manipulator would follow the ideal manipulator to meet the desired trajectory tracking requirements according to equation (16). The generalized position tracking error between the uncertain manipulator system and the ideal manipulator is defined as e t ð Þ ¼ q n t ð Þ À q c t ð Þ and the tracking error in generalized velocity is defined as A sliding surface is defined as where Assuming l min is the minimum eigenvalue of M À1 , and letting is available for using. Following result could be obtained.
Result: The compensating control torque can be defined as where f c ¼ Àf 1 Àf 2 Á Á Á Àf n ½ T ,e is the boundary layer width of sliding surface, which could be defined by a user.
Proof. In the light of the Lyapunov function Differentiating equation (22) with respect to time, one has On differentiating equation (19) with respect to time Noting equations (7), (10), and (16), On substituting equation (26) in equation (23) Because M is positive definite matrix, M À1 is positive definite matrix. s T M À1 s ! l min js j jj 2 holds at all the time. Due to F is uncertain, f is taken as an estimated value of F _ V Àl min js j jj 2 s À1 Q u À l min js j jj 2 s À1 f þ H js j jj j_ e n j jj (28) On substituting Q u from equation (21) and equation (20) _ V ¼ À js j jj l min js j jjs À1 H j_ e n j jj l min s e À f c sgn s ð Þ þl min js j jjs À1 f À H j_ e n j jj 0 Therefore, the control of the uncertain manipulator can be carried out.
Remark 6. jÁ j jj denotes L 2 norm. The value of e in equation (21) is given according to the tracking requirements, and it is theoretically desirable to arbitrarily small to meet the allowable tracking error. In fact, if taking the value of e too small, it would lead to a large amount of computation.

Structure of proposed controller
Bring equation (10), equation (21) into equation (15), the block diagram of the proposed controller controlling the uncertain manipulator to track desired trajectory could be shown as Figure 1. The implementation of the control could be divided into two steps. Firstly, the dynamics model of the idea manipulator could be obtained by Udwadia-Kalaba equation. The modeling method comes from analytical dynamics, no linearization and approximation methods are adopted in the controller design process, so it has high tracking accuracy. Then considering uncertainties exist in the manipulator system, the uncertainties compensation controller is designed by the sliding mode method to suppress the influence of uncertainties.

EASMD controller
To illustrate characteristics of the proposed controller, an EASMD controller is designed for the uncertain manipulator to track the desired trajectory directly to compare with the proposed control method. The generalized position tracking error between the controlled manipulator system and the input desired constraint is defined as and the tracking error in generalized velocity is defined as The sliding surface is defined as where K ¼ diag k 1 ; k 2 ; Á Á Á ; k n ð Þ ; k i > 0. If the controlled actual manipulator is confined on the hyperplane s ¼ 0, the tracking error converges to 0. On differentiating equation (30) with respect to time Noting equations (16) and (31) Substituting equation (34) in equation (33) Defining the exponential convergence law Combining equation (35) with equation (36), it is can be obtained that Replacing F with f and substituting that into equation (37) On substituting equation (38) in equation (35) _ The direct control torque can be defined as where f c ¼ Àf 1 Àf 2 Á Á Á Àf n ½ T . The flow structure of the EASMD controller controlling the uncertain manipulator to directly track the desired trajectory could be shown as Figure 2.

Numerical example
The three-link spatial manipulator system A three-link spatial manipulator, as shown in Figure 3, is selected to analyze the proposed controller. In Figure 3, l iÀ1 is the length of the ith link, r iÀ1 is the distance from the gravity center of the ith link to the end of the joint, and q i is the generalized position.
Let s t ¼ sint,  Figure 2. The block diagram of the EASMD controller for the uncertain manipulator. EASMD: exponential approaching sliding mode direct. Parameters in the inertia matrix of left side of the equation are given by Parameters of the Coriolis forces and centrifugal forces matrix in the right side of the equation are given by Parameters of the gravity terms are given by where g is the acceleration term of gravity.

Tracking the desired trajectory by the ideal manipulator
It is assumed that the motion trajectory of the manipulator end point is a spatial circle. The coordinate of the circle center in the Cartesian coordinate system is (1,1,1), the radius of the circle is 0.5, and the normal vector of the circle plane is (1,1,1). Parametric equations of the circle can be expressed as The circle is the desired tracking trajectory for the manipulator system in the working process. From Figure 3 and forward kinematics of the manipulator, the positions mapping relations between generalized coordinates and Cartesian coordinates with origin of coordinates at the manipulator base can be obtained as Calculating the second derivative of equation (45) and equation (46) relative to time, respectively, and combine the results, constraint equations in the form of equation (4) could be obtained. The constraint equations can be further organized into form of equation (9). The ideal manipulator can track the desired trajectory based on equation (11).
Assume that the initial coordinate of the manipulator end point is 1; 1; 1 ½ , and the initial velocity is 0; 0; 0 ½ at time t ¼ 0. Structural parameters of the three-link spatial manipulator are shown in Table 1. The Matlab 2019a software platform is used to analyze the three-link spatial manipulator. Ode45, a variable step size integration method, is used for integral operation. The simulation time is set to 30s.
The parameters selection scope could be obtained by the system stability analysis method, and the Baumgarte feedback parameters could be optioned as a ¼ diag 10; ð 10; 10Þ, b ¼ diag 15; 15; 15 ð Þ . For details of the system stability analysis method, please refer to the work by Lyu and Liu. 53 The simulation results of the ideal manipulator tracking the desired trajectory are shown in Figure 4.
As can be seen from Figure 4, The control torques could drive the end of the manipulator from the outside of desired trajectory to the desired trajectory gradually, and the tracking accuracy is sufficient to meet the needs of the manipulator in performing general tasks. 2. In the initial stage, the control torques all with relatively large and dramatic changes is the process of driving the ideal manipulator end point from the initial position to the desired trajectory. 3. It is assumed that the uncertainty and external interference of the manipulator could be uniformly written as f ¼ 0:2sin 6t ð Þ 0:3cos 7t ð Þ 0:5 ½ T . The upper bound of uncertainty is F U ¼ ½ 0:2 0:3 0:5 T . The movement of the end point of the   manipulator with uncertainty tends to disorder with the increase of time. Therefore, the compensation control torque Q u is required to make the uncertain manipulator track the trajectory of the ideal manipulator and then track the desired trajectory.  Figure 6(a) to (d), respectively, show the results of torques which applied on three joints of the manipulator under different initial conditions by using the sliding mode reaching law direct control method, and the lower figures in Figure 6(a) to (d), respectively, show the results of torques which applied on three joints of the manipulator under different initial conditions by using the proposed control method.

Tracking control of the uncertain manipulator
According to Figures 5 and 6, the performance analysis results of the proposed controller and the EASMD controller for the uncertain manipulator to perform each given task are shown in Table 2.
According to Figures 5, 6, and Table 2, 1. Both the proposed controller and the EASMD controller could make the uncertain manipulator approach the desired trajectory from the initial conditions which incompatible with the constraints and finally stabilize to the desired trajectory. 2. If the proposed controller and the EASMD controller stabilize the end point of the uncertain manipulator to the desired trajectory, control torques of each joint are stable within their respective ranges. 3. The proposed method could obtain smaller stable tracking error interval with relatively smaller control torques, that is, higher control accuracy. 4. After the parameters are selected, the time that the EASMD controller makes the end point of the uncertain manipulator approach the desired trajectory is a fixed value, and the time that the proposed controller makes the end point of the uncertain manipulator approach the desired trajectory is related to the distance between the initial condition and the desired trajectory and the original attitude of the manipulator. 5. In the approach stage, the control torques variation ranges of the proposed controller are much smaller than that of the EASMD controller, which is more conducive to be applied to the practical manipulator. That is, the chattering is effectively reduced

Conclusions
A control method of trajectory tracking based on precise control torques and sliding mode compensation is presented for the manipulator system with uncertainty. The analytical dynamics equation, which is processed by the Baumgarte constraint stabilization method, is used to obtain the precise control torques of the ideal manipulator tracking the desired trajectory. Then the additional control torques to compensate the uncertainty in the manipulator are obtained based on the concept of sliding mode. The presented method shows that the analytical dynamics method can be used to stably and accurately control the uncertain manipulator, instead of using linearization and/or approximation methods by control theory. The control torques can be obtained directly in the closed-form expression, the related calculation time cost can be neglected, so that it can be applied in real time. The numerical simulation of a three-link spatial manipulator shows that the method is simple and easy to implement. The response and treatment of the proposed controller in the case of limited upper bounds of the joint torques, gradually increase the environmental uncertainty and other inevitable situations in the actual operation of the manipulator, have not been discussed in the research. The next research will focus on the treatment of other problems that may be encountered in the application of the actual manipulator, as well as the experimental research of the proposed controller in the actual manipulator.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article. [À5.8,