## 4 Simulation  
**Remark 1**. : _The control signals (voltage) generated from the controller designed are proportional to torques applied on each joint of the manipulator regarding the characteristics of the drivers._  
**Remark 2**. : _The initial parameters are chosen based on trial and error such that the highest performance can be achieved. In this study, the learning rate \(\eta_{kij}\) for updating each parameter is designed based on experiments._  
**Remark 3**. : _In the simulations, the initial values of the NNSMC are set to be the same as the conventional SMC._  
In this section, some simulations were conducted on the MATLAB-Simulink for the 3-DOF manipulator presented in Figure 1. The simulations were carried out with two case studies and comparisons between the proposed algorithm with the conventional controller are discussed to verify the effectiveness in tracking performance. The system parameters are described in Table 1. The estimated inertia, Coriolis, and gravity matrix describing the manipulator dynamics are shown in the Appendix A. The payload profile is described in Figure 5. We considered the payload change to verify the effectiveness of the proposed algorithm. The initial parameters of the three controllers are shown in Table 2. The reference trajectory of the three joints was designed as:  
\[\left\{ \begin{array}{ll}q_{1d}=5\
icefrac{{}}{{2}}+5\
icefrac{{}}{{2}}\sin( 2\pi t/10-\
icefrac{{}}{{2}})&(\text{degree})\\ q_{2d}=8\
icefrac{{}}{{2}}+8\
icefrac{{}}{{2}}\sin(2\pi t/10-\
icefrac{{}}{{ 2}})&(\text{degree})\\ q_{3d}=50+47\sin(2\pi t/10-\
icefrac{{}}{{2}})&(\text{degree})\\ \end{array} \right.. \tag{44}\]  
The tracking performances of the three joints are depicted in Figure 6, Figure 7, and Figure 8, respectively. The updating of each controller gains of the proposed NNSMC corresponding to three joints are expressed in Figure 9, and the slope of the sliding surfaces is depicted in Figure 10. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameters** & **Value** & **Unit** \\ \hline Mass of link & \(\text{m}_{i\text{ (i = 1,2,3)}}=5\) & kg \\ Length of link 1 & \(l_{1}=0.1\) & m \\ Length of link 2 & \(l_{2}=0.5\) & m \\  & \(l_{3}=0.2\) & m \\ Length of link 3 & \(d_{0}=0.2453\) & m \\  & \(d_{1}=0.2471\) & m \\  & \(d_{2}=0.036\) & m \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The system parameters of the manipulator. As can be seen in Figures 6-8, with respect to the response of the three joints, when the external payload increased suddenly at the 20 th second time period, the tracking performance did not change so much, its tracking error when applying the proposed NNSMC was the smallest in comparison with that of PD and conventional SMC, and the stability of the system was maintained. The behavior of the system was adapted by the changing of the controller feedback gains shown in Figures 9 and 10. At the beginning, the initial was set as the same value as the conventional SMC (for the robust gains K and \(\alpha\)) and the same as PD (for the ratio between error and the change of error). Regarding the updating law, the controller gains were adjusted in order to achieve a suitable value for the working conditions, thus reducing the tracking error with external payload impacts. The controller gains are described in Figure 9, whereas Figure 10 shows the adjusted slope of the sliding surfaces. Due to the errors in the second and third joints satisfying the constraints, the robust gains of these joints did not change much even when the external payload was attached at the time 20 th second However, due to the structure, the mass inertia of the first joint increased significantly, thus resulting in the time for the first joint to adapt to the change being longer. As opposed to previous works, where only the term \(-\alpha\text{tanh}(s)-Ks\) was adjusted to adapt with the working operation, in this study, we considered the slope of the sliding surface as an important parameter that needed to be tuned to minimize the state error.