A Novel Adaptive Sliding Mode Controller for a 2-DOF Elastic Robotic Arm

Collaborative robots (or cobots) are robots that are capable of safely operating in a shared environment or interacting with humans. In recent years, cobots have become increasingly common. Compliant actuators are critical in the design of cobots. In real applications, this type of actuation system may be able to reduce the amount of damage caused by an unanticipated collision. As a result, elastic joints are expected to outperform stiff joints in complex situations. In this work, the control of a 2-DOF robot arm with elastic actuators is addressed by proposing a two-loop adaptive controller. For the outer control loop, an adaptive sliding mode controller (ASMC) is adopted to deal with uncertainties and disturbance on the load side of the robot arm. For the inner loops, model reference adaptive controllers (MRAC) are utilised to handle the uncertainties on the motor side of the robot arm. To show the effectiveness of the proposed controller, extensive simulation experiments and a comparison with the conventional sliding mode controller (SMC) are carried out. As a result, the ASMC has a 50.35% lower average RMS error than the SMC controller, and a shorter settling time (5% criterion) (0.44 s compared to 2.11 s).


Introduction
Cobots are primarily passive robots that are meant to work alongside humans in close proximity. In our daily life, cobots assist humans in numerous situations, such as in search and rescue (SAR) missions [1], surveillance and inspection [2], medical support [3], etc. One aspect that sets cobots apart from traditional robots is their capacity to reduce the amount of damage caused by unexpected collisions in a dynamic collaborative working environment. This ability can be achieved in a variety of ways, including the use of force/torque sensors [4], elastic actuators, or a collision detection algorithm, without modifying the physical configuration of the robot [5]. As it is efficient and low-cost, adopting elastic actuators is one of the most common approaches. Elastic actuators provide several advantages compared to rigid actuators, including the ability to filter shock loads and facilitate force regulation. The major goal of using elastic actuators to control robots is to increase the performance of tracking tasks for the joints. Elastic actuators, on the other hand, have a lower force control bandwidth; hence, their position control is slower than stiff actuators. Furthermore, with elastic actuators, uncertainties and disturbances in the system might create oscillation and instability.
To address these challenges, the following contributions are presented in this study: • An adaptive control mechanism is proposed to deal with the controlling task of a 2-DOF elastic robot arm. The control mechanism has two loops. The outer loop is an adaptive sliding mode controller (ASMC) to deal with uncertainties and disturbances on the load side of the robot arm. The output of this loop is the desired angular position of the motors. The inner loop consists of the model reference adaptive controllers (MRAC) to stabilise the motor side of the robot arm; • Extensive simulation experiments and a comparison with the conventional sliding mode controller are conducted to demonstrate the effectiveness of the proposed controller.
The following is a breakdown of the paper's structure. Section 2 provides an overview of relevant studies. The mathematical model of the considered 2-DOF robot arm with elastic actuators is described in Section 3. Then, the proposed controller is presented in Section 4. To verify the efficiency of the controller, related simulation results are outlined in Section 5. Finally, conclusions and future works are discussed in Section 6.

Related Research Work
Elastic actuators and elastic robots are applied in various applications, which are summarised in Table 1. In Reference [6], NASA Valkyrie [7], a humanoid robot with series elastic actuators, is applied for deployment in improvised explosive devices (IEDs) response. In Reference [8], a series-elastic actuated snake robot is proposed, which is able to navigate in pipe bends and junctions. Elastic actuators are also adopted in rehabilitation robots [9][10][11]. Table 1. Applications of elastic actuators.

