Research on Attitude Detection and Flight Experiment of Coaxial Twin-Rotor UAV

Aiming at the problem that the single sensor of the coaxial UAV cannot accurately measure attitude information, a pose estimation algorithm based on unscented Kalman filter information fusion is proposed. The kinematics and dynamics characteristics of coaxial folding twin-rotor UAV are studied, and a mathematical model is established. The common attitude estimation methods are analyzed, and the extended Kalman filter algorithm and unscented Kalman filter algorithm are established. In order to complete the test of the prototype of a small coaxial twin-rotor UAV, a test platform for the dynamic performance and attitude angle of the semi-physical flight of the UAV was established. The platform can analyze the mechanical vibration, attitude angle and noise of the aircraft. It can also test and analyze the characteristics of the mechanical vibration and noise produced by the UAV at different rotor speeds. Furthermore, the static and time-varying trends of the pitch angle and yaw angle of the Kalman filter attitude estimation algorithm is further analyzed through static and dynamic experiments. The analysis results show that the attitude estimation of the UKF is better than that of the EKF when the throttle is between 0.2σ and 0.9σ. The error of the algorithm is less than 0.6°. The experiment and analysis provide a reference for the optimization of the control parameters and flight control strategy of the coaxial folding dual-rotor aircraft.


Introduction
The measurement accuracy of the attitude information of a coaxial UAV directly affects the navigation accuracy of the speed and position. The gyroscopes, accelerometers and magnetometers are often used as attitude measurement devices. Gyroscopes have cumulative errors, while accelerometers and magnetometers are subject to greater external interference. Effective data fusion is required to ensure a more accurate attitude horn. The flight principle of coaxial twin-rotors is similar to that of a common helicopter. Two coaxial blades with the same diameter, but rotating in opposite directions, are used to control the pitching and rolling attitude of the aircraft by changing the pitch of the tilting disk. However, unlike helicopters, coaxial twin-rotors cancel the tail rotor used to balance the yawing moment on the helicopter and realize the yawing motion of the aircraft through the differential control of the twin-rotors. With the continuous development of power, automatic control and micro-system technology, multi-axis rotor aircraft represented by four-axis rotors have achieved great success. Rotors have been widely used in consumer drones, plant protection, aerial photography and other industries [1][2][3].
The UAV has the advantages of small size and high aerodynamic efficiency. However, the inner and outer shafts of the coaxial upper and lower rotors are commutated by the bevel gear of the main reducer. It has a complex structure and control mechanism, as well as complicated vibration characteristics and nonlinearity. The helicopter rotor rotation test-bed designed by Wu Zhigang is used to measure the noise when the rotor rotates. The anechoic chamber creates a completely anechoic test environment without affecting the rotor flow field, which can meet the test requirements of the model rotor noise radiation characteristics of the helicopter main rotor and tail rotor, and provides an ideal test facility for studying helicopter rotor noise. Zhang Donglin analyzed the inherent characteristics and sensitivity of coaxial counter-rotating closed differential gear trains. The correctness of the theoretical analysis is verified by an example calculation, which provides a basis for the inherent characteristic analysis and optimal design of coaxial counter-rotating closed differential gear trains. An experimental study by Prasad Rao Jubilee analyzes the influence of the different motor duty ratio and propeller pitch value on motor propeller systems with two to four coaxial rotors. The results show that, in the dual-rotor coaxial system, in order to reduce the adverse effects of the front rotor backwashing and run at the best performance, only the initial work of the rear motor should reach 75% duty cycle before the front motor reaches 75% duty cycle. Additional thrust requirements should be generated from the rear rotor and then from the front rotor until its maximum duty cycle [4].
The yawing of UAVs is realized by the differential speed of the upper and lower propellers in producing different torques. The up-and-down power of the UAV is transmitted by gear reduction transmission. Therefore, the mechanical noise and vibration of an unmanned aerial vehicle (UAV) in flight are inevitable. This noise and vibration will have great influence on MEMS accelerometers and sensors. The UAV's attitude and control are directly affected during actual flight. Consequently, an effective data filtering method can better control the attitude of the UAV, and then the position information of the UAV can be determined in order to control the UAV to fly autonomously. Adam Bondyra introduced the development of a comprehensive data-driven FDI method for the rotor failure of multi-rotor UAV. The algorithm aims at early detection of damaged rotor faults, which lead to the decline of flight stability, decrease the safety of UAV operation and increase the power consumption of the power train. The paper analyzes the kinematics and dynamics characteristics for the coaxial attitude estimation method and establishes a hardware-in-the-loop simulation attitude angle test platform to analyze the mechanical vibration and attitude angle performance of UAVs. For the experimental analysis of the mechanical vibration characteristics of different rotor speeds, the EKF and UKF filtering algorithm models are established, and the trend of attitude changes over time is verified in static and dynamic conditions, respectively. The UKF attitude estimation method is better than the EKF attitude estimation method, and the test flight experiment verifies that the proposed algorithm has better attitude estimation results for the coaxial UAV.

