Unmanned aerial vehicle intelligent dynamic obstacle avoidance method and system based on ultrasonic frequency adaptation
By employing an obstacle avoidance method based on ultrasonic frequency adaptation and deep learning, the ranging error and robustness issues of near-field obstacle avoidance for lightweight UAVs in complex environments have been resolved. This method achieves high-precision, interference-resistant autonomous obstacle avoidance, thereby improving the flight safety and mission completion efficiency of UAVs in complex environments.
Patent Information
- Application Number
- CN202511547291.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-10-28
AI Technical Summary
When existing lightweight drones attempt near-field obstacle avoidance in complex environments, fixed-frequency ultrasonic sensors are susceptible to Doppler frequency shift, sensor crosstalk, and multipath echoes, leading to ranging errors, false alarms, or missed detections. Multimodal perception solutions such as vision and lidar are not robust enough under conditions such as low light and heavy fog and rain, making it difficult to promote them on small platforms.
An ultrasonic frequency-adaptive intelligent dynamic obstacle avoidance method for UAVs is adopted. Narrow pulse or linear sweep frequency signals are emitted by the DDS drive device through digital direct synthesis. The CNN-AE is combined for denoising and feature extraction. The deep Q network is used to generate compound actions. The long short-term memory network LSTM is combined for path prediction to achieve frequency-adaptive obstacle avoidance.
It significantly improves the near-field perception accuracy and anti-interference capability of UAVs in complex environments, enhances the real-time performance and flight safety of the system, avoids the hardware cost and power consumption of additional sensors, and achieves efficient autonomous obstacle avoidance.
Smart Images

