# Lattice flocking of multi-quadrotor system: an algorithm based on artificial potential field

- 179 Downloads

## Abstract

This paper investigates the flocking and obstacle avoidance problem of multi-quadrotor system with a lattice-type structure. To tackle nonlinear dynamics and cooperative consensus of a swarm of quadrotors, we proposed two algorithms (one for free flocking and one for constrained flocking) based on artificial potential field with two cooperative strategies using position tracking and attitude tracking, respectively. Firstly, the inner-loop control model of single quadrotor is provided. Then, we build an artificial potential function to act on the coordinate variable. Third, obstacle avoidance term is added to the flocking algorithm proposed previously. Finally, the position and attitude are taken as the coordinate variables, respectively, to both two algorithms, one for optimizing the distance of each quadrotor until the lattice-type structure is formed and keeping continuously and another for optimizing the distance between quadrotor and obstacles to avoid collision. Simulation results demonstrate the validity of both algorithms.

## Keywords

Flocking Artificial potential field Multi-quadrotor system Unmanned aerial vehicle (UAV) Obstacle avoidance## 1 Introduction

In recent years, coordinated and cooperative control of multi-UAV has received much attention spurred by the fact that many benefits can be obtained when multi-UAV executes a task in a cooperative fashion. During all kinds of tasks, consensus is the basis of UAV cooperation. Wei and Beard in [1] introduced the basic theory of consensus problem of multi-agent. They also investigated some further problems such as formation structure, communication, noise and so on. Their study is very helpful for later flocking research. Song in [2] investigates the mean square consensus problem of multi-agent systems impacted by the combined uncertainty of multiplicative noises and time delays. Further research is the formation control because formation is the basis of multi-UAV mission. Turpin et al. [3] proposed a centralized formation control algorithm. They model formation by shape vectors and achieve safe reconfiguration by changing shape vectors. While for flocking, there are many advantages; flock has no accurate position control requirements and so it is very flexible like birds, fishes, ants and bees. Reynolds introduced three heuristic rules that led to creation of the first computer animation of flocking [4]. These three rules have made great influence on the later multi-agent research. Olfati-Saber in [5] proposed a distributed flocking algorithm for particle system that leads to flocking in 3D free space. They also considered constrained flocking. They see agent as second-order dynamic. Cetin et al. [6] used artificial potential field method to plan path for UAV in order to build a long-range communication chain. For obstacle avoidance, Oleynikova et al. in [7] present a continuous time trajectory optimization method for real-time collision avoidance on multi-rotor UAVs. This continuous method is very efficient but costly for single UAV.

On the other hand, the unmanned quadrotor is a widely used UAV for its many advantages, such as low cost, flexibility and efficiency. Especially, the ability to hover makes it suitable for many scenarios and the quadrotor’s structure is simple and easy to maintain. Several typical cooperation applications include crop monitoring [8], forest fires, urban traffic, inspection of the nuclear power station and so on. Mellinger in [9] studied the trajectory generation control for quadrotors. For quadrotor’s dynamic model, Rubio et al. in [10] presented two dynamic models of a quadrotor: translation dynamic and rotation dynamic. And they also compared the difference between them. For quadrotor’s control theories and algorithms, please see [11, 12, 13]; while the research on the flocking problem of multi-quadrotor system is relatively fewer, especially under desired conformation with specific geometric structure.

To capture an apparent spatial order in real life, the lattice type is normally used to model the flocking structure. Lattice-type structure is very flexible for multi-UAV system, because there is no strict requirement of position. We use the flocking algorithm based on artificial potential field to control the multi-quadrotor system, and make them flock together into lattice-type structure. For obstacle avoidance, we create virtual UAV on the boundary of neighbour obstacles and keeping a distance from it will avoid collision with obstacle. For single quadrotor control, two cooperative control strategies are provided based on position control and attitude control, respectively. Free flocking simulation results show that both the control strategies are effective for the free flocking algorithm, and the attitude control strategy can better eliminate the steady-state error and make the lattice-type structure more accurate. Constrained flocking simulation result shows that attitude control strategy is effective for constrained flocking algorithm.

This paper is organized as follows. In Sect. 2, we introduce the multi-quadrotor system control model and the flocking goal together with the obstacle avoidance target. In Sect. 3, we propose two control strategies for the flocking algorithm. Then in Sect. 4, some simulation results are provided. Finally, in Sect. 5, we conclude our work and look to the future research.

## 2 Problem formulation

The theoretical framework presented in this paper relies on some basic concepts in graph theory [14, 15], consensus problems [1, 16], and flocking algorithm [4].

### 2.1 Multi-quadrotor control model

