The invention discloses a
PID controller parameter setting
algorithm based on an improved PSO (
particle swarm optimization)
algorithm, and the
algorithm comprises the following steps: 1, initializing the algorithm parameters; 2, switching to an iterative loop, and carrying out the updating of the position and speed of each particle; 3, randomly searching a new position in the neighborhood of a current position; 4, calculating the adaptability difference between two positions, and judging whether to accept the new position or not through a
simulated annealing mechanism when the adaptability of the new position is inferior to the adaptability of an original position but is superior to the adaptability of a
global optimal position; 5, updating the
global optimal position of a
population, carrying out the
natural selection operation, carrying out the arrangement of all particles according to the adaptability values, and employing the information of a part of better particles to replace the information of the other half particles; 6, judging whether to stop the iteration or not; 7, outputting
PID controller parameters or executing step 2 again. The method can achieve the automatic setting of
control parameters, irons out a defect that a conventional PSO algorithm is very liable to be caught in local optimization, achieves the
complementation of the
simulated annealing operation and a
natural selection strategy, improves the convergence precision of the algorithm under the condition that the number of convergence times of the algorithm is guaranteed, is higher in robustness and precision, and enables the
PID controller to generate a more excellent
control effect.