Adaptive Predefined-Time Sliding Mode Control for QUADROTOR Formation with Obstacle and Inter-Quadrotor Avoidance

In this paper, aiming at the problem of control and obstacle avoidance in quadrotor formation when mathematical modeling is not accurate, the artificial potential field method with virtual force is used to plan the obstacle avoidance path of quadrotor formation to solve the problem that the artificial potential field method may fall into local optimal. The adaptive predefined-time sliding mode control algorithm based on RBF neural networks enables the quadrotor formation to track the planned trajectory in a predetermined time and also adaptively estimates the unknown interference in the mathematical model of the quadrotor to improve the control performance. Through theoretical derivation and simulation experiments, this study verified that the proposed algorithm can make the planned trajectory of the quadrotor formation avoid obstacles and make the error between the true trajectory and the planned trajectory converge within a predetermined time under the premise of adaptive estimation of unknown interference in the quadrotor model.


Introduction
In recent years, remarkable progress has been made in the study of quadrotor formation [1][2][3][4][5][6]. The so-called "quadrotor formation" means that multiple quadrotors complete corresponding tasks according to the expected formation. Among them, how to make the quadrotor formation form the expected formation trajectory within a certain time is an important research topic in the field of multi-agent [4]. In the research field of quadrotor formation, path planning and precise trajectory tracking are the two main research topics. Generally, it is necessary to use trajectory planning to plan the flight path of a quadrotor formation, first to achieve the obstacle avoidance goal, and then use the corresponding control algorithm to track the planned path. The two research fields complement each other and have a certain logical correlation.
For the maintenance of the quadrotor formation, the leader-follower strategy [7] and virtual structure strategy [8] are generally adopted. The leader-follower strategy control is relatively simple, but the follower is dependent on the leader's trajectory, is unable to make independent decisions, and requires a large amount of communication data. For the virtual structure strategy, the whole formation is regarded as a virtual rigid body structure. Compared with the leader-follower strategy, the follower has less dependence on the leader while using the virtual structure strategy, but the communication data volume is still larger.
In order to further improve the application range and safety of quadrotor formation, obstacle avoidance is an essential and necessary research topic. In order to realize the optimal obstacle avoidance of a quadrotor formation, it is required to plan the path of the formation so that it can avoid obstacles. Currently, the most crucial obstacle avoidance Sensors 2023, 23, 2392 2 of 21 methods of quadrotor formation are obstacle avoidance by using deep reinforcement learning training [9] and obstacle avoidance by using the artificial potential field method [10,11]. For the obstacle avoidance algorithm based on reinforcement learning, the primary method is to train the relevant parameters of the neural network in deep reinforcement learning offline so that each quadrotor in the quadrotor formation can autonomously avoid obstacles. The main shortcoming of this method is that it needs to use as many scenes as possible for a long time of training to achieve the expected obstacle avoidance effect. The obstacle avoidance effect relies on reinforcement learning state spaces, reward functions, and action constraints. The artificial potential field method's main idea is to take the obstacle as a high potential energy point and, under the repulsive force of the high potential energy point, to plan a path that can ideally bypass the obstacle. Relative to the obstacle avoidance algorithm based on reinforcement learning, there is no need for early training. However, at present, the artificial potential field method for obstacle avoidance in quadrotor formation fields has not solved the local optimal problem.
In order to make the quadrotor track the planned formation trajectory stably and quickly, the stable position and attitude control of the quadrotor are also significant research topics. Currently, many control algorithms have been proposed in the field of quadrotor control, which are mainly divided into linear control and nonlinear control algorithms. Among them, linear control algorithms mainly include the output feedback algorithm [12] and the PID control algorithm. However, the linear control algorithm has certain limitations for multi-freedom, nonlinear-controlled objects such as the quadrotor. Therefore, to improve the controller's application range, researchers began to study the nonlinear control algorithm in the field of quadrotor control. Various classical nonlinear control algorithms have appeared, such as backstepping control [13], sliding mode control algorithm [13], etc. However, the above control algorithms can only ensure stable convergence of the quadrotor formation control system. Still, they cannot guarantee that the state of the quadrotor system can converge within a finite time. Therefore, a finite-time control algorithm is presented. For example, in the literature [14], the finite-time control algorithm is used to control the quadrotor formation and carry out adaptive estimation of the uncertainty of the model. Compared with the finite-time algorithm, the fixed-time control algorithm can limit the stable time of the quadrotor system state to a known and fixed time range. The literature [5] uses an adaptive fixed-time algorithm based on an RBF neural network to control the quadrotor. The algorithm can make the quadrotor formation converge to the given input in a fixed time, but the specific convergence time cannot be expressed explicitly by the parameters. In recent years, the predefined-time control algorithm has been proposed with the development of nonlinear control fields. The algorithm can make the control system converge within a predetermined time range. Compared with the fixed-time control algorithm, the convergence time of the algorithm can be expressed explicitly as a particular parameter. However, so far, finite-time control algorithms [15,16] and fixed-time control algorithms [5] are primarily used for position control and attitude control of quadrotors. In this paper, the predefined-time control algorithm is extended to control the position loop and attitude loop of the quadrotor so that the quadrotor can be stable within the expected time.
For the nonlinear control of the position and attitude of the quadrotor, the actual control effect depends on the accuracy of the quadrotor mathematical model. However, it is difficult to establish an accurate mathematical model for the quadrotor, and unknown noise interference exists in the environment, so the influence of imprecise modeling in the quadrotor model and unknown interference in the environment on the quadrotor control needs to be adaptive compensation. So far, many algorithms can compensate for environmental interference and imprecise modeling of models, such as the adaptive finite-time control algorithm [15,16] and the adaptive fixed-time control algorithm [5]. However, for the control algorithm of predefined time control, whose convergence time can be explicitly determined by a certain parameter, there is no method to combine it with adaptive algorithms such as the RBF neural network. Based on the above discussion, this paper studies an artificial potential field method with virtual force for trajectory planning of quadrotor formation and an adaptive predefinedtime sliding mode control algorithm based on RBF neural networks to realize the position and attitude control of the quadrotor. The main contributions of this paper are as follows: (1) An artificial potential field method with virtual force is proposed to solve the local optimal problem encountered by using the artificial potential field method in the field of quadrotor formation, and the planned trajectory is input to the position controller of the quadrotor. (2) A predefined-time sliding mode control algorithm for controlling the position and attitude of the quadrotor is studied. Compared with the fixed-time sliding mode algorithm [14], the convergence time of this control algorithm can be expressed explicitly by a certain parameter. (3) On the basis of contribution (2), an adaptive predefined-time sliding mode control algorithm based on RBF neural networks is proposed so that the predefined-time sliding mode control algorithm can be applied to the occasions where there is interference in the environment or inaccurate modeling of the quadrotor model.

