Evaluation of Neural Network Effectiveness on Sliding Mode Control of Delta Robot for Trajectory Tracking

: The Delta robot is an over-actuated parallel robot with highly nonlinear kinematics and dynamics. Designing the control for a Delta robot to carry out various operations is a challenging task. Various advanced control algorithms, such as adaptive control, sliding mode control


Introduction
Delta robots are fast, accurate, and versatile, suitable for tasks like assembly, pickand-place, sorting, and classification.The Delta robot is a parallel robot with three arms connected to an end effector mounted on its base, exhibiting an over-actuated configuration.Lagrangian dynamics, inverse kinematics, and screw theory are three common approaches to model the Delta robot [1][2][3].Knowing the dynamic model is essential for motion planning and trajectory tracking.It allows the controller to calculate the required joint inputs to achieve a desired end effector position.The control design of a Delta robot is challenging due to its high level of non-linearity and complicated kinematic and dynamic model.Therefore, plenty of nonlinear and adaptive control algorithms have been implemented for trajectory tracking and disturbance rejection of the Delta robot.Sliding mode control is one of the most popular nonlinear control algorithms [4,5].This algorithm has been extensively applied to the trajectory tracking of the Delta robot combined with the fuzzy neural network [6], nonlinear proportional-derivative (PD) control [7], and synergetic control [8].Additionally, Radial Basis Function Neural Networks (RBFNNs) combined with sliding mode control were adopted in [8,9] to compensate for the unknown disturbances.The work reported in [10] proposed an online estimation approach to compensate for various uncertainties in the Delta robot and to improve the tracking performance.An adaptive active disturbance rejection control was adopted for the output-based robust trajectory tracking of the Delta robot in [11].Iterative learning control has also been applied to the trajectory tracking of the Delta robot with a high performance.Boundjedir, C.E. and Bouri, M. [12] proposed a PD-type ILC combined with PD control to improve the iteration performance.Model-free iterative learning control was further implemented on the Delta robot with non-repetitive trajectories [13].Moreover, a model reference adaptive control has also been adopted for control of the Delta robot.Combining an identified linear model with mode reference adaptive control has shown a significant performance improvement compared to the three commonly used methods: PID, adaptive control, and sliding mode control algorithms [14].
Besides traditional control algorithms, neural networks were also adopted to improve the trajectory-tracking performance of the Delta robot.An inverse kinematic controller using neural networks was presented in [15] for trajectory control of a Delta robot in real-time by making use of data collected from simulation.Ref. [16] proposed a datadriven optimal control algorithm by approximating the solution of the Hamilton-Jacobi-Bellman equation using neural networks.A neural network model was proposed in [17] to approximate the inverse kinematics of the Delta robot with randomly sampled experimental data and was implemented on the hardware in an open-loop control for trajectory tracking.
Most of the advanced control algorithms mentioned above are either data-driven or model-based.Model-based control algorithms are highly dependent on the accuracy of the model.Therefore, they have high requirements for control robustness in terms of model uncertainties and disturbances.On the other hand, data-driven algorithms operate independent of model accuracy requirements.Given the paramount importance to safety considerations during normal operations, ensuring robustness and maintaining optimal performance pose significant challenges in the control design of Delta robots employing data-driven algorithms.Moreover, another challenge in Delta robot control is the singularity [18,19], which occurs when the end effector is positioned at specific locations where the kinematic model degenerates and the joint angles become indeterminate, which can lead to erratic behavior and potential damage to the robot.Therefore, understanding the robot's geometry and workspace is crucial to avoid singularities, which can cause significant problems during operation.
In this study, we consider a Delta robot equipped with stepper motors as inputs.Once the desired trajectory of the end effector is determined, inverse kinematics can be adopted to solve for the joint inputs analytically or numerically using optimization methods.Moreover, control algorithms can be implemented to further improve the reliability of the motion and the trajectory tracking accuracy of the Delta robot.The objective of this study is to develop a hybrid of data-driven and model-based sliding mode control algorithms instead of using the conventional optimal control to improve the trajectory tracking performance.The inverse kinematics of the Delta robot is analytically difficult to express in the control-affine form, which complicates the control design process.Therefore, to deal with this issue, we propose that neural networks are used to create a control-affine nonlinear input-output dynamic model of the Delta robot, considering the stepper motor angles and velocities as inputs.The neural network input-output model is trained with randomly sampled data in a sufficiently large workspace of the Delta robot.Furthermore, the model-based sliding mode control for trajectory tracking is designed based on the neural network model.The proposed neural networks make full use of the inverse kinematics while the sliding mode control delivers excellent performance in trajectory tracking for a Delta robot.We should point out that the proposed control-affine nonlinear dynamic model of the Delta robot is not derivable either from Lagrangian dynamics or inverse kinematics.It is completely data-driven and can be updated once new experimental data become available.This is also one of the contributions from our work.Section 2 presents the architecture of the Delta robot and its inverse kinematics.Section 3 presents the control-affine nonlinear dynamic model in terms of the neural networks.Section 4 presents the sliding mode control with the neural network model and extensive numerical simulation results to validate the proposed model and control design.Section 5 concludes this paper.

