Particle swarm algorithm-based parameter optimization method for unmanned aerial vehicle flight control system

文档序号:240876 发布日期:2021-11-12 浏览:6次 中文

阅读说明:本技术 基于粒子群算法的无人机飞控系统参数优化方法 (Particle swarm algorithm-based parameter optimization method for unmanned aerial vehicle flight control system ) 是由 李鹏 西蒙尼·巴尔迪 张亚婕 刘娣 杨康 夏鑫 于 2021-08-30 设计创作,主要内容包括:本发明提供了基于粒子群算法的无人机飞控系统参数优化方法,本发明通过迭代的方法,粒子群算法将参数传给ArduPlane的飞控系统中的级联PID控制器,飞控与软件在换仿真器一起完成设置任务后,成本值模块将计算这一过程中飞控的状态成本和能量成本,最后成本值又会传输给粒子群算法,粒子群算法根据新得到的成本更新每个粒子的个体最优值和群体全局最优值,并得到新的参数传给ArduPlane模块,一直到迭代结束。本发明解决飞控系统中的级联PID控制器的参数优化问题,同时优化级联的控制器,利用粒子群算法得到的优化后的参数能够保证控制器的输入能量损耗尽量小,更大提升控制器的综合性能。(The invention provides a particle swarm algorithm-based parameter optimization method for an unmanned aerial vehicle flight control system, which is characterized in that parameters are transmitted to a cascade PID controller in the flight control system of the Arduplane by the particle swarm algorithm through an iteration method, after the flight control and software complete a setting task together by replacing a simulator, a cost value module calculates the state cost and the energy cost of the flight control in the process, finally the cost value is transmitted to the particle swarm algorithm, the particle swarm algorithm updates the individual optimal value and the group global optimal value of each particle according to the newly obtained cost, obtains new parameters and transmits the new parameters to the Arduplane module until the iteration is finished. The invention solves the problem of parameter optimization of the cascade PID controller in the flight control system, optimizes the cascade controller, and can ensure that the input energy loss of the controller is as small as possible by utilizing the optimized parameters obtained by the particle swarm algorithm, thereby greatly improving the comprehensive performance of the controller.)

1. An unmanned aerial vehicle flight control system parameter optimization method based on a particle swarm algorithm is characterized by comprising the following steps:

determining parameters and value ranges of a cascade PID controller in the ArduPlane flight control system;

setting initial parameters in the particle swarm algorithm codes;

the particle swarm algorithm calculates and updates the moving speed and direction of each particle swarm in the particle swarm according to the cost value fed back by the cost calculation module to obtain a new parameter value to be optimized;

the flight control system of ArduPalne starts a software-in-loop simulator according to newly obtained controller parameter values, the flight control system sends flight attitude controller input data to the simulator, the simulation returns data to a sensor of the flight control system, and the flight control system and the simulator together complete a specified flight task;

the cost calculation module calculates and sums the cost values of all cascaded PID controllers in the flight control system;

and after the flight control system and the input energy loss are completed, the cost value calculation module transmits the updated cost value back to the particle swarm algorithm until the iteration is terminated.

2. The particle swarm algorithm-based parameter optimization method for the unmanned aerial vehicle flight control system according to claim 1, wherein the cost calculation module takes into account four control input energy magnitudes when calculating the cost value.

3. The unmanned aerial vehicle flight control system parameter optimization method based on the particle swarm algorithm according to claim 1, is characterized by specifically comprising the following steps:

1) determining parameters to be optimized of a cascade PID controller in an ArduPlane flight control system, wherein the parameters to be optimized at least comprise: the pitch controller, the roll controller, the yaw controller, the proportional controller gain, the integral controller gain and the derivative controller gain in the total energy controller; after the parameters are determined, setting the value ranges of the parameters to be optimized, and inputting the value ranges of the parameters into a particle swarm algorithm code;

2) setting initial parameters in the particle swarm algorithm code, wherein the initial parameters at least comprise: the number of particles, the maximum iteration number and the precision of iteration termination; randomly initializing each particle, individual optimal solution pbestAnd global optimal solution gbest

3) The newly obtained optimal solution p of each particle isbestInputting the corresponding parameter values into corresponding controller gains in the ArduPlane flight control system;

4) starting a flight control system of the ArduPlane, sending flight attitude controller input data to a software-in-the-loop simulator, and returning data to a sensor of the flight control system by the simulator, wherein the data at least comprises: flight state angular velocity, altitude, speed; the flight control system and the simulator can jointly complete the designated flight task;

