High-precision fixed-height transverse dual-rotor unmanned aerial vehicle based on cascade PID and real-time decoupling control and design method of high-precision fixed-height transverse dual-rotor unmanned aerial vehicle
By using low-cost hardware and a real-time decoupling compensation algorithm, the roll-yaw coupling problem of tandem dual-rotor UAVs was solved, achieving high-precision altitude hold control and safety protection, thus improving the stability and cost-effectiveness of the UAVs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-10
- Publication Date
- 2026-04-07
AI Technical Summary
Tandem dual-rotor UAVs suffer from severe roll-yaw dynamics coupling problems. Traditional PID controllers are prone to causing attitude oscillations during maneuvers. Furthermore, high-performance UAVs are expensive, while low-cost solutions have limited performance and lack effective safety protection mechanisms.
A perception system is constructed using a low-cost main control unit, a 6-axis motion sensor, and an ultrasonic sensor. Combined with a self-locking brushless motor and a servo tilt power unit, a five-layer real-time decoupling compensation algorithm is designed. Through a cascaded PID dual-loop control architecture and a safety protection mechanism, high maneuverability, high stability, and high precision flight control are achieved.
Without increasing hardware costs, it significantly reduces roll-yaw coupling interference, improves the stability and maneuverability of UAVs, has high-precision altitude hold control capabilities, and provides multiple safety protections, offering excellent cost performance.
Smart Images