Dynamic Model of Delta Robot
The mechanical structure of a three-DOF Delta robot is shown in Figure 1. Figure 2 shows the geometry and coordinates of the Delta robot in 2D and 3D views.A typical Delta robot is composed of a fixed platform, a moving platform, three active arms, and three passive arms connected to an end effector mounted on the base.The active arms of the robot are driven by the rotation actuators, which are stepper motors in this study.The parameters of the Delta robot are given in Table 1, and the specifications of components used for fabricating the Delta robot can be found in [17].

Inverse Kinematics
Inverse kinematics stands out as one of the most widely adopted algorithms for modeling the Delta robot.Solving the inverse kinematics involves deriving the geometrical relationships between its links and joints.From Figure 2, the relationship between the link positions and angles θ i can be given as where i = 1, 2, 3; Y Fi and Y Ji are the positions of the points F i and J i in the Y direction; and Z Fi and Z Ji are the positions of the points F i and J i in the Z direction.The positions of the joints Y Fi and Y Ji satisfy the geometric constraints of the Delta robot as described in [17].
The inverse kinematics describes how the angles of the joints relate to the positions of the end effector.The joint velocities θi are not considered in Equation (1).In this study, the control inputs include angles and joint velocities [θ, θ] of the stepper motors.Hence, the dynamic input-output model of the Delta robot should involve joint velocities.One way to compute the joint velocities is by using the Jacobian matrix J that relates to the joint velocities θ = [ θ1 , θ2 , θ3 ] T and the end effector position velocities v = [ ẋ, ẏ, ż] T [20]: where r = (x, y, z) T describes the centroid position of the end effector.Equations ( 1) and ( 2) suggest that the joint velocities are highly nonlinear and complex functions of the positions and its velocities of the end effector.In the data-driven study, the joint velocities can be computed using finite difference approximation as, for example, where k is the discrete time, i represents the stepper motor's index number and ∆t is the sample time.However, as discussed in the Section 1, this information alone is not enough to help us build a dynamic input-output model for the Delta robot.Furthermore, if the finite difference method or Jacobian matrix method is used to compute joint velocities, errors in the computed velocities can accumulate over time, leading to a poor position prediction.This affects the performance of trajectory tracking control.
It is commonly known that the control-affine model of a system provides a convenient platform for control design.In this study, we propose to develop a control-affine nonlinear model of the Delta robot by utilizing neural networks.Neural networks can learn and model the underlying physical relationship between the inputs and outputs.A rich set of inputoutput data from the forward model of the Delta robot can be used to train neural networks in order to build the control-affine nonlinear dynamic model of the Delta robot without the need for the Jacobian matrix, finite difference, and inverse kinematics.The proposed controlaffine model is completely data-driven and is intended for control design consideration.The model is not derivable from Newton's law or Lagrange's equation.The input-output data for training the neural networks are randomly sampled in a sufficiently large workspace.Moreover, the neural network model can be further updated by incorporating the concept of transfer learning when new experimental data become available.