Modeling of Coaxial UAV
The mathematical model of coaxial UAV is the basis of flight control and navigation method research. In order to enhance the trueness of the model in the control system simulation, a 6-DOF dynamic equation is established. In order to realize the flight balance and movement of the co-axial twin-rotor aircraft, it is necessary to have a mathematical model of the system first, and then analyze the characteristics and control of the system. Therefore, the establishment of the mathematical model has a particularly important influence on the control of the whole system [5][6][7][8]. According to the Newton Euler formula, the state equation describing the motion characteristics of the co-axial twin-propeller aircraft is derived, and the mathematical model of the aircraft is established. As can be seen from the following Figure 1, the common axis dual-rotor UAV is mainly composed of upper and lower rotors, fuselage, control panel, control mechanism and controller battery core cabin. The lift is generated by the up-and-down counter-rotor rotation of the UAV. The structural model diagram is shown in figure. The lateral movement generates the lateral force component through the tilt of the control panel, and the control quantity includes four input quantities: throttle input, roll, pitch and yaw [9,10]. The structural model diagram of coaxial twin-rotor UAVs includes the kinematic model and dynamic model, as shown in figure.  The whole system of the coaxial twin-rotor UAV is complex, and the coupling degree between modules is high. In order to better analyze the dynamics and kinematics mathematical model of coaxial twin-rotor UAVs, the coaxial twin-rotor UAV is divided into several subsystems. Formula 1 is the nonlinear model.

Dynamics Model of a Coaxial Twin-Rotor UAV
Before deriving the dynamic model of the co-axial twin-rotor UAV, it is assumed that the UAV is a rigid body, its center of mass is on the central axis of the UAV, and the whole UAV is completely symmetric. The six degrees of freedom kinematic equation and the Newton-Euler dynamic equation follow. The dynamic equation of UAV can be expressed as Equation (2).
In the abovementioned formula, ⃗ is the resultant force of the external force of the coaxial dual-rotor UAV. ⃗⃗⃗⃗ is the linear velocity at the center of mass. m is the total mass of the rotor UAV. M is the total moment of external force. L is the total momentum moment. The above-mentioned dynamic equations are obtained in the static coordinate system, but the UAV is always moving when it performs its mission; thus, the dynamic equations in the dynamic coordinate system should be considered when studying the dynamics of UAV. According to Euler's equation of motion, the absolute derivative in dynamic coordinate systems can be obtained as follows.
Combining the dynamic equation with the motion of coaxial twin-rotor UAVs, the matrix expression of its dynamics can be obtained as follows: The whole system of the coaxial twin-rotor UAV is complex, and the coupling degree between modules is high. In order to better analyze the dynamics and kinematics mathematical model of coaxial twin-rotor UAVs, the coaxial twin-rotor UAV is divided into several subsystems. Formula 1 is the nonlinear model. .