Necessary Preliminaries and Problem Formulation
For any state x(t, y 0 ) of the above system, where T c > 0 is the predefined time, α, β > 0, η ∈ (0, 1) and 0 ≤ ε ≤ ∞ is the system parameter, then the motion path x of the system state is stable in the predefined time, and the residual set of the solution of the system can be written by: where 0 < µ < 1 and the predefined time Lemma 2 ([18]). When y ≥ x, and > 1, then:

Quadrotor Dynamic Model
Before describing the dynamics and kinematics models of the quadrotor, the inertial coordinate system and the body coordinate system are briefly introduced and the relationship between the quadrotor model and the coordinate axis is shown in the Figure 1: x R y R ∈ ∈ and positive numbers 0, p > , we get:

Quadrotor Dynamic Model
Before describing the dynamics and kinematics models of the quadrotor, the inertial coordinate system and the body coordinate system are briefly introduced and the relationship between the quadrotor model and the coordinate axis is shown in the Figure  1:   1. Inertial coordinate system O xyz : the origin of coordinates O is at a point on the surface of the earth. The axis O x is on the ground plane, pointing east. The axis O z is negative and perpendicular to the ground plane, pointing to the center of the earth. The axis O y , the axis O x , and the axis O z constitute the right-hand coordinate system.
2. Body coordinate system o i,xbybzb : the origin of coordinates o is located at the center of the mass of the quadrotor. The axis o i,xb coincides with the movement direction of the quadrotor. The axis o i,zb is perpendicular to the plane of the quadrotor body. The axis o i,yb , the axis o i,xb , and the axis o i,zb constitute the right-hand coordinate system. The coordinate system represents the body coordinate system of the ith quadrotor.
The mathematical model of a quadrotor is divided into two parts: the position loop and the attitude loop. Based on the inertial coordinate system, the quadrotor position loop model is shown as follows: where, i represents the ith quadrotor; ..  z i represent the acceleration of the ith quadrotor in the x, y, z directions; g is the gravitational acceleration; m i represents the mass of the ith quadrotor; R B→I i is the inverse matrix of R I→B i ; T i is the lift force of the ith quadrotor; k i,x , k i,y , k i,z are the drag coefficients in the x, y, z directions, respectively, in the inertial coordinate system; . x i , . y i , . z i represent the speed of the ith quadrotor in x, y, z directions; f i,z is the unknown interference in the z axis direction.
For the convenience of expression, Equation (7) is converted into vector form in this paper and replaced as follows: Then Formula (7) can be rewritten as: ..
The quadrotor attitude model is shown as follows: This paper makes the following substitutions: , then the Formula (9) can be written as Formula (10): where A i represents the attitude of the ith quadrotor (the vector composed of roll angle θ i , pitch angle ϕ i and yaw angle Ψ i ), and τ i represents the torque generated in the attitude direction of the quadrotor. The given value of the quadrotor attitude loop is calculated from the control quantity of the position loop, where, φ d i denotes the expected value of the attitude angle φ i , θ d i denotes the expected value of the attitude angle θ i , and Ψ d i denotes the expected value of the attitude angle Ψ i . The specific formula is shown as follows: where u i,x , u i,y , u i,z , respectively, represent the component force of lift force T i in the direction x, y, z, and the conversion relationship is expressed by the following formula:

RBF Neural Network Estimation
RBFNN is a very effective tool for the accurate estimation of unknown interference. In 1988, Broomhead and Lowe introduced RBF into neural network design based on the local response of biological neurons. In 1989, Jackson demonstrated the uniform approximation performance of the RBF neural network for nonlinear continuous functions. RBFNN is a very effective tool for the accurate estimation of unknown interference. The literature [20] compares the performances of the RBF neural network and the BP neural network in approximating nonlinear functions, and the research shows that the generalization ability of the RBF neural network is superior to the BP neural network in all aspects. In this paper, RBFNN will be used for the adaptive estimation of unknown interference f i,z from the z axis of the ith quadrotor. Its network structure is shown in Figure 2: interference. The literature [20] compares the performances of the RBF neural network and the BP neural network in approximating nonlinear functions, and the research shows that the generalization ability of the RBF neural network is superior to the BP neural network in all aspects. In this paper, RBFNN will be used for the adaptive estimation of unknown interference , i z f from the z axis of the ith quadrotor. Its network structure is shown in Figure 2: where, b i is the width of the neural network (the mean of the Gaussian basis function), and C i,j = c i,j,1 , c i,j,2 , . . . , c i,j,n T is the center of the neural network (the variance of the Gaussian basis function). The third layer (output layer): the output of the neural network is: The unknown interference can be expressed by Equation (13): Moreover, the estimated value f i,z of unknown interference can be expressed by Equation (14) where is the real weight of the neural network,Ŵ i = [ŵ i,1 ,ŵ i,2 , . . . ,ŵ i,n ] T represents the estimated value of the real weight, and h( T is the RBF vector of the hidden layer.

Path Planning and Controller Design
Design objectives: Firstly, this paper uses the artificial potential field method to convert the ideal trajectory of each quadrotor in the formation into the planned trajectory, so as to achieve the target of collision avoidance between the formation and obstacles as well as between each quadrotor in the formation, and then inputs the planned trajectory to the controller of each quadrotor in the formation. The controller is combined with an RBF neural network to estimate the unknown interference of each quadrotor in the z axis direction. Finally, the predefined-time sliding mode control algorithm is used to make each quadrotor stably track the planned trajectory within the predefined time. The design flow chart is shown in Figure 3: so as to achieve the target of collision avoidance between the formation and obstacles as well as between each quadrotor in the formation, and then inputs the planned trajectory to the controller of each quadrotor in the formation. The controller is combined with an RBF neural network to estimate the unknown interference of each quadrotor in the z axis direction. Finally, the predefined-time sliding mode control algorithm is used to make each quadrotor stably track the planned trajectory within the predefined time. The design flow chart is shown in Figure 3:

The Path Planning of the Formation
The overall design idea of formation trajectory planning in this paper is as follows: according to the preset ideal trajectory of the ith quadrotor ξ r , and the position of the ith obstacle O k (k = 0, 1, 2, . . . , m), this paper uses the artificial potential field method to calculate the planned trajectory of the ith quadrotor ξ d i.
The actual planned path is shown in Equation (15), and the control quantity is shown in Equation (16) [21]: where ς i denotes that the ith quadrotor is subjected to the vector sum of the artificial potential field repulsive force of all other quadrotors, ς i,o denotes that the ith quadrotor is subjected to the vector sum of the artificial potential field repulsive force of all other obstacles, and ι i , ι i,o is the virtual force preventing the artificial potential field from falling into the local optimal. In order to prevent the artificial potential field method between quadrotors and collisions from falling into the local optimal solution, when ∠ ξ d i,2 , ς i < α, this paper sets: ι i = ς i , ι i ⊥ς i , and set c 1 = c 2 = 0 to temporarily avoid the approximation of the planned trajectory to the ideal trajectory, so as to prevent the quadrotor from falling into the local optimal solution by adding virtual force. When the local optimum is removed , the value of c 1 , c 2 is restored, and the virtual force ι i is removed. In order to prevent the artificial potential field method between formation and falling into the local optimal solution, when ∠ ξ d i,2 , ς i,o < β, this paper sets: , and sets c 1 = c 2 = 0 to temporarily avoid the approximation of the planned trajectory to the ideal trajectory, so as to prevent the quadrotor from falling into the local optimal solution by adding virtual force. When the local optimum is removed , the value of c 1 , c 2 is restored, and the virtual force ι i,o is removed.
The purpose of the angles that limit the values of ∠ ξ d i,2 , ς i and ∠ ξ d i,2 , ς i,o is to determine whether it will fall into the local optimum because of the repulsive force generated by the artificial potential field. This angle can be selected arbitrarily in theory, but when the angle is too small, the calculated obstacle avoidance path may not be smooth and continuous. If the selected angle is too large, unnecessary obstacle avoidance actions will be executed when the local optimization does not appear. Finally, through simulation experiments, we set the values of α and β to 10 • . The artificial potential field function is defined as follows: (17) where R ς is the intensity radius of the artificial potential field, ϕ(X) is the artificial potential function, and k ς is the intensity coefficient of the artificial potential field. The artificial potential field between the quadrotors in the formation is described below. Assuming that the ith quadrotor is located in the artificial potential field generated by other nearby quadrotors, the repulsive force of the potential field generated by other quadrotors and the sum of the artificial potential field strength of the ith quadrotor are shown in Formula (18) and Formula (19), respectively: where ς i represents the sum of the repulsive force vector of the artificial potential field of the ith quadrotor subjected to all other quadrotors, V ξ i represents the sum of the artificial potential field intensity between the ith quadrotor and all other quadrotors, and ∇ ξ d i,1 is the negative gradient term. The artificial potential field between the formation and the obstacle is described below. The obstacle avoidance area R k is defined near the kth obstacle and R k indicates the obstacle avoidance radius. When the ith quadrotor approaches the obstacle, the intersection point of the line between the obstacle k and the quadrotor i and the sphere formed by the obstacle avoidance radius R k is defined as: where O k = (x ok , y ok , z ok ) T is the coordinate of the kth obstacle. The collision avoidance control items between the ith quadrotor and obstacles are shown in Formula (21): where ς i,o denotes the sum of the repulsive force vector of the artificial potential field of the ith quadrotor subjected to all other obstacles and V ξ i,o denotes the sum of the artificial potential field strength between the ith quadrotor and all other obstacles. Through the above formulas, each planned trajectory of the quadrotor within the formation can avoid other quadrotors and obstacles. The control items ς i and ς i,k in Equation (16) are eliminated in the final stable non-obstacle avoidance region. Finally, a linear system is obtained as follows: ..
If the two parameters c 1 and c 2 are correctly selected (c 1 < c 2 ), the system will be stable (ξ d i,1 − ξ r i,1 will approach 0), that is, in the non-obstacle avoidance region, the planned trajectory ξ d j,1 can stably track the ideal trajectory ξ r i,1 .

Controller Design
The control of a quadrotor is mainly divided into two parts: the position control and the attitude control. Firstly, this paper controls the position loop by an adaptive predefinedtime sliding mode controller based on an RBF neural network according to the planned path ξ d i,1 of the obstacle avoidance calculated in the previous step. Then, the control output of the position loop is input into the attitude loop, and the attitude of the quadrotor is controlled through the predefined-time sliding mode control of the attitude loop so as to finally track the specified formation according to the planned path ξ d i,1 .

Predefined-Time Sliding Mode Controller Design of the Position Loop
In this section, through theoretical analysis, this paper proves that the error between the real position and the expected position of the quadrotor can be stabilized within a predefined time. The proof process is described as follows: In order to prove that the position loop error can converge stably, the Lyapunov function is defined: where E i,p = P i − ξ d 1,i represents the position error of the quadrotor. The sliding mode switch function is defined as: .
According to Lemma 1, E i will converge to 0 in a predefined time T c1,i . Next, this article will prove that the sliding mode surface S i,P will also converge to 0 in a predefined time T c2,i .
For the sliding mode switch function S i,P , in order to prove that the sliding mode switch function can also converge stably to 0, this paper defines the Lyapunov function: By substituting Equation (25) into the derivative of Equation (28), we can get: .
where F i = [0, 0, f i,z ] T represents the unknown interference in the position model of the quadrotor, andF i = 0, 0,f i,z T represents the compensation of the quadrotor model controller to the unknown interference. Therefore, by substituting (13) and (14) into (31), we can get: .
For convenience, let κ i = S T i,P S i.P ε N − S T i,P ε i , and ε i = [0, 0, ε i,z ] T is the error between the estimated value and the real value of the neural network in the quadrotor position model.
represents the difference between the estimated weight value and the real weight value of the neural network. The hidden layer output is: Since the difference ∼ W i of adaptive weight value is added, in order to prove that ∼ W i will converge to 0 in the predefined time, Lyapunov function V 3,i is defined again: By differentiating Equation (33), we can get: .
Let the adaptive rate . W i be: .
By proof of Equation (42) and Equation (43), the inequality (41) can be obtained: Next, this paper will prove the inequality in Equation (41), and the proof process is described as follows: First, the vector form of the following equation is decomposed into the scalar form: Finally, from Lemma 2, Equation (42) can be simplified to: Therefore, this paper proves that the inequality in Equation (41) is valid. By substituting inequality (41) into Equation (40), we can get: then by Lemma 3, Equation (44) can be rewritten as: According to Lemma 1, both S i,P and ∼ W i will approach 0 in the predefined time T c2,i . Through the above discussion, it is proven that the position P i of the quadrotor will track the planned position ξ d 1,i within a predetermined time.

Predefined-Time Sliding Mode Controller Design of the Attitude Loop
This paper will prove that the attitude loop is stable in a predetermined time. Define the given input to the attitude loop as: The attitude error is In order to prove that the attitude loop error converges to 0 within the predefined time T c4,i , the Lyapunov function is defined as: The sliding mode switching surface is defined as: The parameters α 3,i , β 3,i , 0 < η 3,i < 1 are all positive numbers. When S i,A = 0, Equation (47) can be simplified as: We take the derivative of Equation (46), and then substitute Equations (48) and (49) into the derivative of Equation (46): By Lemma 1, E i,A will be stable for a predefined period of time T c3,i . Next, this paper proves that the sliding mode surface S i,A is stable for a predefined time. Define the Lyapunov function: By differentiating Equation (51), we can obtain: .
Let the attitude loop control quantity be: By substituting Equation (53) into Equation (52), we get: According to Lemma 1, S i,A will be stable for a predefined time T c4,i . Through the above discussion, this paper proves that the attitude A i of the quadrotor can track the attitude expectation indirectly calculated from the control quantity of the position loop within a predetermined time.

Simulation Results and Analysis
In this section, MATLAB/Simulink is used for numerical simulation to verify the correctness of the algorithm. The simulation verification in this section is mainly divided into three parts: 1. This paper compares the control effects of predefined-time sliding mode control and fixed-time sliding mode control on quadrotor formation; 2. This paper compares the control effects of predefined-time sliding mode control and adaptive predefined-time sliding mode control based on RBF neural networks on the quadrotor after adding interference into the position loop; 3. This paper verifies the effect of quadrotor formation tracking the expected formation and avoiding obstacles.
Consider the following quadrotor parameters: the set inertia torque

Comparison of Predefined-Time Sliding Mode Control and Fixed-Time Sliding Mode Control
This section compares the difference between the predefined-time sliding mode control algorithm and the fixed-time sliding mode control algorithm [22] for the control effect of the quadrotor. The parameters of the predefined-time sliding mode control algorithm are described as follows: for the position loop, the predefined time of the position tracking error E i,p of the quadrotor is set as T c1,i = 0.5, the predefined time of the sliding mode surface is set as T c2,i = 5, and other parameters are set as α 1,i = 2, β 1,i = 2, α 2,i = 1, β 2,i = 2, η 1,i = 0.35, η 2,i = 0.35; for the attitude loop, the predefined time of the attitude tracking error of the quadrotor is set as T c3,i = 1, the predefined time of the sliding mode switch function is set as T c4,i = 0.5, and the other parameters are set as α 3,i = 50, β 3,i = 150, α 4,i = 100, β 4,i = 200, η 3,i = 0.25, η 4,i = 0.15. The parameter setting of the fixed-time sliding mode control algorithm is the same as that in the literature [22]. Figure 4 compares the control effects of the predefined-time sliding mode control algorithm and the fixed-time sliding mode control algorithm on the tracking error of the quadrotor position loop. As can be seen from Figure 4, compared with the fixed-time sliding mode control, the convergence rate of the predefined-time sliding mode control is faster in the axis direction of x, y, z, and the position error curve of the quadrotor converges within 2 s under the predefined-time sliding mode control (T c1,i + T c2,i = 5.5), which also accords with the control objective of the predefined time. The steady-state error of the predefinedtime controller is obviously smaller than that of the fixed-time controller. Figure 5 compares the control effects of the predefined-time sliding mode control algorithm and the fixed-time sliding mode control algorithm on the tracking error of the quadrotor attitude loop. As can be seen from Figure 5, the stability of the attitude error curve of the predefined-time sliding mode control algorithm is worse than that of the fixed-time sliding mode control algorithm, but the convergence speed and the stability of the attitude error curve in the steady state of the predefined-time sliding mode control algorithm are similar to those of the fixed-time sliding mode control algorithm. In addition, the convergence time of the fixed-time sliding mode controller cannot be explicitly determined by parameters, but the convergence time of the predefined-time sliding mode controller can be explicitly determined by a certain parameter. To sum up, the predefined-time sliding mode controller is better than the fixed-time sliding mode controller. Both converge within 1 s (T c3,i + T c4,i = 1.5), which also accords with the control objectives of the predefined-time controller, and the steady-state error of the predefined-time controller for attitude loop control is significantly smaller than that of the fixed-time controller. Figures 6 and 7 are the control curves for lift and attitude torque of the quadrotor, respectively. We can see from the figure that the lift curve is relatively smooth and that no frequent shaking occurs. For the torque curve, there is no large shaking on the whole, but there will be a small amount of shaking. the quadrotor, respectively. We can see from the figure that the lift curve is relatively smooth and that no frequent shaking occurs. For the torque curve, there is no large shaking on the whole, but there will be a small amount of shaking.

Comparison of Predefined-Time Sliding Mode Control and Adaptive Predefined-Time Sliding Mode Control Based on an RBF Neural Network
This section mainly verifies the control effect difference between the adaptive predefined-time sliding mode control based on an RBF neural network and the predefined-time sliding mode control after adding position interference. The specific parameters are described as follows: The parameters of the predefined-time sliding mode control are exactly the same as those set in the previous section; the parameters of the adaptive predefined-time sliding mode control based on the RBF neural network, except for those of the RBF neural network, are the same as in the previous section. The parameters of the RBF neural network are set as follows: , , , , 0,0,0,0,0

Comparison of Predefined-Time Sliding Mode Control and Adaptive Predefined-Time Sliding Mode Control Based on an RBF Neural Network
This section mainly verifies the control effect difference between the adaptive predefined-time sliding mode control based on an RBF neural network and the predefined-time sliding mode control after adding position interference. The specific parameters are described as follows: The parameters of the predefined-time sliding mode control are exactly the same as those set in the previous section; the parameters of the adaptive predefined-time sliding mode control based on the RBF neural network, except for those of the RBF neural network, are the same as in the previous section. The parameters of the RBF neural network are set as follows:

Comparison of Predefined-Time Sliding Mode Control and Adaptive Predefined-Time Sliding Mode Control Based on an RBF Neural Network
This section mainly verifies the control effect difference between the adaptive predefinedtime sliding mode control based on an RBF neural network and the predefined-time sliding mode control after adding position interference. The specific parameters are described as follows: The parameters of the predefined-time sliding mode control are exactly the same as those set in the previous section; the parameters of the adaptive predefinedtime sliding mode control based on the RBF neural network, except for those of the RBF neural network, are the same as in the previous section. The parameters of the RBF neural network are set as follows: I i = e i,z , . e i,z , s i,z T ,where e i,z represents the Z-axis control error, the width value b i of RBF neural network is set to 8, and the center value of the RBF neural network is set to Finally, the initial estimated value of the actual weight of the neural network is set aŝ Figure 8 shows the comparison between the estimated value of unknown interference and the real value of the unknown interference of the adaptive predefined-time sliding mode control algorithm based on the RBF neural network. Since the actual unknown interference is not continuously excited, the estimated value of the neural network in Figure 8 can only be guaranteed to be bounded and cannot converge to the true value. Figure 9 shows the control effects of the above two control algorithms. As can be seen from Figure 10, after adding the model interference, the convergence rate of the adaptive predefined-time sliding mode controller based on an RBF neural network is faster than that of the predefined-time sliding mode controller. Since the reference trajectory is not continuously excited, the adaptive predefined-time sliding mode control based on the RBF neural network presented in this paper cannot completely eliminate the influence of interference. However, compared with the predefined-time sliding mode controller without RBF neural network, the adaptive predefined-time sliding mode controller based on RBF neural network can improve the convergence accuracy of the Z-axis error curve by 200 times and can also make the Z-axis position state stable in the predefined time T c1,i + T c2,i = 5.5. mode control algorithm based on the RBF neural network. Since the actual unknown interference is not continuously excited, the estimated value of the neural network in Figure 8 can only be guaranteed to be bounded and cannot converge to the true value. Figure 9 shows the control effects of the above two control algorithms. As can be seen from Figure 10, after adding the model interference, the convergence rate of the adaptive predefined-time sliding mode controller based on an RBF neural network is faster than that of the predefined-time sliding mode controller. Since the reference trajectory is not continuously excited, the adaptive predefined-time sliding mode control based on the RBF neural network presented in this paper cannot completely eliminate the influence of interference. However, compared with the predefined-time sliding mode controller without RBF neural network, the adaptive predefined-time sliding mode controller based on RBF neural network can improve the convergence accuracy of the Z-axis error curve by 200 times and can also make the Z-axis position state stable in the predefined time   interference is not continuously excited, the estimated value of the neural network in Figure 8 can only be guaranteed to be bounded and cannot converge to the true value. Figure 9 shows the control effects of the above two control algorithms. As can be seen from Figure 10, after adding the model interference, the convergence rate of the adaptive predefined-time sliding mode controller based on an RBF neural network is faster than that of the predefined-time sliding mode controller. Since the reference trajectory is not continuously excited, the adaptive predefined-time sliding mode control based on the RBF neural network presented in this paper cannot completely eliminate the influence of interference. However, compared with the predefined-time sliding mode controller without RBF neural network, the adaptive predefined-time sliding mode controller based on RBF neural network can improve the convergence accuracy of the Z-axis error curve by 200 times and can also make the Z-axis position state stable in the predefined time

Simulation Results of the Obstacle Avoidance of the Quadrotor Formation
In this section, the simulation shows that the position and attitude of the quadrotor can be controlled by the adaptive predefined-time sliding mode control algorithm based on the RBF neural network. On this basis, we use the artificial potential field method to achieve obstacle avoidance in formation. In addition, this paper also optimizes the artificial potential field method, adding disturbance to avoid falling into the local optimal. The formation mainly consists of three quadrotors (one leader and two followers). The expected pilot trajectory is set as follows:  Figure 9 shows the comparison between the planned trajectory and the real trajectory of the quadrotor formation with obstacles. According to that, we can see the planned trajectory can be prevented from falling into local optimal when encountering obstacles by adding virtual force to the artificial potential field method, which can help the formation successfully bypass the obstacles and finally return to the planned path. At the same time, each quadrotor can stably track the planned trajectory under the control of the adaptive predefined-time sliding mode control algorithm based on the RBF neural network, able to stably track the planned trajectory. Taking the leader as an example, this paper shows the error curve of the leader tracking the planned trajectory on the ,, x y z axes in Figures 11-13. It can be seen that the quadrotor can track the planned trajectory stably and quickly under the control of the adaptive pre-defined time sliding mode control algorithm based on the RBF neural network, and the maximum tracking error in the obstacle avoidance process will not exceed 0.05m .

Simulation Results of the Obstacle Avoidance of the Quadrotor Formation
In this section, the simulation shows that the position and attitude of the quadrotor can be controlled by the adaptive predefined-time sliding mode control algorithm based on the RBF neural network. On this basis, we use the artificial potential field method to achieve obstacle avoidance in formation. In addition, this paper also optimizes the artificial potential field method, adding disturbance to avoid falling into the local optimal. The formation mainly consists of three quadrotors (one leader and two followers). The expected pilot trajectory is set as follows: ξ r 1,1 = [0, t, t] T , the trajectory is moving uniformly with a velocity of 1 m/s in the y and z directions), The trajectories of the first follower and the second follower are, respectively, ξ r 2,1 = ξ r 1,1 + [60, 0, 0] T and ξ r 3,1 = ξ r 1,1 − [60, 0, 0] T , and the coordinates of obstacle 1, obstacle 2, and obstacle 3 are, respectively, O 1 = [0, 80, 80]m T ,O 2 = [60, 120, 120]m T , O 3 = [−60, 120, 120]m T . The radius of the artificial potential field is R ς = 5, while the collision avoidance radius between the formation and obstacles is R k = 50. Figure 9 shows the comparison between the planned trajectory and the real trajectory of the quadrotor formation with obstacles. According to that, we can see the planned trajectory can be prevented from falling into local optimal when encountering obstacles by adding virtual force to the artificial potential field method, which can help the formation successfully bypass the obstacles and finally return to the planned path. At the same time, each quadrotor can stably track the planned trajectory under the control of the adaptive predefined-time sliding mode control algorithm based on the RBF neural network, able to stably track the planned trajectory. Taking the leader as an example, this paper shows the error curve of the leader tracking the planned trajectory on the axes in Figures 11-13. It can be seen that the quadrotor can track the planned trajectory stably and quickly under the control of the adaptive pre-defined time sliding mode control algorithm based on the RBF neural network, and the maximum tracking error in the obstacle avoidance process will not exceed 0.05 m. Sensors 2023, 23, x FOR PEER REVIEW 21 of 23 Figure 11. X-axis tracking error of the leader.