Neural Network Model
The nonlinear control-affine model with stepper motor joint angles and velocities as inputs makes the control design relatively straightforward and is given in the following.ẍ = f(x, ẋ) + g(x, ẋ)u ( 4) As pointed out before, the control-affine form of the model is not directly derivable from Newton's law, Lagrangian dynamics, or inverse kinematics.Although various dynamic models for the Delta robot that use the computed-torque approach are available in the literature, they cannot be applied to this study, since the inputs of the Delta robot are only the joint angles and velocities.Here, the neural networks are adopted to approximate the nonlinear functions of the dynamic model for the Delta robot.Specifically, two neural networks are constructed to approximate the nonlinear functions f(•) and g(•).Notably, with an extra hidden layer and an additional input, a single neural network can be customized to approximate the two nonlinear functions.The structure of the proposed neural network model for the Delta robot is shown in Figure 3.The inputs for neural networks are x, ẋ, and u.The output for the neural networks is ẍ, which can be expressed in terms of the two neural networks f(x, ẋ) and ĝ(x, ẋ): where n is the sample time.The loss function is defined as where ẍ(n) is the prediction from neural networks and ẍ(n) is the system response.Data can be collected from simulations or experiments, and n s is the total number of sampled points.Detailed information of the number of hidden layers, type of activation function, and number of neurons are shown in Table 2. Here, the sigmoid neuron is chosen as the activation function.Other activation functions such as tanh or ReLU can also be considered based on the universal approximation theorem of neural networks.The number of training epochs is set as 20,000.The chosen optimization algorithm is stochastic gradient descent (SGD).Dropout with a frequency of 0.5 is adopted to prevent overfitting.The SGD algorithm is one of the most popular stochastic optimization methods in the machine learning community [21].In this study, it has been adopted as the optimization algorithm to train the neural networks.The stochastic gradient descent maintains a single learning rate to update all weights compared to Adam [22].The loss value reached 0.000281 after training for 20,000 epochs.
A remark on the choices of various hyper-parameters for the neural networks is in order.We have to say that the parameters we used are not guaranteed to be optimal.Since there is no established general rule for selecting the hyper-parameters of neural networks, some level of trial and error is involved with specific data set of different applications.With the help of the dynamic model built in Section 2, a SimScape model of the Delta robot is developed and used to generate the data of time series x, ẋ, ẍ and θi .The SimScape model of the Delta robot is shown in Figure 4 and created based on the actual Delta robot that is to be used for the experiment, as shown in Figure 1 and Table 1.The parameters of this modeled Delta robot are digital twins of those listed in Table 1.To generate training data, we randomly sample joint angles in a bounded range of θ i ∈ [−30 • , 120 • ], as shown in Figure 5, in order to cover the typical workspace of the Delta robot.A total of 2500 data points are sampled in the workspace, and 75% of the data are chosen as training data set, and 25% of the data are chosen as validation data set.The corresponding positions of the end effector in 3D are shown in Figure 6.The boundary of these points is associated with the maximum of the positions in the workspace of the end effector of the targeted Delta robot.

Sliding Mode Control
Recall the control-affine nonlinear model in terms of the neural networks in Equation ( 5).We have ẍ = f(x, ẋ) + ĝ(x, ẋ)u (7) Assume that the Delta robot will track the desired trajectory x d (t).The tracking error and its derivative are given as We select a sliding surface as where C ∈ R 3×3 is positive-definite and satisfies the Hurwitz stability condition.Thus, the sliding mode control can be designed as [23] where γ > 0 and α > 0 are constant gains, and ϵ > 0. Chattering is a prevalent concern associated with sliding mode controllers with switching term sgn(s).To reduce the chattering in the sliding mode control, the switching terms for the control law and the sliding surface have to be carefully chosen [24].In this paper, the continuous function tanh(•) is adopted to replace the discontinuous sign function [25].ϵ determines the steepness of tanh(•) as an approximation of the sign function.To prove the stability of the sliding mode control, we shall need the following lemma.
Define a Lyapunov function as Then, we have therefore, we obtain Hence, the closed-loop system is stable.Furthermore, we have According to Lemma 1, we conclude that V(t) exponentially decreases at the rate 2(α + γ/ϵ) when s is outside the boundary layer defined by ϵ, and at the rate of 2α when s is located inside the boundary layer.In both cases, we have Hence, the tracking error of the sliding mode control for the system in Equation ( 7) converges asymptotically to zero at the exponential rate.On the other hand, when the neural network model of the Delta robot has a sufficiently small error, it can be expected that the sliding mode control will deliver similar tracking performance in experiments.This is a subject of on-going work.In this paper, we applied neural network model-based sliding mode control to the physics-and geometry-based model of the Delta robot, and carried out numerical simulations to observe and evaluate the validity of the proposed neural network modeling and control design approach.
In the following examples, we take C as 10 × I where I is the identity matrix, α = 0.1, γ = 0.1, and ϵ = 1.Three different paths are adopted to test the performance of the proposed sliding mode control.The mathematical expressions of three paths, namely heart curve, logarithmic spiral, and spiral, are given as follows.
Heart curve:  (20) where t e is the end of the time.The 3D tracking results and part of the control inputs θ i for different paths are shown in Figures 7-12     A detailed summary of the trajectory tracking errors are shown in Table 3.By evaluating these results, it is found that the maximum value of tracking error for different curves are the same, and the trajectory tracking errors all converge to zero in a finite time.