Dynamics Model of a Coaxial Twin-Rotor UAV
Before deriving the dynamic model of the co-axial twin-rotor UAV, it is assumed that the UAV is a rigid body, its center of mass is on the central axis of the UAV, and the whole UAV is completely symmetric. The six degrees of freedom kinematic equation and the Newton-Euler dynamic equation follow. The dynamic equation of UAV can be expressed as Equation (2).
In the abovementioned formula, → F is the resultant force of the external force of the coaxial dual-rotor UAV.
→ V is the linear velocity at the center of mass. m is the total mass of the rotor UAV. M is the total moment of external force. L is the total momentum moment. The above-mentioned dynamic equations are obtained in the static coordinate system, but the UAV is always moving when it performs its mission; thus, the dynamic equations in the dynamic coordinate system should be considered when studying the dynamics of UAV. According to Euler's equation of motion, the absolute derivative in dynamic coordinate systems can be obtained as follows.
Combining the dynamic equation with the motion of coaxial twin-rotor UAVs, the matrix expression of its dynamics can be obtained as follows: where V b represents the speed of the coaxial dual-rotor UAV in the body coordinate system relative to the geographic coordinate system; ω b represents the coaxial dual-rotor UAV in the body coordinate system relative to the geographic coordinate system angular velocity; I 3×3 represents the unit matrix of the moment of inertia; I represents the moment of inertia of the coaxial dual-rotor drone; F b represents the external force on the coaxial dual-rotor drone in the body coordinate system combined; M b represents the external moment that the coaxial dual-rotor UAV in the body coordinate system is combined. In order to facilitate the calculation and understanding in the future, the linear motion of the UAV is represented by the geographic coordinate system, and the attitude change of the UAV is represented by the body coordinate system. Thus, the formula above (4) can be changed as follows.
During the flight of the coaxial twin-rotor UAV, the resultant force is mainly composed of three forces, which are the lift generated by the rotation of the blades, the gravity of the UAV itself and the air resistance during the flight of the UAV. In the airframe coordinate system, the force formula of UAV is as follows in Formula (6).
where C b n is the rotation matrix. The lift generated by the upper and lower blades of the UAV is F 1 and F 2 respectively, and the direction of the generated lift is perpendicular to the blade tip. When the UAV is flying in an environment with no wind or low wind speed, the influence of air on the UAV's flight attitude can be neglected. The lift force of the UAV in hovering state is shown in Formula (7).
where F 1 , F 2 are the lift generated by the rotation of the upper and lower blades. F 2z represents the projection of the lift generated by the lower blade on the z-axis. The lift generated by the rotation of the blades can be calculated using the following formula.
where b represents the Blade lift coefficient. ω represents the rotational angular velocity of the blade.

Kinematic Model of Coaxial Twin-Rotor UAV
From the above definition, we can determine that the speed of the coaxial dual-rotor UAV in the body coordinate system is V b = [u v w] T . Convert it to the speed in the Earth coordinate system through the rotation matrix and express it as follows.
The relationship of the line motion of the drone was discussed above. Next, using the previous rotation formula to convert the angular velocity of the coaxial dual-rotor UAV in the body coordinates into the angular velocity of the geographic coordinate system is as follows. Equation (10) can also be transformed into the following.
In the kinematics model of the UAV, when the coaxial twin-rotor UAV is flying at a slow speed or hovering in the air, the air resistance of the airframe is very small and can be ignored. Moreover, because the blade selected by the UAV is made of carbon fiber, and its weight is relatively light, the gyro effect produced by the blade can be neglected, which will not affect the flight of the UAV.
The designed coaxial twin-rotor UAV is a nonlinear system with four inputs and six outputs. Its four inputs are the rotational speed of the upper and lower blades and two steering gears. In order to establish a controller for its system model and its characteristics, the system inputs are defined as Formula (12): where U 1 is the height control quantity; U 2 is the pitch control quantity; U 3 is the roll control quantity; U 4 is yaw control.
Formula (12) is merged with Formula (9) to obtain the following mathematical model of coaxial twin-rotor UAVs: Combined with the above requirements, the general nonlinear system model of coaxial UAVs is as follows.

Attitude Estimation Methods
Common attitude estimation methods include the Mahony complementary filtering algorithm, extended Kalman filtering algorithm, etc. Aiming at the structural characteristics of coaxial twin-rotor UAVs and considering the sensor noise, the extended Kalman filtering algorithm and unscented Kalman filtering algorithm models are established [11]. The established nonlinear equation is shown in Equation (15). where Considering the discretization equation of the nonlinear system, Equation (16) can be expressed as follows.
where x(k) is the state matrix of the time system at time k; z(k) is the observation matrix at time k; f (x(k), k) and h(x(k), k) are measurement state functions, which represent the predicted state of the nonlinear discrete system. Here, it is assumed that the state quantity , where x(k) includes the attitude quaternion and random drift quantity of three rotating axis gyroscopes.
In order to better analyze the data processed by the computer, the above formula is discretized by the Runge-Kutta method of order 4, and the simplified equation after discretization is as follows.
where F(k − 1) is the following expressions: Because of MEMS gyroscope drift wide randomness, compensation is not easy. Therefore, we will decide the gyroscope drift, as state variables, and quaternions together to form the final state variables.
The gyroscope random drift satisfies the following measurement value updated equation, as shown in the following formula.
The state equation of the system can be derived from the gyroscope random drift formula and the discrete quaternion state variable equation.
The system utilizes accelerometers and magnetometers to compensate for errors caused by gyro drift because the angular velocity measured by the gyroscope is used for the quaternion update. Therefore, the quaternion is calculated using the output of the accelerometer, and the magnetometer is selected as the measurement variable. If the measured values of the design accelerometer and magnetometer are, respectively, then the attitude angle calculated using the measured value is shown in the following formula. From the attitude angle Formula (23), the measured value is calculated according to the quaternion formula.
Considering noise is unavoidable in the actual environment, therefore, the observation equation of the system is as follows.
where v(k) is the observation noise of the system, H(k) is the measurement noise, the expression is as follows.
The state equation and the observation equation of the system constitute the filtering model of the system. The small coaxial unmanned helicopter is suitable for working in unknown environments. Electromagnetic radiation, hard magnetic material, soft magnetic material and other magnetic fields interfere. Magnetometers are susceptible to interference, resulting in large noise in the measured values. System noise parameters greatly affect the performance and stability of the unscented Kalman filter.

