A magnetic ball levitation control system based on the structure of the double linear hall sensor is designed and realized in this paper. The sensor is respectively placed in the bottom and the top center position of the electromagnetic driver. In order to eliminate the influence of electromagnetic driver magnetic field of the sensor output signal, the output signal of the sensor is done subtract by the signal conditioning circuit. The experiment shows that when the distance varies within the range between 16.46 and 42.46 mm, the output voltage value of the signal conditioning circuit is proportional to the -3 power of the distance between the magnetic ball and the bottom end of the electromagnetic driver. We design a magnetic ball levitation control system based on PID controller and select suitable PID controller parameters. The overshoot and response speed of the system can meet the design requirements. The stable magnetic levitation of the magnetic ball at the position of 25 mm is realized. The position control accuracy of the system is up to ±0.125 mm.