# Adaptive Hierarchical Sliding Mode Control for Double-Pendulum Gantry Crane Based on Neural Network
## 4 Simulation Analysis  
To further verify the control performance of the RBF neural network-based hierarchical sliding mode controller, this section will present simulation verification. Simulations based on MATLAB R2023B will compare the control effects of two methods under the same operating conditions. The simulation time is 90 s, and the sampling time is 0.01 s. The control parameters are the same as in Table 1.  
The RBF neural network structure is 6-49-1, with Gaussian basis function centers at \(\mathrm{c_{j}=}\{-5,-2.5,-1.25,0,1.25,2.5,5\}\), and the Gaussian basis function width is 0.6. The adaptive gain \(\gamma\) is set to 800, and the positive design parameter \(\sigma\) in the adaptive law is set to 0.1. Furthermore, the boundary layer \(\Phi\) for the controller's saturation function is defined as 0.05. To verify the control performance of the proposed RBF neural network-based hierarchical sliding mode controller (RBF-HSMC), three sets of simulations are conducted: comparison of sliding mode control (SMC), hierarchical sliding mode control (HSMC), and the method proposed in this paper; comparison of different pendulum lengths and loads; and robustness verification under different disturbances (Figure 3). First Set: Choose sliding mode control, hierarchical sliding mode control, and the proposed RBF neural network hierarchical sliding mode control for comparison. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Parameters** & \(\lambda_{1}\) & \(\lambda_{2}\) & \(\lambda_{3}\) & \(\beta_{1}\) & \(\beta_{2}\) & \(\eta\) & \(kp\) & \(k_{d}\) & \(k_{a}\) \\ \hline Value & 2 & 1.5 & 1.5 & 0.3 & 0.2 & 25 & 60 & 15 & 25 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Control law parameters. The control rate for the sliding mode method is  
\[u=M\ddot{x}_{d}-\eta\cdot\text{sign}(s)-k_{p}e_{x}-k_{d}\dot{e}_{x}-k_{a}\left( \theta_{1}+\theta_{2}+\frac{1}{2}(\dot{\theta}_{1}+\dot{\theta}_{2})\right) \tag{39}\]  
where \(\lambda_{1}=2.5\), \(\eta=25\), \(\text{k}_{\text{P}}=60\), \(\text{k}_{\text{d}}=15\), and \(\text{k}_{\text{a}}=25\). For the layered sliding mode control method,  
\[u=M\ddot{x}_{d}-\eta\text{sign}(s)-k_{p}e-k_{d}\dot{e}-k_{a}(\theta_{1}+\frac{ 1}{2}\dot{\theta}_{1})-k_{a}(\theta_{2}+\frac{1}{2}\dot{\theta}_{2}) \tag{40}\]  
The simulation machine parameters are set as follows in Table 3[25]. The simulation results are shown in Figure 4.  
Figure 4a shows the trolley position tracking under the three control methods. All three methods can achieve trajectory tracking for the trolley, and the tracking performance is good. Regarding swing suppression (Figure 4c), while the transient swing peaks during movement are comparable, the most critical performance differentiator for precision tasks is the residual swing after the trolley has stopped (t > 30 s). However, they exhibit significant differences in the control process and final effectiveness. As shown, both HSMC (red line) and SMC (blue line) have persistent, small-amplitude oscillations, whereas the RBF-HSMC (black line) very effectively dampens these lingering oscillations to nearly zero. Compared to hierarchical sliding mode control, the RBF neural network hierarchical sliding mode control reduces the maximum residual swing angle of the hook and payload by approximately 80%. Compared to traditional sliding mode control, the reduction in the maximum residual swing angle reaches about 84%. This demonstrates its advantage in swing suppression. Figure 4d shows the change curve of the control force. The RBF neural network hierarchical sliding mode control exhibits some control force chattering in the initial stage but quickly stabilizes, and the control output is smooth. This smoothness in control has direct practical implications, as it reduces mechanical stress and extends the operational life of the trolley's motor. Compared to the sliding mode control force shown in Figure 4f, the hierarchical sliding mode control force in Figure 4e is smoother at the start-up instant.