# Adaptive Hierarchical Sliding Mode Control for Double-Pendulum Gantry Crane Based on Neural Network
## 3 Controller Design  
The traditional single-layer sliding mode control (SMC) tends to cause chattering phenomena. On the one hand, this is due to the system constantly switching between sliding surfaces during operation, and on the other hand, it is because of the use of a constant speed reaching function. In constant speed reaching control, the larger the parameter, the faster the response speed, but the more intense the chattering becomes [22]. The occurrence of chattering can severely affect the work efficiency and may even cause damage to the motor controlling the trolley. Currently, solving the chattering problem in sliding mode control has become a research hotspot. To address that issue, this section proposes replacing the single-layer sliding surface with a multi-layer sliding surface, allowing the system to switch between sliding surfaces at each layer during motion. The constant speed reaching function is replaced with a smooth saturation function to further reduce the possibility of chattering. Layered sliding mode control mainly includes the following three characteristics:  
1. Hierarchical Design: The crane's double-pendulum control system is decomposed into several simple subsystems, with each layer addressing different aspects of the system's control requirements. For the system designed in this section, the control is divided into three layers: tracking the trolley's trajectory, the dynamic response of the hook's swing angle, and the dynamic response of the load's swing angle. These subgoals are interrelated, and the hierarchical design helps separate control and optimize them step by step. 2. Design of Multi-layer Sliding Surfaces **: A sliding surface is defined at each level. The control behavior of the system switches between these surfaces to achieve the control objectives. 3. Combined Control: The control at each level must be combined to make the control system effective. Layered sliding mode control divides the control system into multiple levels, each focusing on a single objective, which helps improve control performance at each level. Compared to traditional sliding mode control, the main advantage of layered sliding mode control is that it can decompose complex problems into multiple independent and simpler subproblems, optimizing each layer step by step. This enhances the system's robustness and flexibility and simplifies the design process. Hierarchical design also effectively handles multi-objective control and non-linear coupling issues and reduces the computational load, making it suitable for a wider range of practical applications. To address the modeling uncertainties, external disturbances, and double-pendulum coupling vibrations in the double-pendulum bridge crane system, this paper proposes an adaptive control method based on the neural network sliding mode. For the nonlinear bridge crane system, multi-objective control for position tracking and double-pendulum anti-swing is achieved by combining layered sliding mode tracking with local feedback linearization techniques. Additionally, an RBF (radial basis function) neural network is introduced to estimate and compensate for system uncertainties online, enhancing the robustness and adaptability of the control system. The logical flow of this entire RBF-HSMC algorithm is visually summarized in Figure 2.  
Figure 2 provides a visual summary of the entire logical flow of the RBF-HSMC algorithm. At each time step, the controller begins by taking the desired trajectory and the measured real-time state of the system as inputs. Based on these inputs, it calculates the tracking error and fuses it with the swing dynamics to compute a single composite sliding surface, s. This surface, which quantifies the overall system error, is then fed into the RBF neural network. The network estimates and compensates for unknown system dynamics, and this compensated signal is subsequently used to calculate the final total control force U.