Filtering Model
The statistical characteristics of the observed noise in the system's observation equation in the framework of the UKF filter algorithm are unchanged. When the noise changes, there is some error in the model, which leads to an increase of the filter estimation error. Therefore, the accuracy of the azimuth measurement cannot be guaranteed for the coaxial UAV under interference. In order to improve the adaptive ability of the UKF algorithm to noise interference, an adaptive estimation algorithm is combined with UKF to adjust the covariance of the measured noise according to the real-time measurements of the two side variables and improve the filtering accuracy [12][13][14]. The EKF algorithm structure diagram as shown in Figure 2. Initializing the state, assuming that the initial value filter is as shown in Equation (27).
The EKF filtering step, time prediction update estimation Formula (28) is shown. Initializing the state, assuming that the initial value filter is as shown in Equation (27). The EKF filtering step, time prediction update estimation Formula (28) is shown.
In Equation (29) above, Q k is the process noise covariance matrix at time k. In the measurement update formula, P k|k−1 is the corresponding covariance matrix at time k.
where H k is the measurement Jacobian matrix at time k, and R k is the observation noise covariance matrix at time k in Equation (31).
where the K k Kalman gain is calculated andx k|k is updated by the observed variable.
x k|k =x k|k−1 + K k y k The error covariance is updated, and the measurement update equation uses the values of the observed variables to correct the state and covariance estimates. The Accord ratio matrix of the state transition matrix and the measurement matrix is shown in Equation (34).
where H k = ∂h ∂x x k|k−1 is the process Accord ratio matrix.

Adaptive Estimation of Measurement Noise
The measured value derived from the real value is often used to estimate the optimal value of the noise parameter of the system. The adaptive filtering method based on the maximum likelihood criterion can estimate the changes of the statistical characteristics of the system noise in real time through the covariance matrix of the system state and the covariance matrix of the measurement noise to ensure that the filter can adapt to the changes better. The maximum likelihood criterion is estimated from the perspective of the maximum probability of measurement occurrence, which takes into account both the change of new interest rate and the change of covariance of new interest rate [15,16]. According to the maximum likelihood criterion, the adaptive measurement noise variance matrix is satisfied in Formula (35).
where N is the number of Windows and represents the amount of new information used. In nonlinear systems, it is very difficult to calculateR k using the adaptive measurement equation formula, thus it is necessary to simplify and improve it. When N = 1, the measured value of the measurement noise covariance matrix is Formula (36). The weighted average of R + k and the predicted value R − k of the measurement noise covariance matrix at the current time is taken as the estimated value of the measurement noise covariance matrix at the current time, i.e., where µ is an adjustable parameter, and the new information sequence contributes more to the measurement noise covariance estimate. By substitutingR k in the above formula into the filtering algorithm, the measurement noise covariance matrix can be estimated in real time, and then the filtering gain can be adjusted, which is the adaptive ability of the filtering algorithm to noise changes. The parameter µ is determined by the simulation method.

Filtering Algorithm
Based on the filtering model, the principle of sensor data fusion using the adaptive UKF filtering algorithm is shown in Figure 3.
where N is the number of Windows and represents the amount of new information used. In nonlinear systems, it is very difficult to calculate using the adaptive measurement equation formula, thus it is necessary to simplify and improve it.
When N=1, the measured value of the measurement noise covariance matrix is Formula (36).
The weighted average of and the predicted value of the measurement noise covariance matrix at the current time is taken as the estimated value of the measurement noise covariance matrix at the current time, i.e., where is an adjustable parameter, and the new information sequence contributes more to the measurement noise covariance estimate. By substituting in the above formula into the filtering algorithm, the measurement noise covariance matrix can be estimated in real time, and then the filtering gain can be adjusted, which is the adaptive ability of the filtering algorithm to noise changes. The parameter is determined by the simulation method.