Type of Robots Humanoid Robot Snake Robot Rehabilitation Robot
Applications NASA Valkyrie [7] COMAN [12] POAL [13,14] RiceWrist [9] ULIX [10] rotary SEA [11] There is much research related to the control algorithm of elastic actuators and elastic robots. One of the earliest pieces of research utilises feed-forward terms and a proportional integral derivative (PID) control loop [15]. In Reference [16], by combining the adaptive back-stepping and the dynamic surface control techniques, an adaptive fuzzy output feedback control approach is developed. In Reference [17], a cascade robust control mechanism is introduced. The robustness is proved by L2-gain attenuation from the disturbance caused by uncertainties to performance for the outer loop, and by Lyapunov's second method for the inner loop. In Reference [18], the synthesis of robust controllers, based on H ∞ loop shaping and µ-synthesis for both position control and vibration damping in a spatial flexible L-shape mechanism with gravity, is proposed. In [19], a feedback control law and an observer are proposed based on the finite-element method and model reduction. Regarding robustness, among the methods of control, a sliding mode controller (SMC) is a simple approach, which exhibits stability against parameter variations, unmodelled dynamics and external disturbances [20]. In [21], a hierarchical non-singular terminal SMC is proposed, which can ensure a faster convergence rate of the systems states to zero within a finite time and is singularity free. In Reference [22], a voltage-based SMC is proposed, which has a low computational volume. Despite the inherent advantages of robustness compared to the disturbances, the performance of SMCs can be affected by changing the system parameters [23]. Therefore, adaptive sliding mode controllers (ASMCs) are also commonly considered. In Reference [24], the adaptive fuzzy sliding mode controller is proposed to stabilise the attitude of the flexible satellite. In Reference [25], a fuzzy adaptive sliding mode-based feedback linearisation controller is proposed. A feedback linearisation approach is utilised to change the nonlinear dynamics to a linear dynamics; then, a sliding mode control strategy is implemented as a trajectory tracking controller. A fuzzy system is applied to regulate the controller gains. In Reference [26], a voltage-based sliding mode controller is combined with an adaptive estimator. However, a controller that can deal with uncertainties at the load side and the motor side at the same time is still missing.
To address these challenges, our research group previously presented a two-loop feedback controller [27]. Then, in Reference [28], we compared this controller and a reinforcement learning algorithm. Then, in Reference [29], we implemented the controller on a two DOFs robot arm with elastic actuators. However, to the best of our knowledge, an adaptive control aiming to both stabilize the system and deal with uncertainties to eliminate the influence of external force/torque has not been released. In Reference [30], we started our research on this aspect and presented some preliminary results. In this paper, we extended our research by presenting more simulation experiments. We also made a comparison with the conventional sliding mode controller to show the effectiveness of the proposed algorithm.

Mathematical Model of the 2-DOF Elastic Robot Arm
The mathematical model of the 2-DOF robot arm with elastic joints is introduced in this section.
The diagram of the 2-DOF robot arm with elastic joints is shown in Figure 1. Based on this diagram, the Denavit-Hartenberg (DH) parameters are shown on Table 2, where d is the offset along the z-axis to the common normal, θ is the angle about the z-axis, from the old x-axis to new x-axis, a is the length of the common normal, and α is the angle about common normal, from old z-axis to new z-axis.
Denote q = [q 1 q 2 ] T and θ = [θ 1 θ 2 ] T as the load side and the motor side angular positions, respectively. The elastic robot arm in this paper is modelled as a two-side system: the load side system and the motor side system. They are attached to each other by the torque of the spring. The dynamic equations of the robot arm are shown in Equations (1) and (2): where M(q) is the mass matrix, C(q,q) is the Coriolis and centrifugal torque matrix, G(q) is the gravitational torque vector, K s is the diagonal matrix of spring stiffness, J is the inertia matrix of the motors, τ ext is the external torque, and τ m is the motor torques. The dynamics of the load side and motor side are presented in Equations (1) and (2), respectively. Equation (1) has the form of a typical robotic dynamic model. The difference is that, instead of the motor torque, the load side is controlled by an elastic force K s (θ − q). This elastic force is created from the motor torque by creating a deviation between motor (θ) and load (q) angular positions. This is shown in the Equation (2).

