Unmanned aerial vehicle dynamic PID tuning method and system based on heteroscedastic bayesian optimization

CN120406497BActive Publication Date: 2026-09-22CHONGQING UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510524843.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2026-09-22
Estimated Expiration
2045-04-24

AI Technical Summary

Technical Problem

[0006]有鉴于此,本发明的目的在于提供一种基于异方差贝叶斯优化的无人机动态PID调谐方法及系统,该方法和系统通过对输入依赖性噪声方差的建模,并采用两阶段优化策略,实现更为精准的无人机轨迹跟踪控制,着力解决现有技术中存在的以下技术问题:传统PID控制器依赖人工经验调参,导致效率低且鲁棒性不足;模型依赖的方法(如LQR、MPC)易受模型失配的影响;基于学习的控制方法(如强化学习)则存在计算资源需求较高的问题;现有基于贝叶斯优化的PID控制方法(BO-PID)采用的同方差噪声假设无法有效处理实际应用场景中的异方差噪声,且其单阶段优化策略易陷入次优解

Benefits of technology

与现有控制方法相比,本发明提出的HBO动态PID调谐方法包含更加精确的噪声建模及更高效的优化策略,具体体现在以下几个方面:1. 通过异方差噪声建模,自适应动态环境下的噪声变化,显著提升位置与角度跟踪的精度和鲁棒性;2. 采用的两阶段优化策略分别针对不同阶段的误差特性,有效避免了单阶段优化中过早陷入局部最优的情况,加速参数优化过程;3. 无需依赖大规模预训练数据,可直接进行在线参数优化,大幅降低计算资源需求;4. 适用于多种复杂轨迹与动态干扰场景,表现出优于传统PID、MPC以及现有贝叶斯优化方法的性能优势。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406497B_ABST
    Figure CN120406497B_ABST
Patent Text Reader

Abstract

The application relates to a dynamic PID tuning method and system for an unmanned aerial vehicle based on heteroscedastic Bayesian optimization, and belongs to the technical field of unmanned aerial vehicle control. The method specifically comprises the following steps: S1: dividing an unmanned aerial vehicle target trajectory tracking task into a preliminary optimization stage and a fine optimization stage; S2: in the preliminary optimization stage, performing preliminary optimization on PID controller parameters through heteroscedastic Bayesian optimization to quickly determine initial parameters; S3: in the fine optimization stage, further optimizing the PID controller parameters on the basis of the determined initial parameters; and S4: fusing the optimization results of the preliminary optimization stage and the fine optimization stage to generate final PID controller parameters. The technical scheme provided by the application models input-dependent noise variance, adopts a two-stage optimization strategy, realizes more accurate unmanned aerial vehicle trajectory tracking control, and well solves the related technical problems in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of unmanned aerial vehicle (UAV) control technology, and relates to a dynamic PID tuning method and system for UAVs based on heteroscedastic Bayesian optimization. Background Technology

[0002] The field of UAV trajectory tracking control mainly includes traditional PID control methods, model-based controllers, and learning-based control methods. The classic proportional-integral-derivative (PID) control method is widely used for UAV attitude stabilization and trajectory tracking tasks due to its simple structure and ease of implementation. However, this method struggles to effectively handle the nonlinear characteristics and external disturbances of the UAV dynamic system, and performance optimization requires significant manual parameter tuning, limiting its applicability in complex dynamic environments.

[0003] Model-based control methods, such as nonlinear model predictive control (NMPC) and model predictive path integral control (MPPI), aim to overcome the limitations of traditional PID methods. NMPC improves UAV navigation and dynamic obstacle avoidance by optimizing real-time predictive models, while MPPI optimizes real-time trajectories through path integrals, improving UAV flight efficiency in obstacle-dense environments. However, these methods require significant computational resources and are highly dependent on the accuracy of the system model, resulting in poor performance when the model is uncertain or the external environment changes frequently.

[0004] In recent years, learning-based methods have gained increasing attention, such as deep reinforcement learning, which enhances the control performance and stability of UAVs in dynamic environments through data-driven approaches. These methods reduce reliance on precise system models, but suffer from the drawbacks of requiring large-scale training data and computational resources, and struggle to quickly respond to dynamic changes in trajectory or environment.

