Enhanced Trajectory Tracking of 3D Overhead Crane Using Adaptive Sliding-Mode Control and Particle Swarm Optimization

—Cranes hold a prominent position as one of the most extensively employed systems across global industries. Given their critical role in various sectors, a comprehensive examination was necessary to enhance their operational efficiency, performance, and facilitate the control of transporting loads. Furthermore, due to the complexities involved in disassembling and reinstalling cranes, as well as the challenges associated with precisely determining system parameters, it became essential to implement adaptive control methods capable of efficiently managing the system with minimal resource requirements. This work proposes a trajectory tracking control using adaptive sliding-mode control (SMC) with particle swarm optimization (PSO) to control the position and rope length of a 3D overhead crane system with unknown parameters. The PSO is mainly used to identify the model and estimate the uncertain parameters. Then, sliding-mode control is adapted using the PSO algorithm to minimize the tracking error and ensure robustness against model uncertainties. A model of the systems is derived assuming changing rope length. The model is nonlinear of second order with five states, three actuated states: position x and y , and rope length l , and two unactuated states, which are the rope angles θ x and θ y . The system has uncertain parameters, which are the system’s masses M x , M y and M z , and viscous damping coefficients D x , D y and D y . A simulation study is established to illustrate the influence and robustness of the developed controller and it can enhance the tracking trajectory under different scenarios to test the scheme


