A Trajectory Tracking Control Based on a Terminal Sliding Mode for a Compliant Robot with Nonlinear Stiffness Joints

A nonlinear stiffness actuator (NSA) can achieve high torque/force resolution in the low stiffness range and high bandwidth in the high stiffness range. However, for the NSA, due to the imperfect performance of the elastic mechanical component such as friction, hysteresis, and unmeasurable energy consumption caused by former factors, it is more difficult to achieve accurate position control compared to the rigid actuator. Moreover, for a compliant robot with multiple degree of freedoms (DOFs) driven by NSAs, the influence of every NSA on the trajectory of the end effector is different and even coupled. Therefore, it is a challenge to implement precise trajectory control on a robot driven by such NSAs. In this paper, a control algorithm based on the Terminal Sliding Mode (TSM) approach is proposed to control the end effector trajectory of the compliant robot with multiple DOFs driven by NSAs. This control algorithm reduces the coupling of the driving torque, and mitigates the influence of parametric variation. The closed-loop system’s finite time convergence and stability are mathematically established via the Lyapunov stability theory. Moreover, under the same experimental conditions, by the comparison between the Proportion Differentiation (PD) controller and the controller using TSM method, the algorithm’s efficacy is experimentally verified on the developed compliant robot. The results show that the trajectory tracking is more accurate for the controller using the TSM method compared to the PD controller.


Introduction
Robots with flexible joints are a benefit to industry, rehabilitation, aviation, and marine exploration for their good interactive performance and security. Flexibility is usually divided into active flexibility and passive flexibility [1]. Active flexibility implies that the robot is rendered flexible through the control algorithm, despite the fact that its main body structure may still be rigid. Passive flexibility is introduced into the robot's design, either through physically compliant actuators, or via soft links. The structure of the elastic component is typically used to make the joint output display a predetermined, desirable flexible behavior. Different from series elastic actuators with constant stiffness springs and variable stiffness actuators with extra motor to adjust stiffness [2,3], the nonlinear stiffness actuator (NSA) was proposed in our group to improve its perceptivity and responsiveness to external loads, where the positional shape and the stiffness curve of the elastic element can be specifically designed [4,5]. However, addition of the elastic element might exacerbate the control problem. For example, friction, hysteresis and part of the energy consumed by the robot's nonlinear elastic components may not be accurately detected in real time. Also, the change of the moment of inertia of some components of robots during motion is TSM algorithm is compared with the traditional PD optimal parameter controller under the same experimental conditions, which verifies the feasibility of the TSM algorithm. This paper is organized as follows; the flexible-joint robot prototype's dynamical model is introduced in Section 2. Subsequently, the design of the Terminal Sliding Mode (TSM) controller is introduced in Section 3, while a stability analysis based on Lyapunov theory is presented in Section 4. Furthermore, experimental results are presented in Section 5, and a conclusion is provided in Section 6.

Brief Introduction of the Developed Compliant Robot with NSAs
The concept of NSA was proposed based on a common law of physical contact in natural phenomenon [4]. The stiffness of the NSA varies continuously and adaptatively with the external torque. To be specific, when the external torque is small, the NSA performs with a low stiffness; while when the external torque is large, the NSA performs with a high stiffness. This property makes the NSA achieve the high torque/force resolution in the low stiffness range and the high bandwidth in the high stiffness range. We not only fabricated a prototype of such actuator, we also built a 3-DOF compliant robot (diagrammed in Figure 1) with nonlinear stiffness joints in our laboratory. The details of NSA are presented in [4,32]. Figure 1 shows the 3D models of the developed 3-DOF robot including two rotations and one translation. The inner structure of the robot and working principle are therefore omitted in this work.
Micromachines 2022, 13, x FOR PEER REVIEW 3 of 14 the influence of parameter changes, and can deal with the irresistible interference of the system. The finite time convergence and stability of the control system are verified. The TSM algorithm is compared with the traditional PD optimal parameter controller under the same experimental conditions, which verifies the feasibility of the TSM algorithm. This paper is organized as follows; the flexible-joint robot prototype's dynamical model is introduced in Section 2. Subsequently, the design of the Terminal Sliding Mode (TSM) controller is introduced in Section 3, while a stability analysis based on Lyapunov theory is presented in Section 4. Furthermore, experimental results are presented in Section 5, and a conclusion is provided in Section 6.