[0005] To address the aforementioned issues and balance computational efficiency and performance, existing research has proposed combining traditional PID controllers with nonlinear dynamic compensation mechanisms, such as sliding mode control (SMC) and Bayesian optimization (BO). Among these, the BO method, combined with Gaussian process (GP) modeling, effectively improves the parameter optimization performance of PID controllers. However, this method still has two key shortcomings: first, it generally assumes that system noise has homoscedasticity, failing to effectively handle heteroscedastic noise caused by dynamic disturbances and sensor errors; second, the single-stage optimization strategy prematurely fine-tunes parameters when the initial error is large, easily getting trapped in local optima and reducing the overall accuracy and robustness of the control. Therefore, it is necessary to solve how to efficiently handle heteroscedastic noise in dynamic environments to improve the accuracy and robustness of PID controllers and expand their application in practical environments. This invention proposes a dynamic PID tuning method based on heteroscedastic Bayesian optimization (HBO), aiming to overcome the limitations of existing methods. Summary of the Invention

[0006] In view of this, the purpose of this invention is to provide a dynamic PID tuning method and system for UAVs based on heteroscedastic Bayesian optimization. This method and system achieve more accurate UAV trajectory tracking control by modeling the variance of input-dependent noise and adopting a two-stage optimization strategy, and focuses on solving the following technical problems existing in the prior art: traditional PID controllers rely on manual experience for parameter tuning, resulting in low efficiency and insufficient robustness; model-dependent methods (such as LQR and MPC) are susceptible to model mismatch; learning-based control methods (such as reinforcement learning) have high computational resource requirements; the homoscedastic noise assumption used by existing Bayesian optimization-based PID control methods (BO-PID) cannot effectively handle heteroscedastic noise in practical application scenarios, and its single-stage optimization strategy is prone to falling into suboptimal solutions.

[0007] To achieve the above objectives, the present invention provides the following technical solution: A dynamic PID tuning method for UAVs based on heteroscedastic Bayesian optimization, the method specifically includes the following steps: S1: Divide the UAV target trajectory tracking task into a preliminary optimization stage and a fine optimization stage; S2: In the preliminary optimization stage, the PID controller parameters are initially optimized by heteroscedastic Bayesian optimization to quickly determine the initial parameters; S3: In the fine optimization stage, based on the determined initial parameters, the PID controller parameters are further optimized; S4: Combine the optimization results from the preliminary optimization stage and the fine optimization stage to generate the final PID controller parameters; In the optimization process of steps S2 and S3, a heteroscedastic noise model is introduced to explicitly model the noise variance dependent on the input, so as to more accurately reflect the uncertainty in the dynamic environment.

[0008] Furthermore, the heteroscedastic noise model includes the following steps: 1) Assume that the noise at different input points is independent of each other, and the off-diagonal elements of the noise covariance matrix are zero; 2) Model the diagonal elements of the covariance matrix as the input-related noise variance function; 3) The noise variance function is parametrically estimated using the Gaussian process regression method; 4) The Gaussian process model is dynamically adjusted based on the estimated noise variance to adapt to the uncertainty level of different input points.

[0009] Furthermore, the noise variance function in the heteroscedastic noise model is defined as:

[0010] in, σ 2 min To minimize noise variance, α The amplitude coefficient of the noise variance. β For regression coefficients, ϕ (x) is the feature mapping function of the input parameters.

[0011] Furthermore, the two-stage optimization strategy specifically includes: In the initial optimization phase, the parameter search range is determined by rapidly reducing the large initial error of the system. In the fine optimization stage, stability and accuracy under dynamic environments are improved by reducing subtle errors in the system.

[0012] Furthermore, in the preliminary optimization stage, the objective function is a weighted sum of position error and angle error, defined as:

[0013] In the formula, These are weighting parameters used to balance position and angle errors. For positional error, This represents the angular error.

[0014] Furthermore, updating the Gaussian process regression model includes the following steps: Train an initial Gaussian process model based on the parameter sampling dataset; The noise variance is dynamically adjusted through residual analysis. The expected improvement criterion (EI) is used to select the next set of parameters to be evaluated, and the optimization is iteratively performed until the preset number of iterations is reached.

[0015] The present invention also provides a dynamic PID tuning system for unmanned aerial vehicles based on heteroscedastic Bayesian optimization, which employs the method described above.

