Consensus Tracking of Nonlinear Agents Using Distributed Nonlinear Dynamic Inversion with Switching Leader-Follower Connection

In this paper, a consensus tracking protocol for nonlinear agents is presented, which is based on the Nonlinear Dynamic Inversion (NDI) technique. Implementation of such a technique is new in the context of the consensus tracking problem. The tracking capability of nonlinear dynamic inversion (NDI) is exploited for a leader-follower multi-agent scenario. We have provided all the mathematical details to establish its theoretical foundation. Additionally, a convergence study is provided to show the efficiency of the proposed controller. The performance of the proposed controller is evaluated in the presence of both (a) random switching topology among the agents and (b) random switching of leader–follower connections, which is realistic and not reported in the literature. The follower agents track various trajectories generated by a dynamic leader, which describes the tracking capability of the proposed controller. The results obtained from the simulation study show how efficiently this controller can handle the switching topology and switching leader-follower connections.


Introduction
Multiple UAV or multi-agent operation has been an exciting research area for years. Multi-agent systems (MASs) play an important role in executing complex tasks, which are usually difficult for a single UAV or agent. Examples of MASs applications are cooperative mobile robotics [1], sensory networks [2], flocking [3], formation control of robot teams [4], rendezvous of multiple spacecraft [5], etc. Agents share information over a communication network and take appropriate control action to agree on a decision, i.e., they achieve consensus. The control action is generated by consensus protocols designed using control theory. Researchers have proposed a variety of consensus protocols to solve different categories of consensus problems considering linear and nonlinear agents, like communication issues (switching topology [6][7][8], delays [9][10][11], noise [12][13][14]), disturbance [15,16], and fault [17,18]. A significant number of these protocols achieve the consensus with a single value, which primarily depends on the initial values of the agents. However, in a real-world scenario, the agents may need to converge to a time-varying consensus value, which is available to a few agents of networked MASs. This problem can be categorized as a consensus tracking problem (also known as a leader-follower consensus problem because a leader agent provides the time-varying values). Leader-follower consensus protocols have been proposed to solve this problem. In [19], the authors considered the nearest neighborhood principle and showed that all agents' states converged to the leader's state if the agents were jointly connected to the leader. However, this scheme was too restrictive. Ren and Beard [20] addressed the same problem in [19] with directed topology and relaxed restriction on the topology. Ren [21] showed that the consensus protocol of a proportional and derivative type could track a time-varying reference state of a virtual leader, but a proportional-like consensus protocol cannot do it. Peng et al. [22] solved a leader-following consensus problem. The leader agent has varying velocity and time-varying delays. Cao et al. [23] presented leader-follower consensus using a variable structure method. Hong et al. [24] proposed a distributed output regulation algorithm for linear agents. In [25], the authors solved a consensus problem for unknown systems. Wang et al. [26] used a distributed observer to solve an adaptive leader-follower consensus problem for higher-order agents. In [27], the authors addressed fixed-time event/self-triggered leader-follower consensus problems for networked multi-agent systems having nonlinear dynamics. In [28], the authors proposed distributed adaptive protocol for cooperative tracking problem considering pure relative output information. Guo et al. [29] discussed a fixed-time consensus tracking problem of nonlinear agents via discontinuous protocols. In [30], the adaptive consensus tracking control problem of nonlinear multi-agent systems (MASs) is solved using a robust adaptive event-triggered sliding-mode control method. Additionally, the authors considered unknown perturbations and limited network bandwidth in the problem.
One of the significant events that cause the tracking failure is the actuator fault. There exist a few papers that addressed the actuator fault in the consensus tracking problem. Qin et al. [31] implemented sliding mode control to solve the consensus tracking problem of nonlinear agents with actuator faults. They also considered disturbance in their study. Mu et al. [32] proposed an event-triggered control strategy to solve the leader-following consensus problem of agents with time-varying actuator faults. Xia et al. [33] presented a fault-tolerant fuzzy tracking controller for nonlinear agents subject to actuator failures and external disturbances. Gong et al. [34] studied an adaptive cooperative fault-tolerant supervisory control problem for nonlinear leader-follower agents with unknown control coefficients and actuator faults. More results can be found in [35,36]. Along with the actuator fault, switching topology is another event that is practical and causes difficulties during the consensus process. A few works have been reported in the literature where the effect of switching topology in tracking is studied. Wen et al. [6] presented consensus Tracking of agents having Lipschitz node dynamics and switching Topologies. Wang et al. [37] addressed a H ∞ consensus tracking control problem for linear agents. They considered switching topology and disturbances in their study. Razaq et al. [38] presented a leader-based consensus of one-sided Lipschitz (OSL) agents under switching graphs and input saturation. It can be mentioned that there exist a small number of papers that discussed consensus tracking considering both the switching topology and actuator fault. Sader et al. [39] presented the consensus tracking problem of agents' nonlinear function, exogenous disturbances, and actuator faults. They considered the switching communication topologies in their study. Liu et al. [40] designed a distributed fault-tolerant consensus tracking control for multi-agent systems with actuator faults considering both fixed and switching topologies. Additionally, Cao et al. [41] solved the same problem of consensus tracking control of stochastic agents with actuator fault under randomly switched topology.
It can be mentioned that, in the leader-follower or consensus tracking problem, the followers are connected to a few agents of the network. The connection between these followers and the leader can also change in a similar way in which the switching topology occurs. However, this leader-follower switching connection is not addressed in any paper. We will address this problem along with the actuator fault in this paper.
All of these papers implemented linear and nonlinear control theory to design the controller. There exists a control technique that is very efficient in designing controllers for nonlinear plants. The philosophy behind NDI is to use feedback linearization theory to remove the nonlinearities in the plant. Additionally, the response of the closed-loop plant is similar to a stable linear system. There are many advantages to using an NDI controller, e.g., (a) closed-form control expression, (b) easy mechanization, (c) global exponential stability, (d) inclusion of nonlinear kinematics in plant inversion, and (e) minimization of the need for individual gain tuning or gain scheduling. It has been used to design controllers in various applications. In [42], the authors designed an NDI-based flight controller. In [43], NDI controller was implemented for autonomous landing of UAV. Lifeng et al. [44] used Improved Dynamic Inversion to design trajectory tracking control for a quadrotor. In [45], the authors used an NDI controller to present a flying formation scheme. The follower UAVs are used to track the desired attitude commanded by the leader. The attitude control of a flexible aircraft was described using dynamic inversion by Caverly et al. [46]. Another example of using NDI to solve an attitude control problem of a hovering quad tiltrotor eVTOL Vehicle was presented by Lombaerts et al. [47]. In [48], the authors used NDI to track the angular reference rates obtained from the guidance command in a missile guidance problem. In [49], the authors presented a Nonlinear Dynamic Inversion (NDI) based flight controller for a VTOL aircraft, including transition maneuvers. They used virtual controls, generalized forces and moments to control its longitudinal motion. A fault-tolerant control (FTC) scheme was proposed by Ma et al. [50]. The scheme was based on extended state observer (ESO) and nonlinear dynamic inversion (NDI). In [51], trajectory generation and control architecture for a fully autonomous autorotative flare are proposed. These flare trajectories are tracked by a nonlinear dynamic inversion (NDI) control law.
These papers present the implementation of dynamic inversion to design a controller for a single platform. Mondal et al. [14] proposed a distributed consensus protocol based on NDI and named it Distributed NDI or DNDI. It has been implemented to solve consensus problems with actuator fault [18], external disturbances [16], and bipartite consensus [52]. In this paper, we have proposed a variety of DNDI that exploits the tracking capability of NDI and successfully solves a leader-following consensus tracking problem, which is different from leaderless consensus in terms of concept and formulation. We have evaluated the performance of the proposed controller in the presence of both (a) switching topology among the agents and (b) switching connections between the leader and the followers.
The contribution in this paper is given as follows.
• Distributed Nonlinear Dynamic Inversion (DNDI) based control protocol is designed to address the consensus tracking problem of nonlinear agents for the first time. This is novel because we exploited the tracking capability of nonlinear dynamic inversion (NDI) for a leader-follower multi-agent scenario. • Detailed mathematical derivation of the controller is provided. • Mathematical details for convergence study are presented, which gives proof of its correctness. • We have considered the presence of both (a) switching topology among the agents and (b) switching connection between the leader and the followers to make the scenario more realistic. This is new in the context of the consensus tracking problem. • Realistic simulation study shows the accuracy of the proposed controller. Different types of leader trajectories are generated to demonstrate the tracking capability of the proposed controller.
The rest of the paper is organized as follows. In Section 2, the preliminaries are given. In Section 3, the problem description is presented. Mathematical details of tracking DNDI for leader-follower consensus tracking is shown in Section 4. The convergence study of tracking DNDI is presented in Section 5. Simulation results are shown in Section 6, and Section 7 gives the conclusion.

