Control Input Design for a Robot Swarm Maintaining Safety Distances in Crowded Environment

: We consider an autonomous and decentralized mobile robotic swarm that does not require an advanced communication system; moreover, each robot must pass a narrow space preserving the distance with other robots. The control barrier function (CBF) method is useful for robotic swarms to guarantee collision avoidance. However, introducing CBF inequalities can cancel other objectives and sometimes causes a deadlock problem. Therefore, we introduce a coupled oscillator system to generate asymmetric global order by itself to avoid deadlock. By generating an effective global order in the swarm, each robot adequately moves to a target position without requiring high-cost communication systems.


Introduction
Several attempts have been made recently to control multi-mobile agent systems [1][2][3][4][5][6][7][8][9][10]. For example, Cui et al. performed formation control on underwater vehicles [1]. Miyano et al. proposed a cooperative object transportation method for multi robots [2]. Among them, mobile robotic swarms, which are autonomous, distributed, and do not require advanced communication, are robust to communication disruptions and robot failures. Therefore, they could be applied to systems operating in harsh environments, as well as micro-robot swarms. Multi-mobile robots must satisfy conflicting objectives such as collision avoidance, gathering, and moving to the target simultaneously. We require a swarm system to perform the conflicting objectives only by observable information from each robot. A straightforward method is to express these objectives as virtual forces to determine the input by adding them [11]. However, each objective interferes with each other and complicates parameter tuning. Furthermore, particularly when considering the size of the robot, guaranteeing collision avoidance is challenging, because we cannot predict how the collision avoidance terms are reflected in the input of the robot. In particular, in a crowded environment, robots can undergo the safety distance of other robots.
An idea to solve interference is to express constraints, such as collision avoidance, as inequalities to the input. Control barrier function (CBF) is a method to design the theoretical inequality condition. CBF is a tool that theoretically guarantees that the target system satisfies the constraints [12,13]. Ames et al. [14] applied CBF to a mobile robot and a legged robot. The CBF method was also applied to multiple robots [15][16][17]. However, inequality constraints using CBF have the limitation that it can cancel other objectives to guarantee constraints. Thus, introducing CBF constraints for multi-robot systems can cause deadlock during movement, as mentioned in [15]. In some situations, to overcome this deadlock problem, deciding control input based only on local observable information, such as relative position and velocity, is insufficient. Therefore, to introduce CBF and avoid deadlock simultaneously, robots must communicate global information and move appropriately from a macroscopic perspective. However, these tasks are not straightforward for a swarm system because they must not use centralized control and high-cost communication. Each robot must decide only by limited information. For an autonomous decentralized swarm system, moving based on global information is the same as forming a global order by itself.
An alternative method for generating global order is using a coupled oscillator system (COS), where the distribution of the natural frequency of each oscillator generates a global phase gradient field covering all the oscillators. If each robot is equipped with an oscillator, the robots share the same gradient field and can move in an orderly manner.
In this paper, we consider a narrow space-passing task for a swarm with CBF inequalities. We introduce the deadlock problem due to CBF and resolve it by generating an asymmetric global order with COS. The proposed method allows introducing CBF constraints for robotic swarms to avoid deadlock problems. The simulations confirm that the proposed method satisfies the following three requirements-separate constraint and task achievement in input determinants, guarantee to maintain a safe distance between robots, and guide the robots successfully.
This method can be applied to robot systems that need to pass through narrow spaces in restricted situations in future. For example, rescue robots that operate in harsh environments, underwater exploration robots where high-speed communication is difficult.