5) after the flight task is completed, the cost calculation module calculates the cost value of each cascade PID controller in the flight control system by using the improved cost function; the cost value includes the difference e between the measured state and the target state in each controller in the flight control system and the reciprocal thereofThe formula is as follows:

wherein i refers to flight control elevation controller module, roll controller module, yaw controller module and total energy controller module; the measurement state at least comprises an unmanned aerial vehicle elevation angle, a roll angle, a speed and a height; four control input energy magnitudes are considered when calculating the cost value, and the formula is as follows:

wherein EiThe method refers to the input energy of each controller of the flight control system, and the total cost value in the flight control system is obtained as follows:

wherein CostoriRefers to the state Cost value, Cost, in the original flight control systemE_oriThe energy cost value refers to an energy cost value in an original flight control system;

6) returning the Cost value Cost obtained in the step 5) to a particle swarm algorithm, and updating the current individual optimal solution and the current group global optimal solution of each particle; each particle will update its velocity and position using the following formula:

xj+1=xj+Vj+1

wherein VjIs referred to as the speed of movement, xjRefers to a position;

7) and checking whether an iteration termination condition is met, if so, exiting the iteration, ending and outputting an optimal parameter value, otherwise, returning to the step 3).

4. The particle swarm algorithm-based unmanned aerial vehicle flight control system parameter optimization method according to claim 3, wherein the parameters in step 1) are set to be dimensions of a particle swarm search space.

5. The particle swarm algorithm-based unmanned aerial vehicle flight control system parameter optimization method according to claim 3, wherein the corresponding controllers in the flight control system in the step 3) comprise the following controllers: corresponding controllers from Pitchcontroller, Rollcontroller, Yawcontroller, TECS in Libraries in ArduPlane.

6. The particle swarm algorithm-based unmanned aerial vehicle flight control system parameter optimization method according to claim 3, wherein the designated flight task in the step 4) is: the fixed wing drone flies from takeoff to a circle of a specified radius at a specified altitude and speed within a fixed time.

7. The particle swarm optimization-based parameter optimization method for unmanned aerial vehicle flight control system according to claim 3, wherein the flight control system using default parameters obtains the Cost of state value to Cost in step 5)1Normalizing, and giving the Cost value obtained by the flight control system with default parameters to the Cost in the step 5)2And (6) carrying out normalization.

Technical Field

The invention relates to a particle swarm algorithm-based unmanned aerial vehicle flight control system parameter optimization method, and belongs to the technical field of automatic control.

Background

Fixed wing unmanned aerial vehicle is widely used in fields such as military affairs, commerce and academic research because of its good performance and modularization integration. The system is a 4-input 6-degree-of-freedom underexcitation coupling nonlinear dynamical system, so that a control system of the fixed wing unmanned aerial vehicle is very complex.

In order to simplify the analysis process of the nonlinear system model, people often perform linearization processing on the unmanned aerial vehicle model, and the simplified model system also simplifies the control system of the unmanned aerial vehicle model, which is called as a flight control system. ArduPilot is a globally known open source unmanned aerial vehicle flight control system, which comprises open source control modules of various unmanned systems, including fixed-wing unmanned aerial vehicles, rotor unmanned aerial vehicles, unmanned boats and the like, and ArduPilot is an open source flight control system of a fixed-wing unmanned aerial vehicle therein. The most commonly used flight control system in the industry at present generally adopts a PID controller, and the flight control system of ArduPlane mainly comprises an elevation controller, a roll angle controller, a yaw controller, a total energy controller and the like, and the controllers all adopt PID controllers. Although the PID controller has the advantages of good adaptability, strong robustness and the like, the gain adjustment of the controller is often problematic, and particularly, the ardupine flight control system comprises a cascade of a plurality of PID controllers, which means that the flight control system has a very complicated characteristic, so that the method for adjusting the gain of the controller manually and by the past experience is undoubtedly a huge and tedious work.

In view of the above, it is proposed to optimize parameters of a controller by using an intelligent algorithm, and the particle swarm algorithm is widely applied to various optimized fields because it is simple and easy to implement and there is no need to adjust a plurality of parameters. However, this approach does not allow for a flight control system with a cascaded PID controller such as ArduPlane. Meanwhile, the cost function designed by using the particle swarm optimization to optimize the parameters of the PID controller only considers the tracking error of the controller and does not consider the input energy cost of the controller, so that the control input energy is overlarge due to the optimization result of the particle swarm optimization, the comprehensive performance of the controller is reduced, and the like. In summary, the conventional ardupone cascade flight control system still lacks a parameter optimization method which can deal with cascade connection of a plurality of PID controllers and can ensure that the input energy of the controllers is as small as possible.