Preliminaries
In this section, we have presented a few topics that are relevant to this study.

Consensus Tracking of Multiple Agents
Let us consider N nonlinear agents connected by a communication topology. The agents (called followers) need to track the trajectory of a leader X L (t), which is connected to a few agents of the networked agents. If the followers' states, i.e., X i (t); i = 1, 2, . . . , N achieve the consensus and track the leader's states, i.e., if for any initial conditions lim t→∞ |X i (t) → X L (t)| = 0, the followers are considered to achieve consensus tracking.

Graph Theory
The communication among the agents can be represented by a weighted graph written by G = {V, E }. The vertices V = {v 1 , v 2 , . . . , v N } of the graph are used to represent the agents. The set of edges, i.e., E ⊆ V × V, shows the communication among the agents. The elements of weighted adjacency There is no self-loop in the graph, i.e., the diagonal elements of the adjacency matrix A as zero (a ii = 0). The degree matrix is represented as The Laplacian matrix is written as L = D − A. In this paper, we consider the topology G of the network as undirected (i.e., a ij = a ji ) and connected (v i , v j ∈ V, there exists a path from v i to v j ).

Switching Leader-Follower Connection
In this paper, we have evaluated the performance of the proposed controller in the presence of a switching leader-follower connection along with the switching topology among the followers. In case of a consensus tracking problem, the leader's state information is available to a few follower agents. Let us consider the leader's state information is available to p agents, p ⊂ N, where N is the total number of followers. At any time t ≥ t 0 , the recipient followers are changed (some of them or all), and the leader's information is available to q agents (p = q or p = q).

