Research on Trajectory Tracking Control of Inspection UAV Based on Real-Time Sensor Data

In power inspection, uncertainties, such as wind gusts in the working environment, affect the trajectory of the inspection UAV (unmanned aerial vehicle), and a sliding mode adaptive robust control algorithm is proposed in this paper to solve this problem. For the nonlinear and under-driven characteristics of the inspection UAV system, a double closed-loop control system which includes a position loop and attitude loop is designed. Lyapunov stability analysis is used to determine whether the designed system could finally achieve asymptotic stability. Sliding-mode PID control and a backstepping control algorithm are applied to analyze the superiority of the control algorithm proposed in this paper. A PX4 based experimental platform system is built and experimental tests were carried out under outdoor environment. The effectiveness and superiority of the control algorithm are proposed in this paper. The experimental results show that the sliding mode PID control can achieve good accuracy with smaller computing costs. For nonlinear interference, the sliding mode adaptive robust control strategy can achieve higher trajectory tracking accuracy.


Introduction
Since the second industrial revolution, electricity has played an indispensable role in human life. China has a vast territory, and overhead transmission lines cover most of it for power transmission. However, most of these transmission networks are built outdoors and are vulnerable to bird nesting, thunder, and lightning. Therefore, it is necessary to conduct power inspections on the transmission line network. At present, China mainly uses electric inspection drones for this project. Compared with manual inspections, inspection drones can improve inspection efficiency and enhance safety [1 -3]. As shown in Figure 1, electric power workers are conducting electric inspection work by use inspection drone. the process of adjusting parameters is complicated, while on the other hand, the robustness is poor, and it is difficult to achieve high-precision trajectory tracking. Literature [10] proposed the use of back-stepping control to design the trajectory tracking controller, establishing the position and attitude error dynamic model of the UAV, using the backstepping method to design the stabilization control items, and using Lyapunov theory to prove the closed-loop system stability, the final trajectory tracking experiment proved the effectiveness of the control algorithm. Although the system is stable, after disturbance is added, the tracking effect becomes worse, and the anti-interference ability of the system is not strong. In [11], the extended state observer of the switching function is used to estimate the disturbance in trajectory tracking, and the calculated estimated value is combined with sliding mode control to finally achieve the trajectory tracking effect. However, chattering occurs in sliding mode control, and the tracking accuracy is affected. Literature [12] uses dual-loop control to achieve high-precision trajectory tracking. The inner loop adopts sliding mode control, while the outer loop adopts linear auto-disturbance rejection control to suppress external interference. Experiments have proven that this method has fast response speed, strong robustness, and can meet the needs of trajectory tracking control of inspection drones. In the literature [13][14][15], fuzzy control is used to design the controller, and the fuzzy system is used to gradually approximate the uncertain items and external interference in the attitude model, while the controller is designed in combination with back-stepping control, which improves the accuracy of trajectory tracking. In recent years, neural network control has begun to increase in popularity, and it has also been favored by scholars. In the literature [16][17][18], facing the uncertainty of the inspection UAV model, the neural network control is used to approximate, and then the external disturbance is suppressed by the observer. Finally, combined with the backstep control, the trajectory tracking effect of the attitude and position of the inspection drone is well achieved.  In the power inspection project, the inspection drone works according to the inspection trajectory established by the staff, as shown in Figure 2. However, due to the interference of factors such as wind gusts at work, the inspection UAV has deviations in the process of  This paper addresses the problem whereby the inspection UAV is disturbed by unknown factors, such as wind gusts in the trajectory tracking process, resulting in the inability to track the inspection trajectory with high accuracy. In this paper, a sliding mode adaptive robust control algorithm is used to design the controller. Compared with other control algorithms, the adaptive algorithm part can better suppress disturbances, while the sliding mode control part can enhance the stability of the system and compensate for the poor robustness of other control algorithms. A control group experiment was also conducted using the sliding mode PID control algorithm and the backstepping control At present, researchers have proposed the following control algorithms for the trajectory tracking control of the inspection drone: PID control, adaptive control, backstepping control, active disturbance rejection control, sliding mode control, etc. [4][5][6][7]. The PID control structure is simple, but the process of adjusting the parameters is relatively cumbersome and the robustness is poor.
Literature [8,9] uses PID control algorithm to design the controller. The error is calculated by the data obtained by the position and attitude sensor and theoretical data, the PID parameters are adjusted to make the error approach zero, and the flight trajectory of the UAV can be tracked. However, there are two main disadvantages. On the one hand, the process of adjusting parameters is complicated, while on the other hand, the robustness is poor, and it is difficult to achieve high-precision trajectory tracking. Literature [10] proposed the use of back-stepping control to design the trajectory tracking controller, establishing the position and attitude error dynamic model of the UAV, using the backstepping method to design the stabilization control items, and using Lyapunov theory to prove the closed-loop system stability, the final trajectory tracking experiment proved the effectiveness of the control algorithm. Although the system is stable, after disturbance is added, the tracking effect becomes worse, and the anti-interference ability of the system is not strong. In [11], the extended state observer of the switching function is used to estimate the disturbance in trajectory tracking, and the calculated estimated value is combined with sliding mode control to finally achieve the trajectory tracking effect. However, chattering occurs in sliding mode control, and the tracking accuracy is affected. Literature [12] uses dual-loop control to achieve high-precision trajectory tracking. The inner loop adopts sliding mode control, while the outer loop adopts linear auto-disturbance rejection control to suppress external interference. Experiments have proven that this method has fast response speed, strong robustness, and can meet the needs of trajectory tracking control of inspection drones. In the literature [13][14][15], fuzzy control is used to design the controller, and the fuzzy system is used to gradually approximate the uncertain items and external interference in the attitude model, while the controller is designed in combination with back-stepping control, which improves the accuracy of trajectory tracking. In recent years, neural network control has begun to increase in popularity, and it has also been favored by scholars. In the literature [16][17][18], facing the uncertainty of the inspection UAV model, the neural network control is used to approximate, and then the external disturbance is suppressed by the observer. Finally, combined with the backstep control, the trajectory tracking effect of the attitude and position of the inspection drone is well achieved. This paper addresses the problem whereby the inspection UAV is disturbed by unknown factors, such as wind gusts in the trajectory tracking process, resulting in the inability to track the inspection trajectory with high accuracy. In this paper, a sliding mode adaptive robust control algorithm is used to design the controller. Compared with other control algorithms, the adaptive algorithm part can better suppress disturbances, while the sliding mode control part can enhance the stability of the system and compensate for the poor robustness of other control algorithms. A control group experiment was also conducted using the sliding mode PID control algorithm and the backstepping control algorithm, and the simulation results and experimental results proved that, in terms of control structure, the method in this paper is more concise, efficient, and has certain advantages compared with other control methods that require the design of an observer or compensator and the repeated adjustment of control parameters.