Target System
We consider N circular mobile robots of radius r that can move in all directions in a two-dimensional plane with obstacles. Suppose that the relative position and velocity with other robots and obstacles can be measured within its visible region r v . Let a mobile robot i have the dynamics expressed in Equation (1) where x i ∈ R 2 and u i ∈ R 2 represent the position and control input of force, respectively.
where m,η are positive constant values denoting mass of each robot and viscosity, respectively. The dot symbol indicates time derivative thenẋ i is velocity andẍ i means acceleration of each robot. Moreover, we construct u i as follows: where f O i , f F i , and f P i are virtual forces denoting collision avoidance with obstacles, maintaining the distance between robots and task goal (like moving to target) term, respectively. By adding up these virtual forces, each robot decides its control input u i . The decision making by (2) can achieve autonomous decentralized control. However, interference between each term causes two major problems: (1) parameter tuning is complicated, and (2) there is no guarantee of collision avoidance constraint, for instance, maintaining a safe distance.
For a later simulation, we define f O i , f F i , as proposed in [18].
where x io denotes the relative position of the nearest obstacle object, and d ij := x ij r c , x ij := x j − x i . N i := {j ∈ {1, . . . , N} | x ij ≤ r v } is a neighbor set of the robot i. These force terms have the distance parameter d o , and r c , and the weight parameters k O , and k F . See the Appendix A for more details on these virtual forces.

CBF Method
To avoid interference between virtual forces, CBF is a useful method. In this section, we review the method of Zeroing CBF (ZCBF). Interested readers can find the details of the method in [13]. Let state x ∈ R n follow the input-affine system below, using input u ∈ R ṁ where f and g are locally Lipschitz. Consider h(x) : R n → R is a continuously differentiable function and C = {x ∈ R n | h(x) ≥ 0}. Then, h(x) is said to be a (ZCBF) [13] for the set C if there exists an extended class K function α : Subsequently, if the function h is a ZCBF of C and if Lipschitz continuous u satisfies inequality (7) at any time, set C becomes forward invariant where L f and L g are the Lie derivatives along f and g, respectively. If we describe the safety condition as h(x) ≥ 0, and select the control input u to satisfy constraint (7), x(t 0 ) ∈ C ⇒ x(t) ∈ C ∀t ≥ 0 is guaranteed; however, we need to be careful regarding the relative degree of h. As presented above, CBF describes the constraint as an inequality condition of input, which theoretically satisfies the constraint. However, the inequality by CBF cancels other objective terms to guarantee constraints. In this sense, CBF is a "hard" method. CBF's "hard" input causes a deadlock problem. While one solution is adding perturbation to the control input, it is not enough in some situations. A more practical way is to introduce global information to each robot and generate a global order in the entire swarm.

COS Method
In this section, we introduce COS, which can generate global order with low-cost communication. We give each robot a new scalar state variable, φ i , and we call it phase. We assume that each robot can observe the phase of its neighboring robots. Based on our assumptions, we update the phase φ i of each robot following a common rule (8) [18,19].
The introduction of phase according to (8) means that we have equipped each robot with a virtual one-dimensional oscillator. In the equation, Ω i indicates the natural frequency of each oscillator, κ is a common constant gain for interactions, φ i is the phase of oscillator i, and i φ j is the phase of oscillator j observed by robot i. Once we assume that observation matches the true value, i φ j = φ j . Since the oscillators of each robot interact with each other, the entire robots constitute a COS. In the COS consisting of oscillators (8), the phase gap of the oscillators converges to a specific value and generate a phase gradient [20].
We will present a simple example. Suppose that four robots are lined up in a straight line (Figure 1). In the figure we show the phase of each robot (oscillator) as a clock.  When there is no coupling between the oscillators (k = 0), the phase of each oscillator is determined individually (Figure 1a). Then, if the neighboring oscillators are coupled (k > 0), the oscillators are synchronized. If the natural frequency of each oscillator Ω i is the same, phase of each oscillator will converge to the same value ( Figure 1b). In contrast, Increasing the natural frequency of the rightmost oscillator (circled in red) produces a phase gradient over the entire system as shown in Figure 1c.
As like example, there will be a spatial gradient in the phase value according to the spatial distribution of Ω i as shown in Figure 2. By observing the phase value of the oscillator, each robot knows the gradient at each position. Each robot follows a globally shared gradient field (9), and then moves in an orderly manner. Therefore, by appropriately specifying Ω i , we can generate a global order in a robotic swarm.