Lemma
The useful lemmas used in this paper are given as follows.

Lemma 1 ([20]
). The Laplacian matrix L in an undirected graph is semi-positive definite, it has a simple zero eigenvalue, and all the other eigenvalues are positive if and only if the graph is connected. Therefore, L is symmetric and it has N non-negative, real-valued eigenvalues

Problem Formulation
In this section, the problem definition is given. The objective is to design a consensus tracking protocol that enables a class of nonlinear agents' (follower) states X i (t); i = 1, 2, . . . , N to achieve the consensus and track the desired signal (X L (t)) generated by a leader agent, i.e., X i (t) → X L (t). The ith follower agent is described bẏ where, X i ∈ n , U i ∈ n are states and control, respectively. f is a continuously differentiable vector-valued function representing the nonlinear dynamics.

Assumption 1. The matrix g(X i ) is invertible for all time.
The leader dynamics is given byẊ where, X L ∈ n . f L is piecewise continuous in t.
Assumption 2. X L (t) andẊ L (t) are assumed to be bounded.
It can be mentioned that the leader's state information is available to a few agents of the networked agents.

Distributed Nonlinear Dynamic Inversion for Consensus Tracking
Considering the agent (Equations (3) and (4)) and leader dynamics (Equation (5)), the consensus tracking error of i th agent (scalar n = 1) is given by Simplifying Equation (6), we obtain where X ∈ N , x L defines the state of a scalar agent, and β i shows if ith agent is connected to the leader. The tracking error is given for the agents with state vector X i ∈ n ; n > 1.
where E i ∈ n ,d i = (d i ⊗ I n ) ∈ n×n ,ā i = (a i ⊗ I n ) ∈ n×nN ,β i = (β i ⊗ I n ) ∈ n×n , X L ∈ n , and X = [X T 1 X T 2 . . . X T N ] T ∈ nN . We enforce the first-order error dynamics as follows.Ė Differentiation of Equation (9) giveṡ The expressions of E i andĖ i are substituted in Equation (9) to obtain Control U i of ith agent is obtained by simplifying Equation (11) as follows.

Convergence Study of DNDI for Consensus Tracking
The convergence study of DNDI is presented here. We define a smooth scalar function: L ⊗ I n can be represented byL where,S ∈ nN×nN is the left eigenvalue matrix ofL ⊗ I n , Ω = diag{0, λ 2 (L), λ 3 (L , . . . , λ N L )} ⊗ I n ∈ nN×nN is eigenvalue matrix,S TS =SS T = I nN×nN . (13) and (15), we can write
Remark 3. Φ =SΦ −1ST is positive definite matrix. Hence,Ṽ is positive definite subject to consensus error and qualify for a Lyapunov function.
Differentiating Equation (13), we geṫṼ where, According to Lemma 2, we can write E T and Substituting the inequality relation in Equation (19) Let us design the gain K i as follows.
Equation (22) is written aṡṼ Therefore, it is clear thatṼ is bounded as t → ∞. Moreover, we present the Uniformly Ultimate Boundedness (UUB) as follows. Using Equations (16) and (25), and Lemma 1.2 presented by Ge et al. [54], we can write We can write Equation (26) as follows.
Therefore, we can write lim Hence, it is proved that the error is bounded and the consensus tracking is successful.

Simulation Study
We have presented the simulation results and discussion in this section.