Establishment of Coordinate System
In order to better study the motion state of inspection drone dynamic model, it is necessary to select the appropriate coordinate system. In this paper, the body axis system and inertial coordinate system are introduced to describe the rotation, position, and attitude of the aircraft. The body axis system is A(A x , A y , A z ). The inertial coordinate system is B(B x , B y , B z ). As shown in Figure 3, γ, θ, and ψ are roll angle, pitch angle, and yaw angle, respectively. Through the rotation matrix of three angles, the transformation matrix from body axis system A to inertial coordinate system B can be deduced R AB [19]. algorithm, and the simulation results and experimental results proved that, in terms of control structure, the method in this paper is more concise, efficient, and has certain advantages compared with other control methods that require the design of an observer or compensator and the repeated adjustment of control parameters.

Establishment of Coordinate System
In order to better study the motion state of inspection drone dynamic model, it is necessary to select the appropriate coordinate system. In this paper, the body axis system and inertial coordinate system are introduced to describe the rotation, position, and attitude of the aircraft. The body axis system is A( , , ). The inertial coordinate system is B( , , ). As shown in Figure 3, γ, θ, and are roll angle, pitch angle, and yaw angle, respectively. Through the rotation matrix of three angles, the transformation matrix from body axis system A to inertial coordinate system B can be deduced [19].

