Unmanned aerial vehicle attitude control method based on multi-scene cruise
By constructing a disturbance influence index matrix and a recurrent neural network, the attitude control parameters of the UAV are dynamically adjusted, solving the problem of UAV attitude instability in multiple scenarios and achieving stable flight and high-precision control in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG ZHONGKE JIANFEI INTELLIGENT EQUIPMENT CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-04-21
AI Technical Summary
Existing drone attitude control methods are difficult to adapt and adjust in multiple scenarios, leading to attitude instability, flight trajectory deviation, or even loss of control. They are particularly unable to guarantee flight safety and mission efficiency in complex environments.
A disturbance impact index matrix is constructed by collecting wind field change deviation rate, magnetic interference intensity index and visual occlusion density anomaly value. The weight fusion coefficient is adjusted in combination with scene switching frequency, and attitude control parameters are generated by recurrent neural network to achieve dynamic adjustment.
It improves the flight stability and response accuracy of drones in multiple scenarios, enabling them to maintain continuous and stable flight under high-frequency environmental switching and sudden disturbances, avoiding flight trajectory deviation and crashes.
Smart Images

Figure CN121900463A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of unmanned aerial vehicle (UAV) flight control, and more specifically to a UAV attitude control method based on multi-scenario cruise. Background Technology
[0002] With the widespread application of drone technology, it has shown great application potential in various scenarios such as urban inspection, forest fire prevention, maritime monitoring, and disaster assessment. However, the complexity of the environment in different scenarios, such as airflow disturbances, magnetic field interference, and obstacle reflections, often leads to unstable attitude control, flight trajectory deviation, or even loss of control and crash when drones perform continuous patrol missions in multiple scenarios, which seriously affects mission completion efficiency and flight safety.
[0003] Most existing UAV attitude control methods rely on fixed control parameters or single-scene training models, which cannot adaptively adjust the attitude control strategy according to real-time scene changes. Especially when continuously traversing complex terrains (such as mountains-cities-ocean), attitude adjustment exhibits significant lag and is difficult to resist sudden disturbances. Some studies have introduced deep learning-based control models, which have achieved certain results in single scenarios, but are prone to control weight failure and poor model generalization ability when migrating between multiple scenarios.
[0004] Furthermore, current UAV attitude control methods do not fully consider the continuity and transition of disturbance characteristics between different scenarios and lack a scenario weight fusion mechanism. This leads to distorted attitude response of the model when switching scenarios at high frequencies, manifesting as increased oscillations and control delays. Especially in high-risk scenarios (such as fire scenes and earthquake-stricken areas), the inability to guarantee accurate aircraft response has become a critical technical bottleneck that urgently needs to be addressed. Summary of the Invention
[0005] The purpose of this invention is to provide a drone attitude control method based on multi-scenario cruise, so as to overcome the shortcomings of the prior art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a UAV attitude control method based on multi-scenario cruise, comprising: S100 collects the set of disturbance characteristic parameters S of the UAV under various preset cruise scenarios; S200, based on the disturbance feature parameter set S, construct the disturbance impact index matrix W for each preset cruise scenario; S300, obtain the actual cruise scene sequence L={L1,L2,…,Ln} contained in the current cruise mission path, where n is the number of scenes in the cruise path; S400, based on the actual cruise scenario sequence L, extract the corresponding disturbance weight value set P={P1,P2,…,Pn} from the disturbance impact index matrix W, and adjust the weight fusion coefficient according to the scenario switching frequency to generate a fused disturbance vector F; S500, the fused disturbance vector F is input into the attitude control model constructed based on the recurrent neural network, and the control parameter set θ corresponding to the scenario is output; S600, dynamically adjust the attitude control commands of the UAV according to the control parameter group θ.
[0007] Preferably, the disturbance characteristic parameter set S includes wind field change deviation rate, magnetic interference intensity index, and visual occlusion density anomaly value.
[0008] Preferably, the method for obtaining the wind field change deviation rate ΔW is as follows: Let the three-dimensional wind speed vector collected by the UAV at time t be... Let the sliding time window size be T, and within the time interval... Internal calculation of mean wind speed vector ; Calculate the current wind speed change deviation vector The formula for calculating the wind field variation deviation rate is: ; where ϵ is a small constant to prevent the denominator from being zero.
[0009] Preferably, the method for obtaining the magnetic interference intensity index MI is as follows: obtaining the magnetic field intensity sequence collected by the UAV per unit time. ;in Let be the magnitude of the magnetic field strength at time i; perform a Fast Fourier Transform on sequence B to obtain the spectrum. Calculate the mean square amplitude ratio of the high-frequency components to the low-frequency components in the spectrum, and define the magnetic interference intensity index MI as: ;in: This is set to a frequency band with a frequency greater than 5Hz; This refers to the frequency band with a frequency of 5 Hz or less.
[0010] The preferred method for obtaining the visual occlusion density outlier (ODV) is as follows: Using YOLOv8 or similar real-time object detection algorithms, identify the number of occluded targets in the image frame. ; Construct a sequence of the number of occluders within a continuous time window: ; Calculate the occlusion density anomaly value (ODV) at the current moment, the expression is: ;in: Let D be the mean of the window sequence. The standard deviation is denoted as .
[0011] Preferably, the step of constructing the disturbance impact index matrix W for each preset cruise scenario includes: Based on the obtained disturbance feature parameter set S, the wind field change deviation rate, magnetic interference intensity index and visual occlusion density anomaly value of the corresponding cruise scenario are extracted and normalized. Based on the normalized disturbance feature vector and combined with the historical stability weight coefficient of the cruise scenario, a weighted feature fusion algorithm is used to calculate the influence weight of the disturbance factor. The weights of each disturbance factor are arranged into row vectors, and the disturbance impact index matrix W is constructed by summing them according to the cruise scenario number.
[0012] Preferably, the step of adjusting the weight fusion coefficients according to the scene switching frequency and generating the fusion perturbation vector F includes: Obtain the number of times consecutive scene numbers are switched in the cruise mission path, and calculate the scene switching frequency value per unit flight distance; The scene switching frequency value is associated with the set of disturbance factor influence weights, and the weight fusion coefficient of each scene is calculated according to a preset function model, wherein the function model is an exponential decay function; Based on the influence weight of the disturbance factor corresponding to each scenario and its fusion coefficient, an element-wise weighted calculation is performed to generate a weighted fusion vector of each disturbance factor on the entire path; The weighted fusion vector is used as the fusion perturbation vector F.
[0013] Preferably, the step of outputting the control parameter set θ corresponding to the scenario includes: The fused perturbation vector F is constructed into an input sequence in time series format and then subjected to dimensionality expansion processing to adapt to the neural network input structure. A recurrent neural network model containing multiple layers of long short-term memory units is constructed. The neural network obtains the nonlinear mapping relationship between perturbation features and attitude response through offline training. The constructed input sequence is fed into a recurrent neural network, and the dynamic correlation in the perturbation sequence is extracted by combining the state transfer between time steps in the network. The attitude control parameter set θ, including the expected values of roll angle, pitch angle and yaw angle, is obtained at the network output layer and used to adjust the UAV attitude control commands in real time.
[0014] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. This invention achieves dynamic disturbance modeling and adaptive control of UAVs in various typical cruise scenarios by introducing a fusion disturbance vector construction method and an attitude control strategy based on recurrent neural networks. By collecting disturbance features such as wind field change deviation rate, magnetic interference intensity index, and visual occlusion density anomalies, and combining them with scene switching frequency for weighted fusion, an input vector reflecting the global disturbance trend is formed. This enhances the sensitivity and robustness of the attitude control system to complex environmental transitions, and significantly improves stability and response accuracy during flight.
[0015] 2. This invention employs a multi-layer long short-term memory network to establish a nonlinear mapping relationship between disturbances and attitude. Combined with sequential modeling technology under a sliding time window, it enables the UAV to perceive disturbance trends in real time and dynamically generate attitude control parameter sets. Even in high-frequency environment switching, sudden disturbances, or unstructured scenarios, continuous and stable flight control can still be achieved, effectively avoiding flight trajectory deviations or even aircraft crashes caused by attitude response delays or control failures. This invention has high engineering practical value. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0017] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 embodiments of the present invention, not all embodiments. 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] For examples, please refer to Figure 1 As shown in this embodiment, the UAV attitude control method based on multi-scenario cruise includes: S100, collect the disturbance characteristic parameter set S of the UAV under various preset cruise scenarios; the disturbance characteristic parameter set S includes: wind field change deviation rate (ΔW), magnetic interference intensity index (MI) and visual occlusion density anomaly value (ODV), and the specific acquisition method is as follows: The wind field variation deviation rate ΔW is used to measure the instability of wind speed disturbances in a certain area, and it has a significant impact on the flight attitude of UAVs.
[0020] Let the three-dimensional wind speed vector collected by the UAV at time t be... Let the sliding time window size be T, and within the time interval... Internal calculation of mean wind speed vector ; Calculate the current wind speed change deviation vector The formula for calculating the wind field variation deviation rate is: ; where ϵ is a small constant to prevent the denominator from being zero.
[0021] The Magnetic Interference Intensity Index (MI) is used to characterize the interference intensity of changes in the environmental magnetic field on the attitude sensor of a drone, especially common in densely populated urban areas or areas with high voltage.
[0022] Obtain the magnetic field strength sequence collected by the UAV per unit time. ;in Let be the magnitude of the magnetic flux density at time i.
[0023] The spectrum is obtained by performing a Fast Fourier Transform (FFT) on sequence B. =FFT(B); Calculate the mean square amplitude ratio of high-frequency components (>5Hz) to low-frequency components in the spectrum, and define the magnetic interference intensity index MI as: ;in: This is set to a frequency band with a frequency greater than 5Hz; This refers to the frequency band with frequencies less than or equal to 5 Hz. A higher MI indicates more severe magnetic field disturbances; a threshold >1.5 is recommended for high interference.
[0024] Visual Occlusion Density Anomaly (ODV) is used to reflect the degree of visual information loss caused by obstructions (such as smoke, buildings, trees, etc.) within the current field of view.
[0025] Using YOLOv8 or similar real-time object detection algorithms, identify the number of occluded targets in the image frame. (Such as tags like "tree", "building", "smoke"); Construct a sequence of the number of occluders within a continuous time window: ; Calculate the occlusion density anomaly value (ODV) at the current moment, the expression is: ;in: Let D be the mean of the window sequence. The standard deviation is 0.5. An ODV > 2.5 is considered an abnormally high-density occlusion region, which should trigger the visual fault tolerance mechanism of the attitude control model.
[0026] The disturbance feature parameter set S is summarized in the form: St={ΔWt, MIt, ODVt}; this parameter set serves as the input basis for constructing the subsequent disturbance impact index matrix W, ensuring that it is distinguishable and responsive to various environmental disturbances in subsequent steps.
[0027] S200, based on the disturbance feature parameter set S, construct the disturbance impact index matrix W for each preset cruise scenario, specifically including the following sub-steps: First, for each preset cruise scenario, based on the matching of scenario identifier and time series, the original values of three disturbance factors corresponding to the scenario are extracted from the disturbance feature parameter set S. These are: wind field change deviation rate ΔW, in the form of dimensionless proportional value; magnetic interference intensity index MI, in the form of spectral energy ratio; and visual occlusion density anomaly value ODV, in the form of standard deviation multiple.
[0028] Each set of parameter values constitutes an original perturbation feature vector, represented as: S′=[ΔW,MI,ODV]; this vector exists in three dimensions, where each dimension represents a perturbation factor.
[0029] To eliminate the influence of different disturbance factors on the numerical scale, each term in the original vector S′ is normalized. A min-max normalization method is used for numerical scaling. For any disturbance factor x, the normalization formula is: Normalized value = (x - x_min) / (x_max - x_min); where x_min and x_max are the minimum and maximum values of the disturbance factor in the current mission's full-scene data, respectively. This step is performed separately for each cruise mission to ensure that the normalization has local scene adaptability. After normalization, the disturbance feature normalized vector is obtained: S_norm = [ΔW_norm, MI_norm, ODV_norm]; the value of each component ranges from 0 to 1.
[0030] For each cruise scenario, the mean flight attitude deviation M1, trajectory deviation rate M2, and flight failure rate M3 in historical missions under that scenario are pre-calculated. These three represent indirect evaluation indicators of flight control accuracy, path holding capability, and mission success rate, respectively. These three indicators are normalized to obtain: M1_norm, M2_norm ∈ [0,1]. Then, empirical weights are assigned to the three indicators, such as 0.4, 0.4, and 0.2 respectively. A weighted average is used to calculate the stability weight coefficient for that scenario: Stability weight K = 0.4 × M1_norm + 0.4 × M2_norm + 0.2 × M3_norm; the value of K ranges from 0 to 1, with smaller values indicating a more unstable scenario.
[0031] The normalized perturbation feature vector S_norm is multiplied element-wise with the stability weight K to form the perturbation factor influence weight vector for the current scenario: W_row=[ΔW_norm×K,MI_norm×K,ODV_norm×K]; this vector represents the actual influence intensity of each perturbation factor on the UAV attitude control system in a specific scenario.
[0032] According to the scene numbering order in the cruise path, the disturbance factor influence weight vector W_row calculated for each scene is sequentially concatenated vertically to finally construct a two-dimensional disturbance influence index matrix W: each row of matrix W corresponds to a cruise scene, and each column represents the weighted influence value of wind field disturbance, magnetic field interference and visual occlusion, respectively.
[0033] For example, if the cruise path contains 5 scenes, then W is a 5x3 matrix with the following structure:
[0034] The disturbance influence index matrix W serves as the basis for the disturbance characteristics input to the attitude control model in the next step, enabling the subsequent model to dynamically adjust the control parameters based on the differences in W, thereby achieving accurate attitude response in multiple scenarios.
[0035] S300, obtain the actual cruise scene sequence L={L1,L2,…,Ln} contained in the current cruise mission path, where n is the number of scenes in the cruise path.
[0036] The entire cruise mission path is divided according to changes in geographical location information and environmental characteristics. Whenever the UAV detects a significant change in environmental disturbance factors (such as a sudden change in wind speed gradient, a jump in the magnetic field disturbance spectrum, or a sharp increase in visual information obstruction rate), it is determined as the starting point of a new cruise scenario. A fixed threshold ΔT is used to determine whether a scenario switch is valid.
[0037] For example, if the instantaneous change in the wind field deviation rate is greater than 0.3, or the magnetic interference intensity index increases by more than 40%, or the visual occlusion density anomaly is higher than 2.5 times the historical average, the current location will be automatically marked as the starting location of the new scene.
[0038] Within each segmented path, a visual recognition model (e.g., using YOLOv8 to identify target types such as buildings, trees, water bodies, and roads) is combined with GNSS map matching results to assign type labels to the scene. Scene types include, but are not limited to: urban built-up areas; mountainous forest areas; water areas; open plains; and elevated road or bridge areas.
[0039] By fusing statistics on most target types with regional features, the cruise scenario type to which the current path segment belongs is finally determined, and the corresponding scenario number Li is assigned.
[0040] After scene identification of all cruise path segments is completed, the scene numbers are arranged sequentially according to the flight order to form an ordered cruise scene sequence L: L={L1,L2,...,Li,...,Ln}; where each element Li is a structured data item, containing at least the following fields: Scene ID; Type (e.g., city, forest, water); Starting and ending latitude and longitude; Timestamp range; Index of corresponding disturbance feature parameter set.
[0041] The aforementioned sequence L is not only used to construct the index order in the disturbance influence index matrix W, but also as the basis for the dynamic mapping of subsequent attitude control parameters θ, thereby ensuring the accurate alignment between the model input and the actual state of the flight path.
[0042] S400, based on the actual cruise scenario sequence L, extract the corresponding disturbance weight value set P={P1,P2,…,Pn} from the disturbance impact index matrix W, and adjust the weight fusion coefficient according to the scenario switching frequency to generate a fused disturbance vector F.
[0043] First, based on the constructed actual cruise scenario sequence L={L1, L2, ..., Ln}, the row vectors of disturbance factor influence weights corresponding to each scenario number are extracted from the disturbance influence index matrix W row by row, and formed into a disturbance weight value set P: P={P1, P2, ..., Pi, ..., Pn}; where Pi represents the disturbance factor influence weight vector corresponding to scenario Li, which has a three-dimensional structure and corresponds to the weighted influence values of wind field change deviation rate, magnetic interference intensity index, and visual occlusion density anomaly value in this scenario.
[0044] During the cruise mission path, the number of times adjacent scene numbers change in the cruise scene sequence L is counted and denoted as M, representing the total number of environmental scene switches during the cruise path. Simultaneously, the total flight distance D (in meters) of the UAV during this cruise path is obtained.
[0045] Based on the above parameters, the scene switching frequency value f is defined as: f = M ÷ D; where the unit of f is "times per meter", representing the average frequency of scene changes occurring within each meter of flight distance. The larger this value, the more complex the path environment and the more frequent the disturbance transitions.
[0046] Based on the scene switching frequency value f, to improve the sensitivity of disturbance modeling in high-frequency switching environments, an exponential decay function model G(f) is constructed as the weight fusion coefficient calculation function for each scene: Where e is the base of the natural logarithm, and β is the decay coefficient that adjusts the steepness of the exponential function, preferably set between 1.5 and 3.0. In this embodiment, the value is 2.0. The function has the following characteristics: when the switching frequency f is low, G(f) approaches 0, indicating that there is no need to over-adjust the perturbation weights; while when f increases, G(f) rapidly approaches 1, significantly enhancing the perturbation response weights, which helps to enhance the model's adaptability to rapid changes in the scene.
[0047] For each item Li in the scene sequence L, its fusion coefficient γi can be expressed as: γi=G(fi), where fi is the scene switching frequency of the local path segment where Li is located, which is achieved by repeating the above frequency calculation in the sliding path window.
[0048] After obtaining the perturbation weight set P and the fusion coefficient γ for each scene, the fusion coefficient weights are applied to each component of the perturbation factor influence weight Pi for each scene Li. The calculation method is as follows: Multiply each dimension value in Pi by γi to obtain the weighted perturbation vector Pi′; The final fused perturbation vector F is obtained by averaging all weighted perturbation vectors Pi′ along the same dimension. , i=1 to n; where Σ represents the element-wise summation of all weighted perturbation vectors along the dimension, and n is the number of scenes.
[0049] The final F is a three-dimensional fused disturbance vector, representing the combined impact of wind field disturbance, magnetic interference, and visual obstruction on the entire cruise path.
[0050] S500, the fused disturbance vector F is input into the attitude control model constructed based on the recurrent neural network, and the control parameter set θ corresponding to the scenario is output.
[0051] First, the fused perturbation vectors F under multiple consecutive time steps are arranged in time sequence to construct an input sequence X={F1, F2, ..., Ft}, where t is the sequence length. Usually, the last 20 time steps are selected as a set of input windows to capture the perturbation trend.
[0052] Each fused perturbation vector Fk is a three-dimensional vector, representing the weighted fusion value of wind field perturbation, magnetic field perturbation, and visual occlusion perturbation, respectively. To adapt to the input structure of the neural network model, the original three-dimensional vector is expanded into a three-dimensional tensor structure. The tensor dimension is defined as: [batch_size, time_steps, features]. In this embodiment, batch_size is set to 32, time_steps to 20, and features to 3.
[0053] When constructing the recurrent neural network model, a structure containing two layers of long short-term memory units is adopted, with each layer containing 128 hidden neurons. Long short-term memory units (LSTM) can model long-term dependencies and short-term mutations in perturbation sequences through their internal input gate, forget gate, and output gate structures, effectively solving the gradient vanishing problem that occurs in traditional recurrent neural networks in time series modeling.
[0054] The neural network was trained offline, using perturbation feature sequences and corresponding attitude response data collected from multiple typical cruise mission scenarios as the training set. The goal was to minimize the mean squared error loss function between the network's output attitude and the expected true attitude. The training optimization algorithm employed the Adam optimizer, with an initial learning rate of 0.001 and 500 training epochs.
[0055] The constructed perturbation input sequence X is input into the trained recurrent neural network model. Inside the network, the hidden state of the previous time step is used as the condition for the calculation of the current time step, forming a state transmission chain between time steps, thereby extracting the dynamic change pattern in the perturbation sequence.
[0056] This process not only preserves the perturbation feature values of the current time step, but also integrates the perturbation evolution information from several past time steps, enabling the model to predict attitude response trends in the short term and enhancing its robustness to perturbation abrupt changes.
[0057] In the output layer of the network, a fully connected layer is set to map the output of the Long Short-Term Memory Unit to the target attitude control parameter set θ, defined as: θ={θ_roll, θ_pitch, θ_yaw}; where: θ_roll represents the expected roll angle of the UAV at the current moment; θ_pitch represents the expected pitch angle; θ_yaw represents the expected yaw angle; the output range of the three attitude angle expectations is -45 degrees to +45 degrees, and the range is constrained by the network activation function. In this embodiment, the hyperbolic tangent function tanh is used as the output layer activation function so that the output value naturally falls within this range.
[0058] The final output control parameter set θ will be used as input to the UAV control command generation module to drive the flight controller to adjust its attitude in real time, ensuring flight stability and trajectory accuracy in multi-scenario disturbance environments.
[0059] S600, dynamically adjust the attitude control commands of the UAV according to the control parameter group θ.
[0060] The process of generating and adjusting attitude control commands includes four stages: attitude target calculation, error calculation, control quantity mapping, and command execution issuance, as detailed below: First, the expected value of each attitude angle in the control parameter set θ is calculated and defined as follows: θ_roll: Target roll angle (rotation around the X-axis), used to control the lateral tilt of the drone; θ_pitch: Target pitch angle (rotation around the Y-axis), used to control the forward and backward pitch of the UAV; θ_yaw: Target yaw angle (rotation around the Z-axis), used to control the heading direction of the UAV.
[0061] The above attitude angle expectations are expressed in degrees. Each value is kept within a reasonable range (e.g., -45° to +45°) under the constraints of the activation function of the neural network output layer to ensure that the UAV does not enter dangerous attitude limits.
[0062] The current actual attitude angle α = {α_roll, α_pitch, α_yaw} is obtained using the real-time attitude sensing unit of the UAV (such as an inertial measurement unit IMU). The difference between this angle and the target attitude angle θ output by the neural network is calculated to obtain the attitude error vector Q: Q = θ - α = {θ_roll - α_roll, θ_pitch - α_pitch, θ_yaw - α_yaw}; where each error term represents the deviation between the current actual attitude and the target attitude.
[0063] Using the error vector Q as input, attitude control commands for each rotor of the UAV are generated through a preset control law function. This control law function employs a gain-adjustable proportional-integral-derivative (PID) algorithm, calculating the control quantity U = {U_roll, U_pitch, U_yaw} based on the current value, historical cumulative value, and rate of change of each error component. , where x∈{roll,pitch,yaw}; Kp_x: proportional gain, Ki_x: integral gain, Kd_x: differential gain; e_x: current error component; ∫e_x dt: integral term of error, used to eliminate steady-state error; de_x / dt: rate of change of error, used to suppress rapid disturbances.
[0064] The control law parameters are obtained through experimental tuning in typical scenarios. Under different scenarios, the gain parameter set can be finely adjusted through model adaptation to improve the adaptive capability of attitude response.
[0065] The calculated control quantity U is mapped to the speed adjustment command for each motor of the UAV. The attitude control quantity is converted into PWM pulse width signals of each propulsion motor using the hybrid control algorithm built into the flight control board (such as the quadcopter motor hybrid control matrix), and sent to the ESC driver in real time: speed _i = base throttle + hybrid control matrix × U; where i is the motor number, the base throttle is used to maintain flight altitude, and U is used to superimpose attitude correction control quantity.
[0066] During flight, the attitude control commands are updated at a high frequency (e.g., 100Hz), enabling the UAV to respond quickly, continuously, and stably to changes in external disturbances and scene switching, significantly improving flight accuracy and control robustness in multiple scenarios.
[0067] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for UAV attitude control based on multi-scenario cruise, characterized in that: include: S100 collects the set of disturbance characteristic parameters S of the UAV under various preset cruise scenarios; S200, based on the disturbance feature parameter set S, construct the disturbance impact index matrix W for each preset cruise scenario; S300, obtain the actual cruise scene sequence L={L1,L2,…,Ln} contained in the current cruise mission path, where n is the number of scenes in the cruise path; S400, based on the actual cruise scenario sequence L, extract the corresponding disturbance weight value set P={P1,P2,…,Pn} from the disturbance impact index matrix W, and adjust the weight fusion coefficient according to the scenario switching frequency to generate a fused disturbance vector F; S500, the fused disturbance vector F is input into the attitude control model constructed based on the recurrent neural network, and the control parameter set θ corresponding to the scenario is output; S600, dynamically adjust the attitude control commands of the UAV according to the control parameter group θ.
2. The UAV attitude control method based on multi-scenario cruise according to claim 1, characterized in that: The disturbance characteristic parameter set S includes wind field change deviation rate, magnetic interference intensity index, and visual occlusion density anomaly value.
3. The UAV attitude control method based on multi-scenario cruise according to claim 2, characterized in that: The method for obtaining the wind field variation deviation rate ΔW is as follows: Let the three-dimensional wind speed vector collected by the UAV at time t be... Let the sliding time window size be T, and within the time interval... Internal calculation of mean wind speed vector ; Calculate the current wind speed change deviation vector The formula for calculating the wind field variation deviation rate is: ; where ϵ is a small constant to prevent the denominator from being zero.
4. The UAV attitude control method based on multi-scenario cruise according to claim 3, characterized in that: The method for obtaining the magnetic interference intensity index (MI) is as follows: obtain the magnetic field intensity sequence collected by the UAV per unit time. ;in Let be the magnitude of the magnetic field strength at time i. The spectrum is obtained by performing a Fast Fourier Transform on sequence B. Calculate the mean square amplitude ratio of the high-frequency components to the low-frequency components in the spectrum, and define the magnetic interference intensity index MI as: ;in: This is set to a frequency band with a frequency greater than 5Hz; This refers to the frequency band with a frequency of 5 Hz or less.
5. The UAV attitude control method based on multi-scenario cruise according to claim 4, characterized in that: The method for obtaining the visual occlusion density outlier (ODV) is as follows: Using YOLOv8 or similar real-time object detection algorithms, identify the number of occluded targets in the image frame. ; Construct a sequence of the number of occluders within a continuous time window: ; Calculate the occlusion density anomaly value (ODV) at the current moment, the expression is: ;in: Let D be the mean of the window sequence. The standard deviation is denoted as .
6. The UAV attitude control method based on multi-scenario cruise according to claim 1, characterized in that: The steps for constructing the disturbance impact index matrix W for each preset cruise scenario include: Based on the obtained disturbance feature parameter set S, the wind field change deviation rate, magnetic interference intensity index and visual occlusion density anomaly value of the corresponding cruise scenario are extracted and normalized. Based on the normalized disturbance feature vector and combined with the historical stability weight coefficient of the cruise scenario, a weighted feature fusion algorithm is used to calculate the influence weight of the disturbance factor. The weights of each disturbance factor are arranged into row vectors, and the disturbance impact index matrix W is constructed by summing them according to the cruise scenario number.
7. The UAV attitude control method based on multi-scenario cruise according to claim 1, characterized in that: The step of adjusting the weight fusion coefficients according to the scene switching frequency and generating the fusion perturbation vector F includes: Obtain the number of times consecutive scene numbers are switched in the cruise mission path, and calculate the scene switching frequency value per unit flight distance; The scene switching frequency value is associated with the set of disturbance factor influence weights, and the weight fusion coefficient of each scene is calculated according to a preset function model, wherein the function model is an exponential decay function; Based on the influence weight of the disturbance factor corresponding to each scenario and its fusion coefficient, an element-wise weighted calculation is performed to generate a weighted fusion vector of each disturbance factor on the entire path; The weighted fusion vector is used as the fusion perturbation vector F.
8. The UAV attitude control method based on multi-scenario cruise according to claim 1, characterized in that: The step of outputting the control parameter set θ corresponding to the scenario includes: The fused perturbation vector F is constructed into an input sequence in time series format and then subjected to dimensionality expansion processing to adapt to the neural network input structure. A recurrent neural network model containing multiple layers of long short-term memory units is constructed. The neural network obtains the nonlinear mapping relationship between perturbation features and attitude response through offline training. The constructed input sequence is fed into a recurrent neural network, and the dynamic correlation in the perturbation sequence is extracted by combining the state transfer between time steps in the network. The attitude control parameter set θ, including the expected values of roll angle, pitch angle and yaw angle, is obtained at the network output layer and used to adjust the UAV attitude control commands in real time.