Disclosure of Invention

In order to solve the problems, the invention provides a particle swarm algorithm-based parameter optimization method for an unmanned aerial vehicle flight control system, which solves the parameter optimization problem of a cascade PID controller in the fixed-wing unmanned aerial vehicle Arduplane flight control system by utilizing the particle swarm algorithm, and frees people from complicated parameter adjustment work, so that the complicated cascade PID controller in the flight control system can still realize parameter adjustment automation. In addition, the cost function designed by the invention considers the tracking error and also considers the input energy, and the obtained parameter optimization result reduces the input energy cost of the controller and greatly improves the comprehensive performance of the controller.

According to the invention, through an iterative method, parameters are transmitted to a cascade PID controller in a flight control system of the ArduPlane by a particle swarm algorithm, after flight control and software complete a setting task together with a simulator, a cost value module calculates the state cost and the energy cost of the flight control in the process, finally the cost value is transmitted to the particle swarm algorithm, the particle swarm algorithm updates the individual optimal value and the group global optimal value of each particle according to the newly obtained cost, and obtains new parameters which are transmitted to the ArduPlane module until the iteration is finished.

In order to achieve the purpose, the invention provides the following technical scheme:

the unmanned aerial vehicle flight control system parameter optimization method based on the particle swarm algorithm comprises the following steps:

determining parameters and value ranges of a cascade PID controller in the ArduPlane flight control system;

setting initial parameters in the particle swarm algorithm codes;

the particle swarm algorithm calculates and updates the moving speed and direction of each particle swarm in the particle swarm according to the cost value fed back by the cost calculation module to obtain a new parameter value to be optimized;

the flight control system of ArduPalne starts a software-in-loop simulator according to newly obtained controller parameter values, the flight control system sends flight attitude controller input data to the simulator, the simulation returns data to a sensor of the flight control system, and the flight control system and the simulator together complete a specified flight task;

the cost calculation module calculates and sums the cost values of all cascaded PID controllers in the flight control system;

and after the flight control system and the input energy loss are completed, the cost value calculation module transmits the updated cost value back to the particle swarm algorithm until the iteration is terminated.

Further, the cost calculation module calculates the cost value by considering four control input energy magnitudes.

Further, the method specifically comprises the following steps:

1) determining parameters to be optimized of a cascade PID controller in an ArduPlane flight control system, wherein the parameters to be optimized at least comprise: the pitch controller, the roll controller, the yaw controller, the proportional controller gain, the integral controller gain and the derivative controller gain in the total energy controller; after the parameters are determined, setting the value ranges of the parameters to be optimized, and inputting the value ranges of the parameters into a particle swarm algorithm code;

2) setting initial parameters in the particle swarm algorithm code, wherein the initial parameters at least comprise: the number of particles, the maximum iteration number and the precision of iteration termination; randomly initializing each particle, individual optimal solution pbestAnd global optimal solution gbest

3) The newly obtained optimal solution p of each particle isbestInputting the corresponding parameter values into corresponding controller gains in the ArduPlane flight control system;

4) starting a flight control system of the ArduPlane, sending flight attitude controller input data to a software-in-the-loop simulator, and returning data to a sensor of the flight control system by the simulator, wherein the data at least comprises: flight state angular velocity, altitude, speed; the flight control system and the simulator can jointly complete the designated flight task;

5) after the flight task is completed, the cost calculation module calculates the cost value of each cascade PID controller in the flight control system by using the improved cost function; cost values comprisingDifference e between measurement state and target state in each controller in flight control system and time reciprocal thereofThe formula is as follows:

wherein i refers to flight control elevation controller module, roll controller module, yaw controller module and total energy controller module; the measurement state at least comprises an unmanned aerial vehicle elevation angle, a roll angle, a speed and a height; four control input energy magnitudes are considered when calculating the cost value, and the formula is as follows:

wherein EiThe method refers to the input energy of each controller of the flight control system, and the total cost value in the flight control system is obtained as follows:

wherein CostoriRefers to the state Cost value, Cost, in the original flight control systemE_oriThe energy cost value refers to an energy cost value in an original flight control system;

6) returning the Cost value Cost obtained in the step 5) to a particle swarm algorithm, and updating the current individual optimal solution and the current group global optimal solution of each particle; each particle will update its velocity and position using the following formula:

xj+1=xj+Vj+1

wherein VjIs referred to as the speed of movement, xjRefers to a position;

7) and checking whether an iteration termination condition is met, if so, exiting the iteration, ending and outputting an optimal parameter value, otherwise, returning to the step 3).