Conclusions
Delta robots have highly nonlinear dynamics.Finding a control-affine model to describe the input-output relationship of the Delta robot analytically with joint angles and velocities as inputs is difficult.Since it is difficult to obtain the analytical representation of the input-output model, a neural network representation was developed to represent the model.This is a completely data-driven model intended for control design consideration, and it is not derivable from Newton's law or Lagrange's equation.The neural networks are trained with randomly sampled data in a sufficiently large workspace.Then, the sliding mode control is designed by making use of the control-affine model to track the desired trajectory.Extensive numerical results have shown that the neural network model-based sliding mode control can be highly effective for trajectory tracking for paths with varying complexity.However, in real-world applications, this control approach can be challenging due to differences in parameters of the frames, arms, and joints, as well as the presence of backlash and flexibility in the joints of the Delta robot.These factors can affect the implementation of neural network-based sliding mode control on hardware.Moreover, the parameters of the sliding mode control need to be fine-tuned based on the specific hardware being used, and high-frequency data collection is required for successful implementation.To overcome these challenges, further work is required to implement neural network-based sliding mode control on hardware.With real data collected from experiments, the method of transfer learning can be applied to refine the neural network input-output model and to update the parameters of the sliding mode control.

Figure 1 .
Figure 1.Hardware setup of the Delta robot.

Figure 2 .Table 1 .
Figure 2. The geometric configuration and coordinate framework required to model the inverse kinematics of the Delta robot.Left: geometric structure of the Delta robot in 3D.Right: twodimensional projection of geometry and coordinates of the Delta robot joints and links.
and g(•) ∈ R 3×6 are nonlinear functions of their arguments, and p x , p y , and p z represent the position of the end effector at the centroid along the x, y, and z axes.

Figure 3 .
Figure 3.A flowchart illustrating the neural network model of the Delta robot.

Figure 6 .
Figure 6.Random sampled points in the 3D workspace of the Delta robot.
. The neural network model-based sliding mode control demonstrates remarkable performance in trajectory tracking of various paths while maintaining bounded control inputs.This indicates that the trained neural network model successfully captures the Delta robot's nonlinear property with an acceptable magnitude of tracking error.The trajectory tracking errors of the sliding mode control e(t) = [e p x , e p y , e p z ] T for different curves are shown in Figure 13.The initial conditions for the tracking of all trajectories are chosen as [x; ẋ] = [x d ; ẋd ] − [0.1; 0.1; 0.1; 0.1; 0.1; 0.1].

Figure 7 .
Figure 7. Three-dimensional trajectory tracking of heart curve using the sliding mode control with the neural network control-affine model.

Figure 8 .
Figure 8. Magnitude of the sliding mode control with the neural network control-affine model for heart curve trajectory tracking.

Figure 9 .Figure 10 .
Figure 9. Three-dimensional trajectory tracking of logarithmic spiral curve using the sliding mode control with the neural network control-affine model.

Figure 11 .Figure 12 .Figure 13 .
Figure 11.Three-dimensional trajectory tracking of spiral curve using the sliding mode control with the neural network control-affine model.

Table 2 .
Summary of neural networks.

Table 3 .
Summary of different trajectory tracking errors in m.