Establishment of Coordinate System
In order to facilitate the establishment of the dynamic model, the following assumptions are proposed: 1. The four-rotor aircraft is regarded as a rigid body, and its body structure is completely uniform and symmetrical. 2. The origin O of the airframe coordinate system coincides with the origin O of the inertial coordinate system to ensure that the inertial matrix is a diagonal matrix in the rigid body coordinate system [20].
Because the main motion forms of quadrotor aircraft are divided into two types, one is translation motion relative to inertial frame B, while the other is rotation relative to body axis system A. Translation has 3 degrees of freedom, rotation has 3 degrees of freedom, a total of 6 degrees of freedom. Therefore, according to the total degrees of freedom, the generalized coordinates can be determined as q = ( , ) T , where = [ x,y,z] T represents location information; = [ γ, , ] T indicates attitude information. The mass of the aircraft is m, the acceleration of gravity is g, and the distance from the end of the rotor to the center of gravity of the aircraft is l. The inertia matrix of quadrotor aircraft in the body axis system is as follows: where , , represent the moment of inertia of the x axis, y axis, and z axis in a coordinate system, which can be obtained by testing [21].

Establishment of Coordinate System
In order to facilitate the establishment of the dynamic model, the following assumptions are proposed: 1.
The four-rotor aircraft is regarded as a rigid body, and its body structure is completely uniform and symmetrical.

2.
The origin O of the airframe coordinate system coincides with the origin O of the inertial coordinate system to ensure that the inertial matrix is a diagonal matrix in the rigid body coordinate system [20].
Because the main motion forms of quadrotor aircraft are divided into two types, one is translation motion relative to inertial frame B, while the other is rotation relative to body axis system A. Translation has 3 degrees of freedom, rotation has 3 degrees of freedom, a total of 6 degrees of freedom. Therefore, according to the total degrees of freedom, the generalized coordinates can be determined as q = (ξ, η) T , where ξ = [x,y,z] T represents location information; η = [ γ, θ, ψ] T indicates attitude information. The mass of the aircraft is m, the acceleration of gravity is g, and the distance from the end of the rotor to the center of gravity of the aircraft is l. The inertia matrix of quadrotor aircraft in the body axis system is as follows: where I x , I y , I z represent the moment of inertia of the x axis, y axis, and z axis in a coordinate system, which can be obtained by testing [21].
where e 3 = 0 0 1 T , d s is the disturbing force of the moving part of the position, u 1 is the lift power of a four rotor aircraft, R AB is a transformation matrix, and d s = d x d y d z T is the interference force in the translational motion.
The equations for the rotational part of the quadrotor aircraft are as follows: where τ is the moment of rolling, pitching and yawing, τ = τ γ τ θ τ ψ is the disturbing torque in the rotational motion; J is the representation of the moment of inertia I of the rigid body in B coordinate system.
The coefficient C is the Coriolis force and centrifugal term [22], which is expressed in the following form [23].

Controller Design Structure
In this paper, a sliding mode adaptive robust trajectory tracking control strategy for quadrotor aircraft is proposed. The system is divided into two dynamic subsystems: position subsystem and attitude subsystem. The position subsystem is taken as the outer loop subsystem, and the attitude part is taken as the inner loop subsystem. The overall design scheme is shown in Figure 4.

Controller Design Structure
In this paper, a sliding mode adaptive robust trajectory tracking control strategy for quadrotor aircraft is proposed. The system is divided into two dynamic subsystems: position subsystem and attitude subsystem. The position subsystem is taken as the outer loop subsystem, and the attitude part is taken as the inner loop subsystem. The overall design scheme is shown in Figure 4.

