When the hook mass of the overhead crane is too heavy or the volume of the load is too huge, the crane system will have a double pendulum effect and its control will be more difficult. For the problem of positioning and eliminating the pendulum of a double-pendulum crane considering state constraints, this paper proposes a double-pendulum trajectory planning for overhead cranes based on the analysis of pendulum angle. Firstly, constructing a novel pendulum angle resolved polynomial output signal, and secondly, processing the coupling between it and the trolly displacement and hook pendulum angle (first stage pendulum angle). Then, considering system safety and smoothness, the pendulum angle state constraint is introduced and transformed into a constraint on the trolly motion through a coupling relationship. Finally, the trajectory planning problem with constraints is converted into a nonlinear planning problem, and the particle swarm optimization algorithm is used to obtain the optimal time for the trolly to reach the target position. The comparison simulation results with the existing method MATLAB show that this method achieves the accurate positioning of the overhead crane and effectively suppresses the double swing and residual swing.