Brief Introduction of the Developed Compliant Robot with NSAs
The concept of NSA was proposed based on a common law of physical contact in natural phenomenon [4]. The stiffness of the NSA varies continuously and adaptatively with the external torque. To be specific, when the external torque is small, the NSA performs with a low stiffness; while when the external torque is large, the NSA performs with a high stiffness. This property makes the NSA achieve the high torque/force resolution in the low stiffness range and the high bandwidth in the high stiffness range. We not only fabricated a prototype of such actuator, we also built a 3-DOF compliant robot (diagrammed in Figure 1) with nonlinear stiffness joints in our laboratory. The details of NSA are presented in [4,32]. Figure 1 shows the 3D models of the developed 3-DOF robot including two rotations and one translation. The inner structure of the robot and working principle are therefore omitted in this work. Although the rotational position of single NSA has been controlled well by building a new model of hysteresis and Proportion Integration Differentiation (PID) with optimized parameters, it is still very difficult to implement accurate trajectory tracking of the end-effector of the developed robot with several NSAs since the coupling influence of each NSA and friction depends on the robot's configuration. Based on the kinematics, the angles of three constituent joints can be calculated via inverse kinematics, in accordance with the desired trajectory. The three joints are then controlled in accordance with a timebased scheme.

Dynamic Model
The nonlinear stiffness drive model, according to [18], includes the power system, transmission system, elastic structure, and external load. The power system is the motor combination, which mainly includes the motor rotor and the gear reducer. The equivalent moment of inertia of the motor combination can be obtained from the dynamics model of the motor combination. The dynamic equations describing the motor rotor, reducer, and output shaft may be represented as follows according to Figure 2: Although the rotational position of single NSA has been controlled well by building a new model of hysteresis and Proportion Integration Differentiation (PID) with optimized parameters, it is still very difficult to implement accurate trajectory tracking of the end-effector of the developed robot with several NSAs since the coupling influence of each NSA and friction depends on the robot's configuration. Based on the kinematics, the angles of three constituent joints can be calculated via inverse kinematics, in accordance with the desired trajectory. The three joints are then controlled in accordance with a time-based scheme.

Dynamic Model
The nonlinear stiffness drive model, according to [18], includes the power system, transmission system, elastic structure, and external load. The power system is the motor combination, which mainly includes the motor rotor and the gear reducer. The equivalent moment of inertia of the motor combination can be obtained from the dynamics model of the motor combination. The dynamic equations describing the motor rotor, reducer, and output shaft may be represented as follows according to Figure 2: .. ..
where J r and b r are the moment of inertia and damping of the motor rotor, respectively; . θ r and .. θ r are the angular velocity and angular acceleration of the motor rotor, respectively; τ m is the torque generated by the motor rotor; τ r is the torque output by the motor rotor; J g and b g are the moment of inertia and damping of the motor reducer, respectively; .. θ g and . θ g are the angular velocity and angular acceleration of the motor reducer, respectively; R 1 is the reduction ratio; τ g is the torque output by the motor reducer; .. θ w and . θ w are the angular velocity and angular acceleration of the nonlinear stiffness drive, outer drum's output shaft, respectively; R 2 is the reduction ratio of the wire drive. Solving Equations (1)-(5) simultaneously can obtain: Micromachines 2022, 13, x FOR PEER REVIEW 5 of 14

TSM Controller
The terminal sliding mode controller is a kind of robust nonlinear controller which has an unfixed structure and avoids the influence of coupling parameters and disturbance, therefore, it is adopted as a main controller for our compliant with NSAs. In this paper, we designed a TSM mode for our robot and it is introduced as follows. It consists of three parts: the design of the switching function, whose purpose is to acquire a sliding mode surface that nullifies the position tracking error, preserves closed-loop stability, and achieves heightened control performance; the design of the approach law, such that it can rapidly reach the set interface, and ensure stability of the control system without chattering; the design of a control law that generates an input, which is capable of ensuring a stable output. The purpose of the terminal-based sliding mode control scheme designed is to achieve accurate end-effector trajectory tracking. According to this target task, the designed terminal sliding mode controller is shown in Figure 3, where it is assumed that the system's input is the desired end-effector trajectory. The sliding mode control law produces the torque required by the drive, which is then transmitted to the robotic system that in turn realizes the desired end-effector trajectory. The drive dynamics (Equation (9)) can be rewritten in the following manner: Then the equivalent dynamic Equation of the motor assembly and the elastic part is: where J eq = J r + 1 R 1 2 J g + J w R 1 2 R 2 2 is the actuator equivalent inertia, and b eq = b r + 1 The dynamic Equation of the outer cylinder part is: where J e and b e are the moment of inertia and damping of the external load, respectively; τ e is the output torque of the drive; .. θ e and . θ e are the angular velocity and angular acceleration of the external load, respectively.
It can be seen from the above formula that the dynamic Equation from the motor to the output shaft (without considering the external torque input) is:

TSM Controller
The terminal sliding mode controller is a kind of robust nonlinear controller which has an unfixed structure and avoids the influence of coupling parameters and disturbance, therefore, it is adopted as a main controller for our compliant with NSAs. In this paper, we designed a TSM mode for our robot and it is introduced as follows. It consists of three parts: the design of the switching function, whose purpose is to acquire a sliding mode surface that nullifies the position tracking error, preserves closed-loop stability, and achieves heightened control performance; the design of the approach law, such that it can rapidly reach the set interface, and ensure stability of the control system without chattering; the design of a control law that generates an input, which is capable of ensuring a stable output. The purpose of the terminal-based sliding mode control scheme designed is to achieve accurate end-effector trajectory tracking. According to this target task, the designed terminal sliding mode controller is shown in Figure 3, where it is assumed that the system's input is the desired end-effector trajectory. The sliding mode control law produces the torque required by the drive, which is then transmitted to the robotic system that in turn realizes the desired end-effector trajectory.

TSM Controller
The terminal sliding mode controller is a kind of robust nonlinear controller which has an unfixed structure and avoids the influence of coupling parameters and disturbance, therefore, it is adopted as a main controller for our compliant with NSAs. In this paper, we designed a TSM mode for our robot and it is introduced as follows. It consists of three parts: the design of the switching function, whose purpose is to acquire a sliding mode surface that nullifies the position tracking error, preserves closed-loop stability, and achieves heightened control performance; the design of the approach law, such that it can rapidly reach the set interface, and ensure stability of the control system without chattering; the design of a control law that generates an input, which is capable of ensuring a stable output. The purpose of the terminal-based sliding mode control scheme designed is to achieve accurate end-effector trajectory tracking. According to this target task, the designed terminal sliding mode controller is shown in Figure 3, where it is assumed that the system's input is the desired end-effector trajectory. The sliding mode control law produces the torque required by the drive, which is then transmitted to the robotic system that in turn realizes the desired end-effector trajectory. The drive dynamics (Equation (9)) can be rewritten in the following manner: The design procedure leading to creation of the terminal sliding-mode controller can be described as follows:  The drive dynamics (Equation (9)) can be rewritten in the following manner: The design procedure leading to creation of the terminal sliding-mode controller can be described as follows: By defining the desired position of the compliant robot system as θ exp , and the end effector trajectory output error as e = θ exp − θ e , the output error derivative variable can then be obtained as follows: Computing Equation (11)'s time derivative, and substituting it into Equation (10), yields the following expression: Based on the robotic system's error that is defined above, a switching function can then be designed (namely, the terminal sliding mode surface), as follows: e , α, β and χ are the system parameters for the switching function, which are all greater than zero, while 1 < γ < 2. According to the designed switching function, in order to make the system converge within a finite time, the design control rate is defined as: whereα,β and ρ are the approach law's design parameters, which are positive constants. The system's control law may then be designed as follows: θ e + J eq ..
In the actual application process, the terminal sliding mode controller, whose target task is the end-effector position tracking control, will encounter discontinuity problems due to the approach law's structure. In order to further suppress chattering effects, this paper adopts a type of saturation function. The saturation function's definition is the following: where δ > 0. In its current form, the trajectory tracking controller design based on terminal sliding mode control, is tailored to compliant robots with nonlinear stiffness actuators, small parametric changes.

Lyapunov Stability Analysis
Lyapunov stability theory is an effective method for analyzing control system stability. This paper provides a stability proof, for the purpose of corroborating the mathematical soundness of the proposed controller. In order to prove stability and convergence of the designed closed-loop system, the lemma described in [26] is introduced.