Position Controller Design
The main design idea of the position controller is to compare the ideal position trajectory with the actual position trajectory, and finally make the error of the two approaches to zero.
Thus, the desired tracking displacement trajectory can be set as ξ c , The displacement obtained by actual tracking is recorded as ξ. Set the error to e s , where e s = ξ − ξ c . According to Formula (2), .. ξ can be expressed separately. Then, find the two derivatives on both sides of the error expression as follows: ..
In the formula, u s = u 1 R AB e 3 is the control input that needs to be designed, u s is understood as a virtual control law, as an intermediate quantity of coordinate transfomation.
According to the sliding mode adaptive robust control method, the sliding mode function is designed first. The sliding mode function can be set as follows: The virtual control law u s of the position subsystem is designed as follows: u s is expressed as: c 1 is the control coefficient, where c 1 > 0,m is an estimator of quality, d s is an etimate of the disturbance force of the displacement part.
Calculating the first derivative of sliding mode function: .
Further sorting out: Compared with other articles, in the position motion part, the main purpose of this paper is to reduce the influence of the disturbance torque on the motion trajectory, so the disturbance torque is designed as the adaptive law to better track the position trajectory. Simultaneously, in order to reflect the superiority of the control method, considering the change of the mass caused by the load of the aircraft, which will affect the lift dynamics and stability of the quadrotor aircraft, the mass adaptive law is also designed. The adaptive law is defined as follows: . d s = γ 1 S 1 (13) . m = −γ 2 S 1 T u s (14) γ 1 and γ 2 are control coefficients. The disturbance force error of displacement part is defined as e d s = d s − d s . The quality error is e m = m−m.
Lyapunov function is defined as follows: The derivation of Lyapunov function is obtained: The interference force and mass of the position part are defined as slow time-varying signals, so the mass error According to the above relations, .
V 1 is approximately equal to −c 1 S 1 T S 1 . According to Lyapunov's law [24], in order to ensure the system is in a stable state, it is necessary for The analysis shows that when the sliding mode function is not zero, the value of Lyapunov derivative function is always less than zero. According to the property of derivative function, the Lyapunov function decreases monotonically, and the sliding mode function, disturbance force error, and mass error decrease gradually. When the sliding mode function S 1 is equal to zero, the Liapunov derivative is equal to zero. At this time, the concept of LaSalle invariant set principle is introduced to analyze. According to the principle of LaSalle invariant set [25], it can be considered that the sliding mode function converges to zero gradually. When t → ∞ , S 1 → 0 . Further, the sliding mode function S 1 is equal to zero, because the Lyapunov derivative function . V 1 = 0, so the Lyapunov function is a constant, and e d s and e m are invariant bounded quantities.
In this case, the sliding mode function will continue to cross at zero, causing the two error quantities to constantly change within a bounded interval, and there is no guarantee that the two error quantities will approach zero. In order to avoid the excessive amount of quality error, the input quantity u 1 needs to be continuously increased, so when the maximum and minimum values of the quality are known, the adaptive law of quality is corrected by a mapping adaptive algorithm [26].
Whenm is greater than the maximum value of the limit range and is in an increasing state, at this time,m remains unchanged,m is equal to 0. Whenm is lower than the minimum value of the limit range and is in a state of decreasing, at this time,m remains unchanged, andm is equal to 0. The mapping adaptive algorithm can not only ensure that m is equal to 0, but also ensures that . V 1 ≤ 0. In the case that the virtual control law u s can be calculated, the actual lifting power u 1 of the quadrotor and the sum η s of the three attitude angle signals of the attitude subsystem must be calculated. Therefore, the virtual control input quantity u s can be expressed as: u x u y u z T , and the intermediate quantity η s is expressed as the following form: Because u s = u 1 R AB e 3 , the matrix operation on u s is expressed as the following form, and the power input expression in the x, y, and z directions can be obtained by sorting.
The u 1 = u z cos θ cos γ are substituted into expressions (21) and (22) and transformed into state space expression.
Adding the intermediate amount η s leads to: u x u y = u z cos ψ s sin ψ s cos ψ s − sin ψ s tan θ s tan γ s sec θ s (25) u x cos ψ s +u y sin ψ s = u z tan θ s The pitch angle and roll angle can be expressed as follows: The pitch angle signal θ s and the roll angle signal γ s are used to track the reference position. They are generated by the virtual control input of the outer ring part and passed to the attitude subsystem of the inner ring part. The error generated by the outer ring part is processed by the inner ring part eliminate. The yaw angle ψ s is used as a given control signal and is generated by a signal generator. The input value of the signal generator can be set to track any yaw angle. The actual position controller input design is u 1 = u z / cos θ cos γ, and u 1 is the actual control input.