Further, the parameters in the step 1) are set as the dimension of the particle group search space.

Further, the corresponding controller in the flight control system in step 3) includes the following controllers: corresponding controllers from Pitchcontroller, Rollcontroller, Yawcontroller, TECS in Libraries in ArduPlane.

Further, the flight mission specified in the step 4) is as follows: the fixed wing drone flies from takeoff to a circle of a specified radius at a specified altitude and speed within a fixed time.

Further, the flight control system using default parameters obtains the state Cost value to the Cost in the step 5)1Normalizing, and giving the Cost value obtained by the flight control system with default parameters to the Cost in the step 5)2And (6) carrying out normalization.

Compared with the prior art, the invention has the following advantages and beneficial effects:

1. the cascade PID controller in the fixed-wing unmanned aerial vehicle ArduPlane flight control system increases the difficulty and complexity of parameter optimization, the invention solves the problem of parameter optimization of the cascade PID controller in the flight control system by using a particle swarm algorithm, and meanwhile, the optimized cascade controller liberates people from fussy parameter adjustment work, so that the complicated cascade PID controller in the flight control system can still automate the parameter adjustment work.

2. The cost function calculation method in the particle swarm optimization is improved, the four control input energy sizes are considered when the cost value is calculated, and the problem that the input energy loss of the flight control system is large after the parameters are optimized is effectively solved. The optimized parameters obtained by the particle swarm optimization can ensure that the input energy loss of the controller is as small as possible, and the comprehensive performance of the controller is improved greatly. Compared with the original flight control system, the flight control system performance after parameter optimization is improved by 20%.

Drawings

FIG. 1 is an overall architecture diagram of a particle swarm algorithm-based ArduPlane unmanned aerial vehicle flight control system parameter optimization method.

FIG. 2 is a diagram of the software-on-the-fly (SSITL) simulator data transfer architecture of Arduplane.

FIG. 3 is a flow chart of a particle swarm algorithm-based ArduPlane flight control system parameter optimization method.

FIG. 4 is a graph of the effect of ArduPlane parameter optimization simulation.

Detailed Description

The technical solutions provided by the present invention will be described in detail below with reference to specific examples, and it should be understood that the following specific embodiments are only illustrative of the present invention and are not intended to limit the scope of the present invention.

The overall framework flow of the method is shown in figure 1, firstly, a particle swarm algorithm calculates and updates the moving speed and direction of each particle swarm in the particle swarm according to the cost value fed back by a cost calculation module to obtain a new group of parameter values to be optimized, then, a flight control system of ArduPalne starts a software-in-the-Loop (SITL) simulator according to the newly obtained controller parameter values, the flight control system sends flight attitude controller input data to the simulator, and the simulator returns data including flight state angular speed, height, speed and the like to the flight control system sensor, as shown in figure 2. The flight control system and simulator will collectively perform a specified flight mission, such as a fixed wing drone flying from takeoff to a circle of specified radius at a specified altitude and speed within a fixed time. And after the flight task is completed, the cost calculation module calculates and sums the cost values of all cascaded PID controllers in the flight control system. It should be noted here that, in order to prevent the problem of large input energy loss of the flight control system after parameter optimization, four control input energy magnitudes are considered when calculating the cost value, so that the optimized parameters obtained by using the particle swarm algorithm can ensure that the input energy loss of the controller is as small as possible, and the comprehensive performance of the controller is improved greatly. And after the flight control system and the input energy loss are completed, the cost value calculation module transmits the updated cost value back to the particle swarm algorithm. Therefore, an iterative feedback process is completed once, the particle swarm optimization can re-excite the parameter optimization process according to the new cost value until an iteration termination condition is triggered, and finally the particle swarm optimization can obtain an optimal parameter optimization result, so that the comprehensive performance of the flight control system of the ArduPlane can be improved.

The particle swarm optimization algorithm is an iterative evolutionary computing technology, is derived from research on foraging behaviors of bird groups, and has the basic idea that an optimal solution is found through information sharing and cooperation among the groups. Each particle in the population has two attributes: the direction of movement and the magnitude of the speed. By using an iterative method, each particle independently searches an optimal solution as an individual optimal solution, the optimal solution in a group is used as a global optimal solution, and all the particles update the moving direction and speed according to the current individual optimal solution and the global optimal solution. And continuously and iteratively updating the individual optimal solution and the population global optimal solution so as to update the position and the speed of the particle individual. When the iteration termination condition is reached, the particle swarm algorithm can obtain the optimal parameter solution.