[0016] The present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the UAV dynamic PID tuning method based on heteroscedastic Bayes optimization as described above.

[0017] The beneficial effects of this invention are as follows: Compared with existing control methods, the HBO dynamic PID tuning method proposed in this invention includes more accurate noise modeling and a more efficient optimization strategy, specifically reflected in the following aspects: 1. By modeling heteroscedastic noise, it adapts to noise changes in dynamic environments, significantly improving the accuracy and robustness of position and angle tracking; 2. The two-stage optimization strategy targets the error characteristics of different stages, effectively avoiding premature local optima in single-stage optimization and accelerating the parameter optimization process; 3. It does not rely on large-scale pre-training data and can directly perform online parameter optimization, greatly reducing the computational resource requirements; 4. It is applicable to various complex trajectory and dynamic disturbance scenarios, demonstrating performance advantages over traditional PID, MPC, and existing Bayesian optimization methods.

[0018] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0019] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating the overall algorithm framework and parameter optimization process of the present invention. Figure 2 This is a pseudocode diagram of the method proposed in this paper; Figure 3 The image shows the tracking results of different algorithms for three trajectories in the simulation experiment; Figure 4 The tracking error is calculated using different noise models; Figure 5 The tracking error is calculated using different optimization strategies; Figure 6 This is a comparison of trajectories generated using different controllers in real-machine experiments. Detailed Implementation

[0020] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0021] Figure 1 This is a flowchart illustrating the overall algorithm framework and parameter optimization process of the present invention, as follows: Figure 1 As shown, for a given target trajectory The optimization process is divided into two stages: In Phase 1 (preliminary optimization phase), PID parameters are rapidly optimized using Heteroscedastic Bayesian optimization (HBO). Specifically, the objective function is defined as the position error. With angle error Weighted sum: (1) In the formula, These are weighting parameters used to balance position and angle errors. In stage 2 (fine-tuning stage), the parameters optimized in stage 1 are used. Further fine-tuning of the initial values ​​yields the parameters. The optimization results from the two stages are combined to obtain the optimal parameters. : (2) Furthermore, the implementation of the Heteroscedastic Bayesian Optimization (HBO) algorithm can be found in [link to implementation details]. Figure 2 As shown in the pseudocode, the specific steps include: first, constructing a Gaussian process regression model. It is used to predict the mapping relationship between parameters and errors, as well as heteroscedastic noise models. This is used to model the uncertainty of the error. Then, initial parameter sampling is performed from the parameter search space. Random sampling of the initial controller parameter set For each set of parameters initially sampled Perform a drone trajectory tracking simulation task and calculate the error. The initial dataset can be obtained from the set of sampling parameters and errors. Based on dataset Pre-training the initial Gaussian process model .

[0022] Next, the main loop optimization process begins (a total of...). (nth iteration), each iteration performs the following steps: Adjust the observation error... and Prediction error The difference is defined as the residual. The heteroscedastic noise model is trained using the residuals of the error. This updates the noise variance corresponding to each input parameter. The noise variance model is defined as follows: (3) In the formula, For regression coefficients, To minimize noise variance, Controlling the overall amplitude of noise variance, The feature mapping function is the input parameter.

[0023] according to Update the noise variance of the Gaussian process model and retrain. The model is then used. The Expected Improvement (EI) criterion is then used to select the next parameter to be evaluated. and use new parameters Perform a drone trajectory task in a simulation and obtain the average error of the trajectory tracking process. To evaluate the new parameters. Finally, the new parameters... and its corresponding average error Add to dataset .

[0024] Repeat the above steps until completion. After several iterations, the parameter with the smallest error is selected as the final optimal parameter.