Filtering Algorithm
Based on the filtering model, the principle of sensor data fusion using the adaptive UKF filtering algorithm is shown in Figure 3. According to the established model and the implementation process of the UKF algorithm, the specific steps of sensor data fusion using adaptive UKF filtering are as follows.
(1) Determine the statistical characteristics of the initial filtering state [17]. It is necessary to determine the initial quaternion, the initial value of the gyroscope drift and the error covariance matrix of the initial state vector. The calculation formula is as follows. According to the established model and the implementation process of the UKF algorithm, the specific steps of sensor data fusion using adaptive UKF filtering are as follows.
(1) Determine the statistical characteristics of the initial filtering state [17]. It is necessary to determine the initial quaternion, the initial value of the gyroscope drift and the error covariance matrix of the initial state vector. The calculation formula is as follows.x (2) Select three particle sigma point sampling strategies to calculate sigma points and their weights.
The sampling strategy of proportion correction was adopted, and sigma points were selected according to the following formula. The weights of the corresponding mean expectation and variance are A and B, as follows.
where n is the state dimension, χ = α 2 (n + κ) − n, where κ is usually 0, α usually takes a very small positive number, and β has the best value of 2 in Gaussian distribution. UT transforms the approximation of the true expectation and variance.
(3) Time update. According to the choice of sigma points and weights, to determine the state variable step predictive valuex k|k−1 and step prediction error covariance matrix P k|k−1 : where Q k−1 is the system state noise covariance matrix.
(4) Measurement update. Calculate the measurement variable step forecast Z k|k−1 and variance P zk , as well as the mutual covariance matrix P x k z k .
where R k is the measurement noise covariance matrix, which is the key parameter calculated in the adaptive UKF filtering. It can be calculated by using the estimated value of the measurement noise covariance matrix. After obtaining the new quantity measurement Z k , obtain the optimal estimate of the system statex k and the state covariance matrix P k .
The Kalman filter gain is as follows.
The new rate sequence is as follows.
The optimal estimate of the system state matrix is as follows.
The state covariance matrix is as follows.

Attitude Control Test Methods
In order to complete the attitude control experiment task, a coaxial UAV experimental prototype is built by using machining and 3d printing technology. The coaxial UAV experimental prototype is composed of upper and lower rotors, fuselage, rotor structure bearing, landing gear and so on. The whole body of the prototype adopts a barrel structure shape made of carbon fiber pipe, and the power of the prototype adopts the structure of the common axis counter-rotor. The two steering engines and the aluminum alloy central shaft controlling the tilting disc maintain a plane, and the plane of the tilting disc is perpendicular to the lift force of the lower propeller of the UAV; thus, the human-machine attitude can be changed by changing the tilting angle of the tilting disc. The power part of the UAV consists of two motors and two steering gear [18,19]. The up and down propeller rotation is realized by the motor speed regulating and driving the gear transmission. The attitude control of the UAV is accomplished by two steering engines and the central axis controlling the tilt plate plane. The electronic part of the UAV is mainly composed of flight control, electrical adjustment, steering gear, receiver, data transmission, GPS and other parts. As the core control unit of the UAV, the flight control completes data fusion, attitude calculation, attitude control and position control. The receiver is responsible for the communication between the operator and the UAV, and the PPM modulation is responsible for the receiving and sending of RC remote command at the ground end [20]. Relevant parameters of the UAV and UAV test platform are shown in Table 1. In order to verify the effectiveness of the attitude control method, a complete test platform for a coaxial twin-rotor flight test prototype was built. The platform includes experimental prototype, external sensor, external processor, current regulator power supply, ground station communication system and other parameter analysis software modules [21]. As shown in the Figure 4, the flight simulation test platform of the co-axial folded twin-rotor aircraft adopts the cantilever suspension design as a whole, which saves the freedom of rotation in one direction and connects the top of the UAV with a safety rope. The universal joint of the common axis UAV base and the support rod structure is fixed, and the whole UAV and the universal joint connection part can rotate and move up and down freely. The physical measurement platform includes a pneumatic lift and power test, torque and speed test, tilt plate control angle test and vibration test. The test project can complete the test methods of lift, vibration acceleration and attitude data of the co-axial dual-rotor aircraft, and it can detect the attitude data of the UAV through the IMU of the internal flight control and the external sensor [22]. The vertical flight process of the co-axial twin-rotor aircraft is mainly affected by the aerodynamic force generated by the rotor rotation and its own gravity. The lift force of the UAV can be detected by collecting the base tension sensor. According to the analysis of the different motion states of the UAV, the change of throttle volume is adjusted to verify the influence of the vibration characteristics on IMU [23].
The experiment is divided into static and dynamic testing. Static testing mainly tests the relationship between the UAV attitude vibration acceleration and the gas volume compared with the no trace of the Kalman filtering algorithm, the Kalman filter algorithm and the gyroscope integral algorithm to solve the attitude angle. The effect of dynamic testing mainly verifies the no trace of the accuracy of the Kalman filter to solve attitude angle [24].