We consider the flocking problem of multi-quadrotor system. Firstly, the typical control model of one single quadrotor should be constructed. The quadrotor can be modeled as a rigid body with three translational degrees of freedom along the axes and three rotational degrees of freedom around the axes. First, two basic coordinate systems of the world frame and the body frame are provided. The world frame, * W*, is defined by axes \( x_{w} \), \( y_{w} \) and \( z_{w} \). The body frame,

*, is attached to the center of mass of the quadrotor. We use*

**B***Z*–

*X*–

*Y*Euler angles to model the rotation of the quadrotor in the world frame.

We can model the quadrotor using \( q = \left[ {x,y,z} \right]^{\text{T}} \in R_{3} \), which refers to the position alone the axes of world frame, and yaw angle \( \psi \), roll angle \( \phi \) and finally pitch angle \( \theta \). The velocity in the world frame is expressed by \( p = \left[ {\dot{x},\dot{y},\dot{z}} \right]^{T} \in R_{3} \) and the angular velocity in the body frame is expressed by \( \varOmega = \left[ {\varOmega_{1} ,\varOmega_{2} ,\varOmega_{3} } \right]^{T} \in R_{3} \).

*D*stands for the distance between rotor and mass center.

*J*stands for the inertia matrix of quadrotor, and \( \times \) is cross-product.

### 2.2 Flocking control target

*V*is the edges of the proximity net and

*r*is the communication range. Only if the distance between two UAV is less than communication range, they can communicate and they are neighbours.

*q*

_{i}is the

*i*-th UAV’s position state. This means all the UAVs keep the same distance eventually. This geometric structure is very flexible because each UAV does not have an absolute fixed position. They just flock together. In 2D space, the structure looks like crystals (see Fig. 3). As there is no strict requirement of position, this type of structure is very flexible.

As the UAV’s neighbors are determined by communication distance *r* and the UAVs with greater distance than *r* will have no influence on it, the desired relative distance *d* must be smaller than *r*. There must be a lower bound of desired relative distance *d* to avoid collision because of overshoot, but we did not calculate its value. Later in chapter 4, the simulation results show that the values of a set of parameters we use based on the experience can avoid this problem.

For most multi-UAV missions, there is still a long distance from the mission area to the takeoff location. So the multi-UAV formation needs to navigate the mission area together. Usually there are obstacles on the way; so the multi-UAV must have obstacle-avoidance capability and that is constrained flocking.

So, in conclusion, we want all the UAV to form lattice-type structure flock using proximity net topology by controlling all the UAV’s acceleration. Then the flock can pass through obstacle area with no collision and reform lattice-type structure. So the multi-UAV system has constrained flocking ability.

## 3 Main results

### 3.1 Free flocking algorithm

We hope that all the unmanned aerial vehicles (UAV) will eventually maintain the same distance to all of its adjacent UAVs (lattice-type structure). So when two unmanned aerial vehicles are close to each other, they need repulsive effect to avoid collision; while when they are far apart, they need to be attractive. They also need to keep the same speed at the same time. Actually, these are the three heuristic rules introduced by Reynolds in 1986 [4]. Here are the three flocking rules: flocking centering, collision avoidance and velocity matching.

- 1.
Non-negative;

- 2.
Reaches minimum value at the desired relative distance

*d*; - 3.
Vanishes when distance is bigger than communication distance

*r*.

So the final collective potential function is a non-negative function, with the property that any solution of the set of algebraic constraints is ‘*closely related to*’ global minimum value and vice versa [5].

But (16) has no group objective, and it states the interaction rule of two UAVs. So fragmentation phenomenon will appear. To solve this problem, we add a new term. The free flocking algorithm is as follows.

### 3.2 Constrained flocking algorithm

We simulate our obstacles as connected regions with boundaries that are smooth manifolds. Specifically, we focus on circle obstacle and wall obstacle.

Thus a new term will be added in the algorithm to achieve the effect of obstacle avoidance. So finally Algorithm 2 has three terms.

### 3.3 Multi-quadrotor control strategies

As mentioned in the chapter 2.1, there are two strategies for the control of single quadrotor (position command control and attitude command control). So in the flocking of multi-quadrotor system, we use both to do the comparison.

We first introduce how to use these two control strategies in the flocking of multi-quadrotor system.

For position command control, the control input of quadrotor is the desired position. So we first use the same amount of virtual vehicles to execute flocking algorithm, which are second-order dynamic systems. Then let the real nonlinear dynamic quadrotor track the position of its own virtual vehicle. In general, each quadrotor’s control input is the virtual vehicle’s position state.

For attitude command control, the quadrotor’s control input is the desired attitude state (pitch angle \( \theta \) and roll angle \( \phi \)). When the attitude angle of the quadrotor is small (less than 30°), the attitude angle is approximately proportional to the acceleration in the horizontal direction. So we can use the results of flocking algorithm as the desired attitude angle which can be the control input of quadrotor.

