Next Article in Journal
Experimental Comparison of Two 6D Pose Estimation Algorithms in Robotic Fruit-Picking Tasks
Previous Article in Journal
Eight-Bar Elbow Joint Exoskeleton Mechanism
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Closed-Form Continuous-Time Neural Networks for Sliding Mode Control with Neural Gravity Compensation

by
Claudio Urrea
*,
Yainet Garcia-Garcia
and
John Kern
Electrical Engineering Department, Faculty of Engineering, University of Santiago of Chile, Las Sophoras 165, Estación Central, Santiago 9170020, Chile
*
Author to whom correspondence should be addressed.
Robotics 2024, 13(9), 126; https://doi.org/10.3390/robotics13090126
Submission received: 4 July 2024 / Revised: 9 August 2024 / Accepted: 21 August 2024 / Published: 23 August 2024
(This article belongs to the Section Intelligent Robots and Mechatronics)

Abstract

:
This study proposes the design of a robust controller based on a Sliding Mode Control (SMC) structure. The proposed controller, called Sliding Mode Control based on Closed-Form Continuous-Time Neural Networks with Gravity Compensation (SMC-CfC-G), includes the development of an inverse model of the UR5 industrial robot, which is widely used in various fields. It also includes the development of a gravity vector using neural networks, which outperforms the gravity vector obtained through traditional robot modeling. To develop a gravity compensator, a feedforward Multi-Layer Perceptron (MLP) neural network was implemented. The use of Closed-Form Continuous-Time (CfC) neural networks for the development of a robot’s inverse model was introduced, allowing efficient modeling of the robot. The behavior of the proposed controller was verified under load and torque disturbances at the end effector, demonstrating its robustness against disturbances and variations in operating conditions. The adaptability and ability of the proposed controller to maintain superior performance in dynamic industrial environments are highlighted, outperforming the classic SMC, Proportional-Integral-Derivative (PID), and Neural controllers. Consequently, a high-precision controller with a maximum error rate of approximately 1.57 mm was obtained, making it useful for applications requiring high accuracy.

1. Introduction

Precise control of industrial robots has become a critical factor in improving efficiency and quality in productive sectors, especially when aiming to gain autonomy. Modern robotic systems face increasingly complex, dynamic, and variable environments, requiring controllers capable of rapidly adapting and maintaining high precision under diverse operating conditions. Hence, the evolution of robotic control has led to the exploration of advanced techniques to address these challenges.
In this context, the use of trajectories occupies an important place, as it represents the translation of tasks that the robot must perform in the work environment. Trajectory tracking is a fundamental task that requires controllers capable of handling complex and nonlinear dynamics. This progression reflects the need to overcome the limitations of traditional approaches and leverage computational and machine learning advances to enhance robot performance in demanding industrial applications.

Related Work

The use of classical control strategies such as the Proportional-Integral-Derivative (PID) controller has been a standard solution in industry due to its simplicity, low cost, and easy implementation. However, these controllers, although effective in certain scenarios, present significant limitations when faced with variable conditions and unknown or highly nonlinear systems. Their precision decreases in the presence of changes in the operating point, dynamic system variations, temporal delays, and other aspects that limit their performance [1]. These limitations have motivated the search for advanced approaches to robotic control. In this context, Sliding Mode Control (SMC) emerges as a promising solution.
SMC stands out as a robust, nonlinear control scheme that dynamically adapts its parameters to effectively handle uncertainties and disturbances in robotic systems. Unlike PID controllers, SMC can maintain high performance across a wide range of operating conditions, making it particularly suitable for robotic applications where precision and adaptability are crucial. However, despite its high performance demonstrated in academic and research settings, SMC presents as its main disadvantage the presence of high-frequency oscillations known as “chattering” in the control signal, which in practice can damage actuators, thus limiting its implementation at an industrial level [1].
To address this, improvements to SMC have been proposed to mitigate this phenomenon. Adaptive approaches have been addressed in various ways, as they allow adjustment to changing conditions and appropriate responses to model uncertainties. In [2], Fuzzy Logic Control (FLC) and SMC are combined with the aim of smoothing the control action and reducing chattering, reporting better performance than conventional SMC. In [3], an SMC controller, Fractional-Order Proportional Integral Derivative (FOPID) controller, and FLC controller are integrated. while maintaining robustness.
Shen et al. [4] have proposed several solutions for the control of Neutral-Point-Clamped (NPC) converters using SMC. In [4], they developed a cascade control scheme combining Adaptive Sliding Mode Control (ASMC) and a Nonlinear High-Gain Observer (HGO), thus improving immunity to measurement noise and disturbance rejection. In [5], they propose an Adaptive Second-Order SMC using an adaptive-gain Generalized Super-Twisting Algorithm (GSTA) and a modified Super-Twisting Observer (STO), reporting better disturbance rejection compared with the use of linear observers as well as a good compromise between dynamic performance and chattering reduction. In [6], several relevant aspects are proposed to improve convergence rate, dynamic performance, abrupt disturbance rejection, and robustness to parameter variations in NPC converter systems, such as a Higher Order Sliding-Mode Observer (HOSMO)-based varying exponent gain Super-Twisting Algorithm (STA) (HOSMO-VEGSTA) control scheme.
In [7], Integral SMC (ISMC) is combined with an Adaptive Super Twisting Observer (ASTO) to improve the control of robotic manipulators for trajectory tracking in the presence of uncertainties and disturbances. The ASTO allows estimation and compensation of uncertainties in finite time, and its adaptive gains enable suppression of the chattering phenomenon compared with fixed-gain observers. In [8], they combine SMC with an Extended State Observer (ESO) for disturbances. Their approach integrates a PID sliding surface with a saturation function-based ESO to estimate and reject disturbances, achieving reduced tracking errors and sensitivity to low-frequency disturbances.
Abadi et al. [9] implement a Sliding Active Disturbance Rejection Control for wheeled mobile robots. To mitigate the effects caused by wheel slip uncertainties and wind disturbances, an SMC control with a boundary layer around the switching surface is applied, implementing a continuous control law. Additionally, Active Disturbance Rejection Control (ADRC) is integrated to estimate and eliminate uncertainties within the feedback loop using an ESO. A similar strategy is proposed in [10]. Another aspect addressed by researchers is systems with time-varying delays, which can occur, for example, in teleoperated systems such as those used in mining or robotic surgery. Chang et al. [11] developed an adaptive sliding mode control scheme that can handle variable delays and unknown bounded disturbances.
In [12], an Adaptive Sliding-Mode-Assisted Disturbance Observer (ASMADO) is proposed for inertially stabilized platforms with a spherical mechanism. This combines ISMC, an adaptive disturbance observer, and gravity compensation. These strategies allow for estimation and compensation of unknown disturbances and model uncertainties, reduction of the magnitude of discontinuous control action, and adequate mitigation of chattering effects while maintaining control robustness. Gravity compensation is a frequently applied strategy, as it leads to smoother and more efficient system control, reducing actuator effort. In [13], a Model Predictive Control (MPC) was complemented with gravity compensation, which was implemented using the neural inverse model of belt drive transmissions and motors, as gravity compensation based on the gravity vector obtained through robot modeling proved too aggressive for the actuators.
As can be observed, appropriate modeling and identification of disturbance dynamics and the system in general are crucial for obtaining efficient, robust control, with extensive use of ESO and other identification techniques being evident. In [14], they developed a control scheme comprising a super-twisting sliding mode controller and a nonlinear input estimator for a soft robot based on data-driven sparse identification. Meanwhile, in [15], they present a model-free terminal sliding mode control method, incorporating a neural network to approximate the robot’s dynamics. In this regard, data-driven controllers are particularly useful in robotic applications, where operating conditions can vary significantly and obtaining an exact model is challenging.
Generally, the inclusion of neural networks has provided efficient solutions in robotic control due to their ability to approximate complex functions and adapt to uncertainties. In [16], a Fuzzy Neural Network Sliding Mode Controller (FNNSMC) is applied. This controller integrates a Radial Basis Function (RBF) neural network to estimate model errors in real-time, improving control precision, and a fuzzy gain adjustment to optimize the response and minimize chattering. RBF networks are also employed in [17,18] in conjunction with SMC and other techniques for robust control in trajectory tracking.
The control scheme proposed in [19] combines a Double-Loop Recurrent Neural Network (DLRNN) with a type-2 fuzzy and SMC to achieve efficient and robust control of uncertain robotic systems. In [20], an intelligent Genetic Algorithm (GA)-optimized Adaptive Fuzzy Fractional-Order Sliding Mode Controller (AFFOSMC) is formed with type-2 fuzzy sets. This approach improves the precision of manipulator trajectory tracking with errors less than 2 mm, a critical precision for surgical operations.
Khan et al. [21] present an approach that combines adaptive SMC with an ESO and reinforcement learning for industrial robots. In [22], the design of an adaptive neural network controller using backstepping techniques is presented, incorporating an integral sliding mode surface to reduce steady-state error. In [23], artificial neural network controllers are designed to replace classical velocity controllers in a UR5 robot. Although their neural controller achieved trajectory tracking performance comparable to PID control, the authors highlight the potential for better generalization and adaptation to variations between individual robotic units.
In general, neural network-based approaches show increasing potential for high-precision robotic control, especially in handling nonlinear dynamics and uncertainties in industrial manipulators. However, traditional neural networks present limitations in terms of training data quantity and valuable computational and energy resources, which complicates their applicability in various fields and real-time applications. In response to these limitations, there has been an increase in the study of neural networks inspired by the behavior of biological neurons and the use of Ordinary Differential Equation (ODE) solvers, among other approaches.
However, the training and inference of ODE-based neural networks are slow, which worsens as the complexity of data and tasks increases, as occurs with medical data processing, physical simulations, among others [24]. In this regard, Hasani et al. propose in [24] Closed-Form Continuous-Time (CfC) neural networks as an efficient solution for sequential data processing and time series with short training times, high precision, and low memory consumption. The present work addresses the development of a robust data-driven Sliding Mode Controller using neural networks capable of effectively handling the nonlinearities and uncertainties of the UR5 robot for trajectory tracking. The main contributions of the study are as follows:
  • Modeling of UR5 nonlinear dynamics: A data-driven approach was developed that captures the robot’s dynamic complexities, solving difficulties associated with model uncertainties and nonlinearities.
  • Effective compensation of gravitational effects: An adaptive method was implemented to counteract gravitational forces, improving robot control performance on the vertical axis.
  • Chattering reduction: The proposed approach allows mitigation of the chattering problem, thus improving actuator lifespan and the smoothness of robot movements.
  • Robustness to external disturbances: A control strategy was designed capable of maintaining stable performance against load variations of up to 1 kg and torque disturbances of 5 Nm, solving the problem of sensitivity to changing conditions in dynamic industrial environments.
  • Improved precision in complex trajectory tracking: A maximum error in Cartesian space of approximately 1.57 mm is achieved, thus addressing the challenge of precision in applications requiring high accuracy.
  • Real-time performance optimization: The efficient integration of advanced machine learning techniques such as Closed-Form Continuous-Time neural networks allowed the implementation of a control system that adapts to changing conditions and solves problems of computational efficiency and adaptability.