Controller Design
In this Section, the proposed control algorithm is presented. The diagram of the proposed controller is shown in Figure 2. The proposed controller has two loops. In the outer loop, the centralised ASMC is implemented to tackle uncertainties and disturbances. In the inner loop, there is one MRAC for each joint to stabilise the motor side. The MRAC was presented in our previous papers [27,29]. Firstly, the conventional sliding mode controller is established. Rewrite Equation (1) as follows: The tracking error is defined as: The sliding surface is defined with the PID form as: in which, , K i2 > 0 as design parameters that need to be suitably tuned so that the characteristic polynomials are strictly Hurwitz [31][32][33]. This ensures that, in the slidingmode phase, lim t−>∞ e(t) = 0 and the system is globally asymptotically stable. The integral term added to the standard PD sliding surface has the effect of eliminating the steady-state error and modifying the reaching time [31,32]. Take the time-derivative of the sliding surface: Denote the control input of the sliding surface in reaching phase as u. Then, the nominal control signal of the sliding mode controller, the desired motor position θ d , is defined as:σ Next, the adaption law is presented. Although it has many advantages, the conventional sliding-mode controller can not be directly implemented because the real system matrices are unknown. Therefore, an adaptation law is proposed using Lyapunov stability criteria. DenoteÂ(q,q),B(q) as the estimated parameter matrices and rewrite Equation (4) as: Substituting Equation (5) into Equation (3), we have: are estimated and real system dynamics matrices, respectively, and Denote ∆ Φ as the deviation between the real system dynamics matrix Φ * and the estimated system dynamics matrix Φ: Then, Equation (6) is as follows: A Lyapunov function is chosen as: Taking the derivative of the Lyapunov function, we have: The time derivative of inertia matrix can be ignored if it is small enough [34]. If the adaption law is chosen as:∆ with α as a 2-by-2 matrix of constants; then,V becomes as follows: The following assumptions are made: Assumption 2. We can find a matrix α such that B(q) −1 α − I ≈ 0 The matrices B(q) −1 and ∆ Φ contain trigonometric functions and bounded physical parameters. Therefore, the Assumption 1 is acceptable. In addition, because the matrix B(q) −1 is bounded, the Assumption 2 can be satisfied through system parameter estimation and further tuning of the matrix α. From the Assumption 2,V becomes: Selecting the control input u is a crucial step in designing ASMC. The fundamental control input is the first-order one u = −Usign(σ), with U as a positive number. Nevertheless, this can cause chattering phenomenon. This phenomenon is the reason for the low control accuracy, high wear of moving mechanical parts, and high heat losses in power electronic boards, as well as the electrical motors [35]. High-order sliding mode control signals were proposed to deal with this [36][37][38]. Although these control signals are able to maintain the sliding mode properties and eliminate the chattering problem [35], more information is demanded by the controller [38]. An r-order sliding-mode controller requires derivatives of the sliding surface up to order r [38]. On the other hand, the "super-twisting" second-order sliding controller, introduced by Levant [37,39], only requires the measurements of the sliding surface. Therefore, the "super-twisting" second-order sliding controller is chosen in this work. This control input is presented as follows: where U is a positive constant, which should be sufficiently large to assure good tracking performance. The termu 2 = −1.1Utanh(σ) describes the leakage of the "super-twisting" second-order sliding controller [40]. In addition, the tanh(σ) is used instead of sign(σ) because it creates a smoother control signal. By adopting the "super-twisting" second-order sliding algorithm, the term uσ T + σ T u is negative definite [35,41]. Thus, the adaptive system is stable.
In adaptive controllers, disturbances and uncertainties can lead to the parameter drift phenomenon, where the estimated parameters gradually drift before suddenly diverging sharply. To tackle this, a dead zone [42] is added to reduce the influence of the parameter drift phenomenon, therefore increasing the stability of the whole system. This is achieved as follows:∆ There are four parameters that need to be tuned in the proposed approach, namely, K p , K i , α and U. A discussion on the effect of these parameters and how to tune them is presented here. K p and K i constitute the sliding surface and affect the convergence of the error. Generally, K p has a role as the proportional gain of a traditional PID controller [43]. Choosing an appropriate value of K p would make the system stable [43]. If the value of K p is too large, the system may be destabilised, and if the value of K p is too small, the system may converge sluggishly [43]. The integral gain K i affects the rates of error integration. In addition, K p and K i have to be chosen such that the characteristic polynomials with s as the variable in the frequency domain, are strictly Hurwitz [31][32][33]. Many methods have been adopted to choose the parameters for the sliding surface. In this paper, the trial-and-error method is used. Alternative methods are also applied in the literature, e.g., the Ziegler-Nichols method [44], particle swarm optimisation [44], evolutionary algorithms [45], etc.
The parameter α could be chosen such that the Assumption A2 (that is B(q) −1 α − I ≈ 0) is satisfied. In practice, the values in matrix B(q) −1 can be obtained from the design or the values can be measured. In addition, the angular load positions q have to be operated within a predefined range. Therefore, we can easily estimate the range of matrix B(q) −1 and use that to choose the values in α. The value of parameter U is chosen by trial and error. The larger the value of U, the better the tracking performance. However, if the value of U is too large, it could destabilise the system.