In conclusion, in attitude command control, the output of flocking algorithm is sent directly into the quadrotor’s attitude controller as control input; while for position command control, the output of flocking algorithm is sent into a virtual second-order dynamic vehicle to calculate the desired position which will be the control input of quadrotor’s position controller.

Since a virtual vehicle is added between the flocking algorithm and the quadrotor in the position command control, the quadrotor begins to have obvious movement as desired only when the virtual vehicle has moved a certain distance. So there must be a time delay for the real quadrotor to move as desired. Our simulation results in chapter 4 also proved this.

In control strategy 1, for *i*-th quadrotor update, the control input is position state \( q_{i} \). While in control strategy 2, attitude state \( \phi_{\text{des}} ,\theta_{\text{des}} {\text{ and }}\psi_{\text{des}} \).

*Q*in both two control strategies for later evaluation. And

*Q*follows to

The algorithm is distributed, so the quadrotor calculates the control inputs itself, just relying on its neighbors’ states. This scheme can reduce the calculation cost on one UAV. Thus, each UAV do not need a powerful computer, and that is easy.

## 4 Simulation results

In this section, we present some simulation results. The update frequency is 100 Hz. The objective point is marked with a red × sign. The following parameters based on experience remain fixed throughout all simulations: \( d = 7 \), \( r = 8.4 \), \( a = b = 5 \), \( c = {{(a - b)} \mathord{\left/ {\vphantom {{(a - b)} {\sqrt {4ab} }}} \right. \kern-0pt} {\sqrt {4ab} }} \), \( h = 0.2 \).

For the sensor measure process, we considered some practical problems. Several sensors will be installed on the quadrotor frame to measure the state itself. These sensors are: GPS, accelerometer and gyroscope. But each sensor has error and delay. So, we added random additive noise to these sensors. The update frequency of GPS is relatively low, and inversely proportional to accuracy. To ensure positioning accuracy, most commercial UAV set the GPS update frequency to 10 Hz. Thus, we set the GPS’s update frequency to 10 Hz to simulate the real situation.

Quadrotor parameter

Parameter | Data range |
---|---|

Mass (kg) | 1.4 |