Design of Attitude Tracking Controller
The attitude control part is the inner loop subsystem, which realizes attitude control through the inner loop control law, while tracking the pitch angle signal quantity θ s and roll angle signal quantity γ s generated by the outer loop control. In the control of the attitude subsystem, the main tracking quantity is η s . According to the expression of the posture part equation derived above, the controller of the attitude part is mainly designed for the control quantity input torque τ. At the same time, the uncertainty in the quadrotor model and the external non-structural disturbance torque in the rotational motion are considered. Therefore, the expression of the attitude part of the quadrotor can be written as follows.
where J = J s + J ∆ , C = C s + C ∆ . The interference force d 1 in the x direction can be expressed as an expression related to the interference torque. Further, consider that d 1 is a bounded quantity.
So, the dynamic model of the attitude subsystem can be expressed as: The tracking error signal of the attitude subsystem is e η = η − η s , and the derivative is further expressed as . e r = . η s − λ 2 e η , η s = γ s θ s ψ s T .
Similar to the design idea of the position controller, first define the sliding mode function. The sliding mode function S 2 is set to the following form: λ 2 is the control parameter. λ 2 > 0. According to the defined sliding mode function relationship, the attitude error subsystem can be transformed into the following form: Therefore, the control quantity input torque can be expressed as the following form: In Formula (34): ε and c 2 are control parameters, ε > d γ , c 2 > 0. sgn is a symbolic function.
It can be seen from the expression of the exponential reaching law that when the exponential approaching speed is gradually reduced from a larger value to zero, the reaching time becomes shorter and the speed of the target point approaching the switching plane is very small. Because it is a process of gradual approximation, it is difficult to ensure that the moving point reaches the switching plane in a certain time, so an isokinetic approach term −εsgn(S 2 ) is added to the above-mentioned basis [18,19].
The nominal values of the defined model are: Furthermore, the Lyapunov function is constructed as follows: The derivative function of V 2 can be obtained as follows: . After the control quantity τ is brought in, the following results can be obtained: .
It can be seen that Lyapunov derivative function . V 2 is a negative number, so the characteristic of Lyapunov function is monotonic decreasing. According to Lyapunov stability law, the attitude subsystem can be considered as stable, and the error is convergent. For the whole system, the Lyapunov function is defined as: Put V 1 and V 2 in it. .
According to the Lyapunov stability law, the whole system can be considered to be in a state of asymptotic stability.
The position controller obtains the pitch signal θ s and roll signal γ s . From the expression of input torque in formula (34), it can be seen that the first derivative and the second derivative of the two signals need to be calculated respectively. In this case, we can use the form of third-order differentiator to realize the control of θ s and γ s first derivative and second derivative.

