Frequency response of swarm deformation with control barrier function

In this study, we focused on robotic swarms, allowing multiple anonymous autonomous robots to gather and move mutually in tasks. We proposed a method to design a parameter of the control barrier function (CBF) in a robotic swarm so that the swarm can achieve collision-free deformation considering the environmental conditions. We analyzed the responses to perturbations of swarming robots, to which we applied the CBF. Although we can guarantee a safe distance between mobile robots, the CBF limits their actions and prevents swarm deformation. Through analysis of the frequency domain, we investigated the effects of a selected parameter in the CBF on the deformability of a swarm. We obtained an appropriate range of parameters that realize both distance maintenance and deformability retention.


Introduction
Research on decentralized adaptive swarming systems is mainly based on findings in physics, such as Boids [1], motile elements [2], and fluid dynamics [3]. For applications in swarming robots, it is quite important to guarantee collision-freeness. In other words, autonomous robots must maintain a certain distance from others even if they are swarming. Yet many researcher employed a local potential function that implies a local gradient around a robot so that it virtually receives repulsive forces from the other robots. This method cannot guarantee a safe distance due to conflicts with other requirements related to tasks and/or environmental conditions.
In real situations, swarming robots must overcome obstacles. In the case of narrow spaces, the tolerance for safe distance can be quite small, because a swarm must change its whole shape (layout of robots) according to the shape dictated by the environment. In an environment with obstacles, to guarantee conflict avoidance, Sakai et al. proposed collision avoidance in inequality constraints form [4]. However, the constraint rule was heuristically structured. This requires the reconstruction of constraints and proof of ability to avoid collision when the model of robots or obstacles change.
The control barrier function (CBF) [5][6][7], expressed in inequality forms of constraints, can theoretically guarantee collision-freeness in a certain class of systems. Although we find many studies introducing CBF to swarm robots, most of them are not concerned about obstacle regions in which robots gather closely. When robots are densely packed together, the collision avoidance constraints can tightly limit their movements and prevent the deformation of the whole shape of the swarm.
In this study, we consider the implementation of CBF to a robotic swarm and investigate its effects on the deformation of the swarm based on an analysis in the frequency domain. After obtaining the appropriate parameter range, we designed a constraint that can realize keeping a safe distance between robots and retaining the deformability of the swarm. This contributes to the design of functional, collision-free swarms.

Base model of swarm
Let N be a set of robots. Suppose a swarm consists of |N| robots that move in a two-dimensional plane; the position of a robot x i ∈ ℝ 2 (i ∈ N) follows: where m and are positive constant values, and u i ∈ ℝ 2 is the control input for robot i. We employ the model in [11] to calculate u i . where x io denotes the relative position of the nearest object, and d ij ∶= are terms corresponding to collision avoidance from obstacles and distance maintained between robots, respectively. d o represents the maximum distance that takes obstacles into account, and r c represents a nominal distance between robots given by a user.
To achieve a certain swarm task, f P i guides each robot based on c(x) , which is an attractant field that contains information on the direction of a swarm. For each task, c(x) should be determined; for example, the odor concentration information can be included in the odor source search problem.

CBF constraints for swarm
While the base model is simple in structure, it can not guarantee a safe distance to prevent collisions. In (2), f F i may conflict with f O i and f P i . Although f F i attempts to maintain an appropriate distance between robots, it cannot theoretically guarantee the distance. If we determine a set of parameters k F , k O and k P experimentally, the actual distances will vary depending on the environment and the number of robots.
Here, we consider guaranteeing a safe distance by applying CBF constraints. However, in the case of obstacle space , and high density of robots, CBF may conflict with the input to exhibit desired behaviours by which a whole shape of a swarm can be deformed. As CBF has a parameter that denotes the naivety of the constraint, we must adjust it to introduce appropriate constraints. Naive constraints can significantly restrict the movements of robots, and consequently, prevent them from deforming. If we set an aggressive parameter, extreme changes in input occur, which can destabilize the system. Therefore, it is necessary to find a suitable range for the parameter. For this purpose, we need to investigate the effect of the parameter on the deformability of a swarm.
Problem statement We set the following two goals for this study: -To implement CBF to guarantee safe distance between robots. -To investigate the effect of the CBF parameter on the deformability of a swarm.
The goals allow us to obtain a suitable range for the CBF parameter that enables the smooth deformation of a swarm while maintaining a safe distance between the robots. In this study, deformability is regarded as the ability to change the aspect ratio of the entire shape of a swarm in response to periodic external forces. We regard deformability as an indicator of the ability to accomplish tasks, such as passing through narrow spaces. The periodic external force is a normalized force caused by environmental conditions. For example, if there are many small obstacles, a swarm undergoes high-frequency external perturbations. If a swarm is squeezed for a long time in a narrow space, the swarm is affected by a low-frequency force.

