Abstract
In this article, we developed a consensus-based leader-following formation control algorithm for a group of robotic fishes modeled by Euler–Lagrange dynamics. The Euler–Lagrange dynamics has been simplified as a second-order dynamics using the input transformation technique. Two consensus-based formation control strategies are discussed under the scenario: (1) leader with constant velocity and (2) leader with time-varying velocity. Three formation-keeping examples are shown in the simulations to verify the obtained formation control algorithm.
Introduction
In recent years, research on formation control of multiagent systems reveals some biological social phenomena, such as flocking of birds, schools of fish, and swarm of bees, 1,2 to name a few. The agents moving in formation can accomplish more complicated tasks through efficient cooperation than a single agent. This also reduce the energy consumption and increase the robustness for the system. 3 In view of those advantages, formation control has broad applied in (1) environmental monitoring, sensors are required to keep in a specified formation for maximum area coverage with limited number of sensors; (2) artificial intelligence system, for example, Google’s self-driving car project that vehicles form to a column with a common speed while keeping a specified formation. Such a design effectively increases the throughput of the transportation network 4 ; (3) military use, such as coordination for Autonomous Underwater Vehicle (AUV), 5 Unmanned Aerial Vehicle (UAV) formation flying, 6 and so on.
Formation control can be categorized as leader-following method, 7 –9 behavioral approach, 10,11 and virtual structures strategy. 12,13 These three types of formation approaches have their own strengths, for example, in the leader-following method, the group behavior can be directed through specifying the single leader’s behavior; in behavioral approach, each agent can share the relative states (like position) of its’ neighbors to keep the formation; and in virtual structures strategy, researcher can use virtual structures’ behavior to prescribe the formation behavior for the group.
In multiagent systems, the formation keeping can be achieved by sharing the configuration states of the individual agent. Consensus algorithms are designed to represent how information flow in a network topology and what update laws to be needed to guarantee information states of all agents converge to a common value. Some classical consensus algorithms and convergence analyses of both first-order and second-order dynamics are discussed in the literature. 14 –17 By appropriately selecting the information states, some consensus algorithms can be used to achieve formation keeping problems. Ren 18 introduced a consensus algorithm to tackle formation control problems of the second-order multiagent systems and proved that leader-following, behavioral and virtual structures formation control strategy can be regarded as special cases of general framework of consensus-based approach.
To the best of our knowledge, most of consensus-based formation control algorithms are applied on mobile robots, AUV, 19 underwater glider, 20 and so on. However, consensus-based formation for multiple robotic fish systems is still open. In this article, we make an extension of the leader–follower consensus algorithms in the study by Ren. 21 The basic idea for consensus-based leader–follower formation is that the group only has one leader which has the knowledge of the global information (like trajectory) and the follower update their information state based on the information states of their leader, thus all of the information states of the follower in the network will converge to the leader’s value. We assume that the information flow topology of the system forms a directed spanning tree so that formation keeping can be guaranteed.
The article is organized as follows. “Preliminaries and problem statement” section introduces some preliminaries on graph theory and basic description of the system. The dynamics of the system are discussed in “Dynamics” section. In “Consensus-based leader–follower formation control algorithm” section, some consensus-based leader-following formation control algorithms are proposed to guarantee the formation keeping. Three simulation examples are conducted to verify the theoretical analysis in “Simulation results” section. Conclusions are finally drawn in the last section.
Preliminaries and problem statement
Graph theory
The communication topology of the robotic fish system is modeled as a directed graph
The following lemma states a sufficient condition for reaching consensus-based formation control framework.
Lemma 1
In general consensus-based formation control framework, the formation keeping is guaranteed as long as a subset of the information flow topology forms a directed spanning tree. 18
Basic description of the robotic fish system
Remark 1
In this work, the considered leader–follower robotic fish system contains one leader and four followers. The topology of the system forms a directed spanning tree. The idea behind this choice is that in theoretical analysis, we can arbitrarily select the number of followers. However, consider the future experiment, it is extremely difficult to achieve formation keeping with multiple followers, either due to the limited size of the experimental site or due to the stability of mechanical structure and electronic equipments of the individual robotic fish.
The motion of the robotic fish has been constrained to planar motion as shown in Figure 1. Let

Robotic fish in a plane.
Dynamics
We use the Lagrange equation of the second kind (Euler–Lagrange) to describe the dynamic behavior of the system. Let
with
The rotational dynamics can be obtained as follows
where, as shown in Figure 2, m1 and m1 denote, respectively, the mass of body part and the mass of tail part. lC,1 and lC,2 represent, respectively, the distance between the front edge and the Center of Mass (CMs) of the robotic fish’s body part and the distance between the front edge and the CMs of the robotic fish’s tail part. And