Objective
In this study, we deal with passing a narrow space problem for robotic swarms [9]. The description of this task is presented later. For this task, our swarm system must satisfy the following three requirements: (i) Separate constraint and task achievement in input determinants; (ii) Guarantee to maintain a safe distance between robots; (iii) Successfully guide the robots; Requirements (i) and (ii) are satisfied by introducing a CBF constraint. However, CBF inequalities cause deadlock and disturb satisfying requirement (iii). To overcome this deadlock problem, we use COS to generate a global order.
In this study, we set the narrow space as shown in Figure 3. We assume that a leader robot knows the target path of the robots. This assumption applies to situations where humans control specific robots and cases such as the odor source search problem, where some robots detect the odor source and use the phase gradient information to guide the entire swarm.
For the leader to guide the followers, the natural period Ω i of each oscillator is set as follows: Throughout the task, Ω i of each oscillator is kept constant. By following the setting mentioned above, a phase gradient is formed around the leader, and followers are guided in the direction of the leader.

CBF for a Swarm
We introduce the CBF constraint for our swarm system. Let be the control period T c and q = [q 1 , q 2 ] T = [x ij ,ẋ ij ] T . The safety function h(q) between agent i, j is described as follows: where r s denote the minimum safety distance. From each agent system, Equation (1), q can be expressed as follows:q = f (q) + g(q)(u j − u i ).
Consider f (q) = (q 2 , − η m q 2 ) T , g(q) = (0, 1 m ) T . Using Equations (11) and (12), the input constraint of each agent corresponding to Equation (7) can be written as follows: where γ > 0 is a parameter denoting the constraint. and this parameter denotes naively of constraint. If we determine u i satisfying inequality constraint (13), h(q) ≥ 0 is theoretically satisfied. This implies that requirement (b) is fulfilled. Moreover, we construct the raw control inputû i as follows:û u trace is the force following the target path given to the leader robot. For follower robots, f O i is deleted from Equation (2), because this force only denotes the collision avoidance constraint. f F i is also a constraint term. However, this term remains because it also aims to ensure an appropriate distance between individual robots. Finally, we determine the robot's control input using the Quad Program form as follows: By determining the input in the form of Equations (14) and (15), we separate constraints from other objectives (requirement (i)) and obtain the theoretical guarantee of collision avoidance (requirement (ii)). We succeed in writing the constraints in the form of inequality using CBF. The separation of constraints and achievement is performed; therefore, the requirement (i) is achieved.

Deadlock Solution by COS
We introduce an example of a deadlock problem due to CBF and propose a method to resolve it. The follower robot moves in the direction of the leader robot by f P i . It sometimes moves around in front of the leader robot, as shown in Figure 4. This is particularly true when the leader slows down or changes direction. Once the leader robot is encircled, the inequality condition of the collision avoidance constraint prevents the leader from moving, and the entire robot stops. We call this the deadlock problem due to leader encirclement. We have to prevent the occurrence of this deadlock problem in order to fulfill the requirement (iii). We add geometrical information to the oscillator as a phase shift based on the relative direction to resolve this problem.
where robot l is the leader, c is a positive constant, and θ li ∈ [−π, π] denotes the direction in which follower i exists relative to the direction of movement of the leader l. This equation changes the phase gradient to be asymmetric in the direction of the leader. This equation leads the phase to be higher on opposing the movement direction of the leader (asymmetry). By coupling the oscillators, the robots share the gradient field with this tendency. Thus, an orderly movement exists that does not disturb the movement of the leader. We have another method for avoiding deadlock, for example, by including perturbations in the robot's input. However, small perturbations toû i are cancelled out by the CBF. Large perturbations prevent task achievement and cause the swarm to shred. Perturbations to u i violate the CBF condition and thus violate the safe distance. Our method achieves deadlock avoidance without affecting the swarm and preserves the CBF condition.