Lemma 1.
For any continuous, non-Lipschitz differential equation defined in the real field, an accompanying Lyapunov function's derivative must satisfy the relationship: That is, if the Lyapunov derivative function is negative semidefinite, then its convergence time can be obtained as follows: In accordance with this lemma, it is known that for any continuous non-Lipschitz function, the system is globally finite time stable, that is, for any given initial condition, the system state converges for a finite time and always remains stable. Additionally, the convergence time is related to the initial state value.
In order to prove stability of the closed-loop system considered herein, a candidate Lyapunov function is constructed as per the designed terminal sliding mode control system, in the following manner: Computing the derivative of the proposed Lyapunov function, yields the expression: Substituting Equation (19) into Equation (20), produces: Since . V ≤ 0, Equation (21) can be rewritten as follows: .
According to the lemma, the convergence time can be obtained via the expression: The above analysis reveals that the designed control system can converge within a finite time under given initial conditions, i.e., the control system is stable.
The control system designed in this paper should offer a certain level of robustness to slight variations of the moment of inertia, energy losses of the elastic component, and interference. To verify the aforesaid feature, a control system robustness analysis is carried out.
Considering the system's kinetic energy evolution, and slight variation caused by the moment of inertia, the dynamic equation can be rewritten as: ..
where ∆J e and ∆b e represent slight changes in moment of inertia and damping; τ dis and τ con represent the energy loss and external disturbance caused by the nonlinear elastic component's deformation, which satisfy the bounded convergence, then Equation (24) can be simplified as: . θ e + J eq ..
where D represents a combination of the slight changes of moment of inertia and damping, the energy loss term caused by the deformation of the nonlinear elastic element, and the total torque change caused by the external disturbance term. Usually, in the physical robotic system, disturbance of system parameters, and external interference, are inevitable. Equation (25) can therefore be rewritten as: . .
Considering external disturbance of the robotic system, and moment of inertia losses, the derivative of the switching function is expressed as follows: Thus, when considering external disturbances and moment of inertia losses, the robotic system's control law should be altered as follows: Substituting (28) into (27), yields the expression: .
By then expanding Equation (29), one can acquire the following formula: For the previously described scenario, in which moment of inertia variations and external disturbances are assumed, it can be known that s and D satisfy bounded convergence. After changing the parameters, Equation (30) can be rewritten in the following form: whereα andβ are the parameters of the reaching law that satisfies the condition in the case of interference. Hence, for the interference case, the Lyapunov derivative Equation may be represented as follows: .
thereby satisfying the condition: Thus, when the system is subjected to small changes in the moment of inertia and external disturbance values, the Lyapunov derivative Equation continues to be negative semidefinite, which in accordance with the lemma yields: Therefore, considering minimal variation of the moment of inertia and damping values, the energy loss term, and the external disturbance caused by deformation of the nonlinear elastic component, the designed compliant robot trajectory tracking terminal sliding mode controller, under the given initial conditions, can still converge within a finite time, thereby proving the system's robustness.

Experimental Results
In this section, the proposed control algorithm is tested on the robot prototype to evaluate its trajectory controlling performance. The control scheme's performance is then compared to that of a sensor-based, PD, trajectory-tracking controller, in order to prove feasibility and practical stability of the resulting closed-loop system, under the same experimental conditions.

Experimental Setup
The prototype of a compliant robot with nonlinear stiffness joints has been developed in our group which has three actuated DOFs shown in Figure 4. The HP host computer based on 64 bit windows-7.1 with Intel Core i7 processor @ 2.40 GHz and 8 GB ram is used to run the control algorithm. The CCS software is used to run the C language program code. The execution rate of the control algorithm is up to 1 kHz, which meets the requirements of the system to process data acquisition and control commands. The DSP board of TMS320F28335 produced by TI company is used to read and process the signal from the maxon motor encoder and transmit it to the host computer. The motor drive adopts an ESCON motor driver. In this paper, an ad electromagnetic tracking system (model: tradstar, produced by NDI company) is used to obtain the position of the end of the robot.
The prototype of a compliant robot with nonlinear stiffness joints has been developed in our group which has three actuated DOFs shown in Figure 4. The HP host computer based on 64 bit windows-7.1 with Intel Core i7 processor @ 2.40 GHz and 8 GB ram is used to run the control algorithm. The CCS software is used to run the C language program code. The execution rate of the control algorithm is up to 1 kHz, which meets the requirements of the system to process data acquisition and control commands. The DSP board of TMS320F28335 produced by TI company is used to read and process the signal from the maxon motor encoder and transmit it to the host computer. The motor drive adopts an ESCON motor driver. In this paper, an ad electromagnetic tracking system (model: tradstar, produced by NDI company) is used to obtain the position of the end of the robot.