Physical parameters of the robotic fish.
The translational dynamics (1) can be rearranged in matrix form
where
Consider the input transformation
and we have that
with q as the output and v as the control input.
Substituting the first equation in (2) into the second one gives the direct relation between τm and
with
According to the standard linear system theory, the combined system given by equations (3) and (6) with q as the output and
Consensus-based leader–follower formation control algorithm
Consensus for multiagent systems
Ren proposes the following second-order consensus protocol 18
where
where
Theorem 1
Consensus protocol (7) achieves consensus asymptotically if and only if matrix Γ has exactly two zero eigenvalues and all the other eigenvalues have negative real parts. Specially,
Proof (Sufficiency)
Noting that Γ has two exactly zero eigenvalues, we can verify that eigenvalue zero has geometric multiplicity equal to one. As a result, we know that Γ can be written in Jordan canonical form as
where
Without loss of generality, we choose
Noting that Γ has exactly two zero eigenvalues, we know that −Γ has a simple zero eigenvalue, which in turn implies that there exists a nonnegative vector p such that
where we have used the fact that
Noting that as t → ∞
We see that
Proof (Necessity)
Suppose that the sufficient condition that Γ has exactly two zero eigenvalues and all the other eigenvalues have negative real parts does not hold. Noting that Γ has at least two zero eigenvalues, the fact that the sufficient condition does not hold implies that Γ has either more than two zero eigenvalues or it has two zero eigenvalues but has at least another eigenvalue having positive real part. In either case, it can be verified that
where p and q are n × 1 vectors. As a result, the rank of
Leader–follower formation control algorithm based on consensus
In this section, we aim at designing a consensus-based leader–follower formation control algorithm for systems modeled by Euler–Lagrange dynamics based on theorem 1. As we analyzed in previous section, Euler–Lagrange dynamics can be simplified as a second-order dynamics using the input transformation technique. The simplified dynamics of the leader are
where q0 and ζ0 denote, respectively, the position and the velocity of the leader. v0 stands for the control law of the leader.
In this work, the leader has been designed to move along a desired trajectory, more specifically, for some constant speed trajectory
In more general cases, the desired trajectory may have time-varying speed
with
Similarly, the simplified dynamics of the follower can be written as
where qi and ζi denote, respectively, the position and the velocity of the ith follower. vi stands for the control law of the ith follower.
Definition 1
The leader–follower robotic fish system is said to achieve formation keeping if it satisfies
for any initial conditions.
For the follower, the widely used consensus-based formation control algorithm can be designed as follow: If the leader moves along a desired trajectory with constant speed, the control input is designed as
If the leader moves along a desired trajectory with time-varying speed, the control input is designed as
Note that in algorithms (16) and (17), the follower only know the information of it’s leader, δij is the desired separation which is used to guarantee the formation keeping. Then we know that
Simulation results
Consider the formation system consists of one leader and four followers, thus the communication topology is shown in Figure 3. Three formation stabilization simulation examples are conducted to verify the theoretical analysis. (1) Case I: the leader fish moves along a linear trajectory with a constant velocity; (2) case II: the leader fish moves along a polygonal trajectory with a constant velocity in a specific time interval. However, the velocity will be changed at the inflection point; (3) case III: the leader fish moves along a circular trajectory with a time-varying velocity. The information exchange topology is a directed edge from the leader to the follower, which forms a directed spanning tree. The physical parameters of the robotic fish are given in Table 1. The control parameters used in the simulations are listed in Table 2.

Communication topology.
Physical parameters of the robotic fish.
Parameters in simulations.
The trajectory, positions, and velocity states of all the robotic fishes in the three cases are shown in Figures 4 to 6.

Trajectory, positions, and velocity states of system (case I). (a) Trajectory; (b) positions at t = {0:T/4:T}; (c) velocity states.

Trajectory, positions, and velocity states of system (case II). (a) Trajectory; (b) positions at t = {0:T/10:T}; (c) velocity states.

Trajectory, positions, and velocity states of system (case III). (a) Trajectory; (b) positions at t = {0:T/10:T}; (c) velocity states.
Conclusion
In this article, we derive the dynamics of robotic fish system based on the Lagrange equation. A consensus-based leader-following formation algorithm is proposed to achieve the formation keeping of the system. The simulation results are provided to test the tracking performance of the system.
Remark 2
The main contribution of this work is that we obtain the accurate dynamic model of the robotic fish and apply linearization techniques to restrain the inherent nonlinearity of the system. The consensus algorithm used is from an existing paper. 21
It should be worth pointing out that this work only gives the theoretical analysis of the formation control and the experiments are needed for further investigations.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part by the National Natural Science Foundation of China under grants 51575005, 61503008, 61633002, and 91648120.