Simulation Research Simulation
First of all, given the theoretical inspection trajectory parameter ξ c of the inspection drone, the theoretical trajectory is: x = cos(1/2t); y = sin(1/2t); z = t. Due to the underdriving characteristics of the inspection drone, the pitch angle and roll angle are transmitted to the inner loop control system as intermediate command signals, so only the yaw angle needs to be defined at this time. Set the constant of yaw angle to ψ s = π/6. The distance from the end of the rotor to the center of gravity of the aircraft is 0. It can be seen from Figure 5 that the inspection drone can track the inspection trajectory well. The blue is the theoretically designed inspection trajectory, and the red is the actual tracking trajectory under the disturbance of the disturbance. It can be seen from the figure The two trajectories are close to the same, which shows the effectiveness of the control algorithm proposed in this paper. Figure 6a-c present the tracking errors in the x, y, and z directions of the inspection drone, respectively. It can be seen that after the quality is changed, the error changes in different time periods are different, and the error is very small and within a reasonable range. Figure 7a-c are the trajectory tracking curves of the roll angle, pitch angle, and yaw angle of the inspection drone. It can be seen that the actual roll angle, pitch angle, and the yaw angle and the ideal roll angle, pitch angle, and yaw angle curve basically tend to be the same. Figure 8 shows the change in the lifting power of the inspection drone, i.e., the input quantity u 1 . From the figure, it can be seen that the lift changes with the change of mass, and the value is close to the gravity of the inspection drone. Figure 9 shows the quality self-adaptive estimation result. The quality estimation value and the actual quality value curve are roughly the same, and the error is within the allowable range. Figure 10 shows a comparison diagram of the disturbance force design value and estimated value of the position movement part. It can be clearly seen from the figure that the disturbance force error in the x-direction and y-direction basically approaches zero, achieving the expected goal. Compared with the designed interference force, the z direction is significantly reduced, and the disturbance is suppressed. The effectiveness and robustness of this control algorithm can also be seen from the before and after changes of the interference force. In practical experiments, the gust of wind can be regarded as a disturbance, and the disturbance can be well suppressed by the adaptive law.
It can be seen from Figure 5 that the inspection drone can track the inspection trajectory well. The blue is the theoretically designed inspection trajectory, and the red is the actual tracking trajectory under the disturbance of the disturbance. It can be seen from the figure The two trajectories are close to the same, which shows the effectiveness of the control algorithm proposed in this paper. Figure 6a-c present the tracking errors in the x, y, and z directions of the inspection drone, respectively. It can be seen that after the quality is changed, the error changes in different time periods are different, and the error is very small and within a reasonable range. Figure 7a-c are the trajectory tracking curves of the roll angle, pitch angle, and yaw angle of the inspection drone. It can be seen that the actual roll angle, pitch angle, and the yaw angle and the ideal roll angle, pitch angle, and yaw angle curve basically tend to be the same. Figure 8 shows the change in the lifting power of the inspection drone, i.e., the input quantity . From the figure, it can be seen that the lift changes with the change of mass, and the value is close to the gravity of the inspection drone. Figure 9 shows the quality self-adaptive estimation result. The quality estimation value and the actual quality value curve are roughly the same, and the error is within the allowable range. Figure 10 shows a comparison diagram of the disturbance force design value and estimated value of the position movement part. It can be clearly seen from the figure that the disturbance force error in the x-direction and y-direction basically approaches zero, achieving the expected goal. Compared with the designed interference force, the z direction is significantly reduced, and the disturbance is suppressed. The effectiveness and robustness of this control algorithm can also be seen from the before and after changes of the interference force. In practical experiments, the gust of wind can be regarded as a disturbance, and the disturbance can be well suppressed by the adaptive law.    Through the above simulation analysis and research, it can be seen that the controller designed by the sliding mode adaptive robust control method can accurately and stably track the given patrol, taking into account the dynamic characteristics of the patrol drone, external disturbance, and system uncertainty. Check the trajectory, obtain good control performance, and verify the effectiveness of the control algorithm.     Through the above simulation analysis and research, it can be seen that the controller designed by the sliding mode adaptive robust control method can accurately and stably track the given patrol, taking into account the dynamic characteristics of the patrol drone, external disturbance, and system uncertainty. Check the trajectory, obtain good control performance, and verify the effectiveness of the control algorithm.