Simulations
In this section, we verify that the robotic swarm using the proposed method satisfies requirements (ii) and (iii). The simulation comprises a narrow passage simulation. The unit of x i is the meter and the unit of u i is the newton in the simulation. We simulated 20 robots within a 16 m × 16 m plane field, as shown in Figure 5. To evaluate a requirement (iii), we introduce a criterion. We determine the center of the swarm from the average of the robot positions. When the center of the swarm enters the target area (a circle of radius 2 (m) from the target point), we define that the swarm guidance has been achieved.
In the simulations, T c = 0.02 (s). and other parameters are listed in Table 1. The parameter selection for the robotic system and COS is based on [20][21][22]. The parameters of the CBF were selected experimentally. Simulations were performed using MATLAB R2020a. In particular, quadprog function in the optimization toolbox of MATLAB was implemented.  First, we check the distances between robots to verify requirement (ii). Figure 6 shows smallest distance between each robot. Figure 6a shows the case without the CBF constraint; we can see that the minimum distance between robots (blue curve) violates the safety distance (red line). This result implies that a collision between robots can occur. In contrast, in the CBF constraint case shown in Figure 6b, the minimum distance of robots maintain the safety distance. By introducing a CBF constraint, the robots avoid a collision. Therefore, requirement (ii) is fulfilled.
(a) without CBF constraint (b) under CBF constraint Figure 6. The minimum distance between each robot. Blue lines denote minimum distance between robots. Red lines are safety distance to be preserved. Green lines are standard distance.
Subsequently, we verify the deadlock problem due to CBF. Figure 7 presents a snapshot of the robotic swarm with CBF trying to pass a narrow space. The red circled robot is the leader. As seen in the figure, after the simulation started, the follower robots encircle a marked leader robot, and the entire robotic swarm stops moving. In contrast, in the simulation shown in Figure 8, the robotic swarm successfully passes a narrow space. In this simulation, each robot follows global order generated by COS as described in Section 3.2. Follower robots do not move forward to the leader's direction, and the leader robot completes the entire swarm. We can see the asymmetric global order (phase gradient). See, for example, Figure 8a. Among the robots that are near the leader, the robots on the opposite side of the leader's movement direction are yellow (the phase is higher), while the other robots are orange or green (the phase is lower). This tendency is also transmitted to the following robots. This shows that the COS forms a global order (phase gradient) that is asymmetric with respect to the leader's direction of movement.
We check whether the criteria of requirement (iii) are satisfied. Figure 9 shows distances from the center of the swarm to the target point. Figure 9a shows the case where deadlock occurs. That the center of the swarm (blue line) does not reach the target area (red line). On the other hand, when the global order by COS avoids deadlock (Figure 9b), the center of the swarm reach the target area. From the simulation results shown in Figure 7-9, we verified that the global order by COS suppresses the deadlock problem, thus, verifying the requirement (iii).  Therefore, we confirmed that the proposed method satisfies all requirements (i), (ii), and (iii).

Conclusions
We required autonomous decentralized swarms with a leader to pass through narrow spaces while maintaining a safe distance. While CBF guarantees a safe distance between robots, it causes a deadlock problem due to encirclement. To prevent leader encirclement, we equipped the swarm with virtual oscillators to generate an asymmetric global order (phase gradient). We verified the effectiveness of the proposed method by simulations. Then we achieved to do both introducing CBF and deadlock avoidance by generating global order by COS. Proposed method gives a way to introduce CBF constraint for robotic swarm avoiding deadlock problem. In the future, we need to consider swarm robots that can perform a variety of tasks in each environment. We have to consider not only leader encircled but also other types of deadlock. In this study, the parameters of CBF were selected experimentally. We are considering a method to select these parameters theoretically. It is also important to investigate how constraints such as CBF affect the characteristics of a swarm system.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. Description of Virtual Forces
We describe form of virtual forces (3), (4) used in the simulation ( Figure A1). We determined the equations form as proposed in [18]. We show these equations again.
f O i is a virtual force to give robots the property of avoiding obstacles where x io denotes the relative position of the nearest obstacle object. d O is distance parameter where robots start avoiding movement. Figure A2a shows magnitude of f O i . f F i is a virtual force for maintaining the distance between robots where d ij := x ij r c , x ij := x j − x i . This virtual force contributes to both collision avoidance and cohesion. r c represents the desired distance between robots. When x ij > r c , f F i produces attraction, and when x ij < r c , it produces repulsion. Figure A2b shows the magnitude of f F i in function of the change in x ij . f O i and f F i have weight parameters k O and k F , respectively. In practice, we generate these virtual forces in the robot by programming it. We have to adjust the balance of the virtual forces appropriately by changing the values of the weight parameters.