The detecting instrument for surface quality of steel ball bases on embedded control system and image detection technique, and is applied to detect surface defect region of steel ball in bearing. Its control system requires excellent real-time character and control accuracy. This paper puts forward a new design for controller of detecting instrument. We adopted TMS320LF2407A which produced by company TI as main processor, and integrated CPLD to develop an embedded controller. We used the Ziegler–Nichols tuning methods to get PID control and designed hardware circuit. We realized the function of correlative logic elements through programming, and constructed an embedded multitask operating system based on the transplant of μC/OS-II on TMS320LF2407A. It solved problems about intricate structure and bad real-time character existed in traditional control module. The result of simulation and experiment indicates that this control system satisfied excellently the requirement of high speed and real-time image detection.