Sliding Mode PID Control Group Experiment
The first group of control experiments uses the sliding mode PID control algorithm to design the inspection drone controller. The control structure diagram is shown in Figure 11.
The system is divided into two parts, one is a full drive subsystem, the other is the under drive subsystem. PID control is used in the full drive subsystem and sliding mode control is used in the underactuated subsystem. When other conditions remain unchanged, the mass is 1 kg for the control experiment. The simulation results are shown in the figure. track the given patrol, taking into account the dynamic characteristics of the patrol drone, external disturbance, and system uncertainty. Check the trajectory, obtain good control performance, and verify the effectiveness of the control algorithm.

Sliding Mode PID Control Group Experiment
The first group of control experiments uses the sliding mode PID control algorithm to design the inspection drone controller. The control structure diagram is shown in Figure 11. The system is divided into two parts, one is a full drive subsystem, the other is the under drive subsystem. PID control is used in the full drive subsystem and sliding mode control is used in the underactuated subsystem. When other conditions remain unchanged, the mass is 1 kg for the control experiment. The simulation results are shown in the figure.
From the simulation results of the sliding mode PID control algorithm, it can be seen from Figure 12 that the overall trajectory tracking has a good effect. The specific position From the simulation results of the sliding mode PID control algorithm, it can be seen from Figure 12 that the overall trajectory tracking has a good effect. The specific position tracking amount is shown in Figure 13. It is not difficult to see from the figure that the error in the x direction is between −0.03 and 0.03; the error in the y direction is between −0.02 and 0.02; the error in the z direction is between −0.026 and 0.026. Although the error is oscillating, it is higher in terms of accuracy than the control algorithm proposed in this paper. Figure 14 presents the attitude tracking curves. It can be seen that the overall trajectory tracking accuracy has a good effect, which is equivalent to the control effect in this article. tracking amount is shown in Figure 13. It is not difficult to see from the figure that the error in the x direction is between −0.03 and 0.03; the error in the y direction is between −0.02 and 0.02; the error in the z direction is between −0.026 and 0.026. Although the error is oscillating, it is higher in terms of accuracy than the control algorithm proposed in this paper. Figure 14 presents the attitude tracking curves. It can be seen that the overall trajectory tracking accuracy has a good effect, which is equivalent to the control effect in this article.

Backstepping Control Group Experiment
The second group of control group experiments adopts backstepping control to design the controller. The control structure diagram is shown in Figure 15. The basic principle of backstepping is to decompose a complex nonlinear system into subsystems that do not exceed the order of the system, and then design partial Lyapunov functions and intermediate virtual control variables for each subsystem, and "backward" to the entire system. They are integrated to complete the design of the entire control law. Therefore, the overall system of the inspection UAV can also be divided into two parts, namely the position subsystem and the attitude subsystem. Firstly, the theoretical inspection trajectory of the inspection drone is given. At the same time, the height control uses the error amount between the actual height and the theoretical height as input, and the lift u 1 in the z direction is obtained through the calculation of the controller. Similarly, in the translation part, the theoretical values and actual errors in the x and y directions are used as input, and the lift u 1 in the z direction is brought into the translation controller to calculate the lift u x and u y in the two directions. After u x and u y undergo backstepping control operations, the theoretical roll angle and theoretical pitch angle of the system are obtained. The second is the design of the attitude subsystem, which is similar to the design of the position controller. The theoretical value of the three angles of the attitude part and the actual value measured by the attitude sensor are calculated to obtain the error, and the error is used as the input. It should be noted that the yaw angle is still set at this time. The three angle errors are input into the attitude controller for calculation, and the input torques u 2 , u 3 , and u 4 of the three angles are obtained. Finally, the input lift and torque obtained by the two subsystems are used to control the work of the inspection drone. The simulation results are shown in the figure. jectory tracking effect is not ideal, and the disturbance is relatively serious. Looking at the error change curves in the three directions, the overall error curve is in an oscillating state, and the oscillating range is relatively large, which shows that the control algorithm is greatly affected in terms of accuracy. It can be seen from Figures 17 and 18 that the tracking effect of the three angles is affected by the disturbance and the angle tracking cannot be performed well.  It can be seen from Figure 16 that due to the addition of disturbance, the overall trajectory tracking effect is not ideal, and the disturbance is relatively serious. Looking at the error change curves in the three directions, the overall error curve is in an oscillating state, and the oscillating range is relatively large, which shows that the control algorithm is greatly affected in terms of accuracy. It can be seen from Figures 17 and 18 that the tracking effect of the three angles is affected by the disturbance and the angle tracking cannot be performed well.