Conclusions
To solve the obstacle avoidance problem of a quadrotor formation model with unknown interference, this paper proposed an artificial potential field method for path

Conclusions
To solve the obstacle avoidance problem of a quadrotor formation model with unknown interference, this paper proposed an artificial potential field method for path

Conclusions
To solve the obstacle avoidance problem of a quadrotor formation model with unknown interference, this paper proposed an artificial potential field method for path

Conclusions
To solve the obstacle avoidance problem of a quadrotor formation model with unknown interference, this paper proposed an artificial potential field method for path planning. It adopted the adaptive predefined-time sliding mode controller based on the RBF neural network to control the formation. Firstly, we converted the ideal trajectory ξ r i,1 into the actual planned trajectory ξ d i,1 using the artificial potential field method and input the actual planned trajectory ξ d i,1 to the position loop controller of each quadrotor in the formation. Secondly, the RBF neural network was used to compensate for the unknown disturbance of the Z-axis of the quadrotor, and the predefined-time sliding mode control algorithm was used to control the position of the quadrotor. Thirdly, we transformed the lift force T i of the position loop into the expected value of the attitude loop through Equations (11) and (12) and input that to the attitude loop controller. Finally, we could realize the position and attitude control of the quadrotor, then it could track the planned trajectory ξ d i,1 within a predefined time, and finally we could realize the trajectory control of the whole formation. In future work, we will verify the algorithm's accuracy and correct its shortcomings by combining the real quadrotor formation.