I. INTRODUCTION
Cranes are one of the most used systems in the industry worldwide.They usually operate in various sites like plants, shipyards, and warehouses to carry heavy payloads.One class of crane systems is the overhead cranes, shown in Fig. 1.An overhead crane usually moves in three-dimensional space, and it usually consists of three essential parts: the trolley, the gantry, and the rope that holds the payload.The trolley moves along the Y -axis, while the gantry moves along the X-axis perpendicular to the motion of the trolley.The payload is moved up and down by changing the rope length.The objective of this work is to study the control of an uncertain 3D overhead crane system and to control the system while addressing the following challenges: the system exhibits uncertainties, and its rope length changes during operation.This section reviews the modeling and control of underactuated three dimensional (3D) overhead crane systems.First, a review of the system modeling is presented.Then, a review of crane control is presented.Modeling overhead cranes can fall into two categories, first is the two-dimensional model [1], [3]- [9], 2D crane models (also called single-pendulum cranes) [10] are usually nonlinear with three states; trolley's position, the length, and angle of hoisting rope [8].In many cases, when the crane is in motion, the rope length does not change or change at a slow rate; hence, some works [1], [3]- [7], [9] assume fixed rope length; as a result, the number of states is reduced to two states only.In addition to fixed rope length, if the swing angle is assumed to be small as well, the system model can be linearized [1] [2].On the other hand, more accurate models can be obtained by incorporating more dynamics into the model, like friction between running parts [8] and external disturbances [4].
The other category is the 3D overhead crane (doublependulum cranes) [11].In 1998, [12], [13] utilized the Lagrangian method to drive a general nonlinear model for a 3D overhead crane.The model describes the dynamics of the crane's five states: x and y positions, hoisting rope length, and swing angles.Similar to 2D overhead cranes, the model can be simplified by assuming fixed rope length; hence, the number of states is reduced to four states only [10], [14], [15], [16], [17]- [20].The linear model is used in other works like [13], [14], [18] by assuming small angles and a fixed length.Some works [11], [13], [21]- [23] included viscous damping coefficients of crane's moving parts, while other models [11], [16], [18] included environmental disturbances like wind in their models.In [15], the dynamics of friction and air resistance were considered in the model.
Generally, the control methods used on overhead cranes could be classified into two major classes: open-loop and closed-loop.One example of open-loop methods is optimal motion planning [24]- [28].Since motion planning methods are offline, the reference trajectory and the system's initial conditions must be known in advance.The second open-loop control method is called command shaping [29]- [32].Unlike motion planning, the Command shaping control method is online.The advantage of using input shaping is that it damps the payload swing, yet, it is sensitive to modeling errors because input shapers are placed at the feed-forward channel [33].
The second class of control methods is closed-loop control.Many control techniques fall under the umbrella of closed-loop control.In [13], [34], a linear closed-loop control is used to control crane systems assuming linear dynamics.Because crane systems are highly nonlinear, in some cases, linear models are not enough to give an accurate representation of the crane's dynamics which could affect the quality of linear control methods.In addition, since the linearized model assumes a fixed rope length, linear control is designed to control the crane at a single rope length.Furthermore, the performance of linear methods could be affected by nonlinear uncertainties in the actual system e.g., wind and friction.Partial feedback linearization is another control scheme used for crane control [19], [22], [35].It is usually employed as an initial step to simplify the control problem [33].
Backstepping control is a method usually used for a particular class of nonlinear dynamical systems.These systems can be divided into subsystems such that the output from one subsystem is considered as a control input for the following subsystem.In [10], [36] the crane controller was designed using the backstepping method.The backstepping is usually combined with another control technique, such as [37], [38], who used it with sliding mode.
Dealing with uncertainty is a significant issue in crane systems.Uncertainties such as friction, external disturbance, or elasticity of the rope could complicate the control problem.Hence, adaptive control is employed to deal with these uncertainties [3], [10], [39]- [41].In [42], they control a highspeed 2D crane using adaptive sliding-mode.On the other hand, some studies use robust control to overcome uncertainties in the model, like [9], [43]- [45].Robust control could perform for systems with small uncertainties.On the other hand, Adaptive methods are suitable for systems with high uncertainty; however, they could be sensitive to unstructured uncertainties [33].
Model predictive control (MPC) is one of the advanced techniques that has been used in crane control.[4], [14], [46].One disadvantage of MPC is that it is sensitive to errors in the model since it highly relies on it [33].
Sliding mode control (SMC) is considered a variable structure control (VSC) technique [23].It has been extensively utilized to control dynamic systems due to its different good features.e.g., disturbance elimination and robustness in the presence of uncertainties in the system [47].Many studies have utilized VSC in the crane systems.Basher [48] used VSC to control the crane using its linearized model.Shyu, Jen and Shang [49] used a SMC anti-swing controller on a 2D overhead crane.Bartolini, Orani, Pisano and Usai [50] proposed a second-order SM control scheme to control a 2D overhead crane.Runge-Kutta (RK) methods are widely recognized as onestep techniques for effectively solving initial value problems in ordinary differential equations [51], [52].In the realm of control theory, various studies have explored the connection between RK coefficients and the stability region linked to these methods, as well as the optimal choice of step sizes for RK approaches, as discussed in [53].Due to their computational simplicity and straightforward implementation, RK methods are extensively used in practical engineering applications.One notable application is the real-time integration of RK methods into control systems.In this study, we utilized Runge-Kutta (RK) type methods to tackle the challenges posed by nonlinear ordinary differential equations [54].In many studies, SMC is combined with another control method to enhance the system's performance e.g., adaptive hierarchical sliding mode with neural network [41], [55], sliding-mode with partial-state feedback [35], sliding-mode with state observer [23], sliding-mode-based robust finite-time [20], backstepping with sliding-mode [37], and finally, a fuzzy-based VSC is used for cranes systems [56]- [59].
Another class of control that is employed in crane control is intelligent control.A common example of this class is fuzzy-Nezar M. Alyazidi, Enhanced Trajectory Tracking of 3D Overhead Crane Using Adaptive Sliding-Mode Control and Particle Swarm Optimization logic control [21], [60]- [62].Another intelligent algorithm used for crane control is PSO [32], [63].In, [55] a neural network is used with adaptive sliding mode.More than one intelligent algorithm can be combined, for example, fuzzy logic with PSO [9], and genetic algorithm with fuzzy control [64].
The 3D overhead crane system's mathematical model is nonlinear and considers the dynamics of the crane's trolley, hoist, and bridge.The model includes both actuated and unactuated states and is susceptible to external disturbances that cause uncertainties in the system dynamics.These uncertainties can arise from various sources, such as changes in the load weight, wind gusts, or friction in the crane's joints.
The uncertainties in the system dynamics can significantly impact the performance and stability of the control system.They can cause the system to become unstable or exhibit oscillations, leading to unsafe or inefficient operation of the crane.To address this issue, the proposed approach uses particle swarm optimization (PSO) to adaptively estimate the uncertain parameters of the system dynamics.The estimated parameters are then used to update the controller, ensuring that the system remains stable and robust under uncertain conditions.
The sliding mode control techniques ensure the stability of the control system by driving the system states to a desired sliding surface in a finite time.The stability of the sliding surfaces is guaranteed, and the effectiveness of the proposed approach is demonstrated through both synthetic and real-life systems.
In this paper, a trajectory tracking control using adaptive sliding mode is applied to a 3D overhead crane system with unknown parameters to control its position and rope length.While some prior studies have applied PSO for crane control, our approach focuses on utilizing PSO specifically for the identification of unknown parameters within the system.

A. Key Contributions
The main contributions of this work and the proposed method are summarized as follows: • This paper proposes a trajectory tracking control scheme to control 3D overhead crane system.A key advantage of this control scheme is that it's easy to implement since it does not require measuring all of the crane parameters in advance, the system identification is going to be done during operation using the PSO algorithm.• This paper employs the complete non-linear model of the 3D overhead crane system with a variable rope length, resulting in enhanced control over crane states and more accurate simulation results compared to the simplifications associated with using a linear model and assuming a fixed rope length.• Utilize fourth-order Runge-Kutta for integrating the dynamic equations to the upcoming time instant.
• The proposed control scheme can be used for different crane operations since it shows a good performance with different types of reference trajectories.
The rest of this article is structured as follows.The nonlinear model of the system is derived in section II.Then, an adaptive sliding-mode control with particle swarm optimization algorithm is proposed in III.Section IV presents and discusses the simulation results.Finally, the conclusion in section V.

II. SYSTEM MODELING
In general, the dynamics of a 3D crane system can be described using the following equation [23].
where q = [x, y, l, θ x , θ y ] T is the state vector, x and y represent the systems position in meters, l represents the rope length in meters, θ x and θ y represent the angles between the rope and the Y -Z and X-Z planes correspondingly in radians.F = [f x , f y , f l , 0, 0] T is the input vector.f x and f y represent the forces applied to move the trolley on the X and Y axes correspondingly in N ewtons(kg.m/s 2), while f l represents the force applied to change rope length in N ewtons(kg.m/s 2).M (q) is the matrix corresponding to the mass, D is the matrix corresponding to damping, C(q, q) is the matrix corresponding to centrifugal force, and G(q) is the matrix corresponding to gravitational force.These matrices can be described as follows:  The matrix M (q) can be shown to be positive definite for l ≥ 0 and |θ y | ≤ π/2.

A. Sliding Mode Control of 3D Overhead Crane
Using the sliding mode controller from [23], u is chosen to be where s is the sliding surface Nezar M. Alyazidi, Enhanced Trajectory Tracking of 3D Overhead Crane Using Adaptive Sliding-Mode Control and Particle Swarm Optimization the values of the positive-definite matrix K = diag{K 1 , K 2 , K 3 } determine how fast s converges to zero.In order to reduce the chattering in the sliding mode controller, the sign function is defined as sgn where λ 11 , λ 12 ,λ 13 , λ 21 , λ 22 , α 21 and α 22 are design parameters of the controller.
It can be seen from equation ( 8) that the sliding mode controller depends on the C, G, and M matrices from the system model, hence, the uncertainty in the model will affect the performance of the controller which leads to the role of PSO algorithm in identifying the uncertainties which are discussed in the next section.

B. PSO
in 1995, James Kennedy and Russell Eberhart introduced PSO.They inspired the algorithm by swarm behavior of animals such as birds [65].In the algorithm, each particle in the swarm represents an agent or candidate solution.The algorithms starts by placing the particles in random positions in the search space moving in random directions.Then, the positions and velocity of all the particles are updated in each iteration according to its distance from the the global best position and local best position, the global best is the overall best position ever reached by the swarm while the local best of a particle is the best position reached by the particle itself.The movements of the particles allows the algorithm to discover better positions (solutions) in the search space [66].The goodness of the particle position is measured using the fitness function.The fitness function is a problem dependent function (differs from problem to other) that measures how good the solution is.Fig. 2 shows the flow chart of PSO Algorithm which can be summarized in the following steps [67]: 1. Randomized Initialization of the population P (0) with n particles, each particle X j (0) represents a candidate solution.
X j (0) can be described as following: x j,k is the position of the k th optimized parameter of the j th particle, where j = [1, 2, ..., n], k = [1, 2, ..., m], and m is the number of optimized parameters.Each particle has a random velocity V j (0) bounded within a specified range.
2. Fitness evaluation of each particle in the population using the objective function J.
where x * j,k is the local best of the k th optimized parameter of the j th particle, x * * k is the k th optimized parameter of the global best, c 1 and c 2 are positive constants, and r 1 and r 2 are random numbers between 0 and 1. 6. Updating particles' positions.
7. If stopping criteria is not reached, repeat from step 2.
The advantage of using an evolutionary optimization technique like PSO is that it does not depend on the gradient of the problem to be optimized; hence, it can be applied on a wide range of optimization problems.In addition, PSO is a simple and efficient algorithm in terms of speed and memory needed.The algorithm is proven to perform well on genetic algorithm benchmark problems [65].

C. Adaptive Sliding Mode with PSO Algorithm
In this section, we combine sliding mode control with PSO to adaptively control the overhead crane with uncertain parameters which are the masses of the crane itself (M x ,M y & M l ) and the viscous damping coefficients (D x , D y & D l ).Following is the sequence of the control algorithm: 1.At time t = 0, the system has the initial values of q 0 .2. Initial particles P 0 and velocities V 0 are randomly generated (Initial estimation of the uncertain parameters).3. A random particle p i 0 from the swarm is selected to compute the estimation of the state in the next step q1 .4. Estimated states are used to compute the controller signals u t+1 using Sliding mode equation ( 8). 5.The control is applied on the actual system to move to the next state q t+1 .6.The fitness function is used to compare the estimation of each particle with the previous w states of the actual system, the fittest particle is selected to update the estimated model.7. If the stopping criteria is not met, repeat from step 4. Fig. 3 shows the summary of the control algorithm, the PSO is continuously identifying and updating the model which is then used to calculate the control signals of the SM controller.

IV. SIMULATION RESULTS
Two scenarios were simulated to test the control scheme, one when the desired trajectories of the crane are constant functions in X-axis and Y -axis, the constant values change at a certain point during the simulation Fig. 4-9.The other scenario is when the desired trajectories are in a sinusoidal form Fig. 10-12.The simulation was done using MATLAB software with custom ordinary differential equations solver based on the Runge-Kutta method in order to gain the full control over the simulation.Table I shows the values of the parameters that are used in the simulation.x Fig. 7. System Response (scenario 1), Algorithm Proposed in [23] Fig. 4, 5, 6, and 7 elucidate the resilience and merits of the suggested sliding mode control grounded in Particle Swarm Optimization (PSO) for managing the masses M x , M y , and M z of the system, along with the viscous damping coefficients D x , D y , and D z , in contrast to the sliding mode control expounded in [23] devoid of system estimation and modeling.

V. CONCLUSION
In this work, the model of 3D overhead crane with changing rope length was derived.And to overcome the uncertainty in the system which are the system masses and viscus coefficients, an adaptive sliding-mode control with PSO was proposed.The simulation results shows that in both scenarios, the control scheme was able to make the system follows the desired trajectories as shown in Fig. 4 and 10 and the PSO was successfully able to estimate the five parameters as shown in Fig. 8 and 11.The control scheme allows to control of the crane system without the need to measure all of its parameters which could be a hard process in some cases.In addition, the scheme can work with different types of reference trajectories.
Runge-Kutta methods are known for their accuracy and stability in solving ODEs, making them valuable for precise integration of dynamic equations in complex systems like the 3D crane.So, incorporating Runge-Kutta for solving ordinary differential equations (ODEs) could indeed enhance trajectory tracking within the nonlinear 3D crane system when coupled with sliding mode control.
Additionally, the utilization of Particle Swarm Optimization (PSO) to identify and optimize the system model is a notable aspect.PSO can effectively handle uncertainties and aid in identifying an accurate system model, thereby improving the precision of the control strategy.When combined with the integration power of Runge-Kutta, this approach presents a comprehensive solution for enhancing trajectory tracking and control within the nonlinear 3D crane system.

Following
are the nonzero elements of matrix M (q) m 11 = M x + m, m 13 = m 31 = m sinθ x cos θ y m 22 = M y + m, m 23 = m 32 = m sinθ x m 33 = M l + m, m 14 = m 41 = m l cosθ x cos θ y m 44 = m l 2 cos 2 θ y , m 15 = m 51 = −m l sinθ x sinθ y m 55 = m l 2 , m 25 = m 52 = m l cosθ y Nezar M. Alyazidi, Enhanced Trajectory Tracking of 3D Overhead Crane Using Adaptive Sliding-Mode Control and Particle Swarm Optimization Journal of Robotics and Control (JRC) ISSN: 2715-5072 256 The nonzero elements of matrix C(q, q) are c 13 = m cosθ x cosθ y θx − m cosθ x cosθ y θy c 14 = m cosθ x cosθ y l − ml sinθ x cosθ y θx − ml cosθ x sinθ y θy c 15 = −m sinθ x sinθ y l − ml cosθ x sinθ y θx − ml sinθ x cosθ y θy c 23 = m cosθ y θy , c 25 = −m cosθ y l − ml sinθ y θy c 34 = −ml cos 2 θ y θx , c 35 = −ml θy c 43 = ml cos 2 θ y θx , c 44 = ml cos 2 θ y l − ml 2 sinθ y cosθ y θy c 45 = −ml 2 sinθ y cosθy θx , c 53 = −ml θy c 54 = ml 2 cosθ y sinθ y θx , c 55 = ml l The nonzero elements of matrix G(q) are g 3 = −mg cosθ x cosθ y ; g 4 = mgl sinθ x cosθ y , g 5 = mgl cosθ x sinθ y where M x and M y indicate the masses moving along X and Y axes in kg, respectively, M l indicate the mass of the rope in kg, m is the mass of the load in kg, g is the gravitational acceleration in m/s 2 , and D x , D y and D l indicate the viscous damping coefficients in kg/s.

3 . 4 .
Updating the global best X * * and individual bests X * based on the fitness of the particles.Nezar M. Alyazidi, Enhanced Trajectory Tracking of 3D Overhead Crane Using Adaptive Sliding-Mode Control and Particle Swarm Optimization Updating the weights