Compared with traditional integer-order PID controller, fractional order PID controller can expand the range of its parameters and control controlled objects more flexibly. It has become one of the research focuses in control field in recent years. Directing at the problem that it is not easy for model parameters of nonlinear fractional order PID controller to be determined, this paper presents a new adaptive particle swarm optimization algorithm which is named YLPSO and can conduct automatic setting of parameters for fractional order PID controller. This algorithm, mainly adopting strategies of adaptive dynamic weight and asynchronization adjustment of learning factors, realizes ability in intensifying algorithm convergence to global optimum by balancing global searching performance and local searching performance of PSO algorithm. Simulation results show that, compared with differential evolution algorithm and standard particle swarm optimization algorithm, YLPSO can control parameter optimizing effect better. Algorithm put forward in this paper provides a new reference for combination of intelligent optimization algorithm and nonlinear fractional order controller.