Control barrier function
Here, we review the zeroing control barrier function (ZCBF) published by Ames et al. [6]. Let state x ∈ ℝ n follow the input-affine system shown below, using the input u ∈ ℝ m ; where f and g are locally Lipschitz. Consider h(x) ∶ ℝ n → ℝ to be a continuously differentiable function, and is said to be a ZCBF for the set C if there exists an extended class K function ∶ ℝ → ℝ such that

3
Let h be a ZCBF of C . If a Lipschitz continuous controller u satisfies the inequality (8) any time, then set C becomes forward invariant.
where L f and L g are the Lie derivatives along f and g. There exists an example of the input satisfying constraint (8) with an equal sign.
If we describe the safety condition as h(x) ≥ 0 and select the control input u to satisfy constraint (8), then x(t 0 ) ∈ C ⇒ x(t) ∈ C ∀t ≥ 0 is guaranteed (the relative degree of u and h is required to be 1). In the remainder of the paper, we simply refer to the input constraint method by ZCBF as the CBF method.

Implementation of control barrier function to the base model
We introduce CBF constraints for our swarm system. We apply the CBF to robots in decentralized manner. Let us discuss the implementation of CBF from the perspective of agent i. We consider the constraint for collision avoidance with agent j, included in the set of neighbors of robot i, N i . L e t T c b e t h e c o n t r o l p e r i o d a n d q = [q 1 , q 2 ] = [x ij ,̇x ij ] ∈ ℝ 4 . We define the safety function h(q) between agents i and j as follows, where r s is the minimum, safe distance, h(q) is the safety condition between the two agents. If h(q) ≥ 0 , the distance between robot i and j is larger than r s considering the movement of q 2 during the control period T c . From each agent's system (1), q follows (10), where We derive the condition for u ∈ ℝ 2 to maintain h(q) ≥ 0 using the CBF method. From (9) and (10), the input constraints between agents corresponding to (8) can be written as follows: > 0 is a parameter that denotes the naivety of the constraint. If is small, robots are required to slow down earlier, and a large implies sudden stopping. Since in our decentralized assumption, agent i does not know the input u j , we divide constraint (11) to attribute to each agent as follows: Decentralized constraints (12) and (13) for robots i and j are sufficient conditions for constraint (11).
Because we consider the perspective of i, the signs of the second terms of (12) and (13) are different. When we consider the perspective of robot j ( q = [x ji ,ẋ ji ] ) , (13) attains the same form as (12). Agent i has the same constraints as in (12) with all agents included in N i .
We construct raw control input û i as When we compare (14) with (2), f O i is replaced by the CBF constraints because this force only denotes the collision avoidance constraint. f F i is also a constraint term but this term is needed to gather the robots as a swarm. Finally, we determine the control input of the robot using the quad program as

Analysis of swarm system with CBF constraint
In this section, we discuss the behavior of the swarm system with CBF. To simplify the discussion, we assume that the constraints between a pair of robots can be addressed using a one-dimensional line in the relative direction. Under this assumption, the constraint function h(q) can be rewritten as follows: Note that we assume that r s = 0 . If the control inputs u of the robots satisfy constraint (12), then x ij satisfies the following inequality: (15) u i = arg min (17) Suppose that an equal sign holds, that is, when the input reflects the constraints of CBF, the frequency domain of (17) is as follows: This is a simple second-order low-passage system with poles − 1 T c and − . The control period T c is a parameter of a system. Therefore, we can design the frequency property of CBF by tuning considering T c . For example, a small cancels out the characteristics of the original system in the low-frequency region, while a larger is expected to preserve it to the possible extent. It should be noted that if we set an exceedingly large , the system can become unstable owing to the discretization by the control period. As the CBF system (17) represents a local system between a pair of robots, we need to discuss the behavior of the entire system.
Consider a swarm composed of eight robots as indicated in Fig. 1. Suppose the left 4 and right 4 robots are subgroups in the swarm. Let x i be an x position of a robot i, then represents the distance between the center positions of the subgroups.
We assume that we can observe the deformation level of the swarm along the x-axis by . The constrained inputs of each robot are only the internal forces in both left and right subgroups that cancel out. Behaviors (17) between robots belonging to different subgroups (marked as the red edge in Fig.1) directly affect the behavior of . Thus, the deformation property follows a simple summation of (17). The deformation along y-axis can be explained in the same manner. Since we believe that analysis can be generalized, we assume that system (17) works over the entire swarm.

Investigating deformability by extra periodic forces
We apply a periodic external force and examine the aspect ratio to investigate the deformability of the system. Suppose an attractant field c(x) is given as follows, where A is constant and T f denotes the period of external force.
Using the maximum distance l x (t), l y (t) . Then, we define an aspect ratio of a swarm as (t) ∶= l y (t)∕l x (t).
Let T f be a response of the aspect ratio against an external force with period T f .
and T f is the oscillation gain in response to external periodic forces.
We obtain a frequency response curve by observing T f with varying T f . By comparing the response curves for various , it is possible to compare the change in the frequency response of the aspect ratio with the changes in the CBF parameter.