Figure CN121806970A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of embedded control system and automatic control of aircraft, and particularly relates to a high-precision constant-height cross-column dual-rotor unmanned aerial vehicle based on cascade PID and real-time decoupling control and a design method thereof. BACKGROUND
[0002] With the increasing demand for unmanned aerial vehicles in narrow space inspection, high-speed maneuvering tracking and other special scenarios, the compact and low-cost cross-column dual-rotor configuration has attracted widespread attention. At present, most development schemes directly use the existing flight control and PID algorithm of the traditional four-rotor or use high-performance processors and complex sensors to suppress coupling, without optimizing the underlying control system for the core dynamic characteristics of the configuration. However, the maneuverability and stability of the unmanned aerial vehicle are fundamentally determined by the degree of fit between the underlying control system and the body characteristics. Therefore, it is important to perform in-depth bottom-layer control algorithm and hardware collaborative design for the cross-column dual-rotor to break through its performance.
[0003] The present application relates to the precise attitude and constant-height control of the cross-column dual-rotor. At present, the configuration faces two main technical bottlenecks: first, the severe roll-yaw dynamic coupling. The roll control of the cross-column dual-rotor depends on the differential of the dual motors, and the yaw control depends on the anti-torque difference generated by the rudder tilting, which strongly interferes with each other, causing the traditional PID controller to easily cause attitude oscillation or even divergence during maneuvering, thereby severely limiting its stability and maneuvering potential. Second, the balance problem between cost and performance. High-performance unmanned aerial vehicles on the market mostly use high-priced main controls such as STM32F4, while schemes using low-cost chips such as STM32F103 are often limited in performance due to simple algorithms and lack effective safety protection mechanisms. SUMMARY
[0004] To solve the above problems, the present application proposes an innovative solution: using a mainstream chip with extremely low cost as the main control unit, integrating a 6-axis motion sensor (used as an attitude sensor) and an ultrasonic sensor (used to achieve a constant-height accuracy of ±1 cm) to construct a perception system, realizing efficient propulsion and torque control through a rudder tilting power unit composed of self-locking brushless motors and rudders, and creating a five-layer real-time decoupling compensation algorithm including gyro coupling, feedforward, feedback, dynamics and aerodynamic coupling. The purpose is to solve the coupling loss of control of the cross-column dual-rotor through software algorithms without increasing the hardware cost, to realize high-maneuvering, high-stability and high-precision flight control, and finally to improve the reliability and drop resistance of the system through the lightweight and modular flight control PCB design, to integrate the above hardware design and decoupling compensation algorithm, and to provide a feasible technical path for the low-cost and high-performance application of the cross-column dual-rotor unmanned aerial vehicle.
[0005] To achieve the above technical purposes, the present application provides the following technical solutions: The application discloses a high-precision constant-height cross-row type dual-rotor unmanned aerial vehicle design method based on cascade PID and real-time decoupling control. The software and hardware development environment of the unmanned aerial vehicle system is configured, including a circuit design and manufacturing environment, an embedded software development environment, a program burning and debugging environment. The unmanned aerial vehicle of the cross-row type dual-rotor configuration is designed. According to the whole machine weight, motor current demand and preset thrust-weight ratio index, the selection of the power supply lithium battery of the unmanned aerial vehicle is determined. The attitude angle data and angular velocity data of the unmanned aerial vehicle are acquired through an attitude sensor; the cascade PID double-loop attitude control architecture is constructed based on the attitude angle data and angular velocity data; the angle loop is used as an outer loop, the angular velocity loop is used as an inner loop, the output of the outer loop is used as the expected input of the inner loop, the output of the inner loop is superimposed with a real-time decoupling compensation quantity designed for the roll-yaw coupling effect, and the unmanned aerial vehicle attitude is controlled through motor differential and rudder complex control. The height data of the unmanned aerial vehicle are collected by selecting a height measuring sensor, the speed data in the height direction are obtained through differential and mean filtering based on the height data, the cascade PID double-loop height control architecture is constructed based on the height data and the speed data in the height direction, the height loop is used as an outer loop, the speed loop is used as an inner loop, the output of the outer loop is used as the expected input of the inner loop, and the height of the unmanned aerial vehicle is controlled. A safety protection mechanism is designed to ensure that the flight state of the unmanned aerial vehicle is stable. The hardware circuit schematic diagram is perfected and a printed circuit board (PCB) is drawn, and then the unmanned aerial vehicle flight control board is obtained through component welding. The control program is compiled and burned to the flight control board, the PID parameters of the unmanned aerial vehicle attitude loop and the compensation coefficient of the real-time decoupling compensation quantity are debugged through ground experiments and flight tests, and finally the height loop parameter fine adjustment and system overall performance optimization are carried out in the free flight of the unmanned aerial vehicle.
[0006] Further, the unmanned aerial vehicle of the cross-row type dual-rotor configuration: The overall structure of the fuselage adopts a modular assembly mode, the fuselage main body adopts a streamline design, and the inside is provided with a battery compartment, a flight control installation platform and a cable channel; two rotors are symmetrically arranged along the transverse axis of the fuselage, the rotation planes of the rotors are parallel to each other and the rotation directions are opposite, and the distance between the left and right rotors is determined according to the principle of minimizing air flow interference and optimizing transverse stability; two brushless motors, two brushless motor drives and two rotors are matched as a power system to provide lift for the unmanned aerial vehicle; each brushless motor is rigidly connected with a digital rudder motor through motor supports on both sides of the fuselage, and the two digital rudder motors are installed on the rudder motor installation platforms on both sides of the fuselage; the output shaft of the rudder motor is connected with the motor support through a 3D printing customized mechanism, the angle of the motor is adjusted in real time through the rudder motor, the differential control of the dual rotors is matched, and the attitude control of the unmanned aerial vehicle is realized.
[0007] Further, the attitude angle data and angular velocity data of the unmanned aerial vehicle obtained by the attitude sensor are specifically: The 6-axis motion processing sensor is selected as the attitude sensor, and the angular velocity of the unmanned aerial vehicle is measured by the attitude sensor; the digital motion processor (DMP) of the attitude sensor is used to integrate the angular velocity of the unmanned aerial vehicle and the linear acceleration data measured by the accelerometer, and the Mahony complementary filtering is performed to obtain the quaternion data of the unmanned aerial vehicle in real time; According to the quaternion rotation formula, the gravity direction in the world coordinate system is rotated to the body coordinate system of the unmanned aerial vehicle to obtain the axial component of the gravity projection in the body coordinate system; the attitude angle of the unmanned aerial vehicle, including the yaw angle, the pitch angle and the roll angle, is calculated by combining the axial gravity component and the quaternion data.
[0008] Further, the real-time decoupling compensation amount designed for the roll-yaw coupling effect includes gyro coupling compensation , feedforward compensation , feedback decoupling compensation , dynamics compensation , roll-yaw coupling compensation , wherein: The gyro coupling compensation is calculated based on the roll angular velocity and the rotor speed factor to offset the precession effect of the rotor gyro; the formula is: ; The feedforward compensation is calculated based on the roll control amount to predict the interference of the roll control on the yaw of the unmanned aerial vehicle; the formula is: ; The feedback decoupling compensation is calculated based on the yaw error to eliminate the accumulated yaw error; the formula is: ; The dynamics compensation is calculated based on the angular velocity of the left and right rudders to adapt to the rudder response delay; the formula is: ; The roll-yaw coupling compensation is calculated based on the roll angular velocity and the roll angle to suppress the direct coupling effect of the roll angular velocity and the roll angle on the yaw; the formula is: ; The total decoupling compensation amount is the sum of each compensation, that is, ; In the formula, is the roll angular velocity, is the roll control amount, is the yaw error, and left and right rudder angular velocity, roll angle, rotor speed factor, compensation coefficient of each compensation amount; roll angular velocity roll angle directly obtained from the attitude sensor; roll control amount output of the angular velocity loop PID controller in the cascade PID double-loop attitude control architecture; yaw error difference between the desired yaw angle and the actual yaw angle obtained from the attitude sensor; left and right rudder angular velocity , obtained by calculating the rate of change of the left and right rudder angle control command output by the flight control system in the adjacent control period; rotor speed factor estimated by the motor throttle control command output by the flight control system.
[0009] Further, the safety protection mechanism specifically includes: The flight control system of the unmanned aerial vehicle continuously monitors the remote control signal. When it is determined that the signal is lost for more than a set time threshold T1, the protection mechanism is automatically triggered: first, the height holding mode is switched in, based on the cascade PID double-loop height control architecture, the actual height at the time of triggering the protection mechanism is set as the target height, the current height is maintained and the attitude is kept. The remote control signal is continuously monitored in the height holding mode. If the signal is restored within the set time threshold T2, the height protection model is exited and the unmanned aerial vehicle flies normally. If the signal is not restored after the set time threshold T2, the autonomous forced landing mode is entered, the expected angles of the attitude control are all set to zero through the cascade PID double-loop attitude control architecture, and the unmanned aerial vehicle is controlled to descend to the ground at a constant speed through the cascade PID double-loop height control architecture, preventing the unmanned aerial vehicle from being lost or crashing.
[0010] Further, the PID parameters of the attitude loop of the unmanned aerial vehicle and the compensation coefficient of the real-time decoupling compensation are debugged layer by layer through ground experiments and flight tests, specifically including: First, ensure the overall stability of the unmanned aerial vehicle, and perform basic debugging of the PID parameters of the pitch angle channel and the roll angle channel in the cascade PID double-loop attitude control architecture, to ensure that each attitude angle channel has stable basic control performance without introducing real-time decoupling compensation; Under the premise of the stability of the roll angle channel PID parameters, the PID parameters of the yaw angle channel are preliminarily set, and a real-time decoupling compensation quantity is introduced; based on the physical mechanism of the roll-yaw coupling of the crossbow dual-rotor, each compensation coefficient is debugged item by item: each compensation coefficient starts from zero, and is debugged by gradually adjusting a single compensation coefficient; the response characteristics of the yaw angle are taken as a unified evaluation object in the debugging process; After the compensation coefficient debugging is completed, the PID parameters of the yaw angle channel are cooperatively re-debugged: under the condition of applying roll interference, the PID parameters of the outer loop and the inner loop of the yaw angle are optimized to ensure that the yaw control still has good dynamic response and steady-state accuracy under the decoupling compensation; Finally, the overall debugging is performed: the PID controllers of the three attitude angle channels and the real-time decoupling compensation module are simultaneously run, and each PID parameter and compensation coefficient is fine-tuned under the condition of compound maneuvering until the system realizes stable and coordinated overall attitude control under the premise that the coupling interference of each axis is significantly reduced.
[0011] More specifically, each compensation coefficient starts from zero, and is debugged by gradually adjusting a single compensation coefficient; the response characteristics of the yaw angle are taken as a unified evaluation object in the debugging process, specifically: The initial value of each compensation coefficient is set to zero, and each single compensation coefficient is debugged by gradually increasing each time, while the remaining compensation coefficients remain unchanged; the increment of each debugging is selected according to the sensitivity of the corresponding physical quantity change to the yaw response; In the debugging process, the response characteristics of the yaw angle are taken as a unified evaluation object, and the determination standard for whether the debugging of different compensation coefficients is completed is: For the gyro coupling compensation coefficient, the debugging is directly based on the correlation between the roll angular velocity and the yaw response; when in continuous or rapid roll motion, the same drift trend of the yaw angle with the roll angular velocity is significantly weakened, and the drift speed no longer increases significantly with the increase of the roll angular velocity, it is determined that the compensation coefficient debugging is completed; For the feedforward compensation coefficient, the debugging is based on the transient response of the yaw caused by the change of the roll control quantity; when the roll control input is applied, the instantaneous offset peak value of the yaw angle decreases significantly with the increase of the compensation coefficient, and no additional oscillation or reverse overshoot is introduced, it is determined that the compensation coefficient debugging is completed; For the feedback compensation coefficient, the debugging is directly based on the accumulation characteristics of the yaw error over time; when under the condition of constant roll attitude or repeated roll operation, the yaw error no longer presents continuous one-way accumulation, but can converge to a stable range within a limited time, it is determined that the compensation coefficient debugging is completed; For the dynamic compensation coefficient, its debugging is based on the correlation between the rudder angular velocity change and the yaw response dynamic characteristics, when the phase lag and dynamic lag phenomenon of the yaw response under the roll excitation condition is obviously reduced, and the dynamic stability of the system is not reduced, it is determined that the debugging of the compensation coefficient is completed. For the roll-yaw coupling compensation coefficient, its debugging is based on the residual oscillation and static deviation of the yaw angle caused by the roll angular velocity and roll angle change; when the residual oscillation amplitude and static deviation of the yaw angle under different roll angles and roll maneuvers are significantly reduced, and are not significantly amplified with the change of the roll state, it is determined that the debugging of the compensation coefficient is completed.
[0012] The application also discloses a high-precision constant-height transverse double-rotor unmanned aerial vehicle based on a cascade PID and real-time decoupling control, which comprises: a main control unit, a modularized sensing interaction unit and a transverse double-rotor power attitude execution unit. The main control unit is a low-cost single-chip microcomputer. The modularized sensing interaction unit is electrically connected with the main control unit through a standardized interface, and comprises an attitude sensor, a height measuring sensor, a Bluetooth communication module and an OLED display module. The transverse double-rotor power attitude execution unit comprises symmetrically arranged double brushless motors, matched brushless electric governors and rudders, the double brushless motors are arranged along the transverse axis of the fuselage, and the rudders are connected with the double brushless motors in linkage. The main control unit is internally provided with a control program compiled based on the design method, and can realize attitude angle and angular velocity calculation, cascade PID double-loop attitude / height control, real-time roll-yaw decoupling compensation and a safety protection mechanism.
[0013] The application also discloses an electronic device comprising a memory and a processor, wherein: The memory is used for storing a computer program capable of running on the processor. The processor is used for executing the computer program to execute the design method of the high-precision constant-height transverse double-rotor unmanned aerial vehicle based on the cascade PID and real-time decoupling control.
[0014] The application also discloses a computer readable storage medium storing computer instructions, the computer instructions are used for enabling the processor to execute the design method of the high-precision constant-height transverse double-rotor unmanned aerial vehicle based on the cascade PID and real-time decoupling control.
[0015] Based on the above technical scheme, the application has at least the following beneficial effects: The design method provided by the application can realize accurate attitude control effect of the unmanned aerial vehicle, eliminate the roll-yaw coupling effect of the side-by-side dual-rotor unmanned aerial vehicle, and design multiple safety protection mechanisms, so that the unmanned aerial vehicle has high control precision and safety. The brushless motor is used as the driving motor, the high-performance brushless motor is matched, and the efficient power system is constructed. The flight control hardware of the application has low cost, and the flight control hardware adopts modular design, integrates various sensor modules, and is equipped with the cascade PID double-loop control algorithm and the real-time decoupling compensation strategy, so that the unmanned aerial vehicle has stable flight performance, reliable safety guarantee and excellent cost performance advantage, and finally a high-performance low-cost side-by-side dual-rotor unmanned aerial vehicle is obtained. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 The overall flowchart of the design method provided by the application is shown in the figure. Figure 2 The physical diagram of the unmanned aerial vehicle designed by the application is shown in the figure. Figure 3 The physical diagram of the remote controller matched with the unmanned aerial vehicle designed by the application is shown in the figure. Figure 4 The flowchart of the cascade PID double-loop attitude control architecture of the unmanned aerial vehicle designed by the application is shown in the figure. Figure 5 The structure diagram of the dual-rotor unmanned aerial vehicle designed by the application is shown in the figure. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical scheme and advantages of the application clearer and more apparent, the application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application and do not limit the application. Figures 1-4
[0018] The steps in the application are arranged by using labels, but are not used to limit the sequence of the steps, unless the sequence of the steps is clearly stated or the execution of a step needs other steps as a basis. The relative sequence of the steps can be adjusted. It can be understood that the term "and / or" used herein involves and covers any and all possible combinations of one or more of the associated listed items.
[0019] The present application aims to design a high-performance low-cost cross-row dual-rotor unmanned aerial vehicle capable of coping with the roll-yaw coupling effect without increasing hardware cost. The embodiment will be described from two core levels of hardware design and control software algorithm of the unmanned aerial vehicle. The hardware part mainly includes the circuit schematic design, PCB layout and final hardware implementation of the cross-row dual-rotor unmanned aerial vehicle body and its remote controller; the software part covers the attitude control algorithm based on the cascade PID double-loop control architecture and real-time decoupling compensation proposed by the present application, the high-precision height-holding algorithm based on ultrasonic sensors, the ground debugging method of system parameters and compensation coefficients, and the flight safety protection strategy.
[0020] As shown in Figure 1 , a high-precision height-holding cross-row dual-rotor unmanned aerial vehicle design method based on cascade PID and real-time decoupling control is shown, which specifically includes the following steps: Configure the software and hardware development environment of the unmanned aerial vehicle system, including the circuit design and manufacturing environment, embedded software development environment, program burning and debugging environment; As a preferred embodiment, in the present embodiment, the circuit design and manufacturing environment uses the domestic J-Link EDA Professional Edition to design the circuit schematic of the flight control system and the remote controller and to layout and wire the PCB (printed circuit board). The software integrates a rich component library and design rule checking (DRC) function to ensure the correctness of the circuit design. After the design is completed, the generated PCB file (Gerber format) is directly submitted to the matching PCB manufacturing and component assembly service using the J-Link single assistant, realizing the rapid circulation from design to physical object; The embedded software development environment: Keil MDK-ARM (Keil 5) is selected as the integrated development environment (IDE) for firmware program development of STM32F103C8T6 single-chip microcomputer. The environment supports editing, compiling, linking and software simulation of C language; The program burning and debugging environment uses the ST-Link debugger, which is connected to the STM32 single-chip microcomputer on the flight control board and the remote controller board through the SWD (serial debugging) interface. After configuring the ST-Link debugger in the Keil environment, one-key downloading, online debugging (such as single-step execution, breakpoint setting, variable monitoring) and chip internal Flash erasing and writing of the firmware can be realized, greatly facilitating the development and iteration of the control algorithm.
[0021] Design an unmanned aerial vehicle with a cross-row dual-rotor configuration; As a preferred embodiment, in the present embodiment, as shown in Figure 5 , the unmanned aerial vehicle with a cross-row dual-rotor configuration: The overall structure of the fuselage adopts a modular assembly method, high-strength 3D printed PLA material is used as the unmanned aerial vehicle fuselage support, the fuselage body adopts a short and wide streamline design, and the inside is provided with a battery compartment, a flight control installation platform and a cable channel, and various components are connected through M3 standard fasteners; the overall unmanned aerial vehicle fuselage size is 12 cm long, 30 cm wide and 24 cm high, has compact external dimensions and an optimized aerodynamic shape. Two rotors are arranged symmetrically along the transverse axis of the fuselage, the rotor rotation planes are parallel to each other and the rotation directions are opposite, and the left and right rotor spacings are determined according to the principle of minimizing airflow interference and optimizing lateral stability (in this embodiment, the left and right rotor spacings are 24 cm); two 2212 brushless motors, two 40A brushless electronic speed controllers and two rotors are matched as a power system to provide lift for the unmanned aerial vehicle; each brushless motor is rigidly connected to an ES08MA digital servo through a motor support on both sides of the fuselage, and the two ES08MA digital servos are installed on the servo installation platforms on both sides of the fuselage; the servo output shaft is connected to the motor support through a 3D printed custom mechanism, the motor angle is adjusted in real time through the servo (the motor tilt angle can be accurately controlled within ± 15°), and the differential control of the double rotors is matched to realize accurate attitude control of the unmanned aerial vehicle in three degrees of freedom of pitch, roll and yaw, significantly improve the flight stability and maneuverability, and are particularly suitable for high-precision constant-height control application scenarios.
[0022] According to the overall weight of the machine, the motor current demand and the preset thrust-to-weight ratio index, the selection of the power lithium battery of the unmanned aerial vehicle is determined; In this embodiment, the overall fuselage weight of the unmanned aerial vehicle is about 400 g, and after adding the flight control board and the sensor, the fuselage weight of the unmanned aerial vehicle is about 450 g; the unmanned aerial vehicle is equipped with two 2212 brushless motors, and the maximum lift of a single motor is about 800 g under a voltage of 14.8 V (4S), so the total lift of the two motors is about 1600 g; considering that the unmanned aerial vehicle needs to maintain a reasonable thrust-to-weight ratio (TWR > 2), the battery weight should be controlled at about 250 g to ensure that there is still sufficient lift margin (1600 g / 700 g ≈ 2.29) under the total weight (450 g + 250 g = 700 g). In addition, the rated working current of the 2212 brushless motor under a voltage of 14.8 V is about 10A~13A, the total current demand of the two motors is 20A~26A, and the current demand under peak working conditions can reach 40A. According to the above indexes, a 14.8V 4S polymer lithium battery with a capacity of 2300mAh, a discharge rate of 45C (maximum continuous discharge current 103.5A) and a weight of 250g is finally selected as the power lithium battery of the unmanned aerial vehicle, and the battery energy is 34.1Wh. The battery can not only meet the current demand, but also ensure a good thrust-to-weight ratio, and the 4S voltage configuration can provide a higher speed range for the motor, enhance the dynamic response capability of the double-rotor system, and realize a cruising time of about 10 minutes.
[0023] The attitude angle data and angular velocity data of the unmanned aerial vehicle are acquired by the attitude sensor; as a preferred embodiment, in the embodiment, the attitude angle data and angular velocity data of the unmanned aerial vehicle acquired by the attitude sensor are specifically as follows: A 6-axis motion processing sensor (MPU6050 sensor is selected in the embodiment, which is provided with a gyroscope for measuring angular velocity and an accelerometer for measuring linear velocity) is selected as the attitude sensor, and the angular velocity of the unmanned aerial vehicle is measured by the attitude sensor; the DMP of the attitude sensor is used to integrate the angular velocity of the unmanned aerial vehicle and the linear acceleration data measured by the accelerometer, and Mahony complementary filtering is performed to obtain the quaternion data of the unmanned aerial vehicle in real time ; According to the quaternion rotation formula, the gravity direction in the world coordinate system is rotated to the body coordinate system of the unmanned aerial vehicle to obtain the axial component of the gravity projection in the body coordinate system; the formula is expressed as: ; Among them, represents the corresponding axial component of the gravity projection in the body coordinate system; represents the quaternion data calculated by the DMP; The attitude angle of the unmanned aerial vehicle is calculated by combining the axial gravity component and the quaternion data, including the yaw angle, the pitch angle and the roll angle of the unmanned aerial vehicle; the calculation formula of the three attitude angles is specifically as follows: ; Among them, yaw angle, pitch angle and roll angle of the unmanned aerial vehicle respectively.
[0024] In the embodiment, after the attitude angle data and angular velocity data of the unmanned aerial vehicle are acquired by the attitude sensor, as shown in Figure 4 , a cascade PID double-loop attitude control architecture is constructed based on the attitude angle data and angular velocity data: the angle loop is the outer loop, the angular velocity loop is the inner loop, the output of the outer loop is the expected input of the inner loop, and the output of the inner loop is superimposed with a real-time decoupling compensation designed for the roll-yaw coupling effect, and the control of the unmanned aerial vehicle attitude is realized through motor differential and rudder compound control. As a preferred embodiment, in the embodiment, the real-time decoupling compensation designed for the roll-yaw coupling effect includes gyro coupling compensation , feedforward compensation , feedback decoupling compensation , dynamics compensation , roll-yaw coupling compensation , wherein: The gyro coupling compensation is calculated based on the roll angular velocity and the rotor speed factor to offset the precession effect of the rotor gyro; the formula is expressed as: ; The feedforward compensation is calculated based on the roll control amount, to predict the interference of roll control on the yaw of the UAV; the formula is: ; The feedback decoupling compensation is calculated based on the yaw error, to eliminate the accumulated yaw error; the formula is: ; The dynamics compensation is calculated based on the angular velocities of the left and right rudders, to adapt to the response delay of the rudders; the formula is: ; The roll-yaw coupling compensation is calculated based on the roll angular velocity and the roll angle, to suppress the direct coupling effect of the roll angular velocity and the roll angle on the yaw; the formula is: ; Total decoupling compensation amount is the sum of each compensation, that is, ; In the formula, is the roll angular velocity, is the roll control amount, is the yaw error, and are the angular velocities of the left and right rudders, is the roll angle, is the rotor speed factor, is the compensation coefficient of each compensation amount; Roll angular velocity and roll angle are directly obtained from the attitude sensor; Roll control amount is the output of the angular velocity loop PID controller in the cascade PID double-loop attitude control architecture; Yaw error is the difference between the expected yaw angle and the actual yaw angle obtained from the attitude sensor; Angular velocities of left and right rudders , are obtained according to the left and right rudder angle control instructions output by the flight control system, by calculating the rate of change of the instructions in the adjacent control period; Rotor speed factor is estimated by the motor throttle control instruction output by the flight control system.
[0025] In this embodiment, to reduce the system cost, the rotor speed factor The acquisition of the rotor speed factor does not depend on an additional speed sensor, but is estimated by the motor throttle control command output by the flight control system. Specifically, the average of the left and right motor throttle command values is taken, and it is normalized from the actual PWM range to the [0, 1] interval. The resulting dimensionless number is the rotor speed factor . This factor effectively characterizes the relative trend of the rotor speed and is sufficient for the coupling compensation calculation of the gyroscopic effect.
[0026] The application constructs a five-layer real-time decoupling compensation algorithm, which reduces the roll-yaw coupling effect from different physical principles in all directions: thus the unmanned aerial vehicle has significant advantages in performance, cost and reliability: in terms of control performance, the roll-yaw coupling interference is reduced by more than 70%, the attitude stabilization time is shortened by 40%, the anti-interference ability is improved by 50% and the steady-state error is less than ±1°; in terms of cost and efficiency, only conventional sensors and actuators are required, no additional decoupling hardware is required, and the physical meaning of the parameters is clear, which reduces the debugging time by 60%; in terms of reliability, the oscillation divergence caused by coupling is effectively eliminated, it is suitable for various flight environments and task modes, and it has good fault tolerance to sensor noise and actuator errors.
[0027] The height data of the unmanned aerial vehicle is collected by selecting a height measurement sensor. In this embodiment, an HC-SR04 ultrasonic ranging module is used as the height measurement sensor. This module can measure distances within a range of 2cm to 400cm. The measurement data is obtained through the GPIO interface of the STM32F103 single-chip microcomputer to get the echo time. The STM32F103 single-chip microcomputer calculates the sound wave propagation time to obtain the height data of the unmanned aerial vehicle.
[0028] Then, based on the height data, the velocity data in the height direction is obtained through differentiation and mean filtering. The formula is as follows: ; Wherein, is the filtered velocity data in the height direction, is the original velocity data in the height direction. Based on the height data and the velocity data in the height direction, a cascade PID double-loop height control architecture is constructed: the height loop is the outer loop and the velocity loop is the inner loop. The output of the outer loop is the expected input of the inner loop, which realizes the control of the height of the unmanned aerial vehicle.
[0029] A safety protection mechanism is designed to ensure the smooth flight state of the unmanned aerial vehicle. As a preferred embodiment, in this embodiment, the safety protection mechanism is specifically: The remote control signal is continuously monitored by the flight control system of the unmanned aerial vehicle. When it is determined that the signal is lost for more than a set time threshold T1, the protection mechanism is automatically triggered: first, the height holding mode is switched in, based on the cascade PID double-loop height control architecture, the actual height at the time of triggering the protection mechanism is taken as the target height, the current height is maintained and the attitude is kept; the remote control signal is continuously monitored in the height holding mode, if the signal is restored within the set time threshold T2, the height protection model is exited and the unmanned aerial vehicle flies normally; if the signal is still not restored after the waiting time exceeds the set time threshold T2, the autonomous forced landing mode is entered, the expected angle of the attitude control is all set to zero through the cascade PID double-loop attitude control architecture, and then the unmanned aerial vehicle is controlled to descend to the ground at a constant speed through the cascade PID double-loop height control architecture, so as to prevent the unmanned aerial vehicle from being lost or crashing.
[0030] The safety protection mechanism is combined with the aforementioned lightweight and high-impact-resistant body design, which significantly improves the reliability and practicality of the system, so that the unmanned aerial vehicle has higher safety margin and cost performance in complex application environment.
[0031] The hardware circuit schematic diagram is perfected and the printed circuit board (PCB) is drawn, and then the unmanned aerial vehicle flight control board is obtained by welding components. In the embodiment, the unmanned aerial vehicle adopts a modular integration scheme, including a main control chip, an MPU6050 sensor, an HC06 Bluetooth communication module, an OLED display module, an HC-SR04 ultrasonic ranging module, and a driving circuit. The MPU6050 sensor, the HC06 Bluetooth communication module, the OLED display module, and the HC-SR04 ultrasonic ranging module serve as the perception system and the interaction system of the unmanned aerial vehicle, wherein: The main control chip selects an STM32F103 single-chip microcomputer, which has a 72MHZ main frequency and contains many peripheral resources such as timers, serial ports, IIC communication, and GPIO. Compared with the STM32F4 series chip, the chip price is more affordable. The main control chip also needs to provide peripheral circuits such as crystal oscillator circuit, reset circuit, and download circuit to support its normal work. In the embodiment, the reset circuit utilizes the properties of the charging conduction and the full-power cutoff of the capacitor to realize the key reset and power-on reset functions of the single-chip microcomputer. The crystal oscillator circuit uses an 8MHZ quartz crystal oscillator as a crystal oscillator element to provide a crystal oscillator signal and configures a starting capacitor to perform resonance matching, phase compensation, amplitude limitation, and noise suppression. The download circuit adopts the SW wiring mode, uses SWIO as the data transmission pin and SWCLK as the clock signal pin to realize program download of the single-chip microcomputer through the ST-Link downloader.
[0032] The HC06 Bluetooth module is composed of an HC06 Bluetooth chip and a corresponding peripheral circuit; the HC-06 Bluetooth module is a serial port transparent transmission wireless communication module based on the Bluetooth 2.0+EDR standard, is widely used in short-distance data transmission scenarios, is especially suitable for embedded systems and single-chip microcomputer projects, has a theoretical communication distance of 10 m, has a working voltage of 3.3V-6V, adopts a serial communication protocol, and communicates through two serial port pins RX and TX. The RX and TX pins are connected to the PA9 and PA10 pins of the STM32F103 single-chip microcomputer.
[0033] The MPU6050 module serves as a core attitude sensor, communicates with the master control chip STM32F103C8T6 through an I2C bus, has its SCL pin connected to PB13 of the master control and its SDA pin connected to PB12, and is powered by a 3.3V power supply; the module is internally provided with a 3-axis gyroscope and a 3-axis accelerometer, supports a DMP (digital motion processor) function, and can realize fusion calculation of raw angular velocity and linear acceleration data.
[0034] The OLED display module is connected to the pins of the unmanned aerial vehicle master control chip based on an SCK / SDA bus, is independently powered by a 3V3 / GND double-line circuit to support dynamic display output, the HC-SR04 ultrasonic ranging module takes PB0 of the STM32F103 single-chip microcomputer as a Trig trigger pin and PB1 as an Echo echo pin, the brushless motor drive interface defines PA0-PA1 digital PWM control ports corresponding to independent speed control of the brushless motor, and the rudder control interface defines PA2-PA3 digital PWM control ports for driving two ES08MA digital rudders to realize motor tilt angle adjustment; all functional modules form a topological structure through a pre-defined pin mapping relationship, guarantee signal integrity, meet the modular development specification of the embedded system, and do not need secondary design of external circuit.
[0035] The double-channel brushless motor drive circuit constitutes the power system of the unmanned aerial vehicle, that is, two 2212 type brushless motors and two 40A brushless electronic speed controllers constitute the core drive unit, each electronic speed controller is connected to the STM32F103 minimum system circuit board through a PWM control interface, and corresponds to an independent control channel of the left and right rotor motors; each electronic speed controller supports a continuous working current of 40A and a short-time peak current of 55A, fully meets the driving requirements of the 2212 brushless motor under high load working conditions, and provides sufficient current margin to cope with sudden wind disturbance and instantaneous power requirements during rapid maneuvering flight; and integrates a triple safety protection mechanism, including overcurrent protection (threshold 55A±5%), overheat protection (120°C automatic shutdown) and low voltage protection (10.5V cutoff), to ensure reliable operation under high dynamic flight conditions of the horizontal double-rotor.
[0036] According to the above-mentioned sensing system, interaction system and driving circuit, the schematic diagram file of the remote controller and the unmanned aerial vehicle can be drawn by using EDA software. After obtaining the schematic diagram file, design rule check (DRC) is performed. After the design rule check is correct, the schematic diagram file is converted into a PCB file to draw the PCB file of the remote controller and the unmanned aerial vehicle. According to the PCB file, the board is manufactured, soldered and subjected to design rule check, so as to obtain the flight control board of the unmanned aerial vehicle.
[0037] After obtaining the flight control board, the control program is compiled and burned into the flight control board. Through ground experiments and flight tests, the PID parameters of the attitude loop of the unmanned aerial vehicle and the compensation coefficients of the real-time decoupling compensation are debugged layer by layer. In the embodiment, the ground experiments and flight tests, and the layer-by-layer debugging of the PID parameters of the attitude loop of the unmanned aerial vehicle and the compensation coefficients of the real-time decoupling compensation specifically include: First, the overall stability of the unmanned aerial vehicle is ensured. In the embodiment, the cross-row double-rotor unmanned aerial vehicle is fixed on a debugging rack, and a basic throttle value (slightly higher than the hovering throttle) is set to ensure the overall problem of the unmanned aerial vehicle. The PID parameters of the pitch angle channel and the roll angle channel in the cascade PID double-loop attitude control architecture are debugged. Without introducing real-time decoupling compensation, each attitude angle channel has stable basic control performance. Specifically: First, the pitch angle PID parameters in the cascade PID double-loop attitude control architecture are debugged. A small initial value is set for the proportional coefficient Kp of the pitch angle outer loop, and then the proportional coefficient Kp of the pitch angle inner loop is continuously increased until the unmanned aerial vehicle pitch angle is stable and slightly oscillates. The unmanned aerial vehicle has a large resistance and the pitch angle can quickly return to normal (indicating that the debugging of the outer loop proportional coefficient is basically completed). Then, the differential coefficient Kd of the pitch angle inner loop is debugged in sequence (so that the unmanned aerial vehicle no longer oscillates, but the pitch angle of the unmanned aerial vehicle has a certain steady-state error), and the integral coefficient Ki is debugged (which can eliminate the steady-state error). Finally, the differential coefficient Kd and the integral coefficient Ki parameters of the pitch angle outer loop are slightly debugged to optimize the stability. Then, the roll angle PID parameters are debugged, and the debugging process refers to the pitch angle PID parameters.
[0038] Under the premise of the stability of the roll angle channel PID parameters, real-time decoupling compensation is introduced, and based on the physical mechanism of the roll-yaw coupling of the cross-row dual-rotor, each compensation coefficient is debugged, including the gyro coupling compensation coefficient (debugging the coefficient to compensate for the gyro precession effect, and observing the stability of the yaw angle during the roll movement), the feedforward compensation coefficient (debugging the coefficient to reduce the feedforward interference of the roll control on the yaw channel), the feedback compensation coefficient (debugging the coefficient to compensate for the yaw cumulative error caused by continuous roll movement), the dynamics compensation coefficient (debugging the coefficient to compensate for the delay of the actuator dynamic response), and the roll-yaw coupling compensation coefficient (debugging the coefficient to compensate for the direct coupling effect of the roll angular velocity on the yaw). Each compensation coefficient starts from zero initial value (or significantly smaller than the threshold range for generating compensation effect), and is debugged by gradually adjusting a single compensation coefficient. The response characteristics of the yaw angle are used as the unified evaluation object during the debugging process.
[0039] In this embodiment, each compensation coefficient is not directly calculated or set, but is adjusted according to the specific physical coupling phenomenon (such as gyro precession, feedforward interference, steady-state error accumulation, actuator delay, and aerodynamic direct coupling) corresponding to each compensation item. During the debugging process, the yaw channel response of the UAV under specific test movements (such as step roll, continuous roll, and attitude holding) is observed to determine whether the coupling is suppressed, and the coefficient value is adjusted accordingly. After all the coefficients are preliminarily determined, overall flight performance optimization and fine-tuning are performed. Through the above debugging method, an optimized compensation coefficient suitable for the cross-row dual-rotor UAV proposed in this application can be determined, thereby realizing high-precision real-time dynamic decoupling control without increasing hardware costs.
[0040] In this embodiment, each compensation coefficient starts from zero initial value (or significantly smaller than the threshold range for generating compensation effect), and is debugged by gradually adjusting a single compensation coefficient. The response characteristics of the yaw angle are used as the unified evaluation object during the debugging process. Specifically: The initial value of each compensation coefficient is set to zero, and each single compensation coefficient is gradually increased for debugging, while the remaining compensation coefficients remain unchanged. The increment of each debugging is selected according to the sensitivity of the corresponding physical quantity change to the yaw response. During the debugging process, the response characteristics of the yaw angle are used as the unified evaluation object, and the determination standard for whether the debugging of different compensation coefficients is completed is: For the gyro coupling compensation coefficient, the correlation between the roll angular velocity and the yaw response is directly used for debugging. When the same direction drift trend of the yaw angle with the roll angular velocity is significantly weakened during continuous or rapid roll movement, and the drift speed no longer increases significantly with the increase of the roll angular velocity, it is determined that the debugging of the compensation coefficient is completed. For the feedforward compensation coefficient, its tuning is based on the yaw transient response caused by the change of roll control amount. When the instantaneous deviation peak of yaw angle is significantly reduced with the increase of compensation coefficient, and no additional oscillation or reverse overshoot is introduced when the roll control input is applied, it is determined that the tuning of the compensation coefficient is completed. For the feedback compensation coefficient, its tuning is directly based on the accumulation characteristics of yaw error over time. When the yaw error no longer presents continuous one-way accumulation under constant roll attitude or repeated roll operation conditions, and can converge to a stable range within a limited time, it is determined that the tuning of the compensation coefficient is completed. For the dynamics compensation coefficient, its tuning is based on the correlation between the change of rudder angular velocity and the dynamic characteristics of yaw response. When the phase lag and dynamic lag of yaw response under roll excitation conditions are significantly reduced, and the system dynamic stability is not reduced, it is determined that the tuning of the compensation coefficient is completed. For the roll-yaw coupling compensation coefficient, its tuning is based on the residual oscillation and static deviation of yaw caused by the change of roll angular velocity and roll angle. When the residual oscillation amplitude and static deviation of yaw angle are significantly reduced under different roll angles and roll maneuvers, and are not significantly amplified with the change of roll state, it is determined that the tuning of the compensation coefficient is completed.
[0041] After the tuning of the compensation coefficients is completed, the PID parameters of the yaw angle channel are cooperatively retuned: under the condition of applying roll disturbance, the PID parameters of the outer loop and inner loop of the yaw angle are optimized to ensure that the yaw control still has good dynamic response and steady-state accuracy under the decoupling compensation effect; Finally, the overall debugging is performed: the PID controllers of the three attitude angle channels and the real-time decoupling compensation module are simultaneously run, and the PID parameters and compensation coefficients are fine-tuned under complex maneuvering conditions until the system realizes stable and coordinated overall attitude control under the premise that the coupling disturbance of each axis is significantly reduced.
[0042] In addition, after the design of the unmanned aerial vehicle flight control board is completed, a matching remote controller also needs to be designed. In the embodiment, the power supply circuit of the remote controller adopts a simple direct connection design, which directly provides power by four 5# dry batteries (nominal voltage 6V) without additional voltage stabilizing or step-down circuit. The circuit core includes a single-pole single-throw toggle switch for controlling the on-off of the power supply, and a 2-pin terminal H4 as a battery input interface, with 1 pin connected to the positive electrode of the battery (VIN) and 2 pin connected to the negative electrode of the battery (GND). This design simplifies the circuit structure, reduces cost and power consumption, and at the same time realizes power management of the remote controller main control unit through a physical switch, meeting the basic operation requirements.
[0043] The remote sensing circuit of the remote controller mainly consists of two potentiometers REM1 and REM2. The REM1 potentiometer is a throttle potentiometer, which is used to provide the unmanned aerial vehicle throttle signal and the expected yaw angle signal; the REM2 potentiometer is a direction potentiometer, which is used to provide the unmanned aerial vehicle pitch angle and roll angle signal; the output pins of the potentiometers are respectively connected to the PA0~PA3 pins of the STM32 single-chip microcomputer; the single-chip microcomputer converts the analog signals of the potentiometers into digital signals through the A / D conversion function for processing. The key circuit of the remote controller consists of 10 key modules (SW1~SW10), and the single-chip microcomputer realizes different key functions of the unmanned aerial vehicle by detecting whether the corresponding keys are pressed. It includes the adjustment of PID parameters, the fine adjustment of the unmanned aerial vehicle attitude and the fine adjustment of the unmanned aerial vehicle hovering throttle. The key circuit can greatly facilitate the later debugging of the PID parameters of the unmanned aerial vehicle, and the remote wireless parameter adjustment can be realized through the remote controller instead of burning the program one time after another.
[0044] The main control chip of the remote controller also consists of an STM32F103 single-chip microcomputer and supporting reset, crystal oscillator and other circuits. After completing the design of the remote controller circuit schematic, the same way as the unmanned aerial vehicle flight control board is adopted to sequentially draw the schematic and PCB, and the PCB file is used for plate making. Finally, the corresponding components are purchased to weld the unmanned aerial vehicle flight control board and the remote controller circuit board, and after welding, the unmanned aerial vehicle motor, shell and flight control board and other components are assembled to obtain the final unmanned aerial vehicle physical diagram and remote controller physical diagram as shown in Figure 2 、 Figure 3
[0045] The design method of the unmanned aerial vehicle proposed in the present application has been introduced, and according to the above design method, a high-precision constant-height cross-column dual-rotor unmanned aerial vehicle based on cascade PID and real-time decoupling control can be obtained, which comprises: a main control unit, a modular perception interaction unit and a cross-column dual-rotor power attitude execution unit; The main control unit is a low-cost single-chip microcomputer chip; The modular perception interaction unit is electrically connected to the main control unit through a standardized interface, and the modular perception interaction unit comprises an attitude sensor, a height measurement sensor, a Bluetooth communication module and an OLED display module; The cross-column dual-rotor power attitude execution unit comprises symmetrically arranged double brushless motors, a matching brushless electronic governor and a rudder, the double brushless motors are arranged along the transverse axis of the fuselage, and the rudder is connected to the double brushless motors in linkage; The main control unit is built-in with a control program compiled based on the above design method, which can realize the calculation of attitude angle and angular velocity, cascade PID double-loop attitude / height control, real-time roll-yaw decoupling compensation and safety protection mechanism. The parameters of the cross-column dual-rotor unmanned aerial vehicle are shown in Table 1 as follows: Table 1 Parameters of the dual-rotor unmanned aerial vehicle Parameter Configuration and description Master chip STM32F103C8T6 Attitude sensor MPU6050 Height sensor height accuracy HC-SR04 ultrasonic sensor 1 cm Communication mode Serial, IIC communication Control mode Remote control control Motor parameters 14060 rpm at 14.8V, 2212 brushless motor Servo parameters ES08MA digital micro servo Paddle parameters 9450 positive and negative paddle Battery parameters 2300mAh / 14.8V / 45C / 4S polymer lithium battery Maximum endurance 10 minutes Download debugging ST-Link downloader In addition, the application also discloses an electronic device comprising a memory and a processor, wherein: a memory for storing a computer program capable of running on the processor; the processor is used for executing the high-precision constant-height cross-column dual-rotor unmanned aerial vehicle design method based on cascade PID and real-time decoupling control when the computer program is run.
[0046] The application also discloses a computer readable storage medium storing computer instructions for enabling the processor to implement the high-precision constant-height cross-column dual-rotor unmanned aerial vehicle design method based on cascade PID and real-time decoupling control when the computer instructions are run.
[0047] To sum up, the application proposes a high-precision constant-height cross-column dual-rotor unmanned aerial vehicle based on cascade PID and real-time decoupling control and a design method thereof, which can realize accurate attitude control of the unmanned aerial vehicle by the cascade PID double-loop control algorithm combined with the real-time decoupling compensation mechanism, eliminate the roll-yaw coupling effect of the cross-column dual-rotor unmanned aerial vehicle, and design a multiple safety protection mechanism, so that the unmanned aerial vehicle has high control precision and safety. The application adopts a brushless motor as a driving motor, matches a high-performance brushless motor governor, and constructs an efficient power system. The flight control hardware of the application has low cost, is modularized, integrates multiple sensor modules, and is equipped with the cascade PID double-loop control algorithm and the real-time decoupling compensation strategy, so that the unmanned aerial vehicle has stable flight performance, reliable safety guarantee and excellent cost performance advantage, and effectively solves the problems of serious coupling of the traditional cross-column dual-rotor and insufficient control precision.
[0048] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in combination with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in any one or more embodiments or examples. In addition, the skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.
[0049] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of executable instructions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions, or a combination of the above.
[0050] The above embodiments introduce the present application in detail, the principles and embodiments of the present application are described by applying specific examples, the above example is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific embodiment and application range will be changed, and the above description should not be understood as the limitation of the present application.
Claims
1. A design method for a high-precision, constant-altitude, tandem-rotor UAV based on cascade PID control and real-time decoupling control, characterized in that, Specifically, the following steps are included: Configure the hardware and software development environment for the UAV system, including circuit design and manufacturing environment, embedded software development environment, and program burning and debugging environment; Design a drone with a tandem dual-rotor configuration; The selection of lithium battery for powering the drone is determined based on the overall weight, motor current requirements, and preset thrust-to-weight ratio. The attitude angle and angular velocity data of the UAV are acquired by attitude sensors. Based on the attitude angle and angular velocity data, a cascade PID dual-loop attitude control architecture is constructed: the angle loop is the outer loop and the angular velocity loop is the inner loop. The output of the outer loop is used as the expected input of the inner loop. The output of the inner loop is then superimposed with a real-time decoupling compensation designed for the roll-yaw coupling effect. The attitude of the UAV is controlled by a combination of motor differential speed and servo motor control. An altitude measurement sensor is selected to collect the drone's altitude data. Based on the altitude data, the velocity data in the altitude direction is obtained after differentiation and mean filtering. Based on the altitude data and the velocity data in the altitude direction, a cascaded PID dual-loop altitude control architecture is constructed: the altitude loop is the outer loop and the velocity loop is the inner loop. The output of the outer loop is used as the desired input of the inner loop to achieve the control of the drone's altitude. Design a safety protection mechanism to ensure stable flight of the drone; Complete the hardware circuit schematic and draw the printed circuit board (PCB), and then complete the component soldering to obtain the drone flight control board; The control program was compiled and burned to the flight control board. Through ground experiments and flight tests, the PID parameters of the UAV attitude loop and the compensation coefficients of the real-time decoupling compensation were adjusted in layers. Finally, the altitude loop parameters were fine-tuned and the overall system performance was optimized during the free flight of the UAV.
2. The design method for a high-precision constant-altitude tandem dual-rotor UAV based on cascade PID and real-time decoupling control according to claim 1, characterized in that, The tandem dual-rotor configuration of the UAV: The overall fuselage structure adopts a modular assembly method. The main body of the fuselage features a streamlined design and houses a battery compartment, flight control mounting platform, and cable channels. Two rotors are symmetrically arranged along the transverse axis of the fuselage, with their rotation planes parallel and rotating in opposite directions. The distance between the left and right rotors is determined based on the principles of minimizing airflow interference and prioritizing lateral stability. Two brushless motors and two brushless ESCs are adapted to the two rotors to form the power system, providing lift for the UAV. Each brushless motor is rigidly connected to a digital servo via motor brackets on both sides of the fuselage. The two digital servos are mounted on servo mounting platforms on both sides of the fuselage. The servo output shafts are connected to the motor brackets via a 3D-printed custom mechanism. Real-time adjustment of the motor angle by the servos, combined with the differential control of the dual rotors, enables attitude control of the UAV.
3. The design method for a high-precision constant-altitude tandem dual-rotor UAV based on cascade PID and real-time decoupling control according to claim 1, characterized in that, The specific steps for acquiring the attitude angle and angular velocity data of the UAV through the attitude sensor are as follows: A 6-axis motion processing sensor was selected as the attitude sensor to calculate the angular velocity of the UAV. The digital motion processor (DMP) built into the attitude sensor was used to integrate the angular velocity data of the UAV and the linear acceleration data measured by the accelerometer, and Mahony complementary filtering was performed to calculate the quaternion data of the UAV in real time. Based on the quaternion rotation formula, the direction of gravity in the world coordinate system is rotated to the UAV body coordinate system to obtain the gravity projection onto the body coordinate system. Combining the gravity components of each axis and the quaternion data, the attitude angles of the UAV are calculated, including the yaw angle, pitch angle and roll angle.
4. The design method for a high-precision constant-altitude tandem dual-rotor UAV based on cascade PID and real-time decoupling control according to claim 3, characterized in that, The real-time decoupling compensation designed for the roll-yaw coupling effect includes gyro coupling compensation. Feedforward compensation Feedback decoupling compensation Dynamic compensation Roll-yaw coupling compensation ,in: The gyro coupling compensation is calculated based on roll rate and rotor speed factor to counteract the precession effect of the rotor gyroscope; the formula is expressed as: ; The feedforward compensation is calculated based on the roll control input to predict the interference of roll control on the UAV's yaw; the formula is expressed as: ; The feedback decoupling compensation is based on yaw error calculation and is used to eliminate accumulated yaw error; the formula is expressed as: ; The dynamic compensation is based on the angular velocities of the left and right servos, used to adapt to servo response delay; the formula is expressed as: ; The roll-yaw coupling compensation is calculated based on roll rate and roll angle to suppress the direct coupling effect of roll rate and roll angle on yaw; the formula is expressed as: ; Total decoupling compensation The sum of all compensations, i.e. ; In the formula, The roll rate is angular velocity. For roll control, For yaw error, and These are the angular velocities of the left and right servos, respectively. For roll angle, For rotor speed factor, The compensation coefficients for each compensation amount; Roll rate With roll angle Obtained directly from the attitude sensor; Roll control amount The output of the angular velocity loop PID controller in the cascaded PID dual-loop attitude control architecture; Yaw error The difference between the desired yaw angle and the actual yaw angle calculated by the attitude sensor; Left and right servo angular velocity , Based on the left and right servo angle control commands output by the flight control system, the rate of change of the commands in adjacent control cycles is calculated. Rotor speed factor The value is estimated by the motor throttle control command output by the flight control system.
5. The design method for a high-precision constant-altitude tandem dual-rotor UAV based on cascade PID and real-time decoupling control according to claim 1, characterized in that, The security protection mechanism is specifically as follows: The drone's flight control system continuously monitors the remote control signal. When the signal loss exceeds a set time threshold T1, a protection mechanism is automatically triggered: First, it switches to altitude hold mode, using a cascaded PID dual-loop altitude control architecture to maintain the current altitude and attitude, with the actual altitude at the time the protection mechanism is triggered as the target altitude. In altitude hold mode, the remote control signal is continuously monitored. If the signal recovers within a set time threshold T2, the drone exits the altitude protection mode and flies normally. If the signal does not recover after a waiting period exceeding the set time threshold T2, the drone enters autonomous forced landing mode. First, the desired angles for attitude control are set to zero using a cascaded PID dual-loop attitude control architecture. Then, the drone is controlled to descend to the ground at a constant speed using a cascaded PID dual-loop altitude control architecture to prevent it from flying away or crashing.
6. The design method for a high-precision constant-altitude tandem dual-rotor UAV based on cascade PID and real-time decoupling control according to claim 1, characterized in that, The specific steps of adjusting the PID parameters and real-time decoupling compensation coefficients of the UAV attitude loop through ground experiments and flight tests include: First, ensure the overall stability of the UAV. Then, perform basic debugging on the PID parameters of the pitch and roll channels in the cascaded PID dual-loop attitude control architecture to ensure that each attitude angle channel has stable basic control performance without introducing real-time decoupling compensation. Under the premise that the PID parameters of the roll angle channel are stable, the PID parameters of the yaw angle channel are initially set, and real-time decoupling compensation is introduced. Based on the physical mechanism of roll-yaw coupling of tandem dual rotors, each compensation coefficient is adjusted item by item: each compensation coefficient starts from zero initial value and is adjusted step by step using a single compensation coefficient. The response characteristics of the yaw angle are used as the unified evaluation object in the adjustment process. After the compensation coefficient is adjusted, the PID parameters of the yaw angle channel are re-adjusted for compatibility: under the condition of applying roll disturbance, the PID parameters of the outer and inner loops of the yaw angle are optimized to ensure that the yaw control still has good dynamic response and steady-state accuracy under the decoupling compensation effect. Finally, overall integration testing is performed: the PID controllers and real-time decoupling compensation modules of the three attitude angle channels are run simultaneously, and the parameters and compensation coefficients of each PID are fine-tuned under compound maneuvering conditions until the system achieves stability and coordination of overall attitude control under the premise that the coupling interference of each axis is significantly reduced.
7. The design method for a high-precision constant-altitude tandem dual-rotor UAV based on cascade PID and real-time decoupling control according to claim 6, characterized in that, Each compensation coefficient is initially set to zero and is adjusted gradually using a single compensation coefficient. The adjustment process uses the yaw angle response characteristics as the unified evaluation object. Specifically: The initial value of each compensation coefficient is set to zero. Each time, a single compensation coefficient is gradually increased for adjustment, while the other compensation coefficients remain unchanged. The increment for each adjustment is selected based on the sensitivity of the physical quantity change corresponding to the compensation coefficient to the yaw response. During the commissioning process, the response characteristics of the yaw angle are used as the unified evaluation object. The criteria for determining whether commissioning with different compensation coefficients is complete are as follows: For the gyro coupling compensation coefficient, it is directly adjusted based on the correlation between roll rate and yaw response. When the yaw angle drifts in the same direction as the roll rate during continuous or rapid roll motion is significantly weakened and the drift speed no longer increases significantly with the increase of roll rate, the compensation coefficient is judged to be adjusted. For the feedforward compensation coefficient, its adjustment is based on the yaw transient response caused by the change of roll control quantity. When the instantaneous offset peak of the yaw angle decreases significantly as the compensation coefficient increases when the roll control input is applied, and no additional oscillation or reverse overshoot is introduced, the compensation coefficient is judged to be adjusted successfully. For the feedback compensation coefficient, its adjustment is directly based on the cumulative characteristics of yaw error over time. When the yaw error no longer shows continuous unidirectional accumulation under constant roll attitude or repeated roll operation conditions, but can converge to a stable range within a finite time, the adjustment of the compensation coefficient is determined to be complete. The dynamic compensation coefficient is adjusted based on the correlation between the change of servo angular velocity and the dynamic characteristics of yaw response. When the phase lag and dynamic hysteresis of yaw response under roll excitation conditions are significantly reduced and the dynamic stability of the system is not reduced, the adjustment of the compensation coefficient is considered complete. The roll-yaw coupling compensation coefficient is adjusted based on the residual oscillation and static deviation of yaw caused by changes in roll angular velocity and roll angle. When the residual oscillation amplitude and static deviation of yaw angle are significantly reduced under different roll angles and roll maneuver conditions, and do not increase significantly with changes in roll state, the compensation coefficient is considered to be adjusted successfully.
8. A high-precision, altitude-fixed, tandem dual-rotor UAV based on cascade PID control and real-time decoupling control, characterized in that... include: Main control unit, modular perception and interaction unit, and tandem dual-rotor power attitude execution unit; The main control unit is a low-cost single-chip microcomputer. The modular sensing and interaction unit is electrically connected to the main control unit through a standardized interface, and the modular sensing and interaction unit includes an attitude sensor, a height measurement sensor, a Bluetooth communication module, and an OLED display module. The transverse dual-rotor power attitude execution unit includes two symmetrically arranged brushless motors, matching brushless ESCs and servos. The two brushless motors are arranged along the transverse axis of the fuselage, and the servos are linked to the two brushless motors. The main control unit has a built-in control program compiled based on the design method described in any one of claims 1-7, which can realize attitude angle and angular velocity calculation, cascaded PID dual-loop attitude / altitude control, real-time roll-yaw decoupling compensation, and safety protection mechanism.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, wherein: Memory is used to store computer programs that can run on a processor; A processor is configured to, when running the computer program, execute the design method for a high-precision constant-altitude tandem dual-rotor UAV based on cascade PID and real-time decoupled control as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause the processor to execute and implement, as described in any one of claims 1-7, a design method for a high-precision, fixed-altitude, tandem-rotor UAV based on cascaded PID and real-time decoupled control.