This paper explains and demonstrates how to design an anti-sway controller of overhead crane for eliminating pendulum of hook-headed. In this paper, we use Lagrange Equation in analytical mechanics to obtain a mathematical model of crane crab motion system. Then the paper comes up with a piece of new idea, i.e. applies linear quadratic regulator techniques to the anti-sway controller’ design of overhead crane. In order to make the designed linear optimal system meet the practical production requirements better, we use a parametric formula’s method of solutions to LQ inverse problems to obtain the weighting matrix Q. In fact, the method is simple and practical, and ensures the performance of closed-loop system is optimized. The paper will introduce the design steps of anti-sway controller of overhead crane and realization of anti-sway controller, which are new and original in this paper.