Unmanned aerial vehicle controller parameter tuning method and device based on system identification, and medium
Patent Information
- Application Number
- CN202611473051.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-21
- Publication Date
- 2026-11-03
AI Technical Summary
Existing methods for tuning parameters of multi-rotor UAV controllers are inefficient and pose safety risks, making it difficult to achieve efficient, convenient, and safe parameter tuning.
A system identification-based approach is adopted. By constructing a unified and simplified model, injecting excitation signals and synchronously collecting data, frequency domain identification and model fitting are performed. The target phase margin and controller structure are set, the controller parameters are determined, and frequency domain stability is checked to ensure the safety and consistency of the parameters.
It improves the efficiency of multi-rotor UAV controller parameter tuning, reduces reliance on manual intervention, minimizes safety risks, and ensures parameter stability and consistency.
Smart Images

Figure CN123029804A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of unmanned aerial vehicle (UAV) technology, and in particular to a method, device, and medium for tuning UAV controller parameters based on system identification. Background Technology
[0002] Multirotor drones are increasingly used in aerial surveying, logistics and other fields, and their flight control performance directly determines the quality and safety of mission execution. Multirotor drones are typical underactuated, strongly coupled, and nonlinear systems. Their dynamic characteristics are affected by multiple factors such as airframe structure, propeller aerodynamic characteristics, motor dynamic response, and load changes, making it difficult to obtain an accurate physical model through theoretical calculations.
[0003] In existing technical solutions, engineers typically use manual trial-and-error methods to tune controller gain parameters. This method relies heavily on personal experience for repeated adjustments and requires flight testing to verify its effectiveness, making it inefficient and posing significant flight safety risks. Meanwhile, another common empirical formula method, such as the Ziegler-Nichols rule, while obtaining system characteristic parameters through step response testing, inherently carries safety risks due to critical oscillation experiments. Furthermore, the formulas used are general industrial empirical values and not specifically optimized for the dynamic characteristics of multi-rotor UAVs. Additionally, there are analytical design methods based on theoretical models to tune controller gain parameters. This method requires precise physical parameters such as moment of inertia and thrust coefficient, which are often difficult to measure accurately in practice and vary considerably between different airframes, making accurate acquisition challenging in engineering applications. More importantly, these methods are often fragmented in practical applications, requiring engineers to iterate and test flights across multiple stages. This not only consumes significant time and effort but also makes it difficult to guarantee parameter consistency and optimization across different batches. Summary of the Invention
[0004] This invention provides a method, device, and medium for tuning the parameters of a UAV controller based on system identification. The technical problem it aims to solve is: how to efficiently, conveniently, and safely tune the flight controller parameters of a multi-rotor UAV.
[0005] In a first aspect, the present invention provides a method for tuning the parameters of an unmanned aerial vehicle (UAV) controller based on system identification, comprising: In response to the received control loop information to be tuned, the control loop is determined, and the controlled object of the control loop is constructed into a unified simplified model; An excitation signal is injected into the command channel of the control loop, and command data and measured data of the command channel are collected simultaneously. Frequency domain identification is performed on the command data and the measured data to obtain the non-parametric frequency response, and model fitting is performed on the non-parametric frequency response to obtain the model parameters of the unified simplified model; Set the target phase margin and select the controller structure; Based on the model parameters, the target phase margin, and the controller structure, the open-loop crossover frequency and controller parameters of the control loop are determined. An open-loop transfer function is constructed based on the model parameters and the controller parameters. The frequency domain stability margin is checked at the open-loop crossover frequency according to the open-loop transfer function to determine whether the preset stability index is met. If the preset stability index is met, then the controller parameters are output; If the preset stability index is not met, the target phase margin is reset or the controller structure is reselected, and the process proceeds to the step of determining the open-loop crossover frequency and controller parameters of the control loop based on the model parameters, the target phase margin, and the controller structure.
[0006] Optionally, the controlled object of the control loop is constructed as a unified and simplified model, including: Based on the information of the control loop to be tuned, the control loop is determined to be one of angular velocity loop, attitude loop, velocity loop or position loop; For the control loop, the controlled object is uniformly constructed as a transfer function in which an integral element, a first-order inertial element, and a pure delay element are connected in series. Specifically, when the control loop is an angular velocity loop, the controlled object is a model of angular acceleration command to angular velocity; when the control loop is an attitude loop, the controlled object is a model of angular velocity command to angle; when the control loop is a velocity loop, the controlled object is a model of acceleration command to velocity; and when the control loop is a position loop, the controlled object is a model of velocity command to position.
[0007] Optionally, the step of injecting an excitation signal into the command channel of the control loop and simultaneously acquiring command data and measured data from the command channel includes: Generate a target signal whose spectrum covers the target frequency band. The target frequency band is a frequency band range determined based on a preset desired open-loop crossover frequency. The target signal includes a finite bandwidth swept frequency signal, a multi-sine composite signal, or a pseudo-random binary sequence. The target signal is injected as an excitation signal into the command channel of the control loop; The instruction data and measured data of the instruction channel are synchronously collected at a sampling rate of not less than ten times the preset closed-loop bandwidth to obtain the instruction data and the measured data.
[0008] Optionally, frequency domain identification is performed on the command data and the measured data to obtain a non-parametric frequency response, and model fitting is performed on the non-parametric frequency response to obtain the model parameters of the unified simplified model, including: The command data and the measured data are processed using the Welch average periodogram method or the H1 / H2 estimation method to obtain the non-parametric frequency response; The non-parametric frequency response is fitted to the unified simplified model using the least squares method to obtain the model parameters, which include the motor time constant of the first-order inertial element and the total system delay of the pure delay element.
[0009] Optionally, the setting of the target phase margin and selection of the controller structure includes: The target phase margin is set according to the task requirements; When the control loop is an angular velocity loop or a velocity loop, a proportional-derivative controller or a proportional-derivative controller with a low-pass filter is selected as the controller structure; when the control loop is an attitude loop or a position loop, a pure proportional controller is selected as the controller structure.
[0010] Optionally, when the controller structure is a proportional-derivative controller, determining the open-loop crossover frequency and controller parameters of the control loop based on the model parameters, the target phase margin, and the controller structure includes: Based on the preset open-loop crossover frequency, the motor time constant, the total system delay, the target phase margin, and the open-loop crossover frequency in the model parameters are substituted into the phase condition equation to obtain the differential time constant. Substituting the differential time constant and the open-loop crossover frequency into the amplitude condition equation, the proportional gain is obtained by solving the equation. The differential time constant is then multiplied by the proportional gain to obtain the differential gain. The proportional-derivative controller is constructed based on the proportional gain, the derivative gain, and the derivative time constant.
[0011] Optionally, when the controller structure is a proportional-derivative controller with a low-pass filter, the open-loop crossover frequency and controller parameters of the control loop are determined based on the model parameters, the target phase margin, and the controller structure, including: Based on the preset open-loop crossing frequency, the required lead angle is calculated according to the model parameters, the target phase margin, and the open-loop crossing frequency; Determine if the required lead angle is greater than zero; if the required lead angle is less than or equal to zero, then determine to use pure proportional control. If the required lead angle is greater than zero, then the lead factor is calculated based on the required lead angle. The open-loop crossover frequency and the lead factor are substituted into the maximum phase boost frequency formula to obtain the filter time constant. Based on the motor time constant, the total system delay, the open-loop crossover frequency, the lead factor, and the filter time constant, the proportional gain is calculated through the amplitude condition equation. The proportional gain and the filter time constant are combined to construct the proportional-derivative controller with low-pass filtering.
[0012] Optionally, frequency domain stability margin verification is performed at the open-loop crossover frequency based on the open-loop transfer function to determine whether a preset stability index is met, including: Based on the open-loop transfer function, the phase margin is calculated at the open-loop crossover frequency, and the gain margin and the peak value of the sensitivity function are also calculated. Determine whether the phase margin, the amplitude margin, and the peak value of the sensitivity function all meet preset threshold conditions; If the phase margin, the amplitude margin, and the peak value of the sensitivity function all satisfy the preset threshold conditions, then the preset stability index is determined to be satisfied. If any one of the phase margin, the amplitude margin, and the peak value of the sensitivity function does not meet the preset threshold condition, then it is determined that the preset stability index is not met.
[0013] Secondly, the present invention also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0014] Thirdly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0015] This invention provides a method, device, and medium for tuning UAV controller parameters based on system identification. By responding to received control loop information to be tuned, the control loop is determined, and a unified simplified model is constructed, providing a standardized processing foundation for controller parameter tuning and avoiding modeling obstacles caused by direct reliance on precise physical models. Based on the model, excitation signals are injected into the command channel, and command data and measured data are collected simultaneously. Model parameters are automatically obtained through frequency domain identification and model fitting. The entire process is data-driven, eliminating reliance on human experience. Furthermore, by setting a target phase margin and selecting the controller structure, the open-loop crossover frequency and controller parameters are determined based on the model parameters, target phase margin, and controller structure. This achieves deterministic calculation from design specifications to controller parameters, reducing manual trial-and-error steps and improving tuning efficiency. After obtaining the controller parameters, an open-loop transfer function is constructed using the model parameters and controller parameters. Frequency domain stability margin is checked at the open-loop crossover frequency to determine whether the preset stability index is met, thereby quantitatively verifying the parameter safety. When the preset stability index is not met, the system resets the target phase margin or reselects the controller structure and recalculates, ensuring that the final output controller parameters have undergone stability verification. This process avoids the risk of instability caused by improper parameters. In summary, this invention improves the efficiency of parameter tuning by combining standardized modeling with data-driven identification, and ensures the safety of parameter tuning through mandatory frequency domain verification and parameter feedback adjustment mechanisms. This solves the problems of low efficiency and high risk in the parameter tuning of existing multi-rotor UAV controllers. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a method for tuning unmanned aerial vehicle (UAV) controller parameters based on system identification, provided in an embodiment of the present invention; Figure 2 A system identification principle diagram provided for embodiments of the present invention; Figure 3 This is a frequency domain comparison diagram of an identification model and a fitting model provided in an embodiment of the present invention; Figure 4 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0020] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0021] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0022] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0023] In UAV flight control systems, controller parameter tuning typically faces challenges such as complex modeling, heavy reliance on manual intervention, and difficulty in ensuring safety. A complete UAV dynamics model includes rigid body six-degree-of-freedom motion equations, aerodynamic and torque models, motor and propeller dynamics, sensor characteristics and delays, and environmental factors such as wind disturbance. These models are high-order and highly nonlinear, making direct application to frequency domain design and robustness analysis impractical. To achieve a balance between model accuracy and design simplicity, this invention employs a low-order linear model to simulate the main dynamics, describes system behavior with a small number of parameters, and utilizes classic frequency domain methods such as Bode plots for analysis to achieve UAV controller parameter tuning. Based on this approach, this invention provides a UAV controller parameter tuning method based on system identification, as illustrated in the flowchart below. Figure 1 .
[0024] Specifically, the method includes the following steps: S1, in response to the received control loop information to be tuned, determines the control loop and constructs the controlled object of the control loop into a unified simplified model.
[0025] In practice, the control loop information to be tuned is data used to identify the control channel that needs to be tuned. For example, it can be a loop identifier entered by the user or a control loop sequence number automatically identified by the system. After receiving the control loop information to be tuned, the current control loop to be tuned is first determined, and the controlled object of the control loop is constructed into a unified and simplified model.
[0026] Within the low-to-mid-frequency band, which is the focus of frequency domain design, the dynamic characteristics of each control loop of the UAV can be abstracted based on its main physical processes: the rigid body kinematic relationship between the controlled variable and the control variable is expressed as an integral characteristic; the dynamic response of the motor or inner loop actuator is expressed as a first-order inertial lag; and the time delays introduced by sensor sampling, navigation calculation, and communication link transmission are expressed as pure delays. In contrast, high-frequency dynamics such as higher-order aerodynamic damping and structural elastic modes have a relatively small impact in this frequency band and can be ignored. Therefore, the controlled objects of different loops can be uniformly constructed as a transfer function in series with an integral element, a first-order inertial element, and a pure delay element. Here, the integral element represents the rigid body kinematic relationship between the controlled variable and the control variable, that is, the controlled variable is the time integral of the control variable; the first-order inertial element represents the dynamic lag generated by the motor or inner loop actuator when responding to commands; and the pure delay element represents the pure time delay introduced by sensor sampling, navigation calculation, and communication link transmission. This structure greatly simplifies the complexity of system description while ensuring accuracy in the mid-to-low frequency bands, allowing different loops to share the same frequency domain design framework.
[0027] In practice, based on the control loop information to be tuned, the control loop is determined to be one of an angular velocity loop, attitude loop, velocity loop, or position loop. The control loop information to be tuned is the basis for the system to identify the current controlled object; by reading this information, the physical attributes of the current link can be uniquely determined.
[0028] Furthermore, for the control loop, the controlled object is uniformly constructed as a transfer function consisting of an integral element, a first-order inertial element, and a pure delay element connected in series. In this structure, the integral element represents the kinematic relationship between the controlled variable and the control variable, i.e., the controlled variable is the time integral of the control variable; the first-order inertial element represents the dynamic response lag of the actuator or the closed inner loop; and the pure delay element represents the time delay caused by signal processing and transmission.
[0029] When the control loop is an angular velocity loop, the controlled object is a model of the angular acceleration command output by the controller to the angular velocity of the machine body, and its transfer function is: In this model, the integral element represents the accumulation of angular acceleration with respect to angular velocity; the first-order inertial element represents the dynamic response process when the motor and propeller generate torque, and its time constant is... That is, the motor time constant; pure delay This represents the time required for sensor filtering and navigation calculation.
[0030] When the control loop is an attitude loop (angle loop), the controlled object is a model of angular velocity command to angle. The controlled object of the angle loop is actually the closed-loop transfer function of the angular velocity loop: In the low-to-mid-frequency region, the closed-loop transfer function can be simplified to a first-order inertial element plus an equivalent delay; therefore, its transfer function can be uniformly expressed as: At this point, the integral element represents the accumulation of angular velocity over angle; the time constant of the first-order inertial element... It is equivalent to the equivalent lag brought about by the inner loop closure; the pure delay represents the additional equivalent delay after the inner loop closure, reflecting the step response characteristics of the entire inner loop closed-loop system.
[0031] Furthermore, when the control loop is a velocity loop, the controlled object is a model that translates acceleration commands to velocity, and its transfer function is: Here, acceleration is the first derivative of velocity; the first-order inertial element... Represents the hysteresis characteristic of a dynamic system when it generates acceleration; pure delay This represents the microsecond delay in the response of the dynamic system.
[0032] Furthermore, when the control loop is a position loop, the controlled object is a model that translates velocity commands to position. Here, velocity is the first derivative of position; therefore, position is the integral of velocity, forming a pure integral element with the following transfer function: .
[0033] This embodiment achieves modular abstraction of different control loops by uniformly constructing each loop as a transfer function consisting of a series of integrators, first-order inertial elements, and pure delay elements. Since all loops share the same mathematical model structure, engineers do not need to perform complex physical derivations for different loops. They only need to determine the physical meaning of the corresponding parameters based on the physical nature of the current loop, and can reuse the same set of analytical equations for design. This unified approach greatly reduces the theoretical complexity of multi-loop controller design and avoids parameter conflicts caused by inconsistent models between different loops. Simultaneously, this construction method allows the bandwidth isolation principle between inner and outer loops to be automatically implemented through a unified mathematical model, effectively preventing coupled oscillations between cascaded loops and improving the stability and robustness of the entire multi-rotor UAV system control.
[0034] S2, inject an excitation signal into the command channel of the control loop, and simultaneously collect the command data and measured data of the command channel.
[0035] In practice, command data refers to the numerical sequence input to the controller reference terminal, while measured data refers to the sequence of measured values of motion states such as angular velocity, attitude angle, or position actually output by the UAV. For example... Figure 2 As shown in the system identification principle diagram, this embodiment injects an excitation signal r into the angular velocity command channel (or the command input terminal of other control loops), and simultaneously collects the command data u input to the controller, the feedback data w from the motor and the aircraft model, and the measured angular velocity n actually output by the aircraft. This method, through spectral analysis, can accurately identify the open-loop and closed-loop transfer functions of the angular velocity loop (or attitude loop, velocity loop, etc.).
[0036] In specific implementation, to ensure the signal-to-noise ratio and effectiveness of the identification data, this step includes the following preferred implementation scheme: generating a target signal with a spectrum covering the target frequency band, wherein the target frequency band is a frequency band range determined based on a preset expected open-loop crossover frequency, and the target signal includes a finite bandwidth swept frequency signal, a multi-sine synthesized signal, or a pseudo-random binary sequence; injecting the target signal as an excitation signal into the command channel of the control loop; synchronously acquiring the command data and measured data of the command channel at a sampling rate not less than ten times the preset closed-loop bandwidth to obtain the command data and the measured data.
[0037] In specific implementation, a target signal covering the target frequency band is generated. The target frequency band is a frequency range determined based on a preset expected open-loop crossover frequency, and the target frequency band and the preset expected open-loop crossover frequency are on the same order of magnitude. First, based on flight mission requirements and system dynamic response indicators, a preset expected open-loop crossover frequency is set. The target frequency band is a frequency range determined based on the preset expected open-loop crossover frequency, and the target frequency band and the preset expected open-loop crossover frequency are on the same order of magnitude. Specifically, the lower limit of the target frequency band is not less than half of the preset expected open-loop crossover frequency, and the upper limit of the frequency band is not greater than twice the preset expected open-loop crossover frequency, thereby ensuring that the target frequency band is always consistent with the preset expected open-loop crossover frequency in terms of numerical magnitude.
[0038] It should be noted that limiting the target frequency band to the same order of magnitude as the preset desired open-loop crossover frequency ensures that the excitation energy is concentrated within the core frequency range of interest to the controller design. If the target frequency band spans multiple orders of magnitude, the energy of the excitation signal will be significantly diluted, leading to a sharp drop in the signal-to-noise ratio at the target frequency. Furthermore, this can easily induce strong nonlinear drift in the UAV at low frequencies or trigger structural elastic resonance modes at high frequencies, thus introducing severe identification interference. Limiting the target frequency band to the same order of magnitude effectively avoids interference from non-target frequency bands, ensuring that the system obtains sufficient excitation energy near the preset desired open-loop crossover frequency.
[0039] For example, when the preset expected open-loop crossover frequency is set to 5 rad / s, the target frequency band can be determined as a continuous frequency band range from 2.5 rad / s to 10 rad / s, with both the upper and lower limits of this band range on the same order of magnitude as the preset value. Within this frequency band, the target signal can be a finite-bandwidth swept-frequency signal, sweeping across the band by continuously varying its frequency over time; it can also be a multi-sine composite signal, injecting high energy at multiple specific frequency points within the target frequency band; or it can be a pseudo-random binary sequence, using its flat spectral envelope to simultaneously excite system modes within the band. Through the above frequency constraints and signal generation methods, high-fidelity frequency domain response data of the system within the target frequency band can be obtained, thus providing a reliable data foundation for the subsequent accurate identification of the model parameters of the unified simplified model.
[0040] Furthermore, the target signal includes a finite bandwidth swept frequency signal, a multi-sine synthesized signal, or a pseudo-random binary sequence. A finite bandwidth swept frequency signal is a sinusoidal signal whose frequency changes continuously with time, providing continuous frequency coverage and suitable for scanning the global dynamic characteristics of a system. A multi-sine synthesized signal synthesizes several sine waves of specific frequencies, providing high-energy excitation at specific frequency points, suitable for accurately measuring the response at specific frequency points. A pseudo-random binary sequence (PRBS) is a periodic signal with approximately white noise characteristics; its spectral envelope is flat, capable of simultaneously exciting the dynamic characteristics of the system across a wide frequency band, and is easy to implement and synchronize in engineering.
[0041] The target signal is injected as an excitation signal into the command channel of the control loop; the command data and measured data of the command channel are synchronously acquired at a sampling rate of not less than ten times the preset closed-loop bandwidth to obtain the command data and the measured data.
[0042] In practice, after the target signal is injected as an excitation signal into the command channel of the control loop, the command data and measured data of the command channel are synchronously acquired at a sampling rate of not less than ten times the preset closed-loop bandwidth. According to the Nyquist sampling theorem, in order to recover the analog signal without distortion, the sampling frequency must be greater than twice the highest frequency in the signal. The requirement that the sampling rate be no less than ten times the preset closed-loop bandwidth greatly ensures the time resolution of data acquisition and suppresses the aliasing effect of high-frequency noise during spectrum analysis, thereby ensuring that the acquired command data and measured data can truly and completely reflect the dynamic characteristics of the system in the target frequency band. Furthermore, the high sampling rate also provides more data samples for subsequent frequency domain identification algorithms, improving the statistical stability of the estimation of non-parametric frequency response.
[0043] This embodiment generates a target signal covering the target frequency band, concentrating limited excitation energy into the frequency range most relevant to the controller design, resulting in extremely high signal-to-noise ratios for the system response data in this band. By employing a sampling rate no less than ten times the preset closed-loop bandwidth, the aliasing effect of high-frequency noise is significantly suppressed, ensuring that the acquired input and output data accurately maps the true dynamics of the system. Furthermore, this targeted excitation design strategy combined with a high-precision sampling strategy provides a high-quality data foundation for subsequent frequency domain identification, fundamentally ensuring that the identified model parameters truly reflect the physical characteristics of the actual system, thus improving the effectiveness and engineering usability of the controller parameters calculated based on the model.
[0044] S3, perform frequency domain identification on the command data and the measured data to obtain the non-parametric frequency response, and perform model fitting on the non-parametric frequency response to obtain the model parameters of the unified simplified model.
[0045] In practice, the input for frequency domain identification is the time-domain command data and measured data. Random noise interference can be removed through spectral analysis, and the output is a non-parametric frequency response representing the system's frequency characteristics, i.e., the system amplitude and phase data at different frequency points. The input for model fitting is the non-parametric frequency response. Using numerical optimization algorithms such as least squares, this non-parametric data is fitted into the structure of the unified simplified model, thereby obtaining the specific motor time constant and total system delay as model parameters.
[0046] In some preferred embodiments, frequency domain identification is performed on the command data and the measured data to obtain a non-parametric frequency response, and model fitting is performed on the non-parametric frequency response to obtain the model parameters of the unified simplified model. This includes: processing the command data and the measured data using the Welch average periodogram method or the H1 / H2 estimation method to obtain the non-parametric frequency response; fitting the non-parametric frequency response to the unified simplified model using the least squares method to obtain the model parameters, which include the motor time constant of the first-order inertial element and the total system delay of the pure delay element.
[0047] In the system identification process, directly using unprocessed time-domain data for parameter fitting often results in severe distortion due to sensor noise and external interference. Simple averaging is insufficient to effectively suppress the impact of non-stationary noise on the accuracy of the system model. Therefore, this embodiment employs the Welch average periodogram method or the H1 / H2 estimation method, combined with least squares fitting, to effectively suppress random noise and extract high-fidelity system model parameters, ensuring that the model can truly reflect the dynamic characteristics of the actual physical system.
[0048] The command data and the measured data are processed using either the Welch average periodogram method or the H1 / H2 estimation method to obtain the non-parametric frequency response. The Welch average periodogram method is an improved periodogram estimation method. Its core idea is to divide the long sequence data into multiple overlapping short sequences, perform a Fast Fourier Transform on each short sequence after windowing, and then average the results of each segment. The advantage of this method is that it effectively reduces the estimation variance through averaging and suppresses the influence of random noise on the spectrum estimation. The H1 estimation method is defined as the ratio of the system output spectrum to the input cross spectrum, suitable for situations where the input signal is noise-free and the output signal is noisy. The H2 estimation method is defined as the ratio of the output autospectrum to the conjugate of the input and output cross spectra, suitable for situations where the output signal is noise-free and the input signal is noisy. In practical engineering, the H1 or H2 estimation method should be selected according to the specific sensor noise characteristics to ensure the reasonableness of the estimation results.
[0049] Furthermore, through the above processing, a non-parametric frequency response is obtained, which is expressed as amplitude and phase data at a series of discrete frequency points. It is not an explicit mathematical model, but a numerical description of the frequency domain characteristics of the system.
[0050] Furthermore, the non-parametric frequency response is fitted to the unified simplified model using the least squares method to obtain the model parameters. The principle of the least squares method is to find a set of model parameters such that, under this set of parameters, the sum of squared errors between the theoretical frequency response and the measured non-parametric frequency response of the model is minimized at all frequency points. Since the unified simplified model has a fixed order and a simple structure, this fitting problem can be solved using a fast-converging numerical optimization algorithm. The fitted model parameters include the motor time constant of the first-order inertial element and the total system delay of the pure delay element.
[0051] Specifically, the physical meaning of the motor time constant is the time required for the motor output to reach 63.2% of its final value under a step input; its magnitude reflects the speed of the motor's response. This parameter is mainly determined by the inductance-to-resistance ratio of the motor armature circuit and is also affected by propeller air resistance. The total system delay represents the sum of time consumed by all stages from the controller outputting the command signal to the actual measurement of the aircraft's motion state by the sensors. This includes the processing time of the flight control computer, the transmission time of the data bus, the filtering lag of the sensors themselves, and the navigation calculation cycle, etc. The total system delay is the core factor causing phase lag in the control system and directly affects the system's stability limit.
[0052] like Figure 3 As shown in the figure, this figure presents the frequency domain comparison results between the identification model and the fitted model. Figure 3The diagram consists of the amplitude-frequency response at the top and the phase-frequency response at the bottom. The solid blue line represents the actual identified non-parametric frequency response, and the dashed red line represents the frequency response of the unified simplified model obtained by least-squares fitting. The fitted model is... That is, the motor time constant is 35ms and the system delay is 6ms. It can be seen that within the preset frequency range (1~11Hz), the blue solid line and the red dashed line highly overlap, indicating that the unified simplified model of the present invention can accurately describe the dynamic characteristics of the controlled object in the target frequency band.
[0053] This embodiment processes time-domain data using the Welch average periodogram method or the H1 / H2 estimation method, fully utilizing spectral averaging techniques to smooth fluctuations caused by random noise, significantly improving the ability to extract the true frequency characteristics of the system from a noisy environment. By further employing the least squares method to fit the non-parametric frequency response to a unified simplified model with a specific structure, not only are high-frequency glitches in the data filtered out, but the non-parametric results are also transformed into low-order model parameters with clear physical meaning, namely the motor time constant and the total system delay. This ensures that the finally extracted model parameters can truly reflect the dynamic characteristics of the actual flight system, thereby giving the model used for subsequent controller design extremely high fidelity.
[0054] S4, set the target phase margin and select the controller structure.
[0055] In practical implementation, the target phase margin is a key safety indicator in frequency domain design, typically set between 45 and 60 degrees. Its magnitude directly determines the overshoot and oscillation trend of the closed-loop system. The controller structure is selected based on the dynamic characteristics of the loop to be tuned. For example, the angular velocity loop or velocity loop often chooses a proportional-derivative controller or a proportional-derivative controller with a low-pass filter, while the attitude loop or position loop often chooses a pure proportional controller.
[0056] In some preferred embodiments, setting a target phase margin and selecting a controller structure includes: setting the target phase margin according to task requirements; when the control loop is an angular velocity loop or a velocity loop, selecting a proportional-derivative controller or a proportional-derivative controller with low-pass filtering as the controller structure; when the control loop is an attitude loop or a position loop, selecting a pure proportional controller as the controller structure.
[0057] In practical implementation, during the flight control of a multi-rotor UAV, the angular velocity loop and velocity loop, as inner loops, directly face external disturbances and the nonlinearity of the actuator, requiring extremely high dynamic response. The attitude loop and position loop, as outer loops, have the controlled object itself containing the closed-loop transfer function of the inner loop, possessing certain filtering characteristics. Using a uniform controller structure for both inner and outer loops can easily lead to slow response in the inner loop or amplified noise in the outer loop, thus affecting the overall system performance. This embodiment selects the controller structure differently based on the control loop type, achieving optimized matching of the performance of each loop. The specific implementation method is as follows: First, the target phase margin is set according to the mission requirements. Setting the target phase margin requires a comprehensive balance between the system's speed and stability: if set too small, the system response will be fast, but it will generate large overshoot and oscillations, even leading to instability; if set too large, the system response will become sluggish, making it difficult to meet real-time control requirements. Therefore, it is usually flexibly set within a preset range according to the UAV's mission type.
[0058] Furthermore, when the control loop is an angular velocity loop or a speed loop, a proportional-derivative (PD) controller or a PDR controller with a low-pass filter is selected as the controller structure. This is because the angular velocity loop and speed loop, as inner loops, must have extremely high open-loop crossover frequencies to quickly suppress external disturbances. Due to the inertial lag of the motor and propeller, and the presence of delay elements in the system itself, a pure proportional controller cannot provide sufficient phase margin at higher frequencies. The derivative term in the PDR controller can provide positive phase lead correction, effectively improving the system's phase near the crossover frequency by introducing an open-loop zero, thus allowing for higher crossover frequencies. Additionally, since the pure derivative element is extremely sensitive to high-frequency noise, a PDR controller with a low-pass filter is further used in practical engineering to suppress the amplification of high-frequency noise while retaining the phase lead effect.
[0059] Furthermore, when the control loop is an attitude loop or a position loop, a pure proportional controller is selected as the controller structure. This is because the attitude loop and position loop already contain the closed-loop transfer function of the inner loop, and the inner loop already has low-pass filtering characteristics after closing. The kinematic nature of the outer loop itself is a pure integral element, and coupled with the low-pass characteristic provided by the inner loop, the phase lag of the outer loop system is relatively small, resulting in good stability. Introducing additional differential terms may amplify the noise transmitted from the inner loop, leading to unnecessary control signal chattering. Using a pure proportional controller not only meets the basic requirements of stability and accuracy for the outer loop, but also greatly simplifies the system structure and reduces computational overhead.
[0060] For the inner loop, which requires high dynamic response and strong disturbance rejection, a proportional-derivative (PD) controller or a PDR controller with a low-pass filter is used to increase bandwidth by utilizing the lead phase angle provided by the derivative term. For the outer loop, which requires good stability and low noise sensitivity, a pure proportional controller is used. This embodiment differentiates the control requirements of the inner and outer loops, achieving a differentiated configuration of the controller structure and avoiding performance bottlenecks caused by a single structure. This not only significantly improves the dynamic response capability of the entire system but also effectively reduces the computational burden of the flight control system.
[0061] S5. Based on the model parameters, the target phase margin, and the controller structure, determine the open-loop crossover frequency and controller parameters of the control loop.
[0062] In specific implementation, taking the controller structure as a pure proportional controller as an example, the open-loop transfer function from the angular velocity command to the angular velocity is: At the open-loop crossover frequency, both phase and amplitude constraints must be satisfied: the sum of the total phase lag generated by all components of the system and 180 degrees must equal the target phase margin. Specifically, the integral component generates a fixed 90-degree phase lag, the phase lag generated by the first-order inertial component increases with frequency, and the phase lag generated by the pure delay component increases linearly with frequency. This is based on the definition of phase margin. , The phase condition equation can be obtained. Based on the amplitude condition (gain is 1 during crossover). The amplitude condition equation can be obtained. .
[0063] Because the total phase lag and frequency constitute a transcendence relationship, an analytical solution cannot be obtained directly. A numerical iterative solution method is required to calculate the specific value of the open-loop crossover frequency. The specific numerical solution steps are as follows: Step 1, Solve the phase equation to obtain the crossover frequency. Step 2: Substitute the values into the amplitude condition equation to obtain the result. For example, in setting = 0.035s, = 0.006 s, target phase margin = 55.0°, crossing frequency = 16.13 rad / s (2.57 Hz), angular velocity gain = 18.53 (1 / s). This solution process ensures that the remaining safe phase reserve of the system at the crossover frequency is exactly equal to the target value. After obtaining the open-loop crossover frequency, the open-loop gain of the system at that frequency must be exactly 1 (i.e., 0 dB). Since the integrator and first-order inertial elements will produce corresponding amplitude attenuation at this frequency, the proportional gain can be determined by calculating the gain value required to offset the above total amplitude attenuation to unity gain.
[0064] For proportional-derivative (PD) controllers and PD controllers with low-pass filters, it is necessary to introduce corresponding phase lead and amplitude variation terms based on the controller structure to construct the corresponding constraint equations, thereby obtaining the corresponding proportional gain, derivative gain, and filter time constant. PD controllers are widely used in the inner-loop control of UAVs, such as the angular velocity loop and speed loop, and their parameter tuning directly affects the dynamic response and stability of the system.
[0065] In some preferred embodiments, when the controller structure is a proportional-derivative controller, the controlled object model is as follows: Based on the preset open-loop crossover frequency, the motor time constant, the total system delay, the target phase margin, and the open-loop crossover frequency from the model parameters are substituted into the phase condition equation to obtain the differential time constant. At this point, the controller structure is as follows: The relationship between the two is The corresponding open-loop transfer function is: At this point, the open-loop total phase expression is: At the crossover frequency, the phase condition equation must be satisfied: PM target = 90° + arctan(τ d ω c ) - arctan(τ m ω c ) - (180 / π)ω c T d (1).
[0066] Further simplification using formula (1) yields: The equation for solving the differential time constant is obtained. .
[0067] Among them, PM target Indicates the target phase margin; ω c τ represents the open-loop crossover frequency. d τ represents the differential time constant to be determined; m T represents the motor time constant; d This represents the total system delay. The physical meaning of formula (1) is: at the open-loop crossover frequency ω cAt this point, the integrator produces a fixed 90-degree phase lag, and the first-order inertial element produces arctan(τ). m ω c The phase lag of the pure delay element produces (180 / π)ω. c T d The phase lag, while the derivative element in the proportional-derivative controller provides arctan(τ) d ω c The positive phase lead of the system. The algebraic sum of the above phase components ensures that the remaining phase of the system at the cross-frequency is exactly equal to the target phase margin, thus guaranteeing the relative stability of the system.
[0068] Furthermore, after obtaining the differential time constant τ d Then, the differential time constant and the open-loop crossover frequency are substituted into the amplitude condition equation to obtain the proportional gain. The physical meaning of the amplitude condition is to ensure that the total open-loop gain at the crossover frequency is exactly 1, i.e., 0 dB. Its mathematical expression is: Therefore, the formula for proportional gain is: (2).
[0069] Among them, K p ω represents the proportional gain to be determined; c τ represents the open-loop crossover frequency. m τ represents the time constant of the motor; d This represents the differential time constant. The physical meaning of formula (2) is: in order to make the system cross the frequency ω c The open-loop gain at that frequency is exactly 1 (i.e., 0 dB), and the required scaling factor must be calculated based on the system's own amplitude response at that frequency. The numerator ω in this formula... c √(1 + (τ m ω c ) 2 The ) represents the integrator and the first-order inertial element at frequency ω. c Total amplitude at point; denominator √(1 + (τ) d ω c ) 2 ) represents the differential element at frequency ω c The amplitude gain introduced at the point is given. By solving the above equation, the proportional gain that meets the crossover frequency requirement can be obtained.
[0070] Subsequently, the system multiplies the differential time constant by the proportional gain to obtain the differential gain, the expression of which is shown in formula (3): K d = K p · τ d (3); Among them, K d K represents the differential gain;p τ represents proportional gain; d The differential time constant is represented by the formula (3). The physical meaning of formula (3) is that the differential gain is the product of the proportional gain and the differential time constant, which clarifies the conversion relationship between the two and forms a complete controller parameter by combining the proportional and differential components. Finally, the proportional-differential controller is constructed based on the proportional gain, the differential gain, and the differential time constant.
[0071] Example parameter τ m =0.0350 s, T d =0.0060 s (6.0 ms), desired crossing frequency ω c =24.00 rad / s (3.82 Hz), target phase margin PM target Taking 50.0° as an example, first substitute it into formula (1) to calculate the differential time constant τ. d =0.0061s; then substitute into formula (2) to calculate the proportional gain K. p =31.0169 (1 / s); finally, substituting into formula (3), the differential gain K is calculated. d =0.1881.
[0072] This embodiment employs rigorous mathematical derivation, ensuring that the design of the proportional-derivative controller is entirely based on analytical calculation rather than trial and error. By utilizing the actual model parameters identified by the system, the calculated differential time constant and proportional gain can accurately compensate for the system's inherent inertial lag and transmission delay, thereby achieving the target phase margin at the set open-loop crossover frequency. This deterministic calculation method not only significantly reduces parameter tuning time but also ensures the scientific validity and consistency of the controller parameters from a physical perspective, greatly enhancing the performance ceiling of the flight control system under complex operating conditions.
[0073] In some preferred embodiments, when the controller structure is a proportional-derivative controller with low-pass filtering, based on the preset open-loop crossover frequency, the required lead angle is calculated according to the model parameters, the target phase margin, and the open-loop crossover frequency; it is determined whether the required lead angle is greater than zero; if the required lead angle is less than or equal to zero, pure proportional control is determined; if the required lead angle is greater than zero, a lead factor is calculated based on the required lead angle, and the open-loop crossover frequency and the lead factor are substituted into the maximum phase boost frequency formula to obtain the filter time constant. Based on the motor time constant, the total system delay, the open-loop crossover frequency, the lead factor, and the filter time constant, the proportional gain is calculated through the amplitude condition equation, and the proportional gain and the filter time constant are combined to construct the proportional-derivative controller with low-pass filtering.
[0074] First, based on the preset open-loop crossover frequency, the required lead angle is calculated according to the model parameters, the target phase margin, and the open-loop crossover frequency. This lead angle refers to the maximum additional phase boost the controller needs to provide to compensate for the system's inherent lag and ensure the system meets the target phase margin at the crossover frequency. The controller structure at this time is as follows: After mathematical rewriting and transformation, it can be transformed into a standard proportional control series lead compensation form: ;in, At this point, the open-loop model of the system is: Therefore, the required lead angle can be calculated.
[0075] In some embodiments, taking the maximum phase boost criterion as an example, the formula for calculating the required lead angle is shown in formula (4): φ lead = PM target - 90° + arctan(τ m ω c ) + (180 / π)ω c T d (4); Where, φ lead Indicates the required lead angle; PM target Indicates the target phase margin; ω c τ represents the open-loop crossover frequency. m T represents the motor time constant; d This represents the total system delay. The physical meaning of formula (4) is: the target phase margin equals 180 degrees plus the total phase of the system at the crossover frequency. The total system phase includes the negative 90-degree fixed phase of the integral element and the negative phase lag arctan(τ) generated by the motor inertia element. m ω c And the negative phase lag (180 / π)ω caused by the delay element. c T d To achieve the target phase margin, the controller must provide an additional 90° - arctan(τ). m ω c ) - (180 / π)ω c T d The phase advance is the required advance angle.
[0076] Furthermore, based on the calculation results of formula (4), it is determined whether the required lead angle is greater than zero.
[0077] If the required lead angle is less than or equal to zero, it means that the inherent phase lag of the system is already small. At the set crossover frequency, the target phase margin requirement can be met by proportional control alone, without the need to introduce lead compensation. Therefore, pure proportional control is selected.
[0078] If the required lead angle is greater than zero, then the lead factor is calculated based on the required lead angle. The formula for calculating the lead factor is shown in formula (5): α = (1 + sinφ lead ) / (1 - sinφ lead (5); Where α represents the lead factor; φ lead This indicates the required lead angle. The physical meaning of formula (5) is: in order to provide φ at a specified frequency lead For the phase boost to be achieved, the ratio of the zero-to-pole frequencies of the lead network must satisfy this relationship. This formula is a general formula for determining the maximum phase boost capability in classical lead compensation network design.
[0079] Furthermore, substituting the open-loop crossover frequency and the lead factor into the maximum phase boost frequency formula, the filtering time constant is obtained. The maximum phase boost frequency formula is shown in formula (6): (6); Where, τ f ω represents the filtering time constant; c ω represents the open-loop crossover frequency; α represents the lead factor. The physical meaning of formula (6) is: in order to ensure that the maximum phase boost frequency of the lead network falls exactly at the set open-loop crossover frequency ω c This allows for maximum phase compensation at the crossover frequency, resulting in a filter time constant τ. f This mathematical relationship must be satisfied.
[0080] Furthermore, based on the motor time constant, the total system delay, the open-loop crossover frequency, the lead factor, and the filter time constant, the proportional gain is calculated using the amplitude condition equation. Since the addition of the lead network introduces an additional gain at the crossover frequency, the proportional gain needs to be readjusted to satisfy the amplitude condition, as shown in equation (7): K p = (7); Among them, K p Represents proportional gain; ω c τ represents the open-loop crossover frequency. m τ represents the time constant of the motor; f α represents the filtering time constant; α represents the lead factor. The physical meaning of formula (7) is: to make the system achieve the open-loop crossover frequency ω c The amplitude at that point is 1 (i.e., 0 dB), and the proportional gain K p The value of must be equal to the product of the total amplitudes of the integrator, the first-order inertial element, and the lead compensation network at the crossover frequency. Among these, ω in the molecule... c√(1 + (τ m ω c ) 2 ) represents the amplitude of the integral and the inertial element, √(1 + (τ) f ω c ) 2 ) represents the magnitude of the lead network poles, and √(1 + (ατ) in the denominator f ω c ) 2 ) represents the amplitude of the zero point of the lead network. The proportional gain is calculated using this formula, and the proportional gain is combined with the filtering time constant to construct the proportional-differential controller with low-pass filtering.
[0081] Example parameter τ m =0.0350 s, T d =0.0060 s (6.0 ms), desired crossing frequency ω c =24.00 rad / s (3.82 Hz), target phase margin PM target Taking 50.0° as an example, first substitute it into formula (4) to calculate the required lead angle φ. lead =8.3°; Substituting into formula (5), the lead factor α = 1.3365 is obtained; Substituting into formula (6), the filter time constant τ is obtained. f =0.0360 s; finally, substituting into formula (7), the proportional gain K is calculated. p =27.1121 (1 / s).
[0082] This embodiment, through a rigorous lead compensation design, not only retains the function of improving the system's phase margin and response speed through differential terms, but also cleverly utilizes the filtering stage to effectively suppress high-frequency noise. The complete design of the logic branches ensures that when the required lead angle is less than or equal to zero, it can be simplified to pure proportional control, avoiding unnecessary computational overhead; while when it is greater than zero, the lead factor, filtering time constant, and proportional gain are accurately calculated, guaranteeing the system's performance at the target frequency. This scheme, through parametric design, achieves an optimal balance between the system's noise immunity and dynamic tracking capability, significantly improving the UAV's flight stability in complex electromagnetic environments.
[0083] S6. Construct an open-loop transfer function based on the model parameters and the controller parameters, and perform a frequency domain stability margin check at the open-loop crossover frequency according to the open-loop transfer function to determine whether the preset stability index is met.
[0084] In practice, an open-loop transfer function is constructed based on the model parameters and the controller parameters. Frequency domain stability margin is then checked at the open-loop crossover frequency using this open-loop transfer function to determine if the preset stability indicators are met. The inputs for the check are the model parameters and controller parameters determined in the preceding steps. After calculating the open-loop transfer function, the actual phase margin is calculated at the crossover frequency, along with the gain margin and peak sensitivity function. This process verifies whether the designed controller truly meets the system safety requirements, ensuring that the parameters have been fully verified before deployment and avoiding flight instability caused by model uncertainties.
[0085] In some preferred embodiments, the step of performing frequency domain stability margin verification at the open-loop crossover frequency based on the open-loop transfer function to determine whether a preset stability index is met includes: calculating the phase margin, gain margin, and peak value of the sensitivity function at the open-loop crossover frequency based on the open-loop transfer function; determining whether the phase margin, gain margin, and peak value of the sensitivity function all meet preset threshold conditions; if the phase margin, gain margin, and peak value of the sensitivity function all meet the preset threshold conditions, then the preset stability index is determined to be met; if any one of the phase margin, gain margin, and peak value of the sensitivity function does not meet the preset threshold conditions, then the preset stability index is determined not to be met.
[0086] First, based on the open-loop transfer function, the phase margin is calculated at the open-loop crossover frequency, and the gain margin and peak value of the sensitivity function are also calculated. The open-loop transfer function is constructed from the previously determined model parameters and controller parameters, and its specific form is the product of the controller transfer function and the controlled object transfer function.
[0087] The phase margin is the vertical distance between the open-loop phase frequency response curve and the negative 180-degree line at the open-loop crossing frequency. If the phase margin is small, the system will tend to be unstable, producing oscillations or even divergence. The gain margin is the difference between the open-loop amplitude and 0 dB at the frequency corresponding to the system's open-loop phase frequency response curve crossing the negative 180-degree line. If the gain margin is too small, the system is extremely sensitive to gain changes and easily becomes unstable due to model uncertainties. The peak value of the sensitivity function is the maximum value of the closed-loop system's sensitivity to input disturbances or model uncertainties; the lower the peak value, the stronger the system's disturbance rejection robustness. These three indicators comprehensively characterize the system's stability boundaries from different dimensions.
[0088] Furthermore, it is determined whether the phase margin, the gain margin, and the peak value of the sensitivity function all meet preset threshold conditions. These preset threshold conditions are pre-defined safety boundaries; for example, the phase margin must be greater than 45 degrees to ensure sufficient relative stability, the gain margin must be greater than 6 dB to prevent instability caused by gain changes, and the peak value of the sensitivity function must be less than 1.5 to ensure good disturbance rejection performance. This invention does not specifically limit these conditions. These standards are all set based on classical robust control theory and aim to cover extreme cases of various uncertainties in actual flight.
[0089] Furthermore, if the phase margin, the amplitude margin, and the peak value of the sensitivity function all meet the preset threshold conditions, then the preset stability index is determined to be satisfied. This indicates that the designed controller parameters, while ensuring extremely high response speed, have sufficient safety margins and can be reliably output to the actual flight control system. If any of the phase margin, the amplitude margin, or the peak value of the sensitivity function does not meet the preset threshold conditions, then the preset stability index is determined to be unsatisfactory. If any index exceeds the limit, the system will directly feed back to the preceding parameter calculation stage, requiring the target phase margin to be reset or the controller structure to be reselected, and re-entering the analytical calculation and verification loop.
[0090] This embodiment upgrades the safety of the control system from qualitative judgment to quantitative mathematical verification by forcibly executing closed-loop verification of multi-dimensional frequency domain indicators. This method completely eliminates the possibility of seemingly reasonable parameters with serious hidden dangers that may arise in traditional trial-and-error methods. It ensures that every parameter output undergoes rigorous mathematical verification, thus logically mitigating the catastrophic risk of UAV crashes or loss of control due to improper controller parameter settings. In particular, it provides strong robustness guarantees for delay elements and uncertainties in motor characteristics that are difficult to model accurately in practical engineering, ensuring the high reliability of the tuning method in engineering applications.
[0091] S7. If the preset stability index is met, the controller parameters are output.
[0092] In practice, if the preset stability index is met, the controller parameters are directly output for actual application.
[0093] S8. If the preset stability index is not met, the target phase margin is reset or the controller structure is reselected, and the process proceeds to the step of determining the open-loop crossover frequency and controller parameters of the control loop based on the model parameters, the target phase margin, and the controller structure.
[0094] In practice, if the verification results show that the phase margin does not reach the preset threshold condition, it indicates that the system lacks sufficient relative stability at the current crossover frequency and is at risk of instability. In this case, the target phase margin setting should be increased to improve the system's stability margin. If the verification results show that the amplitude margin does not reach the preset threshold condition, it indicates that the system is too sensitive to gain changes. In this case, the target phase margin setting should also be increased, or a controller structure that can provide additional phase compensation should be selected to expand the system's amplitude stability boundary. If the verification results show that the peak value of the sensitivity function does not reach the preset threshold condition, it indicates that the system is too sensitive to disturbances. In this case, the target phase margin setting should be increased, and a proportional-derivative controller structure with low-pass filtering should be considered to suppress high-frequency noise and improve the system's disturbance rejection robustness. This loop-loop mechanism forms a complete adaptive closed loop, ensuring that the final output controller parameters simultaneously meet performance requirements and stability constraints.
[0095] This embodiment encapsulates data acquisition, frequency domain identification, parameter analytical calculation, and stability verification into an end-to-end standard process, completely eliminating reliance on human experience. Utilizing the deterministic nature of the analytical equations, the parameters calculated based on the same identification data are identical, ensuring consistent control performance during multi-aircraft delivery. Since the verification step is mandatory before formal output, it theoretically eliminates the possibility of parameters not meeting stability margins, thus avoiding potential crash risks during actual flight tests. This method fully considers engineering constraints such as sensor noise, actuator saturation, and limited computing resources in the actual flight environment. It can be directly embedded into flight control ground station software or airborne parameter tuning toolchains, seamlessly integrating with existing flight control architectures, and possesses strong engineering practicality and versatility.
[0096] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0097] Please see Figure 4 , Figure 4 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.
[0098] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0099] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it causes the processor 502 to execute a system identification-based unmanned aerial vehicle (UAV) controller parameter tuning method.
[0100] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0101] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a system identification-based unmanned aerial vehicle controller parameter tuning method.
[0102] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.
[0103] The processor 502 is used to run a computer program 5032 stored in a memory to implement the steps of a system identification-based unmanned aerial vehicle controller parameter tuning method provided in any of the above method embodiments.
[0104] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0105] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0106] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the steps of the system identification-based unmanned aerial vehicle controller parameter tuning method provided in any of the above-described method embodiments.
[0107] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk, or any other physical storage medium capable of storing program code. The computer-readable storage medium can be non-volatile or volatile.
[0108] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0109] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0110] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0111] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0112] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0113] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, this invention is also intended to include these modifications and variations as long as they fall within the scope of the claims of this invention and their equivalents.
[0114] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for tuning parameters of an unmanned aerial vehicle (UAV) controller based on system identification, characterized in that, include: In response to the received control loop information to be tuned, the control loop is determined, and the controlled object of the control loop is constructed into a unified simplified model; An excitation signal is injected into the command channel of the control loop, and command data and measured data of the command channel are collected simultaneously. Frequency domain identification is performed on the command data and the measured data to obtain the non-parametric frequency response, and model fitting is performed on the non-parametric frequency response to obtain the model parameters of the unified simplified model; Set the target phase margin and select the controller structure; Based on the model parameters, the target phase margin, and the controller structure, the open-loop crossover frequency and controller parameters of the control loop are determined. An open-loop transfer function is constructed based on the model parameters and the controller parameters. The frequency domain stability margin is checked at the open-loop crossover frequency according to the open-loop transfer function to determine whether the preset stability index is met. If the preset stability index is met, then the controller parameters are output; If the preset stability index is not met, the target phase margin is reset or the controller structure is reselected, and the process proceeds to the step of determining the open-loop crossover frequency and controller parameters of the control loop based on the model parameters, the target phase margin, and the controller structure.
2. The method for tuning UAV controller parameters based on system identification according to claim 1, characterized in that, The controlled object of the control loop is constructed into a unified and simplified model, including: Based on the information of the control loop to be tuned, the control loop is determined to be one of angular velocity loop, attitude loop, velocity loop or position loop; For the control loop, the controlled object is uniformly constructed as a transfer function in which an integral element, a first-order inertial element, and a pure delay element are connected in series. Specifically, when the control loop is an angular velocity loop, the controlled object is a model of angular acceleration command to angular velocity; when the control loop is an attitude loop, the controlled object is a model of angular velocity command to angle; when the control loop is a velocity loop, the controlled object is a model of acceleration command to velocity; and when the control loop is a position loop, the controlled object is a model of velocity command to position.
3. The method for tuning UAV controller parameters based on system identification according to claim 1, characterized in that, An excitation signal is injected into the command channel of the control loop, and command data and measured data of the command channel are acquired synchronously, including: Generate a target signal whose spectrum covers the target frequency band. The target frequency band is a frequency band range determined based on a preset desired open-loop crossover frequency. The target signal includes a finite bandwidth swept frequency signal, a multi-sine composite signal, or a pseudo-random binary sequence. The target signal is injected as an excitation signal into the command channel of the control loop; The instruction data and measured data of the instruction channel are synchronously collected at a sampling rate of not less than ten times the preset closed-loop bandwidth to obtain the instruction data and the measured data.
4. The method for tuning UAV controller parameters based on system identification according to claim 2, characterized in that, Frequency domain identification is performed on the command data and the measured data to obtain a non-parametric frequency response. Then, model fitting is performed on the non-parametric frequency response to obtain the model parameters of the unified simplified model, including: The command data and the measured data are processed using the Welch average periodogram method or the H1 / H2 estimation method to obtain the non-parametric frequency response; The non-parametric frequency response is fitted to the unified simplified model using the least squares method to obtain the model parameters, which include the motor time constant of the first-order inertial element and the total system delay of the pure delay element.
5. The method for tuning UAV controller parameters based on system identification according to claim 2, characterized in that, Set the target phase margin and select the controller architecture, including: The target phase margin is set according to the task requirements; When the control loop is an angular velocity loop or a velocity loop, a proportional-derivative controller or a proportional-derivative controller with a low-pass filter is selected as the controller structure; when the control loop is an attitude loop or a position loop, a pure proportional controller is selected as the controller structure.
6. The method for tuning UAV controller parameters based on system identification according to claim 4, characterized in that, When the controller structure is a proportional-derivative controller, based on the model parameters, the target phase margin, and the controller structure, the open-loop crossover frequency and controller parameters of the control loop are determined, including: Based on the preset open-loop crossover frequency, the motor time constant, the total system delay, the target phase margin, and the open-loop crossover frequency in the model parameters are substituted into the phase condition equation to obtain the differential time constant. Substituting the differential time constant and the open-loop crossover frequency into the amplitude condition equation, the proportional gain is obtained by solving the equation. The differential time constant is then multiplied by the proportional gain to obtain the differential gain. The proportional-derivative controller is constructed based on the proportional gain, the derivative gain, and the derivative time constant.
7. The method for tuning UAV controller parameters based on system identification according to claim 4, characterized in that, When the controller structure is a proportional-derivative controller with a low-pass filter, the open-loop crossover frequency and controller parameters of the control loop are determined based on the model parameters, the target phase margin, and the controller structure, including: Based on the preset open-loop crossing frequency, the required lead angle is calculated according to the model parameters, the target phase margin, and the open-loop crossing frequency; Determine whether the required lead angle is greater than zero; if the required lead angle is less than or equal to zero, then determine that pure proportional control is used. If the required lead angle is greater than zero, then the lead factor is calculated based on the required lead angle. The open-loop crossover frequency and the lead factor are substituted into the maximum phase boost frequency formula to obtain the filter time constant. Based on the motor time constant, the total system delay, the open-loop crossover frequency, the lead factor, and the filter time constant, the proportional gain is calculated through the amplitude condition equation. The proportional gain and the filter time constant are combined to construct the proportional-derivative controller with low-pass filtering.
8. The method for tuning UAV controller parameters based on system identification according to claim 1, characterized in that, Based on the open-loop transfer function, a frequency domain stability margin check is performed at the open-loop crossover frequency to determine whether the preset stability index is met, including: Based on the open-loop transfer function, the phase margin is calculated at the open-loop crossover frequency, and the gain margin and the peak value of the sensitivity function are also calculated. Determine whether the phase margin, the amplitude margin, and the peak value of the sensitivity function all meet preset threshold conditions; If the phase margin, the amplitude margin, and the peak value of the sensitivity function all satisfy the preset threshold conditions, then the preset stability index is determined to be satisfied. If any one of the phase margin, the amplitude margin, and the peak value of the sensitivity function does not meet the preset threshold condition, then it is determined that the preset stability index is not met.
9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-8.