Agent Dynamics
We have considered ten agents (N = 10) for simulation. Highly nonlinear terms like sin and cos are included in the agents dynamics. The dynamics for ith agent [14] is given in Equations (31) and (32).Ẋ where, X i = X i 1 X i 2 T . The dynamics of Equations (31) and (32) are written in the form given in Equations (3) and (4) as follows.

Communication Topology
The communication topology used in this simulation study is given as follows.

Results and Discussion: Fixed Topology
We have considered two cases to describe the controller's performance. They are discussed in the following section.

Case 1: Leader States-Constant and Ramp Function
In this case, the leader dynamics are given as follows.
The consensus tracking controls U 1 and U 2 , generated by the DNDI, are shown in Figures 1  and 2, respectively. These controls produce the state trajectories. The states of the leader (X L 1 and X L 2 ) are ramp and constant functions, respectively. It can be seen that the agents' states X 1 and X 2 track the leader states X L 1 and X L 2 , respectively (shown in Figures 3 and 4).
The states achieve consensus with values dictated by the leader. The consensus error E i in states Figures 5 and 6 shows the tracking accuracy.
Agent9 Agent10 Figure 6. Consensus error E 2 in state X 1 of agents.

Case 2: Leader States-Sinusoid Function
In this case, the leader dynamics are considered as follows.
The consensus controls U 1 and U 2 are shown in Figures 7 and 8, respectively. It can be observed that the control signals are different from case 1. This is due to the leader's states, which are sinusoid in nature as given in Equations (40) and (41).  The state trajectories X 1 and X 2 are shown in Figures 9 and 10, respectively. The agents achieve consensus on the leader's trajectories. The leader's states are different, but the consensus controller has managed to track them.  The accuracy of consensus tracking is described by the errors E i in X 1 and X 2 , which are shown in Figures 11 and 12, respectively. The consensus tracking errors become zero in a few seconds, which explains the effectiveness of the proposed controller.

Results and Discussion: Switching Topology and Switching Leader-Follower Connections
In this case, we have presented the case where both (a) switching topology among the agents and (b) switching connection between the leader and the followers. The switching topologies are generated by the Algorithm 1.

Algorithm 1 Random topology generation.
for k = 1 to N p do for i = 1 to N do for j = 1 to N do

for end for end for
We have generated N p adjacency matrices, which denote the undirected topologies. N denotes the number of followers. The (i, j)th, i, j = 1, 2, . . . , N element of kth adjacency matrix k = 1, 2, . . . , N p is generated depending on the value of a random variable x, which is mentioned in the Algorithm 1. One topology at each time instant is selected (denoted by A s ) randomly (among N p topologies) using the Algorithm 2. A random integer ind in the range [1, N p ] is selected, and the corresponding topology A ind is chosen as A s .

Algorithm 2 Selection of topology.
A S remains same end if end for T s is the simulation time. Algorithms 1 and 2 were designed for implementing switching topology among the followers. Next, we will present the algorithms to describe the changing connections between the leader and the followers. N L leader-follower connections are generated using Algorithm 3. It can be observed that each element of the array temp is generated depending on the random variable x and a threshold value l. All the arrays generated are stored in the variable LF_con.
The leader-following switching connection is selected using the Algorithm 4. At each simulation time instant, one random integer ind is generated, and the array corresponding to ind in LF_con is selected as β. We considered the values of N p and N L as 100 and 30, respectively. The switching of topologies among the agents and switching connection of the leader-follower are shown in Figures 13 and 14, respectively. The topologies among the follower (given by the topology number) agents change at every time instant according to Algorithm 2. Similarly, the connections between the leader and the followers (given by the connection number) change according to Algorithm 4.

Algorithm 4
Selection of leader-follower connection.  The tracking consensus controls U 1 and U 2 are shown in Figures 15 and 16, respectively. They have differences from other cases, which is the effect of the switching topology and connections.  The state trajectories are generated by the control. The states of the followers started tracking efficiently within 2 s (see Figures 17 and 18). The effect of the switching is more visible within this time. However, the DNDI-based controller managed to reduce the error (see Figures 19 and 20) and improved the tracking performance. Therefore, it is clear that the proposed controller can perform the consensus tracking even in the presence of switching topology among followers and switching leader-follower connections.

Conclusions
The DNDI-based fault-tolerant controller has been used to solve the consensus tracking control of nonlinear agents for the first time. This derivation is different compared to our previous work about leaderless consensus control. Moreover, switching topology among the agents and switching leader-follower connections are considered, which is more realistic and addressed for the first time. A convergence study is presented to prove the tracking capability of the controller. A realistic simulation study evaluates the controller's performance, where different types of leader trajectories are generated, and the agents successfully track the leader's states. The results show that the proposed controller works efficiently in this realistic scenario. Therefore, the proposed controller is a potential candidate for consensus tracking applications.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.