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).
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]:
where
denotes the hidden state of the network, I
is the input, and
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
, as expressed in (3), which acts as a stability mechanism that helps the system reach an equilibrium state.
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
.
where
indicates that at each time instant
, the signal
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):
LTCs are distinguished by their neural function , 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):
where
defines the hidden state of an LTC layer at a time step
with D cells,
is an exogenous input to the system with
features,
is a time-constant parameter vector,
is a bias vector,
is a neural network parameterized by
, and ⊙ is the Hadamard product that allows element-wise operations on multidimensional tensors. The dependence of
on
denotes the possibility of having recurrent connections.
A closed-form approximation of Equation (7) was sought, arriving at Expression (8):
To improve gradient properties and training stability, the following modifications were made:
The exponential decay term was replaced by , where is an inverted sigmoidal function. This substitution provides a smoother transition and enhances gradient properties during training.
Two new functions, and , were introduced to replace and expand the terms and , respectively. This allows for greater flexibility in modeling system dynamics. Here, , , and are neural networks parameterized by , , and , respectively.
A continuous-time gating mechanism was implemented using and its complement , such that the sigmoidal temporal decay function acts as a gating mechanism interpolating between the two limits of and of the ODE trajectory, controlling the flow of information over time.
These modifications resulted in the CfC formulation present in (9):
The CfC architecture implements a shared backbone that branches into the functions
,
, and
. 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.
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.
where
represents the number of examples in the dataset,
is the actual value of the
i-th example, and
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,
represents the joint number,
represents the angle to rotate around the
z-axis to make two consecutive x-axes parallel,
represents the distance measured along the
z-axis to align two consecutive
-axes,
represents the distance measured along the
x-axis that must be moved to align the new
, with
, while
denotes the angle to rotate around the
x-axis to fully align the new
with
.
Through the transformation matrices
, both the position and orientation of the system
relative to the system
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).
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
. The inverse kinematics solution implemented in this work is based on the one presented in [
29]. The coordinate origin vector from joint axis
to joint axis
can be defined as in (16). Determining the transformation matrix allows for the calculation of the end-effector position relative to the base coordinates
, with
being determined as in Equation (17).
The parameter
is determined by Equation (18), with the variables
and
defined in Equations (19) and (20), respectively, as shown in
Figure 3a.
The location of the parameter
can be seen in
Figure 3b and is determined by Equation (21), with
obtained as in Equation (22).
The matrix
can be obtained as in (23) and allows for the calculation of
as in Equation (24). Parameters
and
are determined using Equations (25) and (26), respectively, as shown in
Figure 3c, with
defined in Equation (27).
The parameter
is determined by Equation (28), with
and
being elements of the matrix
defined in (29).
3.2. UR5 Dynamic Model
The dynamics governing the behavior of an n-DoF robotic manipulator can be formulated as in Equation (30) [
13].
where
represents the torque vector with dimensions
, M represents the inertia matrix with dimensions
,
is the vector of centrifugal and Coriolis forces with
,
is the gravitational forces vector
, and
represents the friction. The variables
,
, and
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).
where
is the sliding surface,
is a positive constant that adjusts the convergence of the system,
represents the position error calculated as shown in (32), while
represents the velocity error, and can be obtained using Equation (33).
where
is the desired joint position vector,
is the current joint position vector,
is the desired joint velocity vector, and
represents the current joint velocity vector.
On the established sliding surface, considering
ensures that the position converges, while considering
allows controlling the convergence rate and smoothing the system’s response. From Equation (31), it can be observed that if
, then
and
. The final torque vector
to be applied to the robot can be obtained using the relationship (34).
where
is the SMC control torque vector,
is the equivalent torque vector obtained using the robot’s inverse model, while
is the gravity compensation torque vector.
The torque
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.
The function
is defined as in (37). The torque
, since it is obtained through a neural network, can be defined in a simplified way as in (38) [
31].
where
is the input vector,
is a learnable weight matrix of the CfC network, and
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
can be obtained as in (39).
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:
In this equation, the following are true:
is the robot’s inertia matrix;
, with W being the weight matrix of the CfC network;
, , with V and U being the weight matrices of the MLP network;
, , and , are positive gain matrices.
The time derivative of L
is expressed as in (41):
Substituting the robot dynamics and the control laws, the Expression (42) is obtained:
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.
Substituting these adaptation laws in (41), the expression (45) is obtained:
If the gain matrix K is chosen large enough to dominate ε, then 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 , , and 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.
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
, while the CfC achieved an MSE of
. The error values reached during the training of the network used to compensate for gravity effects were
for the MLP and
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.
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
,
, and
, while the SMC-CfC-G offers better performance in
,
, and
. 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.