Unmanned aerial vehicle longitudinal attitude PID parameter self-tuning method based on LQR
Through the LQR-based drone longitudinal attitude PID parameter autotuning method, a relationship model between LQR and PID control law is constructed, and optimization parameters are obtained using Bayesian optimization algorithm, which solves the problem of experience in the tuning of the PID parameter in the UAV and achieves efficient control effect.
Patent Information
- Application Number
- CN202510176618.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-18
AI Technical Summary
In the prior art, the adjustment of the PID parameters of the UAV requires the experience of designers, which leads to the large and complex process of parameter adjustment, making it difficult to achieve better control effects.
The LQR-based UAV vertical attitude PID parameter autotuning method is used to construct a relationship model between LQR control law and PID control law, and a scoring model in the time and frequency domain is established, and the Bayesian optimization algorithm is used to iterate the highest score as the final parameters.
It effectively reduces the dependence of design control parameters on experience, improves the drone control performance, and achieves excellent control effects.
Smart Images

Figure CN120065688A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of UAV control, and particularly to a method for self-tuning PID parameters of the longitudinal attitude of a UAV based on LQR. Background Art
[0002] With the development of the low-altitude economy, UAV-related industries have rapidly emerged and demonstrated huge market potential and development prospects, including but not limited to logistics distribution, agricultural plant protection, geographical mapping, environmental monitoring, disaster relief, news reporting, film and television shooting, and infrastructure inspection.
[0003] For the application of UAVs in commercial scenarios, such as material delivery, performances, etc., UAVs need to have good control performance. For the control of UAVs, the most commonly used and mature method in engineering is traditional PID control. For the tuning of each PID parameter, in engineering, it is usually based on the linearized transfer function to manually adjust the parameters, and according to the time-domain and frequency-domain indicators, the parameters are optimized through repeated trial and adjustment. This process largely depends on the experience of designers. Especially for aircraft with a wide flight envelope, the workload of parameter tuning is very large and complex.
[0004] Therefore, at present, the tuning of each PID parameter of UAVs needs to rely on designers to manually adjust the parameters according to experience, and the workload of parameter tuning is very large and complex, making it difficult to achieve an optimal control effect. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for self-tuning PID parameters of the longitudinal attitude of a UAV based on LQR, so as to solve the technical problem in the prior art that it is necessary to rely on designers to manually adjust the parameters according to experience, and the workload of parameter tuning is very large and complex, making it difficult to achieve an optimal control effect.
[0006] To solve the above technical problem, the present invention specifically provides the following technical solutions:
[0007] A method for self-tuning PID parameters of the longitudinal attitude of a UAV based on LQR includes the following steps:
[0008] Step 100: Taking the steady non-sideslip flight of the UAV as the reference motion, after obtaining the longitudinal state space model by trimming and linearizing the operating point of the UAV, a relationship model between the LQR control law and the PID control law of the pitch attitude of the UAV is constructed by using the longitudinal state space model;
[0009] Step 200: Divide the control effect of the PID control law into the time domain and the frequency domain. After establishing the scoring models for the parameters in the time domain and the frequency domain, use the total performance scores of the parameters in the time domain and the frequency domain as the indicators to describe the control effect of the PID control law, and establish a connection between the weights of the LQR control law and the total performance scores to construct a black-box model describing the relationship between the weights and the total performance scores;
[0010] Step 300: Establish a surrogate model with the known weights and total performance scores as the tuning history. Use the Monte Carlo random shooting method to select multiple weights of the LQR control law, calculate the total performance scores respectively based on the black-box model, and update the surrogate model;
[0011] Step 400: Based on the Bayesian optimization method, derive the acquisition function from the surrogate model to obtain the adjusted weights and calculate the total performance scores. Set a maximum number of iterations and a total performance score that meets the requirements, and select the next weight as the newly observed point according to the acquisition function and add it to the tuning history for iterative calculation. When the number of iterations is greater than the set maximum number of iterations or the total performance score is greater than the set total performance score that meets the requirements, end the iterative calculation. After selecting the weight with the highest total performance score, use the relationship model to obtain the parameters of the PID control law that match this weight as the optimized and tuned pitch attitude loop PID parameters.
[0012] As a preferred solution of the present invention, in step 100, the specific method for obtaining the longitudinal state space model of the unmanned aerial vehicle is as follows:
[0013] Taking the steady and non-skidding flight of the unmanned aerial vehicle as the reference motion, the linear longitudinal state space model of the unmanned aerial vehicle can be obtained by using the small perturbation method:
[0014]
[0015] y = Cx + Du;
[0016] Among them, C is the identity matrix, D is 0, x is the transposed matrix of the state variables (VαqθH) T , u is the transposed matrix of the input variables (δ ele δ T ), T , y is the transposed matrix of the output variables, and its value is equal to the transposed matrix of the state variables. a and b are the coefficient values in the linearized state space respectively.
[0017] As a preferred solution of the present invention, in step 100, the specific method for constructing the relationship model between the LQR control law and the PID control law of the pitch attitude of the unmanned aerial vehicle is as follows:
[0018] Establish the input variable relation formula for the longitudinal pitch attitude PID control:
[0019] δele = K p (θ cmd - θ) + K i ∫(θ cmd - θ)dt + K d ·q;
[0020] Extract the state variables from the linear longitudinal state space of the UAV to obtain:
[0021] x = q, y = q, u = δ ele ;
[0022] It can be obtained that:
[0023] x = a 33 q + b 3 δ ele ;
[0024] Expand the extracted state variables. The angle deviation e = θ cmd - θ, and the integral of the deviation ∫edt is regarded as the state x 1 , the angle deviation e is regarded as the state x 2 , and a new state space is formed with the extracted state q;
[0025] Since Regarding θ cmd as a constant value, the expanded state space is described as:
[0026]
[0027] Abbreviate this state space as:
[0028]
[0029] Adopt the LQR algorithm, and the feedback form is u = -Kx. Since the expanded state variables are:
[0030] x = [∫edt e q] T ;
[0031] Then:
[0032]
[0033] Among them, K i = -K 1 , K p = -K 2 , K d = -K 3 .
[0034] As a preferred embodiment of the present invention, in step 200, the scoring model includes a rise time scoring model for step response, an overshoot scoring model, an amplitude margin scoring model of the system, a phase margin scoring model of the system, and a delay margin scoring model of the system;
[0035] Among them, the rise time scoring model and the overshoot scoring model of the step response are scoring models in the time domain, and the amplitude margin scoring model of the system, the phase margin scoring model of the system, and the delay margin scoring model of the system are scoring models in the frequency domain.
[0036] As a preferred embodiment of the present invention, in step 200, the total performance score is specifically:
[0037]
[0038] Where Score sum is the total performance score, Score rimetime is the rise time score of the step response, is the amplitude margin score of the system, is the phase margin score of the system, is the delay margin score of the system, Score overshoot is the overshoot score.
[0039] As a preferred embodiment of the present invention, in step 200, the black box model is specifically:
[0040] Score sum = f(Q, R);
[0041] Among them, f is a black box function, Q and R are the input weights of the LQR control law, and Score sum is the output of the black box function, the total performance score.
[0042] As a preferred embodiment of the present invention, in step 300, the tuning parameter history is specifically:
[0043] Γ((Q 1:k , R 1:k ), H 1:k );
[0044] The specific method for establishing the surrogate model is:
[0045] Using Gaussian process regression of the Bayesian optimization algorithm to estimate the objective function:
[0046] Score sum ~ GP(m(x), k(x, x * ));
[0047] Among them, m(x) is the mean function of the Gaussian process, x is the current sampling point, that is, x = [Q, R]; k(x, x') is the covariance function between different sampling points x and x * '.
[0048] As a preferred solution of the present invention, in step 400, the expected improvement is used as the acquisition function of Bayesian optimization, and the point that can maximize the expected improvement is selected at each step of optimization. Specifically:
[0049]
[0050] where μ(x * ) is the predicted mean of the new sampling point x * (given by the Gaussian process model), σ(x * ) is the predicted standard deviation of the new sampling point x * (given by the Gaussian process model), is the total score of the optimal performance obtained from the currently sampled points, Φ(·) is the cumulative distribution function of the standard normal distribution, and Θ(·) is the probability density function of the standard normal distribution.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] The present invention transforms the LQR state feedback into the form of PID, uses LQR to design the PID parameters, analyzes the obtained parameters through time domain and frequency domain, and proposes a scoring criterion. The Bayesian optimization algorithm is used to iteratively obtain a set of parameters with the highest score as the final parameters, which can effectively reduce the dependence on experience in designing control parameters and can obtain excellent control effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only exemplary, and for those of ordinary skill in the art, without creative efforts, other implementation drawings can be obtained according to the provided drawings.
[0054] Figure 1 is a schematic flowchart of the method for self-tuning PID parameters of the longitudinal attitude of an unmanned aerial vehicle based on LQR provided by an embodiment of the present invention;
[0055] Figure 2 is a schematic diagram of the rise time score of the method for self-tuning PID parameters of the longitudinal attitude of an unmanned aerial vehicle based on LQR provided by an embodiment of the present invention;
[0056] Figure 3Schematic diagram of overshoot score for the longitudinal attitude PID parameter self-tuning method of an unmanned aerial vehicle based on LQR provided by an embodiment of the present invention;
[0057] Figure 4 Schematic diagram of amplitude margin score for the longitudinal attitude PID parameter self-tuning method of an unmanned aerial vehicle based on LQR provided by an embodiment of the present invention;
[0058] Figure 5 Schematic diagram of phase margin score for the longitudinal attitude PID parameter self-tuning method of an unmanned aerial vehicle based on LQR provided by an embodiment of the present invention;
[0059] Figure 6 Schematic diagram of time margin score for the longitudinal attitude PID parameter self-tuning method of an unmanned aerial vehicle based on LQR provided by an embodiment of the present invention;
[0060] Figure 7 Parameter score graph for the longitudinal attitude PID parameter self-tuning method of an unmanned aerial vehicle based on LQR provided by an embodiment of the present invention. Detailed implementation manners
[0061] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0062] As Figure 1 shown, the present invention provides a longitudinal attitude PID parameter self-tuning method for an unmanned aerial vehicle based on LQR, including the following steps:
[0063] Step 100: Taking the steady non-sideslip flight of the unmanned aerial vehicle as the reference motion, after obtaining the longitudinal state space model by trimming and linearizing the working condition points of the unmanned aerial vehicle, a relationship model between the LQR control law and the PID control law of the pitch attitude of the unmanned aerial vehicle is constructed using the longitudinal state space model;
[0064] Step 200: Dividing the control effect of the PID control law into the time domain and the frequency domain, after establishing the score models of the parameters in the time domain and the frequency domain, taking the total performance scores of the parameters in the time domain and the frequency domain as the indexes to describe the control effect of the PID control law, and establishing a connection between the weight of the LQR control law and the total performance score to construct a black box model describing the relationship between the weight and the total performance score;
[0065] Step 300: Establishing a surrogate model with the known weight and total performance score as the tuning parameter history, selecting multiple weights of the LQR control law by means of Monte Carlo random shooting, calculating the total performance score respectively based on the black box model, and updating the surrogate model;
[0066] Step 400: Based on the Bayesian optimization method, derive an acquisition function from the surrogate model to obtain the adjusted weights and calculate the total performance score. Set a maximum number of iterations and a total performance score that meets the requirements. Select the next weight according to the acquisition function as a newly observed point and add it to the tuning history for iterative calculation. When the number of iterations is greater than the set maximum number of iterations or the total performance score is greater than the set total performance score that meets the requirements, end the iterative calculation. After selecting the weight with the highest total performance score, use the relationship model to obtain the parameters of the PID control law that match this weight as the optimized and tuned PID parameters for the pitch attitude loop.
[0067] The self-tuning method for the longitudinal attitude PID parameters of an unmanned aerial vehicle (UAV) based on LQR in the present invention mainly uses the longitudinal state space model of the UAV to construct a relationship model between the LQR control law and the PID control law of the pitch attitude of the UAV, and establish a scoring model for each parameter in the time domain and frequency domain of the PID control law, so as to construct a black-box model describing the relationship between the weights of the LQR control law and the total performance score. After establishing a surrogate model using the tuning history, update the surrogate model using the black-box model, derive an acquisition function from the surrogate model to obtain the adjusted weights and calculate the total performance score for iterative calculation. After setting a maximum number of iterations and a total performance score that meets the requirements, when the number of iterations is greater than the set maximum number of iterations or the total performance score is greater than the set total performance score that meets the requirements, end the iterative calculation. After selecting the weight with the highest total performance score, use the relationship model to obtain the parameters of the PID control law that match this weight as the optimized and tuned PID parameters for the pitch attitude loop.
[0068] Based on this, the present invention converts the LQR state feedback of the pitch attitude of the UAV into the form of PID, designs the PID parameters using LQR, analyzes the obtained parameters through the time domain and frequency domain, and proposes a scoring criterion. The Bayesian optimization algorithm is used to iteratively obtain a set of parameters with the highest score as the final parameters, which can effectively reduce the dependence on experience in designing control parameters and can obtain excellent control effects, so that there is no need to manually tune the PID parameters based on experience, and the tuning is more accurate.
[0069] Among them, in step 100, the specific method for obtaining the longitudinal state space model of the UAV is as follows:
[0070] Taking the steady and non-sideslip flight of the UAV as the reference motion, the linear longitudinal state space model of the UAV can be obtained by using the small perturbation method:
[0071]
[0072] y = Cx + Du;
[0073] Wherein, C is the identity matrix, D is 0, x is the transpose matrix of the state variables (VαqθH) T , u is the transpose matrix of the input variables (δ ele δ T ), T , y is the transpose matrix of the output variables, and its value is equal to the transpose matrix of the state variables. a and b are the coefficient values in the linearized state space respectively.
[0074] Based on the linear longitudinal state space model, in step 100, the specific method for constructing the relationship model between the LQR control law and the PID control law of the UAV pitch attitude is as follows:
[0075] Establish the input variable relationship formula for the longitudinal pitch attitude PID control:
[0076] δ ele = K p (θ cmd - θ) + K i ∫(θ cmd - θ)dt + K d ·q;
[0077] Extract the state variables from the linear longitudinal state space of the UAV to obtain:
[0078] x = q, y = q, u = δ ele ;
[0079] It can be obtained that:
[0080] x = a 33 q + b 3 δ ele ;
[0081] Expand the extracted state variables. The angle deviation e = θ cmd - θ, and the integral of the deviation ∫edt is regarded as the state x 1 , the angle deviation e is regarded as the state x 2 , and a new state space is formed with the extracted state q;
[0082] Since Regarding θ cmd as a constant value, the expanded state space is described as:
[0083]
[0084] Abbreviate this state space as:
[0085]
[0086] Adopt the LQR algorithm, and the feedback form is u = -Kx. Since the expanded state variables are:
[0087] x = [∫edt e q] T ;
[0088] Then:
[0089]
[0090] where, K i = -K 1 , K p = -K 2 , K d = -K 3 ;
[0091] In this way, the state - space LQR is transformed into the problem of adjusting the PID parameters of the pitch attitude of the UAV.
[0092] Using the LQR optimization theory, select the performance index function:
[0093]
[0094] Given in the state - space And select the appropriate state - weight matrix Q and input - weight matrix R, and substitute them into the Riccati equation:
[0095]
[0096] Solve to obtain P, and finally the optimal control strategy can be obtained:
[0097]
[0098] Of course, a relationship model between the PD control law, the longitudinal static - instability control law and the LQR control law can also be established. The following provides a specific embodiment.
[0099] Establish the input - quantity relation formula of the longitudinal pitch - attitude PD control law:
[0100] δ ele = K p (θ cmd - θ)+K d ·q;
[0101] The design of the pitch - attitude PD control law of the UAV is similar to the aforementioned PID control law, and only the integral term of the described state - space needs to be simplified. The simplified state - space can be described as:
[0102]
[0103] Similarly, adopt the LQR technology of state - feedback, and the feedback form is. The simplified state:
[0104] x = [e q] T ;
[0105] Then:
[0106]
[0107] Where K p =-K 1 , K d =-K 2 . In this way, the LQR is transformed into the form of pitch attitude PD control.
[0108] Establish the input quantity relationship of the longitudinal static instability control law for the longitudinal pitch attitude:
[0109] δ ele =K p (θ cmd -θ)+K d ·q+K nz nz;
[0110] For an aircraft with relaxed static stability, in some flight conditions, the aircraft is statically unstable. Therefore, a stability augmentation system needs to be added to improve the static stability of the aircraft, making the aircraft change from statically unstable to statically stable. For the longitudinal direction of the aircraft, the static stability can be improved by feedback of the angle of attack or overload signal of the aircraft. C mα is the derivative of the pitch moment coefficient C m with respect to the angle of attack α, called the static stability derivative. When C mα <0, the aircraft is statically stable. When C mα >0, the aircraft is statically unstable. Feedback the angle of attack of the aircraft: δ ele =L α ·α. When the dynamic derivative is not considered, the pitch moment coefficient:
[0111]
[0112] Substitute the feedback of the elevator angle of attack δ ele =L α ·α into the above formula, and the above formula becomes: Then Therefore, by adjusting the magnitude of L α , it can be made that C mα <0, making the aircraft change from statically unstable to statically stable. In actual engineering, the angle of attack information cannot be accurately obtained, and the overload can be converted with the angle of attack. Therefore, feedback of the overload signal can also achieve the effect of stability augmentation. The conversion relationship between the overload and the angle of attack is as follows:
[0113]
[0114] For the design of the relaxed static stability control law using LQR, the parameter design can be first carried out using the angle of attack α, and then it can be converted into an overload command using the above formula for verification.
[0115] Extract the state (q, α) from the state space described above, and expand the angle deviation e as the state x 1 , the pitch rate q and the angle of attack α are respectively used as the state x 2 x 3 . Thus, the state space can be obtained as follows:
[0116]
[0117] The state variable x = [e q α] T , using LQR for full-state feedback, we can get:
[0118]
[0119] where K p =-K 1 , K d =-K 2 , K α =-K 3 . Since the angle of attack is fed back at this time to improve the static instability of the aircraft.
[0120]
[0121] Therefore, the LQR feedback designed for the angle of attack is converted into the LQR feedback for the overload.
[0122] As shown in the figure, according to LQR, by selecting appropriate Q and R weight matrices, a set of pitch attitude PID / PD / static instability state control parameters can be obtained. Then substitute the generated parameters into the state space to view their control effects. Since only the pitch attitude control of the aircraft is concerned, the effects of speed and altitude are ignored, and only the control effect of the controller on the aircraft state is concerned, and the servo transfer function is connected in series before the input of the state space.
[0123] For linear controllers such as PID, the evaluation criteria for their control effects are divided into two parts: time domain and frequency domain. For the attitude inner loop of the UAV, the time domain indicators mainly focus on the rise time, settling time, steady-state error, etc. of the step response; the frequency domain mainly includes the amplitude margin, phase margin, delay margin and closed-loop bandwidth of the system.
[0124] Formulate a scoring mechanism to score the performance indicators with higher attention in the time domain and frequency domain of the system according to their actual performance. Score the four performance indicators with the highest attention: rise time, amplitude margin, phase margin, and delay margin. Suppose the performance indicators required for the inner loop attitude of a certain UAV are:
[0125] Rise time: t 1 ≤t≤t 2;
[0126] Overshoot: tp ≤ v;
[0127] Gain margin: G m ≥ k dB;
[0128] Phase margin: P m ≥ m°;
[0129] Delay margin: T m ≥ s times the control period;
[0130] As Figure 2 shown, for the rise time, it is a range t 1 ~t 2 When the rise time t < t 1 , it means the response is too fast, and the UAV may diverge due to excessive angular rate; when t > t 2 , it means the attitude loop response is too slow, and it is difficult to design the outer loop link. Within a reasonable time range, the faster the response, the better. A linear function is used as the scoring criterion for the rise time, with a full score of 1 point system. When the rise time is t 1 , the full score of 1 point is obtained. When the rise time t 2 is considered passing and gets 0.6 points, and no points are given for the rest of the range. The scoring function of the rise time is as follows:
[0131]
[0132] As Figure 3 shown, regarding the overshoot, the smaller it is under the premise of meeting the requirements, and a linear function is also used as the scoring criterion.
[0133]
[0134] Regarding the performance indicators of the margin, the larger they are under the condition of meeting the requirements, and an exponential function is used as the scoring criterion for the margin. When it is less than the minimum margin, the score is 0. When it is equal to the minimum margin standard, the score is 0.6. As the margin increases, the score gradually approaches 1.
[0135] As Figure 4 shown, the gain margin scoring formula and the scoring curve are as follows, where e is the natural number and a 1 is the adjustment coefficient. The larger this number is, the steeper the curve.
[0136]
[0137] As Figure 5 shown, the phase margin scoring formula and the scoring curve are as follows, and a 2 is the phase margin adjustment coefficient.
[0138]
[0139] As shown Figure 6 below, the time margin score formula and the score curve are as follows, where a 3 is the time margin adjustment coefficient.
[0140]
[0141] When the PID parameters are determined, the scores of each performance index can be obtained through step 200. By adding up the scores of each performance index, the total performance score can be obtained:
[0142]
[0143] The higher the total score, the better the performance of the controller corresponding to the parameter. The total score method is used as the standard for judging the design quality of PID parameters;
[0144] From the design parameters using LQR to the final calculation of the performance scores of PID parameters, a series of transformations have been experienced. For the entire transformation, it is difficult to express it in a formulaic way. The process from initializing the weight coefficients Q and R to obtaining the performance scores can be regarded as a "black box". Using the Bayesian optimization algorithm, the Q and R weights corresponding to the maximum performance score are obtained, and the "optimal" PID parameters are obtained according to these weight coefficients.
[0145] Bayesian optimization is an algorithm for solving the optimal value of a "black box" function. It uses the performance of the parameters that have been searched before to speculate on the position points that should be observed next, thereby reducing the search space and improving the search efficiency. Let the black box function be f, and its expression is as follows:
[0146] Score sum = f(Q, R);
[0147] Its input is the Q and R weight matrices, and the output is the performance score Score sum .
[0148] Among them, the steps of Bayesian optimization are as follows:
[0149] Based on the existing tuning history Γ((Q 1:k , R 1:k ), H 1:k ), establish a surrogate model;
[0150] According to the acquisition function, select the next parameter (Q k+1 , R k+1 );
[0151] Add the newly observed point (Q k+1 , R k+1 ) to Γ;
[0152] Iterate cyclically until the maximum number of iterations is reached or a satisfactory performance score S is obtained des ;
[0153] Set a maximum number of iterations n and a satisfactory total score S des , when the number of iterations is greater than n or the total performance score Score sum > S des Then end the iterative calculation, and use the control parameter of the item with the highest scoring performance in the final iteration as the PID parameter of the optimized pitch attitude loop.
[0154] As Figure 7 shown, using the linearized model of a certain UAV, the pitch angle step response, open-loop bode diagram, closed-loop bode diagram and the scores of each performance index corresponding to the parameters obtained from 50 different Q and R matrices are obtained using Bayesian optimization.
[0155] The above embodiments are only exemplary embodiments of the present application and are not used to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements within the essence and protection scope of the present application, and such modifications or equivalent replacements should also be regarded as falling within the protection scope of the present application.
Claims
1. A method for self-tuning PID parameters of UAV longitudinal attitude based on LQR, characterized in that: The steps include: Step 100: Taking the steady non-sideslip flight of the UAV as the reference motion, the working point of the UAV is trimmed and linearized to obtain the longitudinal state space model, and then the longitudinal state space model is used to construct the relationship model between the LQR control law and the PID control law of the pitch attitude of the UAV; Step 200: The control effect of the PID control law is divided into the time domain and the frequency domain. After the scoring models of the parameters in the time domain and the frequency domain are established, the total performance score of the parameters in the time domain and the frequency domain is used as an indicator to describe the control effect of the PID control law, and the weight of the LQR control law is linked to the total performance score to construct a black box model describing the relationship between the weight and the total performance score. Step 300: Establish a proxy model using known weights and total performance scores as parameter adjustment history, select weights of multiple LQR control laws using a Monte Carlo random shooting method, calculate the total performance scores based on the black box model, and update the proxy model; Step 400, based on the Bayesian optimization method, derive an acquisition function according to the proxy model to obtain the adjusted weight and calculate the total performance score, set a maximum number of iterations and a total performance score that meets the requirements, and select the next weight as a new observation point according to the acquisition function to add it to the parameter adjustment history for iterative calculation. When the number of iterations is greater than the set maximum number of iterations or the total performance score is greater than the set total performance score that meets the requirements, the iterative calculation is terminated, and after selecting the weight with the highest total performance score, use the relational model to obtain the parameters of the PID control law that matches this weight as the optimized and adjusted pitch attitude loop PID parameters.
2. According to claim 1, a method for self-tuning PID parameters of UAV longitudinal attitude based on LQR is characterized in that: In step 100, the specific method of obtaining the longitudinal state space model of the drone is: Taking the steady non-sideslip flight of the UAV as the benchmark motion, the linear longitudinal state space model of the UAV can be obtained using the small disturbance method: y=Cx+Du; in, C is the unit matrix, D is 0, and x is the transposed matrix of the state quantity (VαqθH) T , u is the transposed matrix of the input (δ ele δ T ) T , y is the transposed matrix of the output quantity, whose value is equal to the transposed matrix of the state quantity, and a and b are the coefficient values in the state space after linearization.
3. The method for self-tuning PID parameters of a UAV longitudinal attitude based on LQR according to claim 2 is characterized in that: In step 100, the relationship model between the LQR control law and the PID control law of the pitch attitude of the UAV is constructed in the following manner: Establish the input relationship of longitudinal pitch attitude PID control: δ ele =K p (θ cmd -θ)+K i ∫(θ cmd -θ)dt+K d ·q; Extract the state quantity of the linear longitudinal state space of the UAV and obtain: x=q,y=q,u=δ ele ; We can get: x=a 33 q+b3δ ele ; Expand the extracted state quantity, angle deviation e = θ cmd -θ, the integral of the deviation ∫edt is regarded as the state x1, and the angle deviation e is regarded as the state x2, which together with the extracted state q form a new state space; because θ cmd Considered as a constant, the expanded state space is described as: The state space can be simplified as: Using the LQR algorithm, the feedback form is u = -Kx. Since the state quantity after expansion is: x=[∫edt e q] T ; but: u=-Kx=-K·[∫edt eq] T =[-K1-K2-K3]·[∫edt eq] T ; =K i ∫edt+K p e+K d ·q Among them, K i =-K1,K p =-K2,K d =-K3.
4. The method for self-tuning PID parameters of a UAV longitudinal attitude based on LQR according to claim 3 is characterized in that: In step 200, the score model includes a rise time score model of a step response, an overshoot score model, an amplitude margin score model of the system, a phase margin score model of the system, and a delay margin score model of the system; Among them, the rise time scoring model and overshoot scoring model of the step response are scoring models in the time domain, and the amplitude margin scoring model, the phase margin scoring model and the delay margin scoring model of the system are scoring models in the frequency domain.
5. The method for self-tuning PID parameters of a UAV longitudinal attitude based on LQR according to claim 4 is characterized in that: In step 200, the total performance score is specifically: Among them, Score sum Score is the total performance score. rimetime is the rise time score of the step response, is the amplitude margin score of the system, is the phase margin score of the system, Score is the delay margin score of the system. overshoot Score for overshoot.
6. The method for self-tuning PID parameters of a UAV longitudinal attitude based on LQR according to claim 5 is characterized in that: In step 200, the black box model is specifically: Score sum =f(Q,R); Among them, f is the black box function, Q and R are the input weights of the LQR control law, and Score sum It is the output of the black box function and the total performance score.
7. The method for self-tuning PID parameters of a UAV longitudinal attitude based on LQR according to claim 6 is characterized in that: In step 300, the parameter adjustment history is: Γ((Q 1:k ,R 1:k ),H 1:k ); The specific method of establishing the proxy model is: Using Gaussian process regression with Bayesian optimization algorithm, estimate the objective function: Score sum ~GP(m(x),k(x,x * )); Where m(x) is the mean function of the Gaussian process, x is the sampling point, x = [Q, R], and k(x, x') is the difference between different sampling points x and x. * The covariance function between .
8. The LQR-based UAV longitudinal attitude PID parameter self-tuning method according to claim 7 is characterized in that: In step 400, the expected improvement is used as the acquisition function of Bayesian optimization, and the point that can maximize the expected improvement is selected at each optimization step, specifically: Among them, μ(x * ) is the new sampling point x * The predicted mean of (given by the Gaussian process model), σ(x * ) is the new sampling point x * The predicted standard deviation of is the optimal performance score obtained from the current sampling point, Φ(·) is the cumulative distribution function of the standard normal distribution, and Θ(·) is the probability density function of the standard normal distribution.
Citation Information
Patent Citations
PID parameter design method based on path integration
CN114114896A
PID (Proportion Integration Differentiation) controller parameter setting method based on LQR (Linear Quadrature Ratio) and modified extended state observer
CN115933368A
PID and LQR compound control method for semi-active suspension
CN116373524A
System and Method for Clutch Pressure Control
US20160069402A1
Cited By
Automatic pilot parameter design method based on linear quadratic regulator
CN121742199A