PID control scheme has been widely used in most of control system. The method of design PID controller is mature gradually. Due to the controlled object is nonlinear and time-varying, so the integer PID controller can not achieve the desired effect. After study people found that the application of fractional order PID controllers can solve the problem of time-varying and nonlinear very well and the controller has high control precision. Currently, the method of design fractional order PID controllers is little. This article describes an artificial immune algorithm and using MATLAB for simulation, the simulation results demonstrate that the artificial immune algorithm has little error and high optimization speed than traditional optimization algorithm, and the fractional order PID controller has a better control effect than traditional integer PID controller.