Simulation
In this Section, simulations implemented in matlab simulink [46] to verify the efficiency of the proposed controller are presented. Figure 3 shows the simulation diagram. Two low-pass filters are added at the input side of the system to smooth the input signal. The simulation parameters are shown in Table 3. The parameters of the proposed approach are shown in Table 4. In addition, to clarify the effectiveness of the proposed controller, it is compared with a conventional SMC-MRAC scheme. Two input signals are used: sine wave and square wave. Furthermore, simulations in disturbed conditions are also presented. There are two types of simulated disturbances: sine wave and square wave. The sine waveform disturbances have a 5-Nm amplitude and 2-Hz frequency. The square waveform disturbances have a 2-Nm amplitude and 0.5-Hz frequency for joint 1, and a 2-Nm amplitude and 0.25-Hz frequency for joint 2. Moreover, a simulation with step input is also presented to analyse the transient and chattering dynamics of the proposed algorithm. In this paper, two specifications are utilised to evaluate the proposed ASMC algorithm: root mean square (RMS) error and total variance of the control signal [47]. The RMS error, which is calculated as is used to evaluate the tracking performance [47]. The total variance of the control signal, which is calculated as is used to evaluate the chattering phenomenon [47]. The RMS errors of the simulations with sine and square wave inputs are presented in Tables 5 and 6, respectively. The RMS errors and the total variance of the control signal of the simulation with step input is presented in Table 7.    Figure 4 shows the angular position response of the robot arm in normal condition of the proposed ASMC and the conventional SMC. We can see that the ASMC has a similar quality to a conventional SMC in the normal condition. In Figure 5, the control voltage of the controllers are shown. The fluctuation stage at the beginning in Figure 5a occurs when the ASMC is in the learning phase. After that phase, the ASMC uses the same voltage shape as the SMC for the tracking task.     Figures 8 and 9 show the control voltage in disturbed conditions with sine wave and square wave disturbances, respectively. After the learning phase, the ASMC uses the same voltage level as the SMC. In addition, the control voltage fluctuates due to the presence of disturbances. As shown in Table 5, the RMS errors of the ASMC are lower than the SMC, implying that the performance of the ASMC is better than the conventional SMC in the simulated cases.      Figure 10 shows the angular position response of the robot arm in normal conditions for the proposed ASMC and conventional SMC with square wave input. The performance of the ASMC improves over time when the adaptive controller can adapt to the system parameters. Overall, after the learning phase, the performance of the ASMC is not inferior to the SMC. Figure 11 presents the control voltage of the two controllers. The ASMC has more voltage fluctuation than the conventional SMC. However, this fluctuation decreases over time.    Figures 12 and 13, respectively. The ASMC has a better tracking performance than the SMC in both cases. The control voltage diagrams of the robot joints are illustrated in Figures 14 and 15. Overall, the control voltage of the proposed ASMC fluctuates more than the conventional SMC. On the other hand, the ASMC has a good tracking performance. This is more clearly indicated through the RMS error in Table 6. The ASMC has a 50.35% lower average RMS error than the SMC controller.

Step Input
In this section, the simulation with step input and the analysis of the transient and chattering dynamics of the proposed algorithm are introduced. Figure 16 shows the angular position response, error and the control voltage of proposed ASMC and SMC. The RMS error and the total variance in the control signal are shown in Table 7. As illustrated in Figure 16, the ASMC has a better tracking performance than the SMC. The proposed ASMC also has a shorter settling time (5% criterion) than the conventional SMC (0.44 s compared to 2.11 s). However, from the total variance in the control signal in Table 1, the ASMC has a higher chattering phenomenon. The chattering phenomenon can be reduced by decreasing the control parameter U, although this increases the rise and settling time.

Conclusions
In this work, we introduced a two-loop controller. To deal with uncertainties and interference on the load side of the robot arm, an adaptive sliding mode controller (ASMC) is proposed in the outer loop. Model reference adaptive controllers (MRAC) are adopted for each joint in the inner loop to address uncertainty on the robot arm's motor side. The usefulness of the presented ASMC algorithm in stabilising the system in the presence of uncertainties and disturbances is proved through detailed simulated studies. Accordingly, the ASMC has a 50.35% lower average RMS error than the SMC controller. It also has a shorter settling time (5% criterion) (0.44 s compared to 2.11 s). However, this improvement comes at the expense of an increase in the total variance of the control signal.
In the future, the proposed method should be implemented on a real elastic robotic arm. In our previous work [29], a physical 2-DOF robot arm with elastic joints was introduced. We will carry out further empirical experiments on this prototype to demonstrate the effectiveness of the proposed algorithm. In addition, we will expand the controller in the case of robots with an arbitrary number of degrees-of-freedom. Furthermore, we will also address and prove local and global asymptotic stability. The controller could be verified on several types of robots (legged robots, snake robots, etc.). Regarding snake robots, our group is planning to validate the proposed method on Serpens, a highly compliant, low-cost snake robot with series elastic actuators, previously presented in [48][49][50].

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.