Specifically, in implementing the method of the invention, the source code of ArduPlane 4.0.6 version and the code of the particle swarm algorithm are downloaded from gitubs, with reference to fig. 3 and according to the following steps:

1) parameters to be optimized of a cascade PID controller in the ArduPlane flight control system are determined, wherein the parameters are respectively an elevation angle controller, a roll angle controller, a yaw controller, a proportional controller gain, an integral controller gain and a derivative controller gain in a total energy controller, and the total parameters are 11. After the parameters are determined, setting the value range to be optimized of the parameters, wherein the value range of the invention is [10 ]-5,100]And inputting the value ranges of the parameters into the particle swarm algorithm code. It should be noted that the number of these parameters will constitute the dimension of the particle swarm search space.

2) Initial parameters are set in the particle swarm algorithm code, such as the number of particles is 300, the maximum iteration number is 10000, the precision of iteration termination is 0.001, and the like. Randomly initializing each particle, individual optimal solution pbestAnd global optimal solution gbest

3) Will newly obtain eachIndividual particle optimal solution pbestThe corresponding parameter values are input to the corresponding controller gains in the ArduPlane flight control system, i.e., the corresponding controller gain parameters of PitchController, RollController, YawController, TECS in libraries in ArduPlane.

4) Starting the ardopane flight control system, sending flight attitude controller input data to the software-in-the-loop simulator, and returning data including flight state angular velocity, height, speed and the like to the flight control system sensor by the simulator (as shown in fig. 3, a process of embedding the ardopane flight control system into a particle swarm optimization is described in detail). The flight control system and the simulator can jointly complete a specified flight task, namely that the fixed-wing unmanned aerial vehicle flies from the takeoff to the circle with the specified height and speed and the specified radius in the fixed time. The final effect is shown in fig. 4, in the figure, the console window is arranged at the upper left corner, the flight state data are displayed, the command window is arranged at the lower left corner, the flight mode command is input, and the unmanned aerial vehicle flight graphical interface is arranged at the right window.

5) After the flight mission is completed, the cost calculation module calculates the cost value of each cascade PID controller in the flight control system by using the improved cost function. The cost value includes the difference e between the measured state and the target state in each controller in the flight control system and the reciprocal thereofThe formula is as follows:

wherein i refers to flight control elevation controller module, roll controller module, yaw controller module and total energy controller module. The measurement state in the system comprises the elevation angle, the roll angle, the speed, the height and the like of the unmanned aerial vehicle. Since the ardupine flight control system has default gain parameters of the controllers, in order to better prove that the parameter optimization provided by the invention is more effective than the default, the flight control system with default parameters can be used for obtaining the state Cost value to the last1And normalization is carried out, so that the problem that the particle swarm optimization is inaccurate due to non-uniform dimension of state difference values in different controller modules is avoided. In order to prevent the problem of large input energy loss of the flight control system after parameter optimization, four control input energy magnitudes are considered when calculating the cost value, and the formula is as follows:

wherein EiThe energy Cost value obtained by the flight control system with default parameters is used for the Cost of the above Cost in order to better prove that the parameter optimization provided by the invention is more effective than the default2And (6) carrying out normalization. The total cost value in the flight control system obtained in this way is:

wherein CostoriRefers to the state Cost value, Cost, in the original flight control systemE_oriRefers to the energy Cost value in the original flight control system, where Cost has been normalized.

6) Returning the Cost value Cost obtained in the step 5) to the particle swarm algorithm, and updating the current individual optimal solution and the current group global optimal solution of each particle. Each particle will update its velocity and position using the following formula:

xj+1=xj+Vj+1

wherein VjIs referred to as the speed of movement, xjIs referred to as position, c1And c2Is a learning factor, typically 2.

7) And checking whether an iteration termination condition is met, if so, exiting the iteration, ending and outputting an optimal parameter value, otherwise, returning to the step 3).

The method solves the parameter optimization problem of the cascade PID controller in the fixed-wing unmanned aerial vehicle ArduPlane flight control system by using a particle swarm algorithm, and releases people from the fussy parameter adjustment work, so that the complicated cascade PID controller in the flight control system can still realize the parameter adjustment automation. In addition, the designed cost function gives consideration to input energy, the obtained parameter optimization result reduces the input energy cost of the controller, and the comprehensive performance of the controller is greatly improved.

The technical means disclosed in the invention scheme are not limited to the technical means disclosed in the above embodiments, but also include the technical scheme formed by any combination of the above technical features. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and such improvements and modifications are also considered to be within the scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:水冷炉排控制系统的控制方法及控制系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!