Test Scheme
The prototype uses an inertial measurement unit (IMU) consisting of a three-axis accelerometer, a three-axis gyroscope (MPU6500), a three-axis reluctance meter (HMC5583L) and a high-performance STM32 microprocessor. The raw data measured by the sensor are sampled with the sampling frequency of 100 Hz by the microprocessor, and the raw data are sent to the industrial control computer through the serial port without filtering. The extended Kalman filter designed by MATLAB is used to process the data on the computer in order to obtain accurate attitude information. Finally, the experimental results are shown by curve description, and the calculation results are compared and analyzed. In order to verify the effectiveness of the proposed algorithm, five groups of experiments are carried out. The measurement value of the sensor of the test system in the static state is collected through the static measurement platform, as shown in the following Figure 5. The attitude angle information is measured and collected through the inertial sensor and sent to the main controller module through the serial bus [25,26]. The experiment is divided into static and dynamic testing. Static testing mainly tests the relationship between the UAV attitude vibration acceleration and the gas volume, compared with the no trace of the Kalman filtering algorithm, the Kalman filter algorithm and the gyroscope integral algorithm to solve the attitude angle. The effect of dynamic testing mainly verifies the no trace of the accuracy of the Kalman filter to solve attitude angle [24].

Test Scheme
The prototype uses an inertial measurement unit (IMU) consisting of a three-axis accelerometer, a three-axis gyroscope (MPU6500), a three-axis reluctance meter (HMC5583L) and a high-performance STM32 microprocessor. The raw data measured by the sensor are sampled with the sampling frequency of 100 Hz by the microprocessor, and the raw data are sent to the industrial control computer through the serial port without filtering. The extended Kalman filter designed by MATLAB is used to process the data on the computer in order to obtain accurate attitude information. Finally, the experimental results are shown by curve description, and the calculation results are compared and analyzed. In order to verify the effectiveness of the proposed algorithm, five groups of experiments are carried out. The measurement value of the sensor of the test system in the static state is collected through the static measurement platform, as shown in the following Figure 5. The attitude angle information is measured and collected through the inertial sensor and sent to the main controller module through the serial bus [25,26].

Vibration Test
According to the experimental requirements, the duty cycle of the input quantity is adjusted by external remote control, and the RC signal is collected by oscilloscope to en-

Vibration Test
According to the experimental requirements, the duty cycle of the input quantity is adjusted by external remote control, and the RC signal is collected by oscilloscope to ensure the accurate quantization input of the signal. Considering the input range {0.2σ,0.4σ,0.6σ,0.8σ,0.9σ}, the industrial control computer completes the quantization sampling and processing of the attitude information of the IMU and external sensor.
The test results {0.2σ,0.4σ,0.6σ,0.8σ,0.9σ} show the attitude vibration curve as shown in Figure 6. When the throttle input quantity gradually increases, the throttle control quantity ranges from 0.2σ to 0.9σ. The vibration amplitude of the UAV becomes larger and larger, and the amplitude in the XYZ direction increases with the throttle volume. In Figure 6: for the coaxial unmanned XYZ, three directions of vibration amplitude, and the relationship between the input figure, the test process of uniform stability of input sampling 1500 sampling points, and remote control throttle sigma from sigma duty ratio 0.2 to 0.9 between the platform under different excitation vibration amplitude of the data, it can be seen that the vibration of the UAV vibration amplitude increases with the increase of the excitation source. ag5 is the response value of 0.9σ excitation, which shows that the amplitude reaches a maximum range of 1.1 g. The influence on IMU can be reduced by analyzing the characteristics of the measurement noise and establishing a noise model.  According to the processed image of the vibration acceleration data measured in the test as shown in Figure 7, it can be seen that the amplitude range of vibration acceleration under the control of the roll (pitch, yaw) parameters and overall parameters is mostly within ±1 g. Among them, there is a maximum acceleration peak of roll motion vibration, which is not more than 1.25 g. According to the acceleration of vibration and the frequency of acquisition, the amplitude of vibration obtained can be indirectly calculated according to Equation (11) below. The frequency of the data collected by the vibration sensor is 100 Hz, the estimated amplitude of the vibration is about ±0.15 mm and the amplitude of the roll motion is not more than 0.2 mm. According to the test results, it can be seen that the controller has good controllability, indicating that it can control the flight of the aircraft [27][28][29].

