## 4 Simulation
### Two-DOF Robotic Arm Simulation  
In this section, the proposed control scheme is applied to a two-degree-of-freedom robotic arm simulation platform to verify its effectiveness. Specific simulation platform parameters are shown in Table 3. The simulations were carried out in two parts, using the proposed fixed-time control combined with an improved sparrow search algorithm. To validate the robustness of the algorithm, we compared it with traditional PD control. The simulations were performed using MATLAB R2021a on a system running Windows 10 (64-bit) with an 11 th Gen Intel (R) Core (TM) i5-11400F processor at 2.60 GHz. The first part of the simulation was conducted without the sparrow search algorithm. In the second part, we presented the simulation results of the control scheme with the sparrow algorithm and compared them to those of the control without the sparrow search algorithm. To compare control performance, we chose the same desired signals, \(q_{1d}\) and \(q_{2d}\), as were utilized for 0.3 rad and 0.2 rad, respectively, and we set the same initial conditions as were used for \(q=[0,0]\) and \(\dot{q}=[0,0]\). There are 5 nodes in the hidden layer of the neural network, with the activity centers of the hidden layer nodes set at \([-1,\,-0.5,\,0,\,0.5,\,1]\), and the variance of the basis function is 1. The control parameters are set to \(A_{11}=0.1,\,\,\,A_{12}=0.01\,\,\,A_{21}=0.01\,\,\,A_{22}=0.001\), and \(\,\,\zeta=0.7\), and the initial weight is \(\Phi_{ij}=0\), where \(i=1,\,\,\,2\) and \(j=1,2,\dots,\,5\). Since the desired trajectory is a square wave, the error suddenly changes when the signal jumps. Therefore, \(k_{P}=10\) was chosen to control the amplitude of oscillation. Symmetric input saturation constraints were chosen with corresponding values of \(\tau_{1 max}=9\) Nm, \(\tau_{1 min}=-9\) Nm, \(\tau_{2 max}=6\) Nm and \(\tau_{2 min}=-6\) Nm, \(\Lambda_{i}=10I_{5\times 5},\,\,\,\epsilon_{i}=0.0002\), and \(i=1,\,\,2\). From Figures 4a and 5a, it can be observed that the first arm reaches a steady state at 0.231 s when tracking the desired trajectory, with an overshoot of 0.311 rad. The steady state error is \(3.59\times 10^{-3}\) rad for the first 5 s, and \(1.97\times 10^{-3}\) rad for the 5 to 10 s interval. From Figures 4b and 5b, it is noted that the second arm reaches a steady state at 0.296 s when tracking the desired trajectory, with an overshoot of \(2.0088\times 10^{-1}\) rad. The steady state error is \(3.92\times 10^{-4}\) rad for the first 5 s, and \(2.2002\times 10^{-4}\) rad for the 5 to 10 s interval. From Figure 6, it is known that the maximum control torque of the first and second arms does not exceed the input unsaturated signal. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameters** & **Meaning** & **Value** & **Unit** \\ \hline \(M_{1}\) & Mass of link 1 & 3.64 & kg \\ \(M_{2}\) & Mass of link 2 & 0.42 & kg \\ \(\mathbf{L_{1}}\) & Length of link 1 & 0.301 & m \\ \(\mathbf{L_{2}}\) & Length of link 2 & 0.094 & m \\ \(\mathbf{I_{1}}\) & Inertia of link 1 & \(\mathbf{L_{XX}=0.0437;\,\,L_{XY}=0.0003;\,\,L_{XX}=0.0000}\) & \\  & & \(\mathbf{L_{XX}=0.0003;\,\,L_{YY}=0.0065;\,\,L_{YZ}=0.0071}\) & kg/m\({}^{2}\) \\  & & \(\mathbf{L_{ZX}=0.0000;\,\,L_{ZY}=0.0071;\,\,L_{ZZ}=0.0071}\) & \\  & & \(\mathbf{L_{XX}=0.0004;\,\,L_{XY}=0.0000;\,\,L_{XZ}=0.0000}\) & \\ \(\mathbf{I_{2}}\) & Inertia of link 2 & \(\mathbf{L_{ZX}=0.0000;\,\,L_{YY}=0.0065;\,\,L_{YZ}=0.0000}\) & kg/m\({}^{2}\) \\  & & \(\mathbf{L_{ZX}=0.0000;\,\,L_{ZY}=0.0000;\,\,L_{ZZ}=0.0010}\) & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Parameters of the two-DOF robotic arm. A fixed-time improved sparrow search algorithm is employed, with the population size set to 30, and iterated 50 times. For parameters \(A_{11}\), \(A_{12}\), \(A_{21}\), and \(A_{22}\), the lower bounds are set to 0.5 times \([0.1,0.01,0.01,0.001]\), and the upper bounds are set to 2 times \([0.1,0.01,0.01,0.001]\).