Comparison Experiments in Single Joint
In order to verify the control system's feasibility, a trajectory tracking experiment is firstly carried out using a single joint, thereby attesting to the designed terminal slidingmode trajectory tracking control system's practicability. On this basis, the experiments are extended to the trajectory tracking control of the three-joint compliant robot's endeffector. The desired trajectory is set as exp 0.5sin(2 ) t θ = . To ensure fairness of the experiment and validity of the comparative analysis, experiments were performed using the same prototype, within the same condition, and the parameters of the PD controller were optimized. The trajectory tracking results of the compared TSM method and PD

Comparison Experiments in Single Joint
In order to verify the control system's feasibility, a trajectory tracking experiment is firstly carried out using a single joint, thereby attesting to the designed terminal slidingmode trajectory tracking control system's practicability. On this basis, the experiments are extended to the trajectory tracking control of the three-joint compliant robot's end-effector. The desired trajectory is set as θ exp = 0.5 sin (2t). To ensure fairness of the experiment and validity of the comparative analysis, experiments were performed using the same prototype, within the same condition, and the parameters of the PD controller were optimized. The trajectory tracking results of the compared TSM method and PD controller are shown in Figures 5 and 6. From Figure 5, the PD controller is also able to obtain a good performance of tracking a sinusoidal signal and the stabilized error is lower than 0.002 rad, even when strong nonlinear factors exist in this prototype. In Figure 6, TSM shows a better performance and the stabilized error is about 0.001 rad. The single-joint experiment results reveal that under identical conditions, trajectory tracking of the TSM controller designed in this paper exhibits heightened trajectory tracking performance, with smaller tracking error values and faster convergence times, in comparison to the PD controller because the nonlinear factor exists in a single joint introduced by friction and hysteresis. controller are shown in Figures 5 and 6. From Figure 5, the PD controller is also able to obtain a good performance of tracking a sinusoidal signal and the stabilized error is lower than 0.002 rad, even when strong nonlinear factors exist in this prototype. In Figure 6, TSM shows a better performance and the stabilized error is about 0.001 rad. The singlejoint experiment results reveal that under identical conditions, trajectory tracking of the TSM controller designed in this paper exhibits heightened trajectory tracking performance, with smaller tracking error values and faster convergence times, in comparison to the PD controller because the nonlinear factor exists in a single joint introduced by friction and hysteresis.

Comparison Experiments on the Prototype of 3 DoF Compliant Robot
Analyzing the single-joint, trajectory-tracking experiment results leads to the corroboration of the proposed terminal sliding mode trajectory control system's feasibility. In order to further test the efficacy of the TSM method to deal with the robot with multiple NSAs, a compliant robot end-effector trajectory-tracking experiment is performed. The designed referential trajectory entails a circular path in Cartesian space. This setting can cause significant joint parameter variations, and therefore provide a thorough controller performance validation. In order to make the experiments

Comparison Experiments on the Prototype of 3 DoF Compliant Robot
Analyzing the single-joint, trajectory-tracking experiment results leads to the corroboration of the proposed terminal sliding mode trajectory control system's feasibility. In order to further test the efficacy of the TSM method to deal with the robot with multiple NSAs, a compliant robot end-effector trajectory-tracking experiment is performed. The designed referential trajectory entails a circular path in Cartesian space. This setting can cause significant joint parameter variations, and therefore provide a thorough controller performance validation. In order to make the experiments convincing, the PD controller adopts optimized parameters to obtain the best parameters, and the pertinent comparative test results are displayed in Figures 7 and 8.   To further analyze the experimental data, the root mean square error is defined as follows: The analysis results of tracking errors along three axes are shown in Figure 9. It can be seen from these results that the tracking errors corresponding to the terminal slidingmode trajectory tracking controller is rather small. Moreover, it is observed that the proposed controller outperforms the traditional PD controller, in terms of trajectory-   To further analyze the experimental data, the root mean square error is defined as follows: The analysis results of tracking errors along three axes are shown in Figure 9. It can be seen from these results that the tracking errors corresponding to the terminal slidingmode trajectory tracking controller is rather small. Moreover, it is observed that the proposed controller outperforms the traditional PD controller, in terms of trajectory- To further analyze the experimental data, the root mean square error is defined as follows: The analysis results of tracking errors along three axes are shown in Figure 9. It can be seen from these results that the tracking errors corresponding to the terminal sliding-mode trajectory tracking controller is rather small. Moreover, it is observed that the proposed controller outperforms the traditional PD controller, in terms of trajectory-tracking accuracy, since its root mean square error value is 1.23 mm, which is smaller than the 2.37 mm value pertaining to the PD controller.