This article is structured as follows: Section 2 describes the theoretical foundations of the implemented neural networks; Section 3 describes the system under study; Section 4 specifies the methodology adopted for the design of the proposed controller; Section 5 presents the experiments and simulations carried out in different scenarios; Section 6 discusses the results obtained; and Section 7 shows the conclusions, limitations, and future lines of research.

2. Neural Networks for Automatic Control Systems

Neural networks are applied in controller design and/or system identification using a black-box or gray-box approach. Feedforward Neural Networks (Multi-Layer Perceptrons, MLP) have been widely used to learn complex input-output mappings, such as the inverse kinematics of robotic arms. However, they present limitations in working with sequential data and time series, which affects their performance in dynamic systems. In contrast, Recurrent Neural Networks (RNNs) are effective in capturing long-term dependencies in sequential data, making them suitable for tasks involving temporal sequences. Nevertheless, they face difficulties in accurately representing the continuous evolution of time and complex nonlinear dynamics.
In response to these limitations, Hasani et al. proposed in [25] the Liquid Time-Constant (LTC) networks, which are characterized by the introduction of “liquid” time constants that adapt to input data, allowing for a more natural and flexible representation. LTCs are limited by their computational cost and prolonged training times, as they depend on numerical solvers of ODE. For this reason, Hasani et al. proposed in [24] Closed-Form Continuous-Time neural networks. CfCs address this limitation by providing a Closed-Form approximation of the LTC solution, eliminating the need for numerical solvers. This work employs both traditional and cutting-edge approaches, such as MLP and CfC neural networks, whose fundamental aspects are addressed below.

2.1. Multi-Layer Perceptron