Figure CN121028836B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of unmanned aerial vehicle flight control, and particularly relates to an intelligent dynamic obstacle avoidance method and system for unmanned aerial vehicles based on ultrasonic frequency adaptation. BACKGROUND
[0002] With the wide application of unmanned aerial vehicles in scenarios such as logistics distribution, pipeline inspection and disaster rescue, the demand for safe autonomous flight in complex environments is increasingly prominent. Currently, fixed 40kHz ceramic ultrasonic sensors are generally used for near-field obstacle avoidance of light small unmanned aerial vehicles, but this fixed frequency scheme is easily affected by Doppler shift, sensor crosstalk and multipath echoes in high-speed flight or multi-machine dense scenarios, resulting in ranging errors, false alarms or missed detections. Although multi-modal perception schemes such as vision and laser radar can expand the environmental perception range, they are not easy to popularize on small platforms due to hardware costs, power consumption and insufficient robustness in low light, heavy fog and rain conditions.
[0003] Therefore, it is of great significance to study a frequency adaptive ultrasonic + deep learning dynamic obstacle avoidance method for unmanned aerial vehicles, which can significantly improve the near-field perception accuracy, anti-interference ability and system real-time performance without increasing additional sensors, and improve the flight safety of light small unmanned aerial vehicles in complex environments. SUMMARY
[0004] The application is to overcome the problem in the prior art that the existing light small unmanned aerial vehicle near-field obstacle avoidance technology adopts multi-modal perception schemes such as vision and laser radar, which are prone to cause insufficient robustness in low light, heavy fog and rain conditions and are not easy to popularize on small platforms due to hardware costs, power consumption, and provides an intelligent dynamic obstacle avoidance method and system for unmanned aerial vehicles based on ultrasonic frequency adaptation, which can significantly improve the near-field perception accuracy, anti-interference ability and system real-time performance without increasing additional sensors, and improve the flight safety of light small unmanned aerial vehicles in complex environments.
[0005] In order to achieve the above application purposes, the application adopts the following technical solutions:
[0006] The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation comprises the following steps:
[0007] S1, when the unmanned aerial vehicle flies along the preset route, the flight control system first reads the center frequency output by the deep Q network in the last decision cycle, and triggers the digital direct synthesis DDS driving device to simultaneously transmit narrow pulse or linear sweep signals to four wideband ultrasonic transducers; the echo received by the wideband ultrasonic transducer is immediately sent to the convolutional neural network CNN-AE for denoising, enhancement and cross-correlation feature extraction after being sampled by an analog-to-digital converter, and the output result is returned to the flight control system as one of the current decision cycle state inputs; the output result contains two key indicators: "closest obstacle distance" and "echo signal-to-noise ratio";
[0008] S2, the attitude recognition module synchronously outputs the fused attitude angle, heading angle, speed and acceleration data, the long short-term memory network performs short-term prediction on the advancing path of the unmanned aerial vehicle to obtain the future attitude change trend; the deep Q network comprehensively detects the ultrasonic features and the future attitude change trend, divides the safety zone, the deceleration zone and the emergency stop zone, and generates a composite action; the composite action includes the next transmission center frequency, the fine yaw angle adjustment amount and the speed scaling coefficient;
[0009] S3, when entering the emergency stop zone, immediately execute braking or climbing maneuver; when entering the deceleration zone, then reduce the speed and bypass according to the yaw instruction; when in the safety zone, then maintain cruising, while feeding back the latest state to the deep learning decision layer of the deep Q network to complete closed-loop update.
[0010] As a preferred, step S1 further comprises the following steps:
[0011] The slight deviation of sound speed c will be amplified by the round-trip time difference and directly affect the distance calculation accuracy. Therefore, the flight control system needs to read the temperature T and relative humidity H at the beginning of each ranging period. Then the sound speed c is calculated according to the empirical formula:
[0012] ;
[0013] After the transducer is triggered, the timer records the rising edge; the echo energy crosses the threshold to trigger the interrupt, and the timer reading is the round-trip time difference . Substitute the compensated sound speed c into the following formula:
[0014] ;
[0015] The slant distance of the corresponding channel to the obstacle .
[0016] The left and right ultrasonic sensors are installed on the body axis in the positive and negative directions, and the baseline length is . If the slant distances of the two channels are and The lateral coordinates of the obstacle in the body plane can be obtained by the intersection of two circles as follows:
[0017] ;
[0018] When the UAV has a pitch or roll, the attitude angle given by the IMU can be used for coordinate rotation correction to prevent geometric solution distortion due to attitude deformation.
[0019] The front and rear ultrasonic sensors are located in the positive and negative directions of the axis, with a baseline . The corresponding slant distance , Solving together gives:
[0020] ;
[0021] Put the four ranging equations into the least squares framework at the same time, use redundant observations to suppress single-channel accidental errors, and realize more stable plane positioning.
[0022] Solve the heading angle Perform attitude decoupling:
[0023] .
[0024] As preferred, step S1 further comprises the following steps:
[0025] In the AirSim-PX4 simulation environment, typical scenes such as straight corridors, forests and urban canyons are built, 0.2m-6m near-field obstacles are randomly arranged, and different wind speeds and noise conditions are injected to generate 2000 flight trajectories. Along the trajectory, three types of original sequences are collected synchronously: ultrasonic wave original echo (center frequency automatically switched with distance label); IMU / GPS attitude-speed data; environment true value label (obstacle distance, collision mark, energy consumption).
[0026] To improve the robustness of the model, ±6dB noise and ±2kHz carrier frequency drift are randomly superimposed on the ultrasonic wave sequence in the offline stage, and ±5% measurement drift and random frame drop are inserted into the attitude-speed sequence:
[0027] ;
[0028] ;
[0029] Finally, the data set is expanded to 1.2×10 7 frames.
[0030] As preferred, in step S1, the echo received by the broadband ultrasonic transducer is immediately sent to the convolutional neural network CNN-AE for denoising, enhancement and cross-correlation feature extraction after being sampled by the analog-to-digital converter, and the output results include the following steps:
[0031] The convolutional auto-encoding network CNN-AE is pre-trained using enhanced data, the network input is a dynamic center frequency marked echo window, and the output is a denoising cross-correlation feature and a distance true value;
[0032] The "reconstruction error + spectral consistency" joint loss is used:
[0033] ;
[0034] Among them, is the overall joint loss, is the number of divided echo windows, is the reconstruction result of the model for the nth echo window, is the weight coefficient of the spectral consistency loss; denotes the L2 norm of the frequency domain amplitude difference.
[0035] After training, freeze the encoding layer and quantize to FP16 to ensure that the inference delay on the board is less than 5ms. Through the "frequency label-feature alignment" method, the encoder can stably extract effective ranging features in different frequency bands, providing a unified representation for subsequent DQN decision-making.
[0036] The converted data is preprocessed to obtain the current attitude of the unmanned aerial vehicle, autonomously avoid obstacles, and optimize the path.
[0037] The application of the data preprocessing in the unmanned aerial vehicle obstacle avoidance system can significantly improve the data processing effect, so that the system can better process data from different sensors and respond to environmental changes in a timely manner, thereby improving the safety and stability of the unmanned aerial vehicle flight.
[0038] It includes sending the six-tuple attitude-velocity data of the fusion of accelerometer, gyroscope, magnetometer, barometer, ultrasonic feature and GPS into double-layer LSTM to predict the attitude change trend in the future 0.5s, and forget gate to judge which historical features are meaningful:
[0039] ;
[0040] The typical input gate is updated as follows:
[0041] ;
[0042] Through the output gate Expose the information most relevant to safety risks as :
[0043] ;
[0044] After 30 rounds of offline training, the same amount of quantization pruning is performed to control the prediction reasoning delay within 3ms and keep the angle error RMS less than 1.5°.
[0045] The flight control system performs hard synchronization on the ultrasonic and IMU sequences before the data enters each network:
[0046] ;
[0047] Guarantee the timestamp error ; then use complementary filtering to eliminate low-frequency drift and high-frequency noise:
[0048] ;
[0049] And use extended Kalman filter (EKF) to output unified body position and velocity estimation, and provide high consistency state quantity for strategy network.
[0050] As preferred, in step S2, the long short-term memory network performs short-term prediction on the UAV travel path to obtain the future attitude change trend, including the following steps:
[0051] Compress the historical noisy ultrasonic echo into high-dimensional features , ultrasonic measurement distance , signal-to-noise ratio , attitude quaternion, body velocity v and acceleration a, which are input into the long short-term memory network LSTM at the same time, and the meaningful historical features are judged by the forget gate:
[0052] ;
[0053] Wherein is the output of the forget gate, is the Sigmoid activation function, is the input weight matrix, is the recurrent weight matrix, is the output of the previous time LSTM unit, is the bias vector.
[0054] Through the output gate Expose the information most relevant to safety risks as :
[0055] ;
[0056] Wherein is the output gate unit state.
[0057] Use the gating mechanism to automatically extract the most useful obstacle avoidance information, so that the DQN (deep Q network) has foresight when generating center frequency and maneuvering instructions.
[0058] As preferred, in step S2, during the generation of the composite action, the deep Q network performs preliminary screening on the center frequency and fine-tuning of the network according to the following experience strategy:
[0059] When the distance between the UAV and the obstacle is greater than 10 m, the low frequency band is preferred, which is used to expand the ranging range; the low frequency band refers to 30 kHz to 300 kHz;
[0060] When the distance between the UAV and the obstacle is in the range of 1 m-10 m, the frequency of the ultrasonic wave emitted by the frequency-adjustable ultrasonic driving device gradually increases in a linear interpolation manner with the distance, so as to balance the range and resolution;
[0061] When the distance between the UAV and the obstacle is in the range of 0.5 m-1 m, the frequency of the ultrasonic wave emitted by the frequency-adjustable ultrasonic driving device is fixedly used at the highest frequency, and a deceleration or emergency stop command is output at the same time, so as to ensure the millimeter-level ranging accuracy and flight safety.
[0062] As preferred, step S2 further comprises the following steps:
[0063] The inertial measurement unit (IMU) is used to measure the UAV in real time to obtain the three-axis acceleration and angular velocity of the UAV, and the quaternion integral algorithm is used to calculate the attitude angle of the UAV; the attitude angle includes the pitch angle , the roll angle , and the yaw angle , and the specific formula is as follows:
[0064] ;
[0065] ;
[0066] wherein is the derivative of the quaternion, is the quaternion. is the quaternion multiplication. is the scalar part of the quaternion, , , is the vector part of the quaternion.
[0067] As preferred, in step S2, the deep Q network adopts a double network structure, including a policy network and a target network; the weight update rule of the policy network and the target network is:
[0068] ;
[0069] wherein, is the weight of the policy network; is the weight of the target network; is a soft update coefficient.
[0070] As preferred, in step S2, the deep Q network maps the received sensor data to a state vector in offline stage
[0071]
[0072] wherein each parameter is normalized to the interval [0, 1], is the maximum detection distance of the ultrasonic sensor, is the signal-to-noise ratio, is the hidden feature vector, is the remaining battery energy, is the rated battery energy, is the center frequency of the ultrasonic emission used at the last time.
[0073] As preferred, in step S2, the deep Q network is a fully connected neural network, the input layer has 6 nodes (corresponding to the dimension of the state vector), the hidden layer has 128 nodes (ReLU activation), and the output layer has 7 nodes (corresponding to 7 actions) Input layer: 6-dimensional state vector s t → fully connected layer (128 neurons, ReLU activation);
[0074] Hidden layer: fully connected layer (64 neurons, ReLU activation);
[0075] Output layer: 7-dimensional action Q value: (corresponding to actions: forward, backward, left, right, up, down, hover).
[0076] The Q value calculation formula is:
[0077] wherein W i , b i are network weights and biases, is the ReLU function.
[0078] As preferred, in the simulation environment construction, the dynamic obstacle motion trajectory is simulated in Gazebo to generate a training data set , and the ε-greedy strategy is used to select actions:
[0079]
[0080] wherein the initial value is 0.5, and exponentially decays to 0.01 with the training round.
[0081] After executing the action , the UAV enters a new state The sensor reacquires data, and the next decision cycle is started.
[0082] As a preference, step S2 further comprises the following steps:
[0083] The reward function is defined as follows:
[0084] ;
[0085] Wherein, is the instantaneous reward at time t, , , are all dynamic weights, is the reward for approaching the target point, is the three-axis acceleration of the unmanned aerial vehicle at the current time;
[0086] Wherein, , , are all dynamic weights, is the reward for approaching the target point;
[0087] The weights of the dynamic reward function are dynamically adjusted according to the distance of the obstacle, for rewarding the obstacle avoidance behavior to different degrees in different distance ranges, so as to guide the unmanned aerial vehicle to make the optimal decision in the flight process; The weights of the dynamic reward function are defined as follows:
[0088] .
[0089] As a preference, the method further comprises the following steps:
[0090] S4, when the unmanned aerial vehicle communication is interrupted, the unmanned aerial vehicle cannot access the reinforcement learning model of the cloud or the ground station, and needs to rely on the locally stored Q value table to make real-time decisions, according to the local Q value table to select the optimal action, the Q value data and the optimal selection formula are as follows:
[0091] ;
[0092] .
[0093] Wherein is the learning rate, is the maximum expected value of the next state, is the action element, is the best emergency action, is the action memory structure.
[0094] The application also provides an unmanned aerial vehicle intelligent dynamic obstacle avoidance system based on ultrasonic frequency adaptation, comprising:
[0095] An ultrasonic ranging module, which comprises four ultrasonic ranging sensors and an ultrasonic driving device for driving the emission of ultrasonic waves with different frequencies and adjustable frequency; the four ultrasonic ranging sensors are located at the center of the front, rear, left and right four sides of the UAV, and are used to read the distance between the UAV and the obstacle, and are electrically connected with the ultrasonic driving device;
[0096] An attitude recognition module, which integrates an accelerometer, a gyroscope, a magnetometer, a barometer and a GPS; the accelerometer outputs the component signals of gravity on three axes of the body coordinate system; the gyroscope outputs the angular velocity signals of the aircraft rotating around three axes; the magnetometer outputs the component signals of the magnetic field intensity on three axes; and the barometer is used to obtain the flight height of the UAV;
[0097] A flight control module, which is electrically connected with the ultrasonic ranging module and the attitude recognition module; the flight control module comprises an embedded single-chip microcomputer and a ground station, is used to process the flight state data measured by the sensors, judge, control and monitor the flight condition of the UAV, output control instructions to the actuator, and realize the control of various flight modes of the UAV and the management of the task equipment;
[0098] An emergency control module, which is used to trigger local decision based on Q value table when the communication is interrupted, so as to make the UAV fly safely under abnormal conditions.
[0099] Compared with the prior art, the beneficial effects of this invention are: (1) This invention integrates multiple sensor data such as ultrasonic sensors, global positioning system (GPS) and inertial measurement unit (IMU) to construct a three-stream data channel of "near field distance-attitude-velocity" to achieve comprehensive perception of the environment around the UAV; the data preprocessing layer is used to filter, timestamp align and coordinate system uniform of the collected data, effectively improving the data quality and providing accurate basis for subsequent obstacle avoidance decisions; this process uses ultrasonic frequency hopping to suppress co-frequency interference and Doppler shift, and can maintain high-precision ranging in the near field without lidar or visual sensors, significantly improving the perception reliability and anti-interference ability in complex environments; (2) The ultrasonic ranging sequence of this invention is first denoised, main lobe enhanced and cross-correlation spectrum compressed by CNN-AE, and directly outputs two types of high confidence features, "nearest obstacle distance" and "echo signal-to-noise ratio", providing a unified and scale-invariant near field representation for subsequent decision-making; this network can adaptively extract effective information under different transmission frequency bands and background noise conditions, avoiding the limitations of traditional threshold or cross-correlation algorithms. The dependence of dynamic parameter adjustment ensures the stability of ranging in various complex acoustic environments; the denoised ranging and signal-to-noise ratio output by CNN-AE are spliced into the input sequence of LSTM, and together with the body acceleration, angular velocity, heading and position data, drive the double-layer recurrent unit; LSTM uses the gating structure to explicitly memorize short-term history, and while predicting the attitude and velocity evolution in the next period, it continuously senses the approach rate of obstacles, realizing the integrated temporal coding of "motion trend + near-field risk"; the prediction vector and the current ultrasonic features enter the deep Q network together to generate a composite action including the next transmission frequency, yaw angle fine adjustment and velocity scaling, so that the obstacle avoidance strategy can be smoothly adjusted in advance; (3) This invention obtains high-quality environmental characterization, forward-looking maneuver prediction and adaptive frequency scheduling without introducing lidar or visual sensors through the information flow of CNN-AE→LSTM→DQN, which significantly improves the autonomous obstacle avoidance safety and mission completion efficiency of light and small UAVs in complex near-field environments. Attached Figure Description
[0100] Figure 1 This is a structural flowchart of the UAV dynamic obstacle avoidance method in this invention;
[0101] Figure 2 A schematic diagram showing the sound field distribution of ultrasonic waves at different frequencies and the spatial range they can detect.
[0102] Figure 3 This is a path optimization diagram for the UAV dynamic obstacle avoidance method in this invention;
[0103] Figure 4 This is a performance comparison chart between the method of the present invention and the traditional method. Detailed Implementation
[0104] In order to more clearly illustrate the embodiments of the present application, the specific embodiments of the present application will be described below with reference to the drawings. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained from these drawings and other embodiments can be obtained without creative labor for those skilled in the art.
[0105] As shown in the drawings, the present application provides an unmanned aerial vehicle intelligent dynamic obstacle avoidance method based on ultrasonic frequency adaptation, comprising the following steps: Figure 1
[0106] Step one, real-time monitoring of the position and distance of static obstacles by ultrasonic sensors, adjusting the frequency of ultrasonic emission. Using barometer equipment to detect the neighborhood environment of the unmanned aerial vehicle in real time, and providing the attitude, acceleration and angular velocity of the unmanned aerial vehicle through the inertial sensor, realizing the comprehensive perception of the environment around the unmanned aerial vehicle and pre-processing the data.
[0107] Step two, two-stage mode of offline training and online updating by CNN-AE and LSTM decision engine, generating an obstacle avoidance path, and dynamically adjusting the flight strategy according to the real-time environment.
[0108] Step three, through a dynamic priority reward function, the reward weight is adaptively adjusted according to the distance of the obstacle, guiding the unmanned aerial vehicle to make the optimal decision and path optimization in the flight process.
[0109] Step four, through the emergency control module, triggering local decision based on Q value table when communication is interrupted, ensuring that the unmanned aerial vehicle can still fly safely in abnormal conditions.
[0110] In step one, one TDK CH-201 (working bandwidth 18kHz-100kHz, maximum range 5m) is used in front and back, and one SensComp 600-1120 (center 120kHz, narrow beam high resolution) is used in left and right. Four transducers are driven by AnalogDevices AD9833 12-bit DDS chips, which can continuously sweep between 16kHz-130kHz;
[0111] In step one, BMI088 six-axis IMU is used, with an accelerometer range of ±8g and an angular velocity meter range of ±2000° / s, and a sampling frequency of 200Hz.
[0112] In step one, BMP388 barometer (resolution 0.01hPa, height accuracy ±0.5m).
[0113] In step one, the slight deviation of sound speed c will be amplified by the round-trip time and directly affect the distance calculation accuracy. Therefore, the flight control needs to read the temperature T and relative humidity H at the beginning of each ranging period. Then the sound speed is calculated according to the empirical formula:
[0114] ;
[0115] In step one, after the transducer is triggered, the timer records the rising edge; the echo energy triggers an interrupt when it crosses the threshold, and the timer reading is the round-trip time . Substitute the compensated sound speed c into the following formula:
[0116] ;
[0117] The slant range of the corresponding channel to the obstacle can be obtained.
[0118] The left and right ultrasonic sensors are installed on the body axis in the positive and negative directions, with a baseline length of . If the slant ranges of the two channels are and , respectively, the lateral coordinates of the obstacle in the body plane can be obtained from the intersection of the following two circles:
[0119] ;
[0120] When the UAV has pitch or roll, the attitude angle given by the IMU can be used for coordinate rotation correction to prevent geometric calculation from being distorted due to attitude deformation.
[0121] The front and rear ultrasonic sensors are located on the axis in the positive and negative directions, with a baseline . The corresponding slant ranges are , which can be obtained by solving the equations simultaneously:
[0122] ;
[0123] Put the four ranging equations into the least squares framework at the same time, use redundant observations to suppress single-channel occasional errors, and realize more stable plane positioning.
[0124] Solve the heading angle to decouple the attitude:
[0125] ;
[0126] In step one, the ultrasonic wave and barometer height fusion sensor uses HC-SR04 ultrasonic sensor (range 0.02-4m, accuracy ±2cm), BMP388 barometer (resolution 0.01hPa, height accuracy ±0.5m).
[0127] In step one, the ultrasonic and barometer height fusion sensor data preprocessing adopts a fusion formula:
[0128] ;
[0129] wherein, is a confidence weight, is the fusion of ultrasonic data, is the fusion of barometer data, is the ultrasonic collection data.
[0130] Further, the confidence weight satisfies the following conditions:
[0131] ;
[0132] In step one, the ultrasonic and barometer height fusion sensor measures the real height of 1.5m, the ultrasonic measurement is 1.48m, the barometer measurement is 1.6m, and the fusion value is 1.51m (error <0.7%).
[0133] In step one, the BMI088 six-axis IMU is used, with an accelerometer range of ±8g, an angular velocity range of ±2000° / s, and a sampling frequency of 200Hz.
[0134] In step one, the IMU real-time measures the three-axis acceleration and angular velocity of the unmanned aerial vehicle, and the quaternion integration algorithm is used to calculate the attitude angle of the unmanned aerial vehicle; the attitude angle includes the pitch angle , roll angle , and yaw angle , and the specific formula is as follows:
[0135] ;
[0136] ;
[0137] In step one, the IMU real-time measures the pitch angle of the unmanned aerial vehicle, which is actually 10°, and the IMU calculation value is 9.8° (error <2%).
[0138] In step one, the Kalman filter is used for unmanned aerial vehicle state positioning, and the state vector is obtained by state prediction (IMU pre-integration):
[0139] ;
[0140] wherein is the process noise .
[0141] In step two, the wideband ultrasonic array is used at the center frequency f given by the flight control modulet The narrow pulse or swept signal is emitted, and the echo is sampled by an analog-to-digital converter and input into a convolution auto-encoding network (CAE) to obtain a latent vector after multiple convolution-pooling layers :
[0142] ;
[0143] ;
[0144] The "reconstruction error + spectral consistency" joint loss is used:
[0145] ;
[0146] The network outputs the latest obstacle distance and echo signal-to-noise ratio end-to-end . .
[0147] In step two, the inertial measurement unit (IMU) collects real-time three-axis acceleration and angular velocity . The sensor time stamp is synchronized by hardware to meet:
[0148] ;
[0149] Mahony filtering closes the error loop in the quaternion domain between the "fast ring" attitude obtained by integrating the angular velocity and the "slow ring" attitude calculated by the acceleration / magnetic force sensor:
[0150] ;
[0151] The compensated angular velocity is used for quaternion differentiation:
[0152] ;
[0153] The integrated new attitude quaternion is normalized to eliminate numerical drift.
[0154] The extended Kalman filter (EKF) is used to correct the state and covariance:
[0155] ;
[0156] Mahony filtering and extended Kalman filtering (EKF) are fused to obtain position, velocity, and attitude in a unified coordinate system. The attitude angle is obtained by quaternion integration, and the pitch angle formula is as follows:
[0157] ;
[0158] In step two, the denoising range d_ultra and signal-to-noise ratio The IMU / GPS six-tuple forms an 11-dimensional sequence xt, which is input into a two-layer long short-term memory network (LSTM).
[0159] The gating calculation of the two-layer LSTM at time step t is:
[0160] ;
[0161] The forget gate is obtained in the same way , the output gate , the candidate memory ; the internal state and the output are:
[0162] ;
[0163] The hidden vector ht output by the CNN-AE network is spliced to represent the future short-time attitude and near-field trend. Then, the state vector is constructed:
[0164] ;
[0165] In step two, the obstacle distance is 15m, the speed is 5m / s, the remaining power is 6000mAh, and the target point deviation is 50m. The state vector is obtained:
[0166] ;
[0167] In step two, as shown in Figure 2 , when the distance between the UAV and the obstacle is greater than 10m (corresponding to the a position in Figure 2 ), the low frequency band is preferentially selected to expand the ranging range; the low frequency band refers to 30kHz to 300kHz;
[0168] When the distance between the UAV and the obstacle is in the range of 1m-10m (corresponding to the b position in Figure 2 ), the frequency of the ultrasonic wave emitted by the frequency-adjustable ultrasonic driving device gradually increases in a linear interpolation manner with the distance, so as to balance the range and resolution;
[0169] When the distance between the UAV and the obstacle is in the range of 0.5m-1m (corresponding to the c position in Figure 2 ), the frequency of the ultrasonic wave emitted by the frequency-adjustable ultrasonic driving device is fixedly used at the highest frequency, and a speed reduction or emergency stop instruction is output at the same time, so as to ensure millimeter-level ranging accuracy and flight safety.
[0170] In step three, the deep Q network takes as input and outputs the composite action . Among them is used to drive the transducer to hop frequency in the next period through DDS; Synchronization with vscale, write flight control module, complete the heading and speed fine-tuning. Flight control module continuously compares With safety threshold: if entering emergency stop area, brake or climb immediately, if in deceleration area, round smoothly, keep cruising in safety area.
[0171] In step three, the reward function design equation is:
[0172] ;
[0173] Wherein, , , All are dynamic weights, Reward for approaching target point.
[0174] Further, the reward function dynamic weight adjustment rule is as follows:
[0175] ;
[0176] In step three, the near obstacle scene test is carried out:
[0177] d obs =1.5m, reward r t =2.0 / 1.5-0.1*1.2+0.3*0.3=1.21. The UAV selects emergency climb action, and the obstacle avoidance is successful.
[0178] Further, the long-distance target approach scene test is carried out: =20m, reward r t =0.5 / 10-0.1*0.5+0.3*0.2=0.06. The UAV prefers to fly straight, and the path efficiency is improved by 15%.
[0179] In step three, the execution result and the immediate reward r t Write experience replay pool, used for periodic fine-tuning of policy network weight, realize online self-adaption. Through dynamic priority reward function, guide the UAV to make optimal decision and path optimization in flight process. State input: single frame processing time 8ms. IMU: 200Hz, attitude solution delay 1ms. Decision to execution delay delay is 22ms (meet ≤50ms requirement). In 10Hz burst obstacle test, the obstacle avoidance success rate is 98.7%.
[0180] In step four, the emergency module communication interruption detection and mode switching trigger condition: no ground station heartbeat signal is received for 5 consecutive communication periods (period=100ms), and 4G / 5G signal strength<-100dBm.
[0181] Further, the local Q value table construction and query are carried out:
[0182] ;
[0183] ;
[0184] Further, local path replanning, Q-value guided path generation: from the current state s t , search in the Q-value table for a future 3-step action sequence {a t , a t+1 , a t+2}, select the path with the highest cumulative reward:
[0185] ;
[0186] Finally, the path optimization result as shown in Figure 3 is obtained, it can be seen obviously that the optimized path is shorter than the original path, the flight efficiency is improved, the task time consumption is shortened, and the energy consumption is also reduced.
[0187] In addition, the application also provides an unmanned aerial vehicle intelligent dynamic obstacle avoidance system based on ultrasonic frequency self-adaption, which comprises:
[0188] An ultrasonic ranging module, the ultrasonic ranging module comprises four ultrasonic ranging sensors and an ultrasonic driving device for driving the emission of ultrasonic waves with different frequencies and adjustable frequency; the four ultrasonic ranging sensors are located at the centers of the front, rear, left and right four surfaces of the unmanned aerial vehicle, and are used for reading the distance between the unmanned aerial vehicle and the obstacle, and are electrically connected with the ultrasonic driving device;
[0189] An attitude recognition module, the attitude recognition module is integrated with an accelerometer, a gyroscope, a magnetometer, a barometer and a GPS; the accelerometer outputs component signals of gravity on three axes of the body coordinate system; the gyroscope outputs angular velocity signals of the aircraft rotating around three axes; the magnetometer outputs component signals of the magnetic field intensity on three axes; and the barometer is used for acquiring the flight height of the unmanned aerial vehicle;
[0190] A flight control module, the flight control module is electrically connected with the ultrasonic ranging module and the attitude recognition module; the flight control module comprises an embedded single-chip microcomputer and a ground station, and is used for processing flight state data measured by the sensors, judging, controlling and monitoring the flight state of the unmanned aerial vehicle, outputting control instructions to an executing mechanism, and realizing the control of various flight modes of the unmanned aerial vehicle and the management of the task equipment;
[0191] An emergency control module, which is used for triggering local decision based on the Q-value table when the communication is interrupted, so that the unmanned aerial vehicle can fly safely under abnormal conditions.
[0192] The application provides a kind of unmanned aerial vehicle dynamic obstacle avoidance method based on frequency adaptation and deep learning, realizes efficient autonomous obstacle avoidance by multi-source sensor fusion and double network DQN architecture.The system adopts ultrasonic sensor and IMU data to construct normalized state vector, uses CNN-AE to complete end-to-end denoising and cross-correlation enhancement on original echo, outputs near-field distance and signal-to-noise ratio.Subsequently, with the help of Mahony complementary filter and multiplication type EKF, inertial, magnetic and satellite data are fused to obtain high confidence attitude and velocity estimation.Combined with dynamic weight reward function, the balance of obstacle avoidance safety, path efficiency and energy optimization is achieved.Double network structure (policy network + target network) improves training stability through soft update, as shown in Figure 4 The measured obstacle avoidance success rate of the application reaches 96.2%, which is 23% higher than that of the traditional method.The delay in online decision-making stage is ≤22ms, the task time is shortened by 38%, the energy consumption is reduced by 42.9%, and the path tracking error is only 0.23m.The scheme has high robustness, real-time performance and energy efficiency, and provides a reliable unmanned aerial vehicle flight obstacle avoidance solution for logistics, inspection and other fields.
[0193] The above only describes the preferred embodiments and principles of the application, and for ordinary skilled persons in the art, the specific implementation methods can be changed according to the idea provided by the application, and these changes should be regarded as the protection scope of the application.
Claims
1. A method for intelligent dynamic obstacle avoidance of unmanned aerial vehicles based on ultrasonic frequency adaptation, characterized in that, Includes the following steps; S1. When the UAV flies along the preset route, the flight control system first reads the center frequency of the deep Q network output in the previous decision cycle and triggers the digital direct synthesis (DDS) drive device to simultaneously transmit narrow pulse or linear sweep frequency signals to four broadband ultrasonic transducers. The echoes received by the broadband ultrasonic transducers are sampled by the analog-to-digital converter and immediately sent to the convolutional neural network CNN-AE to complete denoising, enhancement and cross-correlation feature extraction, and output the results. S2, the attitude recognition module synchronously outputs the fused attitude angle, heading angle, velocity and acceleration data, the long short-term memory network makes short-term predictions of the UAV's travel path to obtain the future attitude change trend; the deep Q network integrates the detected ultrasonic features and the future attitude change trend to divide the safe zone, deceleration zone and emergency stop zone, and generate compound actions; S3: When entering the emergency stop zone, immediately perform braking or climbing maneuvers; when entering the deceleration zone, reduce speed and detour according to yaw instructions; when in the safe zone, maintain cruise while feeding back the latest status to the deep learning decision layer of the deep Q network to complete the closed-loop update. In step S1, the echo received by the broadband ultrasonic transducer is sampled by an analog-to-digital converter and immediately fed into a convolutional neural network (CNN-AE) to complete denoising, enhancement, and cross-correlation feature extraction, and the output results include the following steps: The convolutional autoencoder network CNN-AE is pre-trained using augmented data. The network input is an echo window with a dynamic center frequency label, and the output is denoised cross-correlation features and ground truth distance values. Using a combined loss of "reconstruction error + spectral consistency": ; in, For the overall joint loss, The number of echo windows after division. This represents the reconstruction result of the model for the nth echo window. These are the weighting coefficients for the spectral consistency loss; The L2 norm represents the amplitude difference in the frequency domain.
2. The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation according to claim 1, characterized in that, In step S2, the Long Short-Term Memory network makes short-term predictions of the UAV's travel path to obtain future attitude change trends, including the following steps: Compressing historically noisy ultrasound echoes into high-dimensional features Ultrasonic distance measurement Signal-to-noise ratio The attitude quaternion, the body velocity v, and the acceleration a are simultaneously input into the Long Short-Term Memory (LSTM) network, and meaningful historical features are identified through the forget gate. ; in, Output for the forget gate. It is the Sigmoid activation function. For the input weight matrix, This is a cyclic weight matrix. This is the output of the LSTM unit from the previous moment. It is the bias vector; Through the output gate Expose the information most relevant to security risks : ; in, This indicates the state of the output gate unit.
3. The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation according to claim 2, characterized in that, In step S2, during the generation of compound actions, the deep Q-network follows the following empirical strategy to perform initial screening of the center frequency and fine-tuning of the network: When the distance between the drone and the obstacle is greater than 10m, the low frequency band is selected first to expand the ranging range; the low frequency band refers to 30kHz to 300kHz. When the distance between the drone and the obstacle is in the range of 1m-10m, the frequency of the ultrasonic wave emitted by the frequency-adjustable ultrasonic drive device gradually increases with the distance in a linear interpolation manner. When the distance between the drone and the obstacle is within the range of 0.5m-1m, the frequency-adjustable ultrasonic drive device emits sound waves at the fixed highest frequency and simultaneously outputs deceleration or emergency stop commands.
4. The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation according to claim 3, characterized in that, Step S2 also includes the following steps: Real-time measurements of the UAV's three-axis acceleration are obtained using an inertial measurement unit (IMU). With angular velocity The attitude angles of the UAV are calculated using a quaternion integration algorithm; these attitude angles include pitch angles. Roll angle Yaw angle .
5. The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation according to claim 4, characterized in that, In step S2, the deep Q-network adopts a dual-network structure, including a policy network and a target network; the weight update rules for the policy network and the target network are as follows: ; in, For policy network weights; For target network weights; This is the soft update coefficient.
6. The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation according to claim 5, characterized in that, In step S2, the deep Q-network maps the received sensor data into state vectors during the offline phase. The specific formula is as follows: ; Among them, each parameter is normalized to the [0,1] interval. This represents the maximum detection distance of the ultrasonic sensor. For signal-to-noise ratio, To hide the feature vector, For the remaining energy of the battery, For the battery's rated energy, The frequency of the ultrasonic transmission center used in the previous moment.
7. The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation according to claim 6, characterized in that, Step S2 also includes the following steps: The reward function is defined as follows: ; in, The instant reward at time t, , , All are dynamic weights. The reward is for getting closer to the target point. The three-axis acceleration of the drone at the current moment; Weights of the dynamic reward function Based on the distance between the drone and the obstacle Dynamic adjustments are made to reward obstacle avoidance behavior at different distances, thereby guiding the drone to make optimal decisions during flight.
8. The intelligent dynamic obstacle avoidance method for unmanned aerial vehicles based on ultrasonic frequency adaptation according to claim 7, characterized in that, It also includes the following steps: S4. When drone communication is interrupted, select the optimal action based on the local Q-value table. The Q-value data and the optimal selection formula are as follows: ; ; in, For learning rate, This represents the maximum expected value of the next state. For optimal emergency response, It is a motor memory structure.
9. An intelligent dynamic obstacle avoidance system for unmanned aerial vehicles (UAVs) based on ultrasonic frequency adaptation, used to implement the intelligent dynamic obstacle avoidance method for UAVs based on ultrasonic frequency adaptation as described in any one of claims 1-8, characterized in that, The ultrasonic frequency adaptive unmanned aerial vehicle (UAV) intelligent dynamic obstacle avoidance system includes: The ultrasonic ranging module includes four ultrasonic ranging sensors and an ultrasonic driving device for driving the emission of ultrasonic waves at different frequencies, with adjustable frequencies. The four ultrasonic ranging sensors are located at the center of the front, rear, left, and right sides of the UAV and are used to read the distance between the UAV and obstacles. They are all electrically connected to the ultrasonic driving device. The attitude recognition module integrates an accelerometer, gyroscope, magnetometer, barometer, and GPS. The accelerometer outputs the component signals of gravity along the three axes of the aircraft coordinate system; the gyroscope outputs the angular velocity signals of the aircraft's rotation around the three axes; the magnetometer outputs the component signals of magnetic field strength along the three axes; and the barometer is used to obtain the UAV's flight altitude. The flight control module is electrically connected to the ultrasonic ranging module and the attitude recognition module. The flight control module includes an embedded microcontroller and a ground station, which are used to process the flight status data measured by the sensors, judge, control and monitor the flight status of the UAV, output control commands to the actuators, and realize the control of various flight modes in the UAV and the management of mission equipment. The emergency control module is used to trigger local decisions based on the Q-value table when communication is interrupted, enabling the drone to fly safely in abnormal situations.
Citation Information
Patent Citations
Unmanned aerial vehicle flight control system and method with precise positioning and autonomous obstacle avoidance
CN120255563A
Electric power unmanned aerial vehicle obstacle avoidance method and system based on multi-modal perception and reinforcement learning
CN120610568A