Moment of axes ( | [0.05, 0.05, 0.24] |

Roll and pitch angle \( \phi ,\theta \) | − 30° to 30° |

Yaw angle \( \psi \) | − 180° to 180° |

Angular velocity, \( \dot{\phi },\dot{\theta },\dot{\psi } \) | − 50 to 50 deg/s |

Control input \( \mu_{1} \) | 0–43.5 |

Control input \( \mu_{2} ,\mu_{3} \) | − 6.25 to 6.25 |

Control input \( \mu_{4} \) | − 2.25 to 2.25 |

### 4.1 Multi-quadrotor free flocking simulation using algorithm 1

At the beginning, we randomly sprinkle 15 points in the scene around the original position (0, 0) as the initial position of the UAVs. Set the virtual objective’s position with (0, 0). Each quadrotor can only communicate with its neighbours designed by a sphere with constant radius which is the communication range *r*; while every quadrotor can receive the objective’s state. The objective has a constant speed heading right.

*d*.

Since the position is randomly at first, few quadrotors have the desired distance with its neighbours. Finally, in Fig. 7b, a lattice-type flock is formed and maintained thereafter. But there is an obvious distance between the virtual vehicle and its nearby quadrotor, which indicates that there exists a state error for every quadrotor. Figure 8 shows the flocking for a group of \( n = 15 \) quadrotors using attitude command control. As you can see in Fig. 8b, each quadrotor is equally distanced from all of its neighbours and form a lattice-type flock eventually, and there are no state errors.

*Q*-function which is shown in Fig. 9.

*Q*-function using both control strategies. As mentioned in the chapter 3, the smaller the value of

*Q*, the more accurate the lattice-type flock is. We will compare the smallest value and the decline rate of both two

*Q*-function to find which control strategy is better. When using position tracking the smallest value of

*Q*is 64.39, while using attitude tracking, 58.33. The comparison of decline rate of

*Q*-function over the first 2 min also proved the better performance of attitude tracking. After calculation the decline rate of

*Q*-function over the first 2 min is 38.45 when using position tracking, while for attitude tracking, 45.84. Table 2 shows the difference of

*Q*-function between two control strategies.

Comparison of *Q*-function between two control strategies

Control strategy | Minimum value of | Decline rate of |
---|---|---|

Position tracking | 64.39 | 38.45 |

Attitude tracking | 58.33 | 45.84 |

So in conclusion, the flocking of multi-quadrotor system is less accurate when using position tracing, because of the time delaying in each quadrotor, which is caused by the adding virtual vehicle in the control. Thus, the simulation results proved that attitude tracing is better than position tracing.

### 4.2 Multi-quadrotor constrained flocking simulation with obstacle avoidance using algorithm 2

Obstacle parameters

Obstacle number | Type | Parameters |
---|---|---|

1 | Circle | Center: (20, 20) |

Radius: 1 | ||

2 | Circle | Center: (35, 35) |

Radius: 1.3 | ||

3 | Linear | Length: 5 |

Endpoint: (20, 30) (25, 30) |

At first, 15 quadrotors’ initial positions are randomly set and the objective’s initial position is set to \( ( - 5, - 5) \) and the initial speed is zero. The objective’s speed is constant heading to top right corner. Note that \( c_{1}^{\alpha } < c_{1}^{\gamma } < c_{1}^{\beta } \) and \( c_{2}^{v} = 2\sqrt {c_{1}^{v} } \) for all species.

In Fig. 10a, 15 quadrotors’ initial positions are random, and their speed is zero. In Fig. 10b, lattice-type flock is formed, and they have not encountered obstacles so far. In Fig. 10c, the objective passes through the first circle obstacle, while quadrotors avoid obstacle. Finally, in Fig. 10f, all quadrotors pass through the obstacle area with no collision and reform lattice-type flock. The simulation result proves that algorithm 2 is effective for obstacle avoidance.

## 5 Conclusion

In this paper, we use the flocking algorithm based on artificial potential field to control the multi-quadrotor system, and make them flock together into lattice-type structure. We also investigate constrained flocking with obstacle avoidance ability. Two cooperative control strategies for multi-quadtotor system are provided based on position command control and attitude command control, respectively. Simulation results show that both the control strategies are effective for free flocking algorithm, and using attitude command control strategy can better eliminate the steady-state error and make the lattice-type structure more accurate. Attitude command control strategy is effective for constrained flocking algorithm. Further, the impact of communication noise and delay is worth investigating to be more practical.

## References

- 1.Wei R, Beard RW (2008) Distributed consensus in multi-vehicle cooperative control. Springer, LondonzbMATHGoogle Scholar
- 2.Song L, Huang D, Nguang SK et al (2016) Mean square consensus of multi-agent systems with multiplicative noises and time delays under directed fixed topologies. Int J Control Autom Syst 14(1):69–77CrossRefGoogle Scholar
- 3.Turpin M, Michael N, Kumar V (2012) Trajectory design and control for aggressive formation flight with quadrotors. Auton Robots 33(1):143–156CrossRefGoogle Scholar
- 4.Reynolds CW (1987) Flocks, herds, and schools: a distributed behavioral model. In: ACM SIGGRAPH’87 computer graphics conference proceedings, vol 21, no. 4, pp 25–34, July 1987Google Scholar
- 5.Olfati-Saber R (2006) Flocking for multi-agent dynamic systems: algorithms and theory. IEEE Trans Autom Control 51(3):401–420MathSciNetCrossRefGoogle Scholar
- 6.Cetin O, Zagli I, Yilmaz G (2013) Establishing obstacle and collision free communication relay for UAVs with artificial potential fields. J Intell Robotic Syst 69(1):361–372CrossRefGoogle Scholar
- 7.Oleynikova H, Burri M, Taylor Z et al (2016) Continuous-time trajectory optimization for online UAV replanning. In: IEEE/RSJ international conference on intelligent robots and systems. IEEE, 2016Google Scholar
- 8.Valente Joao, Sanz D, Barrientos A et al (2011) An air-ground wireless sensor network for crop monitoring. Sensors 11(6):6088–6108CrossRefGoogle Scholar
- 9.Mellinger D (2012) Trajectory generation and control for quadrotors. Dissertations and theses—gradworksGoogle Scholar
- 10.Rubio JDJ, Cruz JHP, Zamudio Z et al (2014) Comparison of two quadrotor dynamic models. IEEE Latin Am Trans 12(4):531–537CrossRefGoogle Scholar
- 11.Bouabdallah S, Siegwart R (2007) Full control of a quadrotor[M]Google Scholar
- 12.Altug E, Ostrowski JP, Taylor CJ (2003) Quadrotor control using dual camera visual feedback. In: IEEE international conference on robotics and automation, 2003. Proceedings ICRA. IEEE, 2003 vol 3, pp 4294–4299Google Scholar
- 13.Das A, Subbarao K, Lewis F (2009) Dynamic inversion with zero-dynamics stabilisation for quadrotor control. Iet Control Theory Appl 3(3):303–314MathSciNetCrossRefGoogle Scholar
- 14.Diestel R (2000) Graph theory, vol. 173 of graduate texts in mathematics. Springer, New YorkGoogle Scholar
- 15.Bollobas B (1998) Modern graph theory, vol. 184 of graduate texts in mathematics. Springer, New YorkGoogle Scholar
- 16.Saber RO, Murray RM (2003) Consensus protocols for networks of dynamic agents. In: American control conference, 2003. Proceedings of the IEEE, 2003, pp 951–956Google Scholar