The invention relates to a four-axis unmanned aerial vehicle PID parameter setting method based on a
whale optimization
algorithm, and belongs to the technical field of unmanned aerial
vehicle control. The method aims at solving the problems that in the traditional PID parameter setting process, experience is relied on, time is consumed, and optimal parameters are difficult to obtain. According to the method, the
whale optimization
algorithm is introduced, and the characteristics of high global search capability and high convergence speed are utilized, so that the parameters of the four-axis unmanned aerial vehicle
PID controller are automatically optimized. The method comprises the steps that firstly, a
kinetic model of the four-axis unmanned aerial vehicle is established, a control target of a
PID controller is determined, PID parameters serve as optimization variables, and a
fitness function is defined to evaluate control performance; then, performing global search in a parameter space by using a
whale optimization
algorithm, and gradually optimizing PID parameters by simulating a whale
predation behavior; the optimized PID parameters are applied to a flight
control system of the four-axis unmanned aerial vehicle, and stable attitude, height and
position control is achieved. The method has the advantages that PID parameters are automatically set through the whale optimization algorithm, the low efficiency and subjectivity of a traditional
trial and error method are avoided, and the parameter setting efficiency and precision are remarkably improved; meanwhile, for an unmanned aerial
vehicle control system with high nonlinearity and complexity, the WOA can adjust parameters based on actual feedback under the condition that accurate modeling of the
system is not needed, and dependence on
system modeling is reduced.