Conclusions
In the NSA, due to the imperfect performance of the elastic mechanical component, it is more difficult to achieve accurate position control compared to the rigid actuator. Moreover, for a compliant robot with multiple degree of freedoms (DOFs) driven by NSAs, the influence of every NSA on the trajectory of the end effector is different and even coupled. To perform accurate trajectory-tracking of the end effector on a compliant robot, a controller based on terminal sliding mode is designed. A stability proof is derived based on Lyapunov theory, which considers the application of the proposed control scheme onto the presented dynamical model. Moreover, the resulting closed-loop system's time convergence and its robustness are verified. The single-joint sinusoidal trajectory experiment, and the end-effector planar prototype trajectory experiment, are carried out under the same experimental conditions on a compliant 3-DoF robot with NSAs developed in our team, while the PD parameters are assigned with optimal values. These experiments verify the effectiveness and superiority of the proposed algorithm. In the future, the proposed algorithm will be applicable in compliant robots including industrial robots, wearable robots and exoskeletons.  In Figure 10, the tracking errors in every joint which has nonlinear stiffness property are given. The mean tracking errors of the first and the second are lower than 0.002 rad in both the PD controller and TSM controller, and it is obvious that the errors in the TSM controller is lower than the PD controller in rotational joint with nonlinear stiffness. For the third joint, in fact it is a translational joint which is driven by a cable-pulley mechanism, and its errors are larger than those in the other two joints because the driven structure is different where the cable connects two positions with a long distance in the third joint, which introduces vibration and flab. However, the mean errors of the TSM controller is also lower than those of the PD controller, which means the proposed method is also an effect in translational joint.

Conclusions
In the NSA, due to the imperfect performance of the elastic mechanical component, it is more difficult to achieve accurate position control compared to the rigid actuator. Moreover, for a compliant robot with multiple degree of freedoms (DOFs) driven by NSAs, the influence of every NSA on the trajectory of the end effector is different and even coupled. To perform accurate trajectory-tracking of the end effector on a compliant robot, a controller based on terminal sliding mode is designed. A stability proof is derived based on Lyapunov theory, which considers the application of the proposed control scheme onto the presented dynamical model. Moreover, the resulting closed-loop system's time convergence and its robustness are verified. The single-joint sinusoidal trajectory experiment, and the end-effector planar prototype trajectory experiment, are carried out under the same experimental conditions on a compliant 3-DoF robot with NSAs

Conclusions
In the NSA, due to the imperfect performance of the elastic mechanical component, it is more difficult to achieve accurate position control compared to the rigid actuator. Moreover, for a compliant robot with multiple degree of freedoms (DOFs) driven by NSAs, the influence of every NSA on the trajectory of the end effector is different and even coupled. To perform accurate trajectory-tracking of the end effector on a compliant robot, a controller based on terminal sliding mode is designed. A stability proof is derived based on Lyapunov theory, which considers the application of the proposed control scheme onto the presented dynamical model. Moreover, the resulting closed-loop system's time convergence and its robustness are verified. The single-joint sinusoidal trajectory experiment, and the end-effector planar prototype trajectory experiment, are carried out under the same experimental conditions on a compliant 3-DoF robot with NSAs developed in our team, while the PD parameters are assigned with optimal values. These experiments verify the effectiveness and superiority of the proposed algorithm. In the future, the proposed algorithm will be applicable in compliant robots including industrial robots, wearable robots and exoskeletons.