The Static Test
The UAV is still placed on a horizontal platform. With a roll angle and pitchin of 0, the coaxial UAV attitude Angle measurement environment is a relatively clo vironment. There is no wind. Using the extended Kalman filtering and no trace of filtering algorithms, the UAV static and accelerometer were not influenced by th vibration and the acceleration of gravity disturbance. The attitude calculated b erometer and the magnetometer is taken as the measurement value, the angular information measured by the gyroscope is fused and the static attitude is solved w accuracy. The roll angle calculated by the fusion algorithm is more accurate. The v curve of vibration acceleration in pitching motion is shown in Figure 8. The vibra celeration curve of the rolling motion is shown in Figure 9. The variation curve vibration acceleration is shown in Figure 10.

The Static Test
The UAV is still placed on a horizontal platform. With a roll angle and pitching angle of 0, the coaxial UAV attitude Angle measurement environment is a relatively closed environment. There is no wind. Using the extended Kalman filtering and no trace of Kalman filtering algorithms, the UAV static and accelerometer were not influenced by the body vibration and the acceleration of gravity disturbance. The attitude calculated by accelerometer and the magnetometer is taken as the measurement value, the angular velocity information measured by the gyroscope is fused and the static attitude is solved with high accuracy. The roll angle calculated by the fusion algorithm is more accurate. The variation curve of vibration acceleration in pitching motion is shown in Figure 8. The vibration acceleration curve of the rolling motion is shown in Figure 9. The variation curve of yaw vibration acceleration is shown in Figure 10.     When the throttle value is 0.5σ, the change of attitude angle is detected, and the comparison results of the static roll angle are calculated by the EKF fusion algorithm. The roll angle calculated by the EKF filter has angle drift, and the error is close to 1, while the error of the UKF filter algorithm is less than 0.5. When the throttle value is 0.5σ, the change of the attitude angle is detected, and the comparison results of the static pitch angles are calculated by the EKF fusion algorithm. The roll angle calculated by the EKF filter has angle drift, and the error is close to 2, while the error of the UKF filter algorithm is less than 0.6. When the throttle value is 0.5σ, the change of the attitude angle is detected, and the comparison results of the static yaw angle are calculated by the EKF fusion algorithm [30,31]. The roll angle calculated by the EKF filter has angle drift, and the error is close to 0.5, while the error of the UKF filter algorithm is less than 0.4.    When the throttle value is 0.5σ, the change of attitude angle is detected, and the comparison results of the static roll angle are calculated by the EKF fusion algorithm. The roll angle calculated by the EKF filter has angle drift, and the error is close to 1, while the error of the UKF filter algorithm is less than 0.5. When the throttle value is 0.5σ, the change of the attitude angle is detected, and the comparison results of the static pitch angles are calculated by the EKF fusion algorithm. The roll angle calculated by the EKF filter has angle drift, and the error is close to 2, while the error of the UKF filter algorithm is less than 0.6. When the throttle value is 0.5σ, the change of the attitude angle is detected, and the comparison results of the static yaw angle are calculated by the EKF fusion algorithm [30,31]. The roll angle calculated by the EKF filter has angle drift, and the error is close to 0.5, while the error of the UKF filter algorithm is less than 0.4. When the throttle value is 0.5σ, the change of attitude angle is detected, and the comparison results of the static roll angle are calculated by the EKF fusion algorithm. The roll angle calculated by the EKF filter has angle drift, and the error is close to 1, while the error of the UKF filter algorithm is less than 0.5. When the throttle value is 0.5σ, the change of the attitude angle is detected, and the comparison results of the static pitch angles are calculated by the EKF fusion algorithm. The roll angle calculated by the EKF filter has angle drift, and the error is close to 2, while the error of the UKF filter algorithm is less than 0.6. When the throttle value is 0.5σ, the change of the attitude angle is detected, and the comparison results of the static yaw angle are calculated by the EKF fusion algorithm [30,31]. The roll angle calculated by the EKF filter has angle drift, and the error is close to 0.5, while the error of the UKF filter algorithm is less than 0.4.