[0025] This embodiment uses the PyBullet physics simulation platform under the Python 3.8 environment to conduct a simulation experiment to verify the trajectory tracking control of a quadcopter drone. The specific physical parameters of the simulated drone are: drone mass is 27 grams, and gravitational acceleration is 9.81 m / s². 2 The arm is 3.97 cm long, and the moment of inertia along the X and Y axes is 1.40 × 10⁻⁶. -5 kg·m 2 The moment of inertia along the Z-axis is 2.17 × 10⁻⁶. -5 kg·m 2 The thrust coefficient is 2.88 × 10⁻⁶. -8 kg·m / rad 2 The torque coefficient is 7.24 × 10⁻⁶. -10 kg·m 2 / rad 2 The motor drag coefficient is 0.02 s, and the motor speed coefficient is 2.81 × 10⁻⁶. -2 The simulation parameters were set to rad, motor bias of 426.24 rad / s, and PWM maximum value of 65535Hz. The simulation time step was set to ∆t = 0.01s. Simulation results are shown in Table 1. The proposed HBO-PID method outperforms traditional PID, LQR, MPC, TD3, RS-PID, and BO-PID methods on all trajectories. On elliptical trajectories, the HBO-PID method achieved a position error of 0.137m, a reduction of 24.7% to 42.9% compared to the baseline method, and an angle error of 0.323°, a reduction of 40.9% to 78.4%. Similar performance advantages were observed on other trajectories.

[0026] The experiment included three typical trajectories: elliptical, four-leaf clover, and spiral, with each trajectory tracked for 50 seconds. Positional error was introduced to quantify performance. and angle error As an evaluation indicator: (4) Simulation results are shown in Table 1 and Figure 3 As shown, the HBO-PID method proposed in this invention significantly outperforms traditional PID, LQR, MPC, TD3, RS-PID, and BO-PID methods in terms of both position and angle errors. For example, the position error on the elliptical trajectory is 0.137m, which is reduced by 24.7% to 42.9% compared to traditional methods, and the angle error is reduced by 40.9% to 78.4%.

[0027] Table 1. Performance comparison of different control algorithms on three trajectories.

[0028] Table 2 shows the physical parameters of the quadcopter used in the simulation in this embodiment.

[0029] Table 2 Physical parameters of the quadcopter used in the simulation

[0030] To verify the practical effectiveness of the method of the present invention, the present invention was experimentally verified on a real machine platform. The experimental platform used a quadcopter drone with a mass of 800 grams, a maximum thrust of 2.99 Newtons, a minimum thrust of 0.22 Newtons, and the spatial dimensions of the motion capture system were 6×4×3 meters, with a sampling frequency of 100Hz.

[0031] Real-world experiments were conducted to track elliptical, four-leaf clover, and spiral trajectories, and the results are shown in Table 3. The method of this invention (HBO-PID) shows significantly lower average position and average angle errors in real-world environments compared to the BO-PID method, with the average position error reduced by 61.2% and the average angle error reduced by 34.7%, demonstrating the superior accuracy and robustness of the method in practical applications.

[0032] Table 3. Performance comparison of different control algorithms on three trajectories in real machine experiments.

[0033] This embodiment further verifies the effectiveness of the proposed heteroscedastic noise model and two-stage optimization strategy through ablation experiments. Figure 4 As shown, the exponential heteroscedastic noise model significantly outperforms the polynomial model, especially in the case of a spiral trajectory, where position and angle errors are reduced by 26.5% and 39.3%, respectively. Furthermore, as... Figure 5As shown, the two-stage optimization strategy significantly outperforms the single-stage optimization strategy when the initial error is large, especially in the four-leaf clover trajectory where the angle error is reduced by 60.3%, verifying the effectiveness of the two-stage strategy in avoiding getting trapped in local optima. The above embodiments clearly illustrate the significant advantages of this invention in improving the trajectory tracking accuracy and robustness of UAVs.

[0034] In summary, to verify the effectiveness of this invention, experiments were conducted on three typical UAV trajectories (elliptical trajectory, cloverleaf trajectory, and spiral trajectory) in this embodiment. The benchmark methods used included traditional PID, linear quadratic regulator (LQR), model predictive control (MPC), deep reinforcement learning (TD3), random search PID (RS-PID), and traditional Bayesian optimization PID (BO-PID). The experimental results show that the method proposed in this invention significantly outperforms all benchmark methods in terms of both position and angle errors.

[0035] Specifically, the position tracking error of this invention on an elliptical trajectory is 0.137 meters, which is a reduction of 24.7%, 25.9%, 39.4%, 41.2%, 41.5%, and 42.9% compared to TD3 (0.182 meters), BO-PID (0.185 meters), RS-PID (0.226 meters), PID (0.233 meters), MPC (0.234 meters), and LQR (0.240 meters), respectively. Furthermore, the improvement in angle tracking accuracy is even more significant, with an accuracy improvement ranging from 40.9% to 78.4%.