Artificial neural networks are inspired by the human brain and mimic its functioning through a layered structure, with the aim of performing tasks in a similar manner. The input layer receives the features to be considered from processes or systems, while the output layer corresponds to the desired outputs. Neural networks can have a determined number of intermediate layers, known as hidden layers. Hidden layers can enhance the algorithm, allowing for more complex connections and improving the network’s processing capacity and performance. Figure 1a represents the diagram of a MLP neural network, while Figure 1b outlines the structure of the CfC (https://github.com/raminmh/CfC, accessed on 1 June 2024), inspired by the architecture proposed in [24].
In the MLP, connections are forward, indicating a feedforward network. The output of the neural network is defined as in Equation (1).
y = σ i = 1 n w i · x i + b

2.2. Closed-Form Continuous-Time Neural Networks

The basis of LTC functioning lies in the use of ODE solvers to compute their outputs. The state of a Neural ODE (NODE) can be defined as in Equation (2) [26]:
d x t d t = f x t , I t , t , Φ
where x t R D denotes the hidden state of the network, I t is the input, and f is parameterized by Φ .
Continuous-Time Recurrent Neural Networks (CT-RNN) introduce a formulation where the dynamics of the hidden state are influenced by a time constant ϱ that regulates the speed at which the system adapts to changes in the hidden state. This is represented by the inclusion of the term x ( t ) / ϱ , as expressed in (3), which acts as a stability mechanism that helps the system reach an equilibrium state.
d x t d t = x t ϱ + f x t , I t , t , Φ
Combining the concepts of NODEs and the time constant ϱ , Hasani et al. propose an alternative formulation called CT-RNN in [25]. The dynamics of the hidden state are defined as in (4), where S(t) represents the following nonlinearity defined as in (5) with parameters Φ and A .
d x t d t = x t ϱ + S t
S t = f x t , I t , t , Φ A x t
where S t R J indicates that at each time instant t , the signal S is a vector of J real numbers.
With the introduction of S(t), the formulation of a CT-RNN with a variable “liquid” time constant, coupled to its hidden state, termed Liquid Time-Constant Recurrent Neural Networks, is obtained, as defined in Equation (6):
d x t d t = 1 ϱ + f x t , I t , t , Φ x t + f x t , I t , t , Φ A
LTCs are distinguished by their neural function f , which determines both the derivative of the hidden state and a liquid time constant dependent on the input, allowing for dynamic adaptation to the changing characteristics of real-time data. LTCs are flexible in their implementation, compatible with various ODE solvers. This unique structure provides them with greater expressiveness and stability compared with traditional ODE models, making them particularly suitable for time-series modeling tasks.
However, LTCs present limitations regarding computational cost and prolonged training times due to their reliance on numerical solvers for operation. For this reason, Hasani et al. propose an evolution of LTCs, called Closed-Form Continuous-Time neural networks, in [24]. Building on the formulation presented in (6), the hidden state of an LTC recurrent neural network is determined by the general expression (7):
d x t d t = w ϱ + f x , I , Φ x t + A f x , I , Φ
where x D × 1 t defines the hidden state of an LTC layer at a time step t with D cells, I m × 1 t is an exogenous input to the system with m features, w ϱ D × 1 is a time-constant parameter vector, A D × 1 is a bias vector, f is a neural network parameterized by Φ , and ⊙ is the Hadamard product that allows element-wise operations on multidimensional tensors. The dependence of f on x ( t ) denotes the possibility of having recurrent connections.
A closed-form approximation of Equation (7) was sought, arriving at Expression (8):
x t x 0 A e w ϱ + f I t , Φ t   f I t , Φ + A
To improve gradient properties and training stability, the following modifications were made:
  • The exponential decay term e w ϱ + f I t , Φ t was replaced by σ f x , I ; Φ f t , where σ is an inverted sigmoidal function. This substitution provides a smoother transition and enhances gradient properties during training.
  • Two new functions, g and h , were introduced to replace and expand the terms x 0 A and A , respectively. This allows for greater flexibility in modeling system dynamics. Here, f , g , and h are neural networks parameterized by Φ f , Φ g , and Φ h , respectively.
  • A continuous-time gating mechanism was implemented using σ f x , I ; Φ f t and its complement 1 σ f x , I ; Φ f t , such that the sigmoidal temporal decay function acts as a gating mechanism interpolating between the two limits of t and t of the ODE trajectory, controlling the flow of information over time.
These modifications resulted in the CfC formulation present in (9):
y = σ f x , I ; Φ f t     g x , I ; Φ g + 1 σ f x , I ; Φ f t     h x , I ; Φ h
The CfC architecture implements a shared backbone that branches into the functions f , g , and h . This design allows the network to learn shared representations while independently exploring temporal and structural dependencies. With this architecture, it retains the universal approximation capability of LTCs while improving training capacity and model flexibility without the need for numerical ODE solvers, significantly accelerating both training and inference. Empirical studies have demonstrated that CfCs can be up to 100 times faster in training and inference compared with LTCs while maintaining or even improving accuracy in time series modeling tasks. This CfC formulation represents a significant advancement in the field of Continuous-Time neural networks, offering a balance between the expressiveness of ODE-based models and the computational efficiency required for large-scale practical applications [24].
The use of activation functions and loss functions in the training of neural networks plays a crucial role in their performance. Activation functions enable the network to learn and model nonlinear relationships between input and output data. Commonly used activation functions in neural networks include the hyperbolic tangent sigmoid function, defined as in (10). MLPs frequently employ the pure linear function (purelin) in the output layer, defined in (11), which is a linear activation function suitable for regression tasks where a continuous and unbounded output is desired.
tansig x = tanh x = 2 1 e 2 x 1
p u r e l i n x = x
The swish activation function is widely used in image work and has also shown good performance in training various types of neural networks in general, particularly in its Sigmoid Linear Unit (SiLU) variant, as defined in (12) [27]. In the case of loss functions commonly used in neural network training, the Mean Squared Error (MSE) is defined in (13), which measures the average squared difference between the values predicted by the network and the actual values.
S W x = x 1 + e x
M S E = 1 n i = 1 n y i y ^ i 2
where n represents the number of examples in the dataset, y i is the actual value of the i-th example, and y ^ i is the value predicted by the network for the i-th example.

3. Description of the System under Study

This study utilizes MatLab® R2024a software and Python 3.9 on a Lenovo AMD Ryzen 9 5900HX 3.3 GHz laptop with 32 GB of RAM and an NVIDIA GeForce RTX 3080 GPU as the hardware. The robot selected to validate the proposed control strategy is the UR5. This is a collaborative robot from Universal Robots, which has been used in numerous applications due to its features and capabilities. The UR5 has 6 Degrees of Freedom (DoF), an open structure specially adapted for flexible use, various orientations, and extensive communication possibilities with external systems. It can operate in demanding work environments as well as in clean rooms, such as medical settings. It has a payload capacity of 5 kg, a reach of 850 mm, and a repeatability of ±0.1 mm [28].

3.1. UR5 Kinematic Model

Figure 2a shows the dimensions of the UR5 robot and the reference frames of each link according to the Denavit-Hartenberg (D–H) algorithm for the home position (0, −90, 0, −90, 0, 0), while Figure 2b displays the D–H representation.
Table 1 presents the D–H parameters. In this context, i represents the joint number, θ i represents the angle to rotate around the z-axis to make two consecutive x-axes parallel, d i represents the distance measured along the z-axis to align two consecutive x -axes, a i represents the distance measured along the x-axis that must be moved to align the new O i 1 , with O i , while α i denotes the angle to rotate around the x-axis to fully align the new O i 1 with O i .
Through the transformation matrices T i i 1 , both the position and orientation of the system i relative to the system i 1 are related, which is obtained using Equation (14). The general homogeneous transformation matrix relating the end-effector to the robot base in terms of the joint coordinates is determined by Equation (15).
T i i 1 = cos θ i sin θ i 0 0   sin θ i · cos α i   cos θ i · cos α i sin α i 0     sin θ i · sin α i   cos θ i · sin α i   cos α i 0   a i cos θ i   a i sin θ i d i 1
T 6 0 = T 1 0 · T 2 1 · T 3 2 · T 4 3 · T 5 4 · T 6 5

Inverse Kinematics

Determining the inverse kinematics of the robot involves finding the joint coordinates that position and orient the end-effector according to a desired spatial location, allowing for the inverse calculation of each joint angle θ i . The inverse kinematics solution implemented in this work is based on the one presented in [29]. The coordinate origin vector from joint axis v to joint axis u can be defined as in (16). Determining the transformation matrix allows for the calculation of the end-effector position relative to the base coordinates P 6 0 , with P 5 0 being determined as in Equation (17).
P v u = P v u x P v u y P v u z 1
P 5 0 = P 6 0 + T 6 0 0 0 d 6 1
The parameter θ 1 is determined by Equation (18), with the variables ψ and φ defined in Equations (19) and (20), respectively, as shown in Figure 3a.
θ 1 = φ + ψ + π 2
ψ = a t a n   2 P 5 0 y P 5 0 x
φ = ± cos 1 d 4 P 5 0 x 2 + P 5 0 y 2
The location of the parameter θ 5 can be seen in Figure 3b and is determined by Equation (21), with P 6 1 obtained as in Equation (22).
θ 5 = ± cos 1 P 6 1 z d 4 d 6
P 6 1 = T 6 0 1 P 6 0
The matrix T 6 1 can be obtained as in (23) and allows for the calculation of θ 6 as in Equation (24). Parameters θ 3 and θ 2 are determined using Equations (25) and (26), respectively, as shown in Figure 3c, with P 3 1 defined in Equation (27).
T 6 1 = T 1 0 1 T 6 0 = . . α 0   . . β 0   . . . 0   . . . 1
θ 6 = a t a n   2 β α
θ 3 = ± cos 1 P 3 1 2 a 2 2 a 3 2 2 · a 2 · a 3
θ 2 = a t a n   2 P 3 1 y P 3 1 x + sin 1 a 3 · sin θ 3 P 3 1
P 3 1 = P 4 1 + T 4 1 · 0 d 4 0 1
The parameter θ 4 is determined by Equation (28), with ρ and μ being elements of the matrix T 4 3 defined in (29).
θ 4 = a t a n   2 μ ρ
T 4 3 = T 3 1 1 T 4 1 = ρ   μ 0 0   0 0 1 0   . . 0 0   0 0 . 1

3.2. UR5 Dynamic Model

The dynamics governing the behavior of an n-DoF robotic manipulator can be formulated as in Equation (30) [13].
τ = M q q ¨ + C q , q ˙ + G q + F q ˙
where τ represents the torque vector with dimensions n × 1 , M represents the inertia matrix with dimensions n × n , C q , q ˙ is the vector of centrifugal and Coriolis forces with n × 1 , G q is the gravitational forces vector n × 1 , and F q ˙ represents the friction. The variables q ,   q ˙ , and q ¨ represent the joint position, velocity, and acceleration, respectively. The dynamic model of the UR5 robot is available at the following link (https://drive.google.com/drive/folders/1Or-8sECzHhKaKkuDFRKfJH5vES0eoyC4?usp=drive_link). It is based on the modeling presented in [30], and the corresponding code is available at (https://github.com/kkufieta/ur5_modeling_force_estimate, accessed on 1 June 2024).
In the case of the UR5 robot implementation used in the study, it was modeled in SolidWorks and introduced into the Simscape simulation environment of MatLab®. Table 2 summarizes the robot’s dynamics and physical parameters defined in its design.

4. Design of Control Strategy

The following section outlines the theoretical aspects of the methodology used for designing the proposed control strategy.

4.1. Sliding Mode Control Based on Closed-Form Continuous-Time Neural Networks with Gravity Compensation

Sliding Mode Control involves forcing the system trajectories to remain on a sliding surface, which allows avoiding undesired behaviors and provides stability. The sliding surface defined in this study is represented in (31).
s = λ · e + e ˙
where s is the sliding surface, λ > 0 is a positive constant that adjusts the convergence of the system, e represents the position error calculated as shown in (32), while e ˙ represents the velocity error, and can be obtained using Equation (33).
e = q d q
e ˙ = q ˙ d q ˙
where q d is the desired joint position vector, q is the current joint position vector, q ˙ d is the desired joint velocity vector, and q ˙ represents the current joint velocity vector.
On the established sliding surface, considering e ensures that the position converges, while considering e ˙ allows controlling the convergence rate and smoothing the system’s response. From Equation (31), it can be observed that if s 0 , then e 0 and e ˙ 0 . The final torque vector τ to be applied to the robot can be obtained using the relationship (34).
τ = τ s w + τ e q + τ g
where τ s w is the SMC control torque vector, τ e q is the equivalent torque vector obtained using the robot’s inverse model, while τ g is the gravity compensation torque vector.
The torque τ s w is determined as in Expression (35). For this, the saturation function defined in (36) is implemented, which smooths the control action near the sliding surface, helping to reduce chattering while maintaining the robustness of the controller. The variable K represents the positive gain matrix and ϕ represents the boundary layer thickness.
τ s w = K s a t s ϕ
s a t s ϕ   s g n s ,   s > ϕ s ϕ ,   s ϕ
The function s g n s is defined as in (37). The torque τ e q , since it is obtained through a neural network, can be defined in a simplified way as in (38) [31].
s g n s       1 ,   s > 0     0 ,   s = 0 1 , s < 0
τ e q = W T Θ X
where X is the input vector, W is a learnable weight matrix of the CfC network, and Θ X is the internal state vector of the network.
This formulation allows the CfC network to learn and adapt to the robot’s full dynamics, including the effects of inertia, Coriolis, centrifugal, and other nonlinearities. The torque τ g can be obtained as in (39).
τ g = V T σ U T q + b + c
where V is the output layer weight matrix of the MLP network, U is the input-to-hidden layer weight matrix, b is the hidden layer bias vector, c is the output layer bias vector, and σ · is the generic activation function.

Stability Analysis

Consider the candidate Lyapunov function:
L = 1 2 s T M q s + 1 2 t r W ~ T Γ 1 W ~ + 1 2 t r V ~ T Γ V 1 V ~ + 1 2 t r U ~ T Γ U 1 U ~
In this equation, the following are true:
  • M q is the robot’s inertia matrix;
  • W ~ = W * W , with W being the weight matrix of the CfC network;
  • V ~ = V * V , U ~ = U * U , with V and U being the weight matrices of the MLP network;
  • Γ , Γ V , and Γ U , are positive gain matrices.
The time derivative of L L ˙ is expressed as in (41):
L ˙ = s T M q s ˙ + 1 2 s T M ˙ q s t r W ~ T Γ 1 W ~ ˙ t r V ~ T Γ V 1 V ~ ˙ t r U ~ T Γ U 1 U ~ ˙
Substituting the robot dynamics and the control laws, the Expression (42) is obtained:
L ˙ s T K s a t s ϕ + s T W ~ T Θ X + s T V ~ T σ U T q + b + U ~ T V T σ U T q + b q + ε
where ε represents the bounded approximation errors and disturbances of the neural networks used.
The proposed adaptation laws for the networks are defined in (43) and (44) for the CfC and MLP, respectively.
W ~ ˙ = Γ Θ X s T
V ~ ˙ = Γ V σ U T q + b s T U ~ = ˙ Γ U q V T σ U T q + b T s T
Substituting these adaptation laws in (41), the expression (45) is obtained:
L ˙ s T K s a t s ϕ + ε
If the gain matrix K is chosen large enough to dominate ε, then L ˙ < 0 implies that s converges to a neighborhood of the origin, whose size depends on ε and can be made arbitrarily small by increasing K, which must be sufficient to dominate not only ε, but also the terms involving W ~ , V ~ , and U ~ in (42). This analysis demonstrates the practical stability of the closed-loop system, considering the CfC and MLP neural networks.
The methodology for designing, testing, and validating the controller is summarized in Table 3:

4.2. System Identification

The uncertain factors in robot dynamics are divided into structural and non-structural uncertainties. Parameter identification errors introduce structural uncertainty. Many factors, such as non-linear joint damping, friction model design methods, and noise, are non-structural uncertainties, and expressing uncertain factors through physical modeling methods is challenging. On the other hand, many manufacturers do not provide, or only partially provide, the robot’s dynamic parameters. Simultaneously, due to factors such as manufacturing errors and uneven material distribution, the dynamic parameters of industrial robots of the same model may differ.
Therefore, developing reasonable and applicable torque prediction methods is important for industrial robot modeling. However, due to the complexity of most robots, it is impractical to measure physical parameters directly. Experiments remain the most effective way to obtain dynamic parameters [32]. The use of neural networks, while often a complex and iterative process of trial and error, can achieve adequate identification values, all closely related to the complexity of the plant to be identified. Generally, the success of training depends on the quantity and quality of the data. Some of the frequently suggested excitation signals are sinusoidal signals, pseudo-random or noise-type signals, as well as the use of Fourier series, among others. Figure 4 shows the scheme applied in this research for system identification.
The UR5 is a collaborative robot designed for fast and precise movements. Capturing its high-frequency dynamics is essential for robust control in demanding applications. In the context of SMC control, which is susceptible to chattering, an exact inverse model incorporating these dynamics can optimize compensation, alleviating the load on the discontinuous part of the control and attenuating chattering, thus improving the overall performance of the SMC. In response to this, the chirp signal is used to identify the inverse model of the UR5 robot. This signal performs a frequency sweep, allowing a wide spectrum to be stimulated in a single experiment. This approach facilitates a more refined tuning of the SMC, allowing higher gains without compromising stability, which translates into more precise and reliable control. The torque signals applied to each of the joints are shown in Figure 5.
The obtained data are divided into three sets, corresponding to 70% (initial data for training), 20% (intermediate data for testing), and 10% (final data for validation). The sampling time for identification was set at 0.01 s, with the aim of efficiently capturing the plant’s dynamics. The simulation time was set at 600 s, taking a total of 60,000 training samples. The MLP neural network training was performed using the Neural Network Start application in MatLab®, which can be accessed with the nnstart command. The CfC neural network was trained in Python 3.9 software.

4.3. Gravity Compensation

Gravity compensation in robotics helps to correct overshoots and asymmetric transient behaviors, improving position control in multi-DoF robots. It is especially beneficial for robotic systems with small actuators that generate less torque [33]. This improves movement precision, reduces actuator effort, and increases the system’s energy efficiency. Additionally, it facilitates trajectory tracking and robot stability in various positions. Implementing this compensation neuronally offers additional benefits, such as adaptability to variations in robot parameters, efficient handling of uncertainties and non-linear effects, and greater computational efficiency. Neural networks also allow for smoother integration with data-based approaches, have the potential for continuous improvement, and can be more easily generalized to other robot models or complex systems, such as soft robots.
To counteract the gravitational forces acting on the UR5, a neural gravity compensator is applied. For this, an MLP neural network and a CfC neural network were trained with data obtained by applying an input signal to the gravity matrix of the UR5 robot. For training the gravity compensation network, four trajectories were used, which can reflect specific tasks to be developed by the robot. Trajectories in the form of stacked ellipses, rose curve trajectory, sinusoid, and circular trajectory were implemented. The selected trajectories cover the robot’s workspace and provide a good variety of movements, including cyclical movements, height changes, variable orientations, and complex curves. This is important to capture a wide range of gravitational effects. The sampling time was set at 0.01 s, the simulation time at 10 s and obtaining a total of 4000 training samples.
Table 4 summarizes the main training parameters established, both for training the inverse model of the robot and for training the neural gravity compensator.
The control scheme implemented for the Sliding Mode Control based on SMC-CfC-G is shown in Figure 6.

4.4. Cartesian Trajectories

To verify the performance of the proposed control strategy, the tracking of two trajectories is evaluated. Trajectory 1 corresponds to a three-petal flower, whose mathematical formulation is defined in (46) and is visualized in Figure 7a.
r = 0.1 sin 3 t x = 0.2 + r · sin t y = 0.2 + r · cos t   z = 0.4  
For trajectory 2, curves and straight lines are combined, as shown in Figure 7b. For its formation, the minjerkpolytraj function from MatLab® was used, which takes as input the number of samples, the waypoints, and the time to move from one waypoint to another.
These trajectories have been chosen for their ability to challenge the controller in multiple aspects. The three-petal flower, with its smooth curves and continuous changes in direction, allows for evaluating the precision and smoothness of the controller in complex movements. The transition between a curve and a straight line can involve abrupt changes in velocity and acceleration, which can cause vibrations or unwanted movements if the controller does not handle these changes adequately, providing an ideal scenario to test the robustness and adaptability of the controller.

5. Simulation Results

The training performed to develop the inverse model of the robot using MLP achieved an MSE of 4.95 × 10 6 , while the CfC achieved an MSE of 2.0 × 10 1 . The error values reached during the training of the network used to compensate for gravity effects were 3.9 × 10 9 for the MLP and 6.2 × 10 2 for the CfC. Both neural networks were evaluated as an inverse model and as a gravity compensator, with the CfC performing best for modeling the robot’s behavior and the MLP for gravity compensation. Table 5 summarizes the adjusted values for each joint in the implementation of the SMC-CfC-G controller.
The selection of the SMC parameters for the UR5 robot controller was carried out using a systematic experimental approach. First, conservative values were set for the sliding surface coefficient (λ), the SMC gain (K), and the boundary layer thickness (ϕ), based on theoretical estimates. Then, an iterative tuning process was carried out, evaluating the robot’s performance in terms of tracking accuracy, robustness to disturbances, and smoothness of movement. This process involved the execution of several tests with representative trajectories, analyzing the results of various performance indices, control effort, and the level of chattering.
The parameters were gradually refined for each joint, seeking a balance between response speed, precision, and stability. Finally, the selected parameters were validated with a set of trajectories not used during the tuning and under different load conditions. This approach allowed obtaining a set of parameters well-adapted to the specific dynamic characteristics of the UR5 and the specific purposes of the application, ensuring robust and efficient controller performance. The implementation of an adaptive (ϕ) is considered for future research, which favors real-time adjustments according to changing conditions during the robot’s operation.

5.1. Performance Indexes

For a quantitative evaluation of the results of each controller in terms of response quality and error values in tracking the desired trajectory, performance indexes (PIs) are calculated. The PIs considered are: Integral Square Error (ISE), Integral of Time-Weighted Absolute Error (ITAE), and Residual Mean Square Error (RMSE), which are mathematically defined in Equations (47)–(49) [1,34]. The ISE penalizes larger error values to a greater extent; a small ISE is indicative of better overall reference tracking.
I S E = 0 T e 2   t d t r a d
I T A E = 0 T t e t d t r a d · s
R M S E = 1 n i = 1 n e i 2 r a d
On the other hand, the ITAE penalizes late errors to a greater extent, and the RMSE measures the average magnitude of errors regardless of their sign. In all cases, the best controller performance is evidenced by ISE, ITAE, and RMSE values close to zero.

5.2. Trajectory Tracking

In addition to the controller proposed in the study, a classical SMC controller was designed with the same adjustment parameters as the proposed controller, as shown in Table 5, as well as a PID and a Neural controller (ANN), which allowed for comparison of the performance of the designed controller. Figure 8 shows the result for trajectory tracking by the designed controllers.
As observed, all controllers performed the desired trajectory in its entirety and in an acceptable manner. However, a phase shift in the z-axis is evident, mainly from the PID and SMC controllers. According to this figure, the behavior of the neural controller is good, although less precise than that achieved by the SMC-CfC-G. For a closer look at the behavior of these controllers, Figure 9, Figure 10 and Figure 11 show the results in Cartesian space (x, y, z axis) in trajectory tracking. In the first column is the positioning for trajectory 1, and in the second column is the positioning for trajectory 2.
The view of trajectory tracking in the previous axes does not present considerable differences, although it is distinguished that the PID controller presents the worst response, while the rest have a similar behavior, highlighting the performance of the SMC-CfC-G controller in all cases as the most precise. When analyzing the behavior on the z-axis, greater differences are observed, mainly influenced by gravity effects.
The PID controller is evidently strongly influenced by gravity effects, as is the SMC, albeit to a lesser extent. Visually, the neural controller is the second-best performer, with the SMC-CfC-G being the superior performer.

5.3. External Disturbance Rejection

An important characteristic of a control system is the ability to achieve good rejection of external disturbances. This ability is crucial for maintaining system stability and precision in dynamic and variable environments. To test this quality in the proposed controller, two types of disturbances were introduced that simulate adverse conditions that could occur in real applications.
The first disturbance consisted of adding a 1 kg load to the end effector at 1.5 s of simulation, a load that was maintained for the rest of the trajectory. A 1 kg load applied to the end effector can be representative of a pick-and-place operation or fluctuations in tool weight, among other scenarios that represent a change in the robot’s operating conditions, which is common in industrial applications. The second disturbance consisted of applying a torque of 5 Nm to the end effector from 1.2 s after starting its movement until 2.2 s in all three axes. This disturbance can be representative of interactions with complex mechanisms such as gears, screwing operations, assembly, or environmental disturbances.
Figure 12 shows the results of tracking trajectory 2 by the designed controllers. The selection of this trajectory is motivated by the fact that it combines lines and curves, which can be more complicated for an articulated robot. Figure 12a shows the tracking under the 1 kg load, and Figure 12b reflects the performance achieved when applying the torque disturbance. As can be observed, both disturbances cause changes in trajectory tracking.
When applying the mass, the main effect noted was a deviation in the z-axis; however, they maintained the ability to follow the trajectory. The controller most affected by this disturbance was the PID. The SMC and ANN maintained similar behavior, with a slight deviation in the z-axis. In the case of the SMC-CfC-G, the effects of this disturbance are not visually evident, with satisfactory control being observed. In contrast, the application of multidirectional torque resulted in more pronounced deviations from the desired trajectory, especially in the case of the PID controller, followed by the neural controller, which was particularly sensitive to this disturbance. Both the SMC and SMC-CfC-G maintained the ability to perform the desired trajectory, with the latter being the least affected by the disturbance, with no evident effects noted.
For a better analysis of the performance of the control strategies, the performance indices achieved by the implemented controllers for both trajectories, considering the different scenarios analyzed, are shown below. Table 6 contains all the performance indices for tracking trajectory 1 without considering disturbances.
In general, the SMC controllers obtained the best performance, with similar behavior based solely on the calculated quantitative parameters. The following tables reflect the performance indices achieved for trajectory 2. In this case, three scenarios are considered: the PIs calculated Without Disturbances (ND), with Load Disturbance (LD), and the scenario where Torque Disturbance (TD) is applied. Table 7 shows the ISE results for all controllers, with the best results achieved for each joint in the different scenarios highlighted.
As observed, although the rest of the controllers achieve small values, the SMC and SMC-CfC-G controllers perform best in terms of ISE in all cases. The SMC provides better results for q 1 , q 5 , and q 6 , while the SMC-CfC-G offers better performance in q 2 , q 3 , and q 4 . However, in the presence of disturbance when applying torque, the SMC-CfC-G controller shows better performance, demonstrating greater robustness and adaptability. Table 8 contains the ITAE.
When analyzing the ITAE, the result obtained is similar to the previous one, with SMC controllers being superior to the rest. Table 9 contains the calculated RMSE values. Despite similar values between the SMC controllers, improvements to the proposed controller over the classic SMC controller are verified here. The calculated metrics reflect the effects of disturbances on the different controllers, with the adverse effects of applying torque disturbance being notable on most occasions. In the case of increased load on the robot’s end effector, no considerable increase in performance indices is observed compared with the same parameter without disturbance.

6. Discussion

The main motivation of this study is to apply a robust control strategy based on data under the gray box principle with high precision in trajectory tracking. The proposed SMC-CfC-G controller presents several advantages that justify its good performance. Firstly, the SMC control law focuses on reducing error over time and minimizing it quickly. In the specific case of the implemented controller, a maximum error of approximately 2.2 mm is achieved on the x-axis, approximately 1.7 mm on the y-axis, and approximately 0.8 mm on the z-axis.
Another important strength of the proposed controller is gravity compensation. When verifying the errors, especially on the z-axis, the effectiveness of this methodology and the neural network dedicated to this function is observed. The MLP outperformed the CfC in developing the gravity compensator, which may be largely influenced by a small number of training samples. However, both neural networks showed better performance than that offered by applying the gravity vector obtained through robot modeling, so this methodology is considered efficient in controller design.
It is worth noting that we worked with a fairly realistic configuration of the UR5 robot through its implementation in Simscape, where the movement ranges established by the manufacturer were considered, as well as the maximum speed and torque values established for each joint, which provides greater reliability of the results obtained in the study. The performance of the inverse model developed using the CfC neural network was decisive in the final result, as it was able to adequately model the system dynamics. The CfC neural network managed to determine the robot parameters with a chirp signal; this process can be improved with the implementation of other signals and a larger number of training data points.
To add more realism to the analysis, the results of trajectory tracking were evaluated qualitatively and quantitatively in different situations. Curved trajectories were implemented, which are more natural for the UR5 based on its morphology, as well as lines, which, despite being more challenging for the robot, were successfully performed by the proposed controller. The study was also complemented by the implementation of common external disturbances in industry with different degrees of complexity. A 1 kg load applied to the end effector allowed evaluation of the adaptability and robustness of the control algorithm. The application of a multidirectional torque of 5 Nm corresponds to a more complex and challenging scenario, providing a more rigorous test for the control system. This disturbance allowed testing the recovery capacity and maintenance of precision of the control system in variable load situations.
From these disturbances, high sensitivity of the PID to gravitational-type disturbances and low adaptability were evidenced; the neural controller and SMC were also affected to a lesser extent, which was not the case for the SMC-CfC-G controller. The second disturbance caused considerable deviations in trajectory tracking by the PID and ANN controllers, impairing their ability to compensate for the effect of the disturbance and hindering immediate correction of trajectory tracking. The SMC controllers were able to correctly track the trajectory, although the classic SMC maintains a larger error on the z-axis. In contrast, the SMC-CfC-G error underwent minimal variations, maintaining high precision, which can be observed qualitatively and quantitatively.
Regarding the calculated performance indices, they allow verifying the better behavior of SMC control in general. However, it can be stated to some extent that RMSE and ISE were more accurate in differentiating the best-performing controller. Both indices focus on minimizing overall error without introducing time weight, which may be more suitable for systems where balanced and robust performance is sought throughout the trajectory, offering a clear and direct view of the system’s overall precision. Based on the results obtained, a low average deviation between the desired values and the actual values obtained by the controller is evidenced, and consequently, high precision and good reference tracking.

7. Conclusions

This study presented a robust data-based controller approach for precise trajectory tracking. Neural networks were applied both for identifying the inverse model of the UR5 robot and for gravity compensation, resulting in precise, robust control and good rejection of external disturbances. As part of this research, the behavior of the recently proposed CfC neural network was studied, which has been applied in a small number of situations, thus demonstrating its efficiency and applicability in industrial robot control.
Regarding the limitations of this study, it can be highlighted that, given the complexity of adjusting parameters of CfC neural networks, it is considered that further experiments should be conducted with various parameter configurations, such as initial learning rate, activation function, and optimizers, among others, to achieve better performance and adjustment. It is also significant to evaluate the performance of other variants of the CfC architecture, such as the so-called CfC-mmRNN, where the CfC defines the memory state of an RNN, for example, a Long Short-Term Memory, which allows mitigating the vanishing gradient problem. On the other hand, although the inverse model of the robot was made using the CfC neural network, which allows efficient learning of temporal relationships, the use of chirp signals only in identification is recognized as a limitation of the study, which limited the modeling of gravitational effects to some extent. For this reason, it was considered to perform a neural gravity compensator to counteract.
In future research, the SMC-CfC-G controller will be applied to high-precision medical tasks, particularly in the field of robotic surgery. The proposed controller could be integrated as a low-level component within a hierarchical control system for surgical robots, taking advantage of its high precision and robustness to disturbances. This application could significantly improve accuracy in delicate surgical procedures, such as microsurgeries or minimally invasive interventions. In addition to improvements in precision, the controller’s ability to adapt to different loads and efficiently compensate for gravity effects could be particularly useful in manipulating various surgical instruments. This application would not only demonstrate the practical utility of our approach in a highly specialized industrial context but could also contribute significantly to the advancement of robotic surgery, potentially improving outcomes for patients.

Author Contributions

Conceptualization, C.U. and Y.G.-G.; methodology, C.U. and Y.G.-G.; software, C.U. and Y.G.-G.; validation, C.U. and Y.G.-G.; formal analysis, C.U. and Y.G.-G.; investigation, C.U. and Y.G.-G.; resources, C.U. and Y.G.-G.; data curation, C.U. and Y.G.-G.; writing—original draft preparation, C.U. and Y.G.-G.; writing—review and editing, C.U. and Y.G.-G.; visualization, C.U. and Y.G.-G.; supervision, C.U. and J.K.; project administration, C.U. and J.K.; funding acquisition, C.U. and J.K. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Faculty of Engineering of the University of Santiago of Chile and Agencia Nacional de Investigación y Desarrollo de Chile (ANID-Subdirección de Capital Humano/Doctorado Nacional/2022-21220266).

Data Availability Statement

All data are contained within this article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Urrea, C.; Garcia-Garcia, Y. Design and Performance Analysis of Level Control Strategies in a Nonlinear Spherical Tank. Processes 2023, 11, 720. [Google Scholar] [CrossRef]
  2. Qureshi, M.S.; Swarnkar, P.; Gupta, S. A supervisory on-line tuned fuzzy logic based sliding mode control for robotics: An application to surgical robots. Robot. Auton. Syst. 2018, 109, 68–85. [Google Scholar] [CrossRef]
  3. Sachan, S.; Swarnkar, P. Robust Motion Planning in Robot-Assisted Surgery for Nonlinear Incision Trajectory. Electronics 2023, 12, 762. [Google Scholar] [CrossRef]
  4. Shen, X.; Liu, J.; Lin, H.; Yin, Y.; Alcaide, A.M.; Leon, J.I. Cascade control of grid-connected NPC converters via sliding mode technique. IEEE Trans. Energy Convers. 2023, 38, 1491–1500. [Google Scholar] [CrossRef]
  5. Shen, X.; Wu, C.; Liu, Z.; Wang, Y.; Leon, J.I.; Liu, J.; Franquelo, L.G. Adaptive-gain second-order sliding mode control of NPC converters via super-twisting technique. IEEE Trans. Power Electron. 2023, 38, 15406–15418. [Google Scholar] [CrossRef]
  6. Shen, X.; Liu, J.; Liu, Z.; Gao, Y.; Leon, J.I.; Vazquez, S.; Wu, L.; Franquelo, L.G. Sliding Mode Control of Neutral-Point-Clamped Power Converters with Gain Adaptation. IEEE Trans. Power Electron. 2024, 39, 9189–9201. [Google Scholar] [CrossRef]
  7. Shen, H.; Song, T.; Fang, L.; Wang, H.; Zhang, Y. Adaptive super twisting observer-based prescribed time integral sliding mode tracking control of uncertain robotic manipulators. Int. J. Adapt. Control Signal Process. 2024, 38, 2588–2616. [Google Scholar] [CrossRef]
  8. Abbasi, S.J.; Lee, S. Enhanced Trajectory Tracking via Disturbance-Observer-Based Modified Sliding Mode Control. Appl. Sci. 2023, 13, 8027. [Google Scholar] [CrossRef]
  9. Abadi, A.; Ayeb, A.; Labbadi, M.; Fofi, D.; Bakir, T.; Mekki, H. Robust Tracking Control of Wheeled Mobile Robot Based on Differential Flatness and Sliding Active Disturbance Rejection Control: Simulations and Experiments. Sensors 2024, 24, 2849. [Google Scholar] [CrossRef]
  10. Jiang, S.; Huang, F.; Liu, W.; Huang, Y.; Chen, Y. A Double Closed-Loop Digital Hydraulic Cylinder Position System Based on Global Fast Terminal Sliding Mode Active Disturbance Rejection Control. IEEE Access 2024, 12, 80138–80152. [Google Scholar] [CrossRef]
  11. Chang, Y.-H.; Yang, C.-Y.; Lin, H.-W. Robust Adaptive-Sliding-Mode Control for Teleoperation Systems with Time-Varying Delays and Uncertainties. Robotics 2024, 13, 89. [Google Scholar] [CrossRef]
  12. Tian, D.; Wang, M.; Wang, F.; Xu, R. Adaptive sliding-mode-assisted disturbance observer-based decoupling control for inertially stabilized platforms with a spherical mechanism. IET Control. Theory Appl. 2022, 16, 1194–1207. [Google Scholar] [CrossRef]
  13. Kern, J.; Urrea, C.; Verdejo, H.; Agramonte, R.; Becker, C. Trajectory Tracking and Disturbance Rejection Performance Analysis of Classical and Advanced Controllers for a SCORBOT Robot. Robotics 2024, 13, 48. [Google Scholar] [CrossRef]
  14. Papageorgiou, D.; Sigurðardóttir, G.Þ.; Falotico, E.; Tolu, S. Sliding-mode control of a soft robot based on data-driven sparse identification. Control. Eng. Pract. 2024, 144, 105836. [Google Scholar] [CrossRef]
  15. Truong, T.N.; Vo, A.T.; Kang, H.-J. A model-free terminal sliding mode control for robots: Achieving fixed-time prescribed performance and convergence. ISA Trans. 2024, 144, 330–341. [Google Scholar] [CrossRef]
  16. Sang, H.; Yang, C.; Liu, F.; Yun, J.; Jin, G. A fuzzy neural network sliding mode controller for vibration suppression in robotically assisted minimally invasive surgery. Int. J. Med. Robotics Comput. Assist. Surg. 2016, 12, 670–679. [Google Scholar] [CrossRef]
  17. Yuan, T.; Zhang, C.; Yi, F.; Lv, P.; Zhang, M.; Li, S. RBFNN-Based Adaptive Integral Sliding Mode Feedback and Feedforward Control for a Lower Limb Exoskeleton Robot. Electronics 2024, 13, 1043. [Google Scholar] [CrossRef]
  18. Wu, H.; Zhang, X.; Song, L.; Zhang, Y.; Wang, C.; Zhao, X.; Gu, L. Parallel Network-Based Sliding Mode Tracking Control for Robotic Manipulators with Uncertain Dynamics. Actuators 2023, 12, 187. [Google Scholar] [CrossRef]
  19. Li, L.J.; Chang, X.; Chao, F.; Lin, C.M.; Huỳnh, T.T.; Yang, L.; Shang, C.; Shen, Q. Self-Organizing Type-2 Fuzzy Double Loop Recurrent Neural Network for Uncertain Nonlinear System Control. IEEE Trans. Neural Netw. Learn. Syst. 2024, 35, 1–15. [Google Scholar] [CrossRef]
  20. Sachan, S.; Swarnkar, P. Intelligent fractional-order sliding mode optimised control of surgical manipulator for healthcare system. Electr. Eng. 2024, 106, 2131–2142. [Google Scholar] [CrossRef]
  21. Khan, H.; Khan, S.A.; Lee, M.C.; Ghafoor, U.; Gillani, F.; Shah, U.H. DDPG-Based Adaptive Sliding Mode Control with Extended State Observer for Multibody Robot Systems. Robotics 2023, 12, 161. [Google Scholar] [CrossRef]
  22. Li, T.; Zhang, G.; Zhang, T.; Pan, J. Adaptive Neural Network Tracking Control of Robotic Manipulators Based on Disturbance Observer. Processes 2024, 12, 499. [Google Scholar] [CrossRef]
  23. Mystkowski, A.; Wolniakowski, A.; Kadri, N.; Sewiolo, M.; Scalera, L. Neural Network Learning Algorithms for High-Precision Position Control and Drift Attenuation in Robotic Manipulators. Appl. Sci. 2023, 13, 10854. [Google Scholar] [CrossRef]
  24. Hasani, R.; Lechner, M.; Amini, A.; Liebenwein, L.; Ray, A.; Tschaikowski, M.; Teschl, G.; Rus, D. Closed-form continuous-time neural networks. Nat. Mach. Intell. 2022, 4, 992–1003. [Google Scholar] [CrossRef]
  25. Hasani, R.; Lechner, M.; Amini, A.; Rus, D.; Grosu, R. Liquid time-constant networks. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtual. 2–9 February 2021; Volume 35, pp. 7657–7666. [Google Scholar]
  26. Chen, R.T.; Rubanova, Y.; Bettencourt, J.; Duvenaud, D.K. Neural ordinary differential equations. Adv. Neural Inf. Process. Syst. 2018, 31, 1–19. [Google Scholar] [CrossRef]
  27. Urrea, C.; Garcia-Garcia, Y.; Kern, J. Improving Surgical Scene Semantic Segmentation through a Deep Learning Architecture with Attention to Class Imbalance. Biomedicines 2024, 12, 1309. [Google Scholar] [CrossRef]
  28. Universal Robots A/S. UR5 Especificaciones Técnicas No. Artículo 110105. Available online: https://www.universal-robots.com/media/50591/ur5_es.pdf (accessed on 16 June 2024).
  29. Jian, B.-L.; Tsai, C.-S.; Kuo, Y.-C.; Guo, Y.-S. An image vision and automatic calibration system for universal robots. J. Low Freq. Noise Vib. Act. Control. 2021, 40, 347–366. [Google Scholar] [CrossRef]
  30. Kufieta, K. Force Estimation in Robotic Manipulators: Modeling, Simulation and Experiment. Master’s Thesis, NTNU Norwegian University of Science and Technology, Trondheim, Norway, 2014. Available online: http://folk.ntnu.no/tomgra/Diplomer/Kufieta.pdf (accessed on 16 June 2024).
  31. Liu, J. Sliding Mode Control Using MATLAB; Academic Press: Cambridge, MA, USA, 2017. [Google Scholar]
  32. Wang, S.; Shao, X.; Yang, L.; Liu, N. Deep learning aided dynamic parameter identification of 6-DOF robot manipulators. IEEE Access 2020, 8, 138102–138116. [Google Scholar] [CrossRef]
  33. Bembli, S.; Haddad, N.K.; Belghith, S. A robust Model free terminal sliding mode with gravity Compensation control of a 2 DoF exoskeleton-upper limb system. J. Control Autom. Electr. Syst. 2021, 32, 632–641. [Google Scholar] [CrossRef]
  34. Silaa, M.Y.; Bencherif, A.; Barambones, O. Indirect Adaptive Control Using Neural Network and Discrete Extended Kalman Filter for Wheeled Mobile Robot. Actuators 2024, 13, 51. [Google Scholar] [CrossRef]
Figure 1. Schematic representation of implemented neural networks. (a) Multi-Layer Perceptron. (b) Closed-Form Continuous-Time neural networks.
Figure 1. Schematic representation of implemented neural networks. (a) Multi-Layer Perceptron. (b) Closed-Form Continuous-Time neural networks.
Robotics 13 00126 g001
Figure 2. UR5 robot modeled in Simscape. (a) Robot reference frames according to the D–H algorithm; (b) D–H representation.
Figure 2. UR5 robot modeled in Simscape. (a) Robot reference frames according to the D–H algorithm; (b) D–H representation.
Robotics 13 00126 g002
Figure 3. Planar projection of the axis coordinates. (a) Planar projection of the fifth axis coordinate to the base coordinate; (b) Planar projection of the sixth axis coordinate to the base coordinate; (c) Planar projection of the fifth axis to the first axis joint coordinate [29].
Figure 3. Planar projection of the axis coordinates. (a) Planar projection of the fifth axis coordinate to the base coordinate; (b) Planar projection of the sixth axis coordinate to the base coordinate; (c) Planar projection of the fifth axis to the first axis joint coordinate [29].
Robotics 13 00126 g003
Figure 4. UR5 identification procedure schemes.
Figure 4. UR5 identification procedure schemes.
Robotics 13 00126 g004
Figure 5. Chirp-type signals used for UR5 identification.
Figure 5. Chirp-type signals used for UR5 identification.
Robotics 13 00126 g005
Figure 6. Proposed control scheme (SMC-CfC-G).
Figure 6. Proposed control scheme (SMC-CfC-G).
Robotics 13 00126 g006
Figure 7. Trajectories in Cartesian space. (a) Three-petal flower; (b) Combination of lines and curves.
Figure 7. Trajectories in Cartesian space. (a) Three-petal flower; (b) Combination of lines and curves.
Robotics 13 00126 g007
Figure 8. Trajectory tracking by the designed controllers. (a) Desired Cartesian trajectory 1 (three-petal flower); (b) Desired Cartesian trajectory 2 (combination of lines and curve).
Figure 8. Trajectory tracking by the designed controllers. (a) Desired Cartesian trajectory 1 (three-petal flower); (b) Desired Cartesian trajectory 2 (combination of lines and curve).
Robotics 13 00126 g008
Figure 9. Simulation results for the implemented control strategies. (a) x-axis tracking trajectory 1; (b) x-axis tracking trajectory 2.
Figure 9. Simulation results for the implemented control strategies. (a) x-axis tracking trajectory 1; (b) x-axis tracking trajectory 2.
Robotics 13 00126 g009
Figure 10. Simulation results for the implemented control strategies. (a) y-axis tracking trajectory 1; (b) y-axis tracking trajectory 2.
Figure 10. Simulation results for the implemented control strategies. (a) y-axis tracking trajectory 1; (b) y-axis tracking trajectory 2.
Robotics 13 00126 g010
Figure 11. Simulation results for the implemented control strategies. (a) z-axis tracking trajectory 1; (b) z-axis tracking trajectory 2.
Figure 11. Simulation results for the implemented control strategies. (a) z-axis tracking trajectory 1; (b) z-axis tracking trajectory 2.
Robotics 13 00126 g011
Figure 12. Tracking of Cartesian trajectory 2 in the presence of external disturbances. (a) Increase in end effector load; (b) Multidirectional torque.
Figure 12. Tracking of Cartesian trajectory 2 in the presence of external disturbances. (a) Increase in end effector load; (b) Multidirectional torque.
Robotics 13 00126 g012
Table 1. D–H parameters of the UR5 robot.
Table 1. D–H parameters of the UR5 robot.
Kinematics θ i [rad] d i [m] a i [m] α i [rad]
Joint 1 θ 1 0.08920π/2
Joint 2 θ 2 0−0.42500
Joint 3 θ 3 0−0.39230
Joint 4 θ 4 0.10920π/2
Joint 5 θ 5 0.09470−π/2
Joint 6 θ 6 0.082300
Table 2. UR5 design parameter [28].
Table 2. UR5 design parameter [28].
DynamicsMass [kg]Center of Mass [m]Motion RangeMaximum SpeedTorque
Link 13.7[0, −0.02561, 0.00193]±360°±180°/s150 Nm
Link 28.393[0.2125, 0, 0.11336]±360°±180°/s150 Nm
Link 32.33[0.15, 0, 0.0265]±360°±180°/s150 Nm
Link 41.219[0, −0.0018, 0.01634]±360°±180°/s28 Nm
Link 51.219[0, −0.0018, 0.01634]±360°±180°/s28 Nm
Link 60.1879[0, 0, −0.001159]±360°±180°/s28 Nm
Table 3. Experiment methodology pseudocode.
Table 3. Experiment methodology pseudocode.
1:Procedure
2:Data acquisition UR5 inverse model identification Data collection for the UR5 robot using chirp signals. The data include joint position, velocity, and acceleration, as well as previous and current torque. This allows capturing the robot’s dynamics for training the inverse model of the robot.
Input   data :   q ,   q ˙ ,   q ¨ ,   τ k 1
Output   data :   τ k
3:Analysis and comparison of system identification techniques using neural networks (MLP, CfC)Evaluate MLP and CfC neural network architectures to determine which is more effective in identifying the robot’s inverse model.
4:Obtaining the inverse model of the UR5 robotTrain the selected neural network (CfC) with the acquired data to obtain an inverse model of the UR5 robot.
5:Data acquisition to obtain the gravity vectorCollect specific data to model the effect of gravity in different robot configurations using stacked ellipse trajectories, rose curve trajectories, sinusoidal trajectories, and circular trajectories.
Signal   q G q = q 1 q 2 q 3 q 4 q 5 q 6 τ g k τ g k = τ 1 τ 2 τ 3 τ 4 τ 5 τ 6
6:Training and comparison of neural networks for gravity compensationTrain and compare MLP and CfC networks to determine which is more effective in gravity compensation.
7:Gravity vector of the UR5Implement the selected neural network (MLP) to estimate the gravity vector in real-time.
8:Design of the control strategyDevelop the Closed-Form Continuous-Time Neural Networks with Neural Gravity Compensation (SMC-CfC-G) controller by integrating the inverse model and gravity compensation for trajectory tracking.
9: Definition   of   control   parameters   ( s ,   λ   ,   K ,   ϕ )Adjust the parameters of the SMC controller, including gains and boundary layer thickness, to reduce chattering.
10:Implementation of the control strategy
(SMC-CfC-G)
τ = τ s w + τ e q + τ g
-
In each iteration, read the current position, velocity, and acceleration of the robot.
-
Estimate the equivalent torque using the CfC inverse model.
-
Calculate gravity compensation using the MLP.
-
Determine the control law.
-
Apply the final control torque to the robot.
11:Controller performance evaluationConduct trajectory tracking and disturbance rejection tests to evaluate controller performance.
12:Analysis of results and adjustment of parameters, if necessaryAnalyze performance indices (ISE, ITAE, and RMSE) and adjust controller parameters as necessary to optimize performance.
13:End
Table 4. Training parameters of the neural networks.
Table 4. Training parameters of the neural networks.
ParametersMLPCfC
Epochs50001000
Initial Learning Rate1.0 × 10−3
Mini-Batch Size88
Activation Functiontansig, purelinSiLU
OptimizerBayesian Regularized (trainbr)Adam
Number of Neurons3 Hidden Layers (19; 9; 6 neurons)1 Hidden Layer (128 neurons)
Loss FunctionMSEMSE
Table 5. Adjusted values for SMC-CfC-G controller.
Table 5. Adjusted values for SMC-CfC-G controller.
JointKλ ϕ
q 1 8060.5
q 2 18080.25
q 3 10060.5
q 4 3050.5
q 5 2050.5
q 6 2050.5
Table 6. Performance indexes for trajectory 1 without disturbances.
Table 6. Performance indexes for trajectory 1 without disturbances.
PIsController q 1 q 2 q 3 q 4 q 5 q 6
ISEPID17.08430.00360.0088 1.94 × 10 4 4.58 × 10 5 4.13 × 10 6
ANN0.0033 9.90 × 10 4 0.0019 2.32 × 10 4 4.58 × 10 5 2.85 × 10 6
SMC 2.09 × 10 5 8.57 × 10 5 0.0026 9.12 × 10 5 1.09 × 10 5 4.85 × 10 7
SMC-CfC-G 8.54 × 10 5 6.26 × 10 7 1.95 × 10 5 4.68 × 10 5 2.92 × 10 5 3.74 × 10 5
ITAEPID13.50750.15700.32920.04030.00380.0055
ANN0.05300.07670.02840.03730.00380.0040
SMC0.01250.02480.16920.0326 4.50 × 10 4 5.79 × 10 4
SMC-CfC-G0.02770.00200.01280.01780.01090.0205
RMSEPID0.03150.03220.05020.00750.00360.0011
ANN0.03070.01680.02310.00820.0035 9.02 × 10 4
SMC0.00240.00500.02740.00510.0018 3.72 × 10 4
SMC-CfC-G0.049 4.22 × 10 4 0.00240.00370.00290.0033
Best performance is denoted in bold.
Table 7. Performance index ISE for trajectory 2.
Table 7. Performance index ISE for trajectory 2.
ControllerScenario q 1 q 2 q 3 q 4 q 5 q 6
PIDND0.00160.04840.0203 3.35 × 10 4 4.07 × 10 5 5.24 × 10 6
LD0.00160.07220.03190.0070 4.06 × 10 5 5.23 × 10 6
TD0.00310.05160.02250.03940.01050.0473
ANNND0.00150.04840.0203 3.26 × 10 4 4.07 × 10 5 5.08 × 10 6
LD0.00150.07220.03190.0084 4.06 × 10 5 8.59 × 10 6
TD0.00320.05160.02250.03410.01050.0616
SMCND 1.15 × 10 6 0.00140.0057 2.21 × 10 4 1.11 × 10 5 1.80 × 10 6
LD 1.30 × 10 6 0.00180.0072 5.13 × 10 4 1.12 × 10 5 1.81 × 10 6
TD 1.41 × 10 5 0.00150.0060 8.66 × 10 4 1.24 × 10 4 5.03 × 10 4
SMC-CfC-GND 1.47 × 10 4 2.23 × 10 6 3.94 × 10 5 1.21 × 10 4 4.21 × 10 4 5.57 × 10 4
LD 1.46 × 10 4 9.89 × 10 6 9.18 × 10 6 1.13 × 10 4 4.22 × 10 5 8.69 × 10 5
TD 1.98 × 10 4 3.01 × 10 6 3.43 × 10 5 1.21 × 10 4 4.03 × 10 5 7.44 × 10 5
Best performance is denoted in bold.
Table 8. Performance index ITAE for trajectory 2.
Table 8. Performance index ITAE for trajectory 2.
ControllerScenario q 1 q 2 q 3 q 4 q 5 q 6
PIDND0.05112.31321.70390.18800.00320.0016
LD0.05702.90502.14950.98140.0016 7.15 × 10 4
TD0.13302.34481.74100.57150.20930.4382
ANNND0.04882.31321.70390.18010.00320.0133
LD0.05552.90502.14951.08010.00160.0265
TD0.14552.34481.74100.52450.20930.5104
SMCND0.00810.40300.86880.1716 4.94 × 10 4 3.34 × 10 4
LD0.00890.45390.99020.2645 9.65 × 10 4 3.51 × 10 4
TD0.01420.40640.87790.20950.02080.0428
SMC-CfC-GND0.13470.01530.06800.11860.22740.2692
LD0.13460.03490.01880.11370.05490.1076
TD0.13820.01560.06650.09820.05440.1046
Best performance is denoted in bold.
Table 9. Performance index RMSE for trajectory 2.
Table 9. Performance index RMSE for trajectory 2.
ControllerScenario q 1 q 2 q 3 q 4 q 5 q 6
PIDND0.01420.07780.05040.00650.0023 8.09 × 10 4
LD0.01420.09500.06310.02970.0023 8.08 × 10 4
FD0.01970.08030.05300.07020.03620.0769
ANNND0.01370.00590.01450.00640.0022 7.97 × 10 4
LD0.01370.01800.01800.03250.00230.0010
FD0.01980.03950.01550.06520.05800.0878
SMCND 3.79 × 10 4 0.01330.02660.00530.0012 4.75 × 10 4
LD 4.04 × 10 4 0.01480.03010.00800.0012 4.75 × 10 4
FD0.00130.01350.02730.01040.00390.0079
SMC-CfC-GND0.0043 5.28 × 10 4 0.00220.00390.00730.0084
LD0.00430.00110.00110.00380.00230.0033
FD0.0050 6.13 × 10 4 0.00210.00390.00220.0030
Best performance is denoted in bold.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Urrea, C.; Garcia-Garcia, Y.; Kern, J. Closed-Form Continuous-Time Neural Networks for Sliding Mode Control with Neural Gravity Compensation. Robotics 2024, 13, 126. https://doi.org/10.3390/robotics13090126

AMA Style

Urrea C, Garcia-Garcia Y, Kern J. Closed-Form Continuous-Time Neural Networks for Sliding Mode Control with Neural Gravity Compensation. Robotics. 2024; 13(9):126. https://doi.org/10.3390/robotics13090126

Chicago/Turabian Style

Urrea, Claudio, Yainet Garcia-Garcia, and John Kern. 2024. "Closed-Form Continuous-Time Neural Networks for Sliding Mode Control with Neural Gravity Compensation" Robotics 13, no. 9: 126. https://doi.org/10.3390/robotics13090126

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop