The self-tuning PID controller was designed based on set theory of fuzzy control. It can attain on-line tuning of the control parameters and realize the optimal control by measuring control error and error varying and fuzzy-reasoning. Simulation study was made with the toolboxes of Simulink and fuzzy inside MATLAB, the simulation results show that the fuzzy control system can improve the dynamic and static performance and improve the robustness of the system compared with the routine PID.