Experimental Study
In order to better verify the effectiveness of the proposed control algorithm, this paper adds an actual experimental platform for verification. The hardware system part of the experimental platform is the PIX series flight controller with the model of the main control chip STM32F427. The MPU6050 sensor is selected as the attitude acquisition component. The GPS module with the model number M8N and the MS5611-01BA air pressure sensor are selected for the measurement of position parameters. The experiment mainly uses wind as interference to measure the flight status and trajectory tracking of the UAV to verify the superiority of the control strategy proposed in this paper. The patrol track of the experimental design is shown in Figure 19.
According to Figure 20, it can be seen that after designing the predetermined trajectory, the inspection drone can roughly track the predetermined trajectory, and although there is an error in the tracking result, considering the influence of wind gusts and disturbances during the experiment, the tracking result is also within the controllable range. The experimental data from Figures 21-26 can clearly show the tracking results of each index, and the actual value curve and the theoretical value basically tend to be the same,

Experimental Study
In order to better verify the effectiveness of the proposed control algorithm, this paper adds an actual experimental platform for verification. The hardware system part of the experimental platform is the PIX series flight controller with the model of the main control chip STM32F427. The MPU6050 sensor is selected as the attitude acquisition component. The GPS module with the model number M8N and the MS5611-01BA air pressure sensor are selected for the measurement of position parameters. The experiment mainly uses wind as interference to measure the flight status and trajectory tracking of the UAV to verify the superiority of the control strategy proposed in this paper. The patrol track of the experimental design is shown in Figure 19.   According to Figure 20, it can be seen that after designing the predetermined trajectory, the inspection drone can roughly track the predetermined trajectory, and although there is an error in the tracking result, considering the influence of wind gusts and disturbances during the experiment, the tracking result is also within the controllable range. The experimental data from Figures 21-26 can clearly show the tracking results of each index, and the actual value curve and the theoretical value basically tend to be the same, which shows the effectiveness of the control algorithm, and the error range of each index is also within the plan.                         In order to better compare the three control algorithms during the experiments, different algorithms are used for the control experiments. The parameters of the experimental equipment are kept constant and only the control algorithms are changed. The experimental results of the three control algorithms are shown in Table 1.  In order to better compare the three control algorithms during the experiments, different algorithms are used for the control experiments. The parameters of the experimental equipment are kept constant and only the control algorithms are changed. The experimental results of the three control algorithms are shown in Table 1. Combining the experimental data in Tables 1 and 2, it can be seen that the sliding mode adaptive robust control algorithm is faster in terms of stabilization time than the sliding mode PID control algorithm and the backstepping control algorithm. Although the two algorithms used as the control group can finally track the motion trajectory of the quadrotor aircraft, in terms of tracking error, the tracking error range of the two algorithms is larger than that of the sliding mode adaptive robust control algorithm. Although the sliding mode PID algorithm can achieve good results in respect of stability time and tracking accuracy, it is very cumbersome to adjust the PID parameters, and the overshoot phenomenon is serious when the parameters are not selected properly. It can be concluded that the sliding mode adaptive robust control algorithm has good stability, higher precision, and obvious advantages by comparing the experimental results of the other two control algorithms under the condition of considering the disturbance. can achieve reasonable results in terms of control accuracy, and the backstepping control, although designed with system stability in mind, struggles to achieve the expected results in terms of control accuracy. In the control process of the actual experiment, from the data measured by the sensor and the theoretical data curve calculated on the ground station, it can be seen that the control algorithm used can reach the actual demand, and the inspection drone can follow the control point well for inspection. In the future, we will continue to combine the algorithm from the anti-interference and the inspection drone in order to better apply to the actual project.