Dynamic Flight Experiment
In order to complete the prototype flight test and verify the attitude following effect, the flight test was carried out in the outdoor environment of the campus of the University of Science and Technology, where the GPS signal was unobstructed and there was no wind disturbance. The coaxial UAV flew 90 m in the X direction and 27 m in the Y direction, and the flight altitude was controlled at about 2 m. After the flight was completed, the flight log of 400 s was selected and analyzed. From the flight log, the actual flight trajectory and expected value approximation of the UAV could be obtained. For good follow-up attitude, the maximum flying speed is 1.32 m/s and the maximum flying altitude is 2.1 m. Figures 11-13 shows the expected value and actual value of dynamic flight XYZ direction. Figure 14 shows the expected value and actual value of dynamic flight path. Figure 15 shows the actual flight diagram. the flight log of 400 s was selected and analyzed. From the flight log, the actu trajectory and expected value approximation of the UAV could be obtained. For g low-up attitude, the maximum flying speed is 1.32 m/s and the maximum flying is 2.1 m. Figures 11-13 shows the expected value and actual value of dynamic flig direction. Figure 14 shows the expected value and actual value of dynamic flig Figure 15 shows the actual flight diagram.    the flight log of 400 s was selected and analyzed. From the flight log, the actu trajectory and expected value approximation of the UAV could be obtained. For g low-up attitude, the maximum flying speed is 1.32 m/s and the maximum flying is 2.1 m. Figures 11-13 shows the expected value and actual value of dynamic flig direction. Figure 14 shows the expected value and actual value of dynamic flig Figure 15 shows the actual flight diagram.    is 2.1 m. Figures 11-13 shows the expected value and actual value of dynam direction. Figure 14 shows the expected value and actual value of dynam Figure 15 shows the actual flight diagram.

Conclusions
Aiming at the problem of error accumulation and large interferenc tude measurement device for coaxial UAV attitude measurement, a dat of EKF and UKF is proposed to ensure a more accurate attitude angle. T formance and attitude angle test platform of the coaxial UAV half-in-the established. The platform analyzes the performance of UAVs at different attitude angles. The main noise sources and main random errors of the mainly analyzed. Aiming at the attitude calculation problem of the co UAV, an optimized adaptive unscented Kalman filter algorithm and an e filter algorithm are proposed to advance the model [32][33][34]. In contrast, th the gradient descent algorithm to reproduce and adjust the process noi optimize the state prediction and estimation, which effectively reduces

Conclusions
Aiming at the problem of error accumulation and large interference of a sin tude measurement device for coaxial UAV attitude measurement, a data fusion of EKF and UKF is proposed to ensure a more accurate attitude angle. The dyna formance and attitude angle test platform of the coaxial UAV half-in-the-loop fl established. The platform analyzes the performance of UAVs at different rotor spe attitude angles. The main noise sources and main random errors of the coaxial U mainly analyzed. Aiming at the attitude calculation problem of the coaxial du UAV, an optimized adaptive unscented Kalman filter algorithm and an extended filter algorithm are proposed to advance the model [32][33][34]. In contrast, the algorit the gradient descent algorithm to reproduce and adjust the process noise covar optimize the state prediction and estimation, which effectively reduces the erro state solution. In the process of attitude calculation, the attitude quantity is rep by quaternion, and the variation trend of roll angle, pitch angle and yaw angle is a in the outdoor flight attitude verification test. The flight results show that the algorithm has good attitude estimation characteristics, indicating that the resear egy of this subject has sufficient engineering application value.

Conclusions
Aiming at the problem of error accumulation and large interference of a single attitude measurement device for coaxial UAV attitude measurement, a data fusion method of EKF and UKF is proposed to ensure a more accurate attitude angle. The dynamic performance and attitude angle test platform of the coaxial UAV half-in-the-loop flight was established. The platform analyzes the performance of UAVs at different rotor speeds and attitude angles. The main noise sources and main random errors of the coaxial UAV are mainly analyzed. Aiming at the attitude calculation problem of the coaxial dual-rotor UAV, an optimized adaptive unscented Kalman filter algorithm and an extended Kalman filter algorithm are proposed to advance the model [32][33][34]. In contrast, the algorithm uses the gradient descent algorithm to reproduce and adjust the process noise covariance to optimize the state prediction and estimation, which effectively reduces the error of the state solution. In the process of attitude calculation, the attitude quantity is represented by quaternion, and the variation trend of roll angle, pitch angle and yaw angle is analyzed in the outdoor flight attitude verification test. The flight results show that the attitude algorithm has good attitude estimation characteristics, indicating that the research strategy of this subject has sufficient engineering application value.