# Nonlinear Nonsingular Fast Terminal Sliding Mode Control Using Deep Deterministic Policy Gradient
## 4 Experimental Results and Discussion  
### Simulation Comparison with Control Algorithms  
To verify the effectiveness of DDPG-NNFTSMC proposed in this paper, the dynamic model of two joint manipulator was introduced into this section. The simulation analysis was carried out by using MATLAB/Simulink, and the sampling rate was set to \(10^{-3}\) s, the sensor was used to measure the corresponding position accuracy, response speed, and the path tracking control of each joint. Considering the characteristics of the control system, the external disturbance and uncertain friction were modeled. The control effect was compared with TSMC, NTSMC, and RBF-SMC. Figure 3 is the pseudo-code of the proposed algorithm. The second-order manipulator model designed according to [5; 35] was shown in Equation (1), where:  
\[\mathrm{M(q)}=\left[ \begin{array}{cc}\rho_{1}+2\rho_{3}\mathrm{cos(q_{2})+2 \rho_{4}\mathrm{sin(q_{2})}&\rho_{2}+\rho_{3}\mathrm{cos(q_{2})}+\rho_{4} \mathrm{sin(q_{2})}\\ \rho_{2}+\rho_{3}\mathrm{cos(q_{2})}+\rho_{4}\mathrm{sin(q_{2})}&\rho_{2} \end{array} \right] \tag{28}\]  
\[\mathrm{C(q,\,\dot{q})}=\left[ \begin{array}{cc}(-2\rho_{3}\mathrm{sin(q_{2}) }+2\rho_{4}\mathrm{cos(q_{2})})\,\dot{\mathrm{q}_{2}}&\left(-\rho_{3}\mathrm{ sin(q_{2})}+\rho_{4}\mathrm{cos(q_{2})}\right)\,\dot{\mathrm{q}_{2}}\\ (\rho_{3}\mathrm{sin(q_{2})}-\rho_{4}\mathrm{cos(\,\dot{q}_{2})})\dot{\mathrm{ q}_{1}}&0\end{array} \right] \tag{29}\]  
Figure 3: Pseudo-code of the proposed algorithm. Figure 2: DDPG–NNFTSMC control flow chart. \[\mathrm{G(q)}=\left[ \begin{array}{c}\rho_{3}St_{2}\mathrm{cos}(\mathrm{q}_{1}+ \mathrm{q}_{2})+\rho_{4}St_{2}\mathrm{sin}(\mathrm{q}_{1}+\mathrm{q}_{2})+( \rho_{1}-\rho_{2}+St_{1})\,St_{2}\mathrm{cos}(\mathrm{q}_{1})\\ \rho_{3}St_{2}\mathrm{cos}(\mathrm{q}_{1}+\mathrm{q}_{2})+\rho_{4}St_{2}\mathrm{ sin}(\mathrm{q}_{1}+\mathrm{q}_{2})\end{array} \right] \tag{30}\]  
The friction force was:  
\[\mathrm{F}\big{(}\,\dot{\mathrm{q}}\big{)}=2\mathrm{sgn}\big{(}\,\dot{\mathrm{q }}\big{)} \tag{31}\]  
The external interference is as follows:  
\[\tau_{\mathrm{d}}=\big{[} \begin{array}{cc}10\sin\big{(}\,\dot{\mathrm{q}} \big{)}&10\sin\big{(}\,\dot{\mathrm{q}}\big{)}\end{array} \big{]}^{\mathrm{T}} \tag{32}\]  
The uncertainty parameters are as follows:  
\[\rho\;=\big{[} \begin{array}{cc}\rho_{1}&\rho_{2}&\rho_{3}&\rho_{4}\end{array}  \big{]}^{\mathrm{T}} \tag{33}\]  
The physical parameters of the two joints manipulator are shown in Table 2. Table 3 was the control parameter selection for the control strategies. This paper compared Equation (1) with TSMC and NTSMC proposed in [5; 26], RBF-SMC [5; 19], NNFTSMC and DDPG-NNFTSMC proposed in this paper. In order to further compare the effects of each control strategy, Equation (28) was led to calculate the average position error \(\overline{\mathrm{E}}_{\mathrm{s}}\) and the average speed error \(\overline{\mathrm{E}}_{\mathrm{v}}\) according to [9], where \(n\) was the simulation step size, and the results are shown in Tables 4 and 5. \[\overline{\mathrm{E}}=\sqrt{\frac{1}{n}\sum_{k=1}^{n}(||\epsilon_{i}||)^{2}}\; \;(\mathrm{i}\;=\;1,\;2,\;3\ldots) \tag{34}\] \begin{table}
\begin{tabular}{c c c} \hline \hline
**Error Control Strategy** & \(\overline{\mathrm{E}}_{\mathrm{s1}}\) & \(\overline{\mathrm{E}}_{\mathrm{s2}}\) \\ \hline TSMC & 0.6083 & 0.3986 \\ NTSMC & 0.6449 & 0.4288 \\ RBF–SMC & 0.4459 & 0.1151 \\ DDPG–NNFTSMC & 0.0690 & 0.0757 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The control parameter selection for the control strategies. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**m\({}_{1}\)** & \(l_{1}\) & \(l_{\mathbf{c_{1}}}\) & \(\mathbf{l_{1}}\) & \(\mathbf{m_{e}}\) & \(l_{\mathbf{ce}}\) & \(\mathbf{l_{e}}\) & \(\mathbf{\delta_{e}}\) & \(C_{\mathbf{q}}\) & \(C_{\mathbf{z}}\) \\ \hline
1 kg & 1 m & 0.5 m & 1/12 kg & 3 kgFigures 4-7 correspond to the tracking performance of four controllers, including tracking position and tracking error of each joint, tracking speed and speed error.