[0036] Ablation experiments verified the effectiveness of the proposed heteroscedastic noise model and two-stage optimization strategy. Under three trajectories, the proposed exponential noise model showed a significant advantage over the polynomial noise model; for example, under a spiral trajectory, the position error was reduced by 26.5%, and the angle error by 39.3%. Simultaneously, the proposed two-stage optimization strategy also demonstrated a significant performance improvement over the single-stage optimization strategy, particularly in angle tracking accuracy. For instance, under a four-leaf clover trajectory, the angle error decreased from 3.342° to 1.328°, an improvement of 60.3%.

[0037] Further actual flight experiments have also demonstrated the practical value of the invention. In real-world environments, compared with the traditional BO-PID method, the invention reduces the average position error by 61.2% and the average angle error by 34.7%, demonstrating superior robustness and accuracy in various complex dynamic environments. Figure 6 This is a comparison of trajectories generated using different controllers in real-machine experiments.

[0038] Although the implementation process of this invention is mainly based on the evaluation of UAV trajectory tracking scenarios, the proposed method is also applicable to control tasks in other dynamic environments, such as robot navigation, autonomous driving and industrial automation control, and has broad application prospects.

[0039] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications should be covered within the scope of the claims of the present invention.

Claims

1. A dynamic PID tuning method for unmanned aerial vehicles based on heteroscedastic Bayesian optimization, characterized in that: The method specifically includes the following steps: S1: Divide the UAV target trajectory tracking task into a preliminary optimization stage and a fine optimization stage; S2: In the preliminary optimization stage, the PID controller parameters are initially optimized by heteroscedastic Bayesian optimization to quickly determine the initial parameters; S3: In the fine optimization stage, based on the determined initial parameters, the PID controller parameters are further optimized; S4: Combine the optimization results from the preliminary optimization stage and the fine optimization stage to generate the final PID controller parameters; In the optimization process of steps S2 and S3, a heteroscedastic noise model is introduced to explicitly model the noise variance dependent on the input, so as to more accurately reflect the uncertainty in the dynamic environment. The heteroscedastic noise model includes the following steps: 1) Assume that the noise at different input points is independent of each other, and the off-diagonal elements of the noise covariance matrix are zero; 2) Model the diagonal elements of the covariance matrix as the input-related noise variance function; 3) The noise variance function is parametrically estimated using the Gaussian process regression method; 4) Dynamically adjust the Gaussian process model based on the estimated noise variance to adapt to the uncertainty level of different input points; The noise variance function in the heteroscedastic noise model is defined as: in, σ 2 min To minimize noise variance, α The amplitude coefficient of the noise variance. β For regression coefficients, ϕ (x) is the feature mapping function of the input parameters.

2. The UAV dynamic PID tuning method based on heteroscedastic Bayesian optimization according to claim 1, characterized in that: The two-stage optimization strategy specifically includes: In the initial optimization phase, the parameter search range is determined by rapidly reducing the large initial error of the system. In the fine optimization stage, stability and accuracy under dynamic environments are improved by reducing subtle errors in the system.

3. The UAV dynamic PID tuning method based on heteroscedastic Bayesian optimization according to claim 2, characterized in that: In the initial optimization stage, the objective function is a weighted sum of position and angle errors, defined as: In the formula, These are weighting parameters used to balance position and angle errors. For positional error, This represents the angular error.

4. The UAV dynamic PID tuning method based on heteroscedastic Bayesian optimization according to claim 3, characterized in that: The update of a Gaussian process regression model includes the following steps: Train an initial Gaussian process model based on the parameter sampling dataset; The noise variance is dynamically adjusted through residual analysis. The expected improvement criterion (EI) is used to select the next set of parameters to be evaluated, and the optimization is iteratively performed until the preset number of iterations is reached.

5. A dynamic PID tuning system for unmanned aerial vehicles based on heteroscedastic Bayesian optimization, characterized in that: The system employs the method described in any one of claims 1 to 4.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the UAV dynamic PID tuning method based on heteroscedastic Bayesian optimization as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Multi-credibility data fusion method based on heterovariance Gaussian process regression

    CN116822214A

  • PID control parameter setting method, terminal and medium

    CN118377216A

  • Unmanned aerial vehicle control method and system

    CN118534932A