Simulation of collision avoidance and deformability
We performed computer simulations in three different cases to verify the generalizability of our method in terms of the number of robots, the initial shape of a swarm, and the parameters of the base model.
(20) The control period was set as T c = 0.02 s. We applied = 0.1, 0.5, 1.0, 5.0, 10, 20 and 100 for each case. Table 1 shows the other parameters we used. The simulations were performed by MATLAB R2020a. We used the quadprog function in the optimization toolbox to solve the quad program (15) of CBF. We carried out 20 trials for each condition, where we applied random perturbations ( ±0.1 m) to the initial positions of the robots. The plots in Figs.5,6, and 7 show the average of the results.

Results of Case 1
First, we verified whether the safety distance was guaranteed by CBF. Fig.3 shows the minimum distance among robots when we imposed the external periodic force ( T f = 8 s). The horizontal green line indicates the safe distance we set. The dashed curve colored with sky blue, which indicates the result without CBF, violated the safe distance. In the contrast, the other curves showing results with CBF almost maintain longer distances than the safe distance.
However, as mentioned in 3.3, when is quite large ( = 100 , the deep blue curve), the minimum distance fluctuated near the boundary and invaded the safe distance.
Next, we observed the frequency response, as the measure of the deformability to external periodic forces. Fig.4 shows the changes of the aspect ratio of the whole shape of the swarm. We applied two frequencies, T f = 0.5 s and 2.0s, respectively. The black curve shows the original responses without CBF. When we applied CBF with < 1 , the curves show different results from the original ones, where the initial aspect ratios were not maintained. On the other hand, when we set ≥ 1 , the responses with CBF were almost the same as the original responses, where the initial aspect ratios were kept under the external forces.
We also observed the frequency responses of the aspect ratio. Fig.5 clearly shows that the results of the cases with < 1 had significantly different shapes of the curves from those of other cases. However, the original system had a peak at approximately 1 rad/s; < 1 cases did not.
This results can be explained as follows. CBF affects the frequency responses of aspect ratio of a whole swarm as a low-pass filter (18). One breakpoint frequency is rad/s. If we set < 1 , CBF changes frequency responses by canceling the original one with a peak frequency at 1 rad/s. On the other hand, if we set > 1 , CBF does not affect the peak frequency. In this case, the frequency responses is maintained the same as the non-CBF case.
According to the results, we conclude that we should set 1 < < 100 so that a swarm with CBF keeps its original property against external forces and avoids collision.

Results of Case 2
We increased the number of robots and changed the initial shape of the swarm. Fig. 6 shows the frequency responses. Almost the as with Case 1, the response curves of ≥ 1 were almost the same as the original one, yet those of < 1 looked different. This result verifies that the effects of the CBF on the frequency responses are the same even if the number of robots and initial shape changes.

Results of Case 3
We changed the viscosity of the robots from = 20 to = 5 . Fig. 7 shows the frequency responses. The characteristic waveform of the original system (without CBF) moved to a higher frequency, approximately at 2 rad/s. In case 3, < 2 resulted in different shapes of the response curves from the original one, yet < 1 did in Case 1 and 2.
In Case 3, as in Cases 1 and 2, we can design the CBF that maintains the frequency responses by choosing the larger than the peak frequency of the original responses (2 rad/s). Therefore, the design for the range of applies even when parameters in the robot model, such as viscosity , changes.   According to the simulation results in Case 1, 2, and 3, we verified that the proposed method surely kept the safe distance and the original property of the frequency response to the external forces. However, it must be noted that the design of the parameter is crucial. When the mass m or viscosity in the robot model gets smaller, the peak frequency of the original system is increase. It requires a larger lower limit of .
When the control period T c is larger, upper limit of the decreases to avoid vibration and guarantee collision-freeness. The range of feasible depends the parameters of the robot model. We need to pay attention to design to achieve both collision-freeness and deformability.

Conclusions
In this study, we implemented the CBF to a robotic swarm that is composed of autonomous mobile robots. Although CBF theoretically guarantees collision-freeness, it can limit the motion of the robots. This reduces the deformability of the entire shape of the swarm. Deformability is quite important for adaptive behaviors in obstacle regions. By analyzing the response of the original system and the CBF system, we can obtain a feasible range of a parameter that facilitate the retention of the original deformability while guaranteeing safe distance. Through verifications by the simulations, we believe that the results contribute to the designing of appropriate constraints in swarm models.
In future, we will investigate the influence of inequality constraints, such as CBF, on the swarm in the performance of actual tasks. When the robots are dense (distances among robots are small), the CBF constraints for collision avoidance become more severe. In such a case, the decentralized constraints in this paper do not guarantee the existence of a quadratic programming solution. It is necessary to modify the method to decentralize the CBF constraints.