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 Mx, My and Mz, and viscous damping coefficients Dx, Dy and Dy. 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.