To promote efficiency and reduce labors work, automatic pipe straightening machine was designed. The way of detecting the bending of pipes was developed by using laser displacement sensors, then where and how to put pressure on pipes were decided with the theory of elastic-plastic mechanics. The control system of automatic pipe straightening machine was also developed,which can display parameters.In the system, parameters could be input to adapt to different types of pipes.It is proved that using the designed straightening machine, labors work is reduced significantly and the automation of pipe straightening is improved.