Algorithms For Shaping a Particle Swarm With a Shared Control Input Using Boundary Interaction

Shiva Shahrokhi, Arun Mahadev, and Aaron T. Becker

Abstract—Consider a swarm of particles controlled by global inputs. This paper presents algorithms for shaping such swarms in 2D using boundary walls. The range of configurations created Kilobots with by conforming a swarm to a boundary wall is limited. We photophile behavior (global control input) describe the set of stable configurations of a swarm in two canonical workspaces, a circle and a square. To increase the Distant light diversity of configurations, we add boundary interaction to sources our model. We provide algorithms using friction with walls to place two robots at arbitrary locations in a rectangular workspace. Next, we extend this algorithm to place n agents at desired locations. We conclude with efficient techniques to 3 cm control the covariance of a swarm not possible without wall- friction. Simulations and hardware implementations with 100 robots validate these results. 3 cm These methods may have particular relevance for current micro- and nano-robots controlled by global inputs. Fig. 1. Swarm of kilobots programmed to move toward the brightest light as explained in §V. The current covariance ellipse and mean are shown in red, the desired covariance is shown in green. Navigating a swarm using I.INTRODUCTION global inputs is challenging because each member receives the same control Particle swarms steered by a global force are common in inputs. This paper focuses on using boundary walls and wall friction to break the symmetry caused by the global input and control the shape of a swarm. applied mathematics, biology, and computer graphics. [x ˙ , y˙ ]> = [u , u ]>, i ∈ [1, n] (1) i i x y can be generated. To extend the range of possible shapes, §II-B The control problem is to design ux(t), uy(t) to make all introduces wall friction to the system model. We prove that n particles achieve a task. As a current example, micro- two orthogonal boundaries with high friction are sufficient to and nano-robots can be manufactured in large numbers, arbitrarily position two robots in §III-A, and §III-B extends this see Chowdhury et al. [6], Martel et al. [16], Kim et al. [12], to prove a rectangular workspace with high-friction boundaries Donald et al. [7], Ghosh and Fischer [9], Ou et al. [18] or can position a swarm of n robots arbitrarily within a subset of Qiu and Nelson [19]. Someday large swarms of robots will the workspace. §IV describes implementations of both position be remotely guided ex vivo to assemble structures in parallel control algorithms in simulation and §V describes experiments and through the human body, to cure disease, heal tissue, and with a hardware setup and up to 100 robots, as shown in prevent infection. For each application, large numbers of micro Fig. 1. After a review of recent related work §VI, we end robots are required to deliver sufficient payloads, but the small with directions for future research §VII. size of these robots makes it difficult to perform onboard II.THEORY computation. Instead, these robots are often controlled by a A. Using Boundaries: Fluid Settling In a Tank arXiv:1609.01830v1 [cs.RO] 7 Sep 2016 global, broadcast signal. These applications require control techniques that can reliably exploit large populations despite One method to control a swarm’s shape in a bounded high under-actuation. workspace is to simply push in a given direction until the Even without obstacles or boundaries, the mean position swarm conforms to the boundary. of the swarm in (1) is controllable. By adding rectangular a) Square workplace: This section examines the mean 2 2 boundary walls, some higher-order moments such as the (¯x, y¯), covariance (σx, σy, σxy), and correlation ρxy of a very swarm’s position variance orthogonal to the boundary walls large swarm of robots as they move inside a square workplace (σx and σy for a workspace with axis-aligned walls) are under the influence of gravity pointing in the direction β. also controllable [23]. A limitation is that global control can The swarm is large, but the robots are small in comparison, only compress a swarm orthogonal to obstacles. However, and together occupy a constant area A. Under a global input navigating through narrow passages often requires control of such as gravity, they flow like water, moving to a side of the the variance and the covariance. workplace and forming a polygonal shape, as shown in Fig. 2. The paper is arranged as follows. §II-A provides analytical The range for the global input angle β is [0,2π). In this position control results in two canonical workspaces with fric- range, the swarm assumes eight different polygonal shapes. tionless walls. These results are limited in the set of shapes that The shapes alternate between triangles and trapezoids when 1.0 0.03 x σ xy 3 π 0.8 π 0.02 5 π 4 4 8 3 π 0.01 0.6 π π 8 5 π 3 π 2 0.2 0.4 20.6 0.8 1.0 0.4 8 4 -0.01 3 π π 0.2 8 -0.02 4 β A -0.03 A 0.2 0.4 0.6 0.8 1.0 π 3 π A=3/4 0.08 2 2 σ x 8 0.4 1/2 ρxy 5 π 3 π 0.06 0.2 1/4 8 4 1/8 π 1/16 0.04 π 0.2 0.4 0.6 2 0.8 1.0 4 -0.2 3 π 0.02 π 8 8 A -0.4 π A 0.00 0 0.0 0.2 0.4 0.6 0.8 1.0 4

Fig. 2. Pushing the swarm against a square boundary wall allows limited control of the shape of the swarm, as a function of swarm area A and the commanded movement direction β. Left plot shows locus of possible mean positions for five values of A. The locus morphs from a square to a circle as A increases. The 2 covariance ellipse for each A is shown with a dashed line. Center shows two corresponding arrangements of kilobots. At right is x¯(A), σxy(A), σx(A), and ρ(A) for a range of β values. See online interactive demonstration at [29].

0.10 3 π σ xy 5 π 4 0.05 8 h

π h 0.5 2 1.0 1.5 2.0

π 3 -0.05 π β 4 8

-0.10 π 2 3 π 1.0 0.25 2 σ x 8

0.20 0.5 π 5 π ρxy 3 π 0.15 4 π 8 h 4 0.5 1.02 1.5 2.0 0.10 π -0.5 3 π 0.05 8 h π 8 0 4 0.5 1.0 1.5 2.0 -1.0

Fig. 3. Pushing the swarm against a circular boundary wall allows limited control of the shape of the swarm, as a function of the fill level h and the commanded movement direction β. Left plot shows locus of possible mean positions for four values of h. The locus of possible mean positions are concentric circles. See online interactive demonstration at [28].

the area A<1/2, and alternate between squares with one corner in the lower-left corner is: removed and trapezoids when A>1/2. √ √  √ √  R 2 −A tan(β) R 2 −A cot(β)+x cot(β) Computing means, variances, covariance, and correlation 0 0 x dy dx R x¯(A, β) = requires integrating over the region containing the swarm: A 1√ p = 2 A tan(β) (5) RR x dx dy RR y dx dy 3 x¯ = R , y¯ = R (2) √ √  √ √  A A R 2 −A tan(β) R 2 −A cot(β)+x cot(β) y dy dx RR 2 RR 2 0 0 2 R (x − x¯) dx dy 2 R (y − y¯) dx dy y¯(A, β) = σx = , σy = (3) A A A √ RR 2 1 p (x − x¯x)(y − y¯) dx dy σ = 2 A cot(β) (6) σ = R , ρ = x (4) 3 xy A xy σ σ x y The full equations are included in the appendix, and are The region of integration R is the polygon containing the summarized in Fig. 2. A few highlights are that the correlation swarm. If the force angle is β, the mean when the swarm is is maximized when the swarm is in a triangular shape, and is ±1/2. The covariance of a triangle is always ±(A/18). and N = F cos(θ) Variance is minimized in the direction of β and maximized orthogonal to β when the swarm is in a rectangular shape. Fig. 16 shows the resultant forces on two robots when one The range of mean positions are maximized when A is small. is touching a wall. As illustrated, both experiences different b) Circular workplace: Though rectangular boundaries net forces although each receives the same inputs. For ease of are common in artificial workspaces, biological workspaces analysis, the following algorithms assume µf is infinite and are usually rounded. Similar calculations can be computed for robots touching the wall are prevented from sliding along the a circular workspace. The workspace is a circle centered at wall. This means that if one robot is touching the wall and (0,0) with radius 1 and thus area π. For notational simplicity, another robot is free, if the control input is parallel or into the swarm is parameterized by the global control input signal the wall, the touching robot will not move. There are many β and the fill-level h. Under a global input, the robot swarm alternate models of friction that also break control symmetry. fills the region under a chord with area Fig. 16c shows fluid flow along a boundary. Fluid in the free- p flow region moves uniformly, but flow decreases to in the A(h) = arccos(1 − h) − (1 − h) (2 − h)h. (7) boundary layer. For a circular workspace, the locus of mean positions are aligned with β and the mean position is at radius r(h) from (y − h)2 y y u(y) = u0[1 − = u0 [2 − ] (10) the center: h2 h h 3/2 2(−(h − 2)h) The next section shows how a system with friction model (9) r(h) =   (8) 3 p−(h − 2)h(h − 1) + arccos(1 − h) and two orthogonal walls can arbitrarily position two robots.

2 Variance σx(β, h) is maximized at β = π/2 + nπ and h ≈ Free Flow 1.43, while covariance is maximized at β = π3/4 + nπ and F F θ h ≈ 0.92. h ±1 For small values, correlation approaches . N Boundary F Layer Results are summarized in Fig. 3. Ff Fsin(θ) forward Fcos(θ) θ F B. Using Boundaries: Friction and Boundary Layers a. b. c. Global inputs move a swarm uniformly. Controlling co- Fig. 4. (a,b) Wall friction reduces the force for going forward Fforward on a variance requires breaking this uniform symmetry. A swarm robot near a wall, but not for a free robot. (c) velocity of a fluid reduces to inside an axis-aligned rectangular workspace can reduce vari- zero at the boundary. ance normal to a wall by simply pushing the swarm into the boundary. Directly controlling covariance by pushing the swarm into a boundary requires changes to the boundary. An obstacle in the lower-right corner is enough to generate III.ALGORITHMS positive covariance. Generating both positive and negative co- A. Position Control of 2 Robots Using Wall Friction variance requires additional obstacles. Requiring special obsta- cle configuration also makes covariance control dependent on This section describes Alg. 1, which uses wall-friction to the local environment. Instead of pushing our robots directly arbitrarily position two robots in a rectangular workspace. This into a wall, this paper examines an oblique approach, by algorithm introduces concepts that will be used for multi-robot using boundaries that generate friction with the robots. These positioning. It only requires collisions with two orthogonal frictional forces are sufficient to break the symmetry caused by walls, in this case, the bottom and left walls. Fig. 5 shows a uniform inputs. Robots touching a wall have a negative friction Mathematica implementation of the algorithm, and is useful force that opposes movement along the boundary. This causes as a visual reference for the following description. robots along the boundary to slow down compared to robots Assume two robots are initialized at s1 and s2 with cor- in free-space. responding goal destinations e1 and e2. Denote the current ~ Let the control input be a vector force F with magnitude F positions of the robots r1 and r2. Subscripts x and y denote and orientation θ with respect to a line perpendicular to and the x and y coordinates, i.e., s1x and s1y denote the x and y into the nearest boundary. N is the normal or perpendicular locations of s1. The algorithm assigns a global control input force between the robot and the boundary. The force of friction at every instance. The goal is to adjust ∆rx = r2x − r1x Ff is nonzero if the robot is in contact with the boundary and from ∆sx = s2x − s1x to ∆ex = e2x − e1x and adjust |θ|< π/2. The resulting net force on the robot, Fforward, is ∆ry = r2y − r1y from ∆sy = s2y − s1y to ∆ey = e2y − e1y aligned with the wall and given by using a shared global control input. This algorithm exploits the position-dependent friction model (9). Our algorithm solves the positioning problem in two steps: Fforward = F sin(θ) − Ff ( First, |∆rx − ∆ex| is reduced to zero while ∆ry is kept µ N, µ N < F sin(θ) f f constant in Alg. 2. Second |∆ry − ∆ey| is reduced to zero where Ff = (9) F sin(θ), else while ∆rx is kept constant. t = 0 s t = 0.14 s t = 0.29 s t = 0.43 s t = 0.76 s

Fig. 5. Frames from an implementation of Alg. 1: two robot positioning using walls with infinite friction. The algorithm only requires friction along the bottom and left walls. Robot initial positions are shown by a crosshair, and final positions by a circled crosshair. Dashed lines show the shortest route if robots could be controlled independently. Solid arrows show path given by Alg. 1. Online demonstration and source code at [22].

β A A Algorithm 1 WallFrictionArrange2Robots(s1, s2, e1, e2,L) α Require: starting (s , s ) and ending (e , e ) positions of two 1 2 1 2 3.) ε A B B B B B robots. (0, 0) is bottom corner, s1 is rightmost robot, L 1.) 2.) is length of the walls. Current position of the robots are B (r1, r2). 1: (r1, r2) = GenerateDesiredx-spacing(s1, s2, e1, e2,L) Fig. 6. A DriftMove(α, β, ) to the right repeats a triangular movement sequence {(β/2, −), (β/2, ), (−α, 0)}. Robot A touching a top wall 2: GenerateDesiredy-spacing(r1, r2, e1, e2,L) moves right β units, while robots not touching the top move right β − α.

ε

wb h Robot

b zone Algorithm 2 GenerateDesiredx-spacing(s1, s2, e1, e2,L) Goal Require: Knowledge of starting (s1, s2) and ending (e1, e2) ε+2r Move h Staging zone Drift Move positions of two robots. (0, 0) is bottom corner, s1 is s 2ε w s topmost robot, L is length of the walls. Current robot start final

positions are (r1, r2). k=1 Ensure: r1y − r2y ≡ s1y − s2y 1:  ← small number 2: ∆sx ← s1x − s2x k=2 3: ∆ex ← e1x − e2x 4: r1 ← s1, r2 ← s2 5: if ∆ex < 0 then k=7 6: m ← (L −  − max(r1x, r2x), 0) . Move to right wall 7: else 8: m ← ( − min(r1x, r2x), 0) . Move to left wall 9: end if Fig. 7. Illustration of Alg. 3, n robot position control using wall friction. 10: m ← m + (0, − min(r1y, r2y)) . Move to bottom 11: r1 ← r1 + m, r2 ← r2 + m . Apply move 12: if ∆ex − (r1x − r2x) > 0 then B. Position Control of n Robots Using Wall Friction 13: m ← (min(|∆ex − ∆sx|,L − r1x), 0) . Move right Alg. 1 can be extended to control the position of n robots 14: else using wall friction under several constraints. The solution 15: m ← (− min(|∆ex − ∆sx|, r1x), 0) . Move left described here is an iterative procedure with n loops. The kth 16: end if loop moves the kth robot from a staging zone to the desired 17: m ← m + (0, ) . Move up position in a build zone. All robots move according to the 18: r1 ← r1 + m, r2 ← r2 + m . Apply move global input, but due to wall friction, at the end the kth loop, 19: ∆rx = r1x − r2x robots 1 through k are in their desired final configuration in 20: if ∆rx ≡ ∆ex then the build zone, and robots k + 1 to n are in the staging zone. 21: return (r1, r2) See Fig. 7 for a schematic of the build and staging zones. 22: else Assume an open workspace with four axis-aligned walls 23: x r , r , e , e ,L return GenerateDesired -spacing( 1 2 1 2 ) with infinite friction. The axis-aligned build zone of dimension 24: end if (wb, hb) containing the final configuration of n robots must be disjoint from the axis-aligned staging zone of dimension (ws, hs) containing the starting configuration of n robots. 5) swarm’s mean position is moved to the center of the Without loss of generality, assume the build zone is above workspace the staging zone. Furthermore, there must be at least  space above the build zone,  below the staging zone, and IV. SIMULATION  + 2r to the left of the build and staging zone, where r Two simulations were implemented using wall-friction for is the radius of a robot. The minimum workspace is then position control. The first controls the position of two robots, ( + 2r + max(wf , ws), 2 + hs, hf ). the second controls the position of n robots. All code is The n robot position control algorithm relies on a available online at Zhao and Becker [28, 29]. DriftMove(α, β, ) control input, shown in Fig. 6. A drift Two additional simulations were performed using wall- move consists of repeating a triangular movement sequence friction to control variance and covariance. The first is an {(β/2, −), (β/2, ), (−α, 0)}. The robot touching a top wall open-loop algorithm that demonstrates the effect of varying moves right β units, while robots not touching the top move friction levels. The second uses a closed-loop controller to right β − α. achieve desired variance and covariance values. Let (0, 0) be the lower left corner of the workspace, pk the A. Position Control of Two Robots x, y position of the kth robot, and fk the final x, y position of the kth robot. Label the robots in the staging zone from left-to- Algorithms 1, 2, were implemented in Mathematica using right and top-to-bottom, and the fk configurations right-to-left point robots (radius = 0). Fig. 5 shows this algorithm for and top-to-bottom as shown in Fig. 7. two configurations. Robot initial positions are shown by a crosshair, and final positions by a circled crosshair. Dashed Algorithm 3 PositionControlnRobotsUsingWallFriction(k) lines show the shortest route if robots could be controlled

1: move( −, r − pk,y) independently. The path given by Alg. 1 is shown with solid 2: while pk,x > r do arrows. Each row has five snapshots taken every quarter sec- 3: DriftMove(, min(pk,x − r, ), ) left ond. For the sake of brevity axis-aligned moves were replaced 4: end while with oblique moves that combine two moves simultaneously. f −r k,y ∆rx is adjusted to ∆ex in the second snapshot at t = 0.25. 5: m ← ceil(  ) fk,y −r The following frames adjust ∆ry to ∆ey. ∆ry is corrected 6: β ← m r−pk,y − t = 0.75 7: α ← β − by . Finally, the algorithm moves the robots to their m corresponding destinations. 8: for m iterations do ∆r ∆r 9: DriftMove(α, β, ) up In the worse case, adjusting both x and y requires 10: end for two iterations. Two iterations of Alg. 2 are only required if |∆ex − ∆sx|> L. Similarly, two iterations are only required 11: move(r +  − fk,x, 0) if |∆ey − ∆sy|> L. An online interactive demonstration and 12: move(fk,x − r, 0) source code of the algorithm are available at [22].

Alg. 3 proceeds as follows: First, the robots are moved left B. Position Control of n Robots away from the right wall, and down so robot k touches the Alg. 3 was simulated in MATLAB using square block robots bottom wall. Second, a set of DriftMove()s are executed that with width. Code is available at [14]. Simulation results move robot k to the left wall with no net movement of the are shown in Fig. 8 for arrangements with an increasing other robots. Third, a set of DriftMove()s are executed that number of robots, n= [8, 46, 130, 390, 862]. The distance move robot k to its target height and return the other robots moved grows quadratically with the number of robots n.A to their initial heights. Fourth, all robots except robot k are best-fit line 210n2 + 1200n − 10, 000 is overlaid by the data.. pushed left until robot k is in the correct relative x position In Fig. 8, the amount of clearance is  = 1. Control per- compared to robots 1 to k − 1. Finally, all robots are moved formance is sensitive to the desired clearance. As  increases, right until robot k is in the desired target position. the total distance decreases asymptotically, as shown in Fig. 9, because the robots have more room to maneuver and fewer C. Controlling Covariance Using Wall Friction DriftMoves are required. Assume an open workspace with infinite boundary friction. 2 2 C. Efficient Control of Covariance Goal variances and covariance are (σgoalx, σgoaly, σgoalxy and mean, variances and covariance of the swarm are Random disturbances impair the performance of Alg. 1 2 2 (¯x, y,¯ σx, σy, σxy). For our experiments, c1 = 0.1. and Alg. 3. Still, we are able to control covariance of the 2 2 1) swarm is pushed into the left wall until σx < c1σgoalx. swarm. This section demonstrates simulations of controlling 2) swarm’s mean position is moved to the center of the covariance of the swarm. These simulations use the 2D physics workspace engine Box2D, by Catto [5]. 144 disc-shaped robots were 2 2 3) swarm is pushed into the bottom wall until σy ≤ σgoalt. controlled by an open-loop control input as illustrated in Fig. 4) if σgoalxy > 0 swarm slides right until σxy ≥ σgoalxy 10. All robots had the same initial conditions, but in four else swarm slides left until σxy ≤ σgoalxy tests the boundary friction was Ff = {0, 1/3F, 2/3F,F }. 2 5

0 (BodyLength) xy σ −5

2 20

Total moves moves Total 10 (BodyLength) 2 x σ 0

Number of robots n 20 2

10

Shapes (BodyLength) 0 2 y

σ 0 20 40 60 80 100 120 n= 8 n= 46 n= 130 n= 377 n= 862 Time(s)

Fig. 8. The required number of moves under Alg. 3 using wall-friction Fig. 11. Closed-loop simulation with 144 disc robots and three sets of initial to rearrange n square-shaped robots. See hardware implementation and conditions. The algorithm tracks goal variance and covariance values (green). simulation at [14]. The goal covariance switches sign every 30 s.

Vision System

30W LED Lights start finish 50W LED Lights

Commanded moves moves Commanded 1.5 m

ε, Minimum Clearance 1 m 1 m Fig. 9. Control performance is sensitive to the desired clearance . As  increases, the total distance decreases asymptotically. Robots 3 cm Without friction, covariance has minimal variation. As fric- Workspace Boundary tion increases, the covariance can be manipulated to greater degrees. Fig. 13. Hardware platform: table with 1×1 m workspace, surrounded by 144 disc-shaped robots were also controlled by a closed- eight triggered LED floodlights, with an overhead machine system. loop controller using the procedure in §III-C. Fig. 11 illustrates that covariance and variances in x and y axis were controlled from a set of initial conditions. V. EXPERIMENT

30 Our experiments are on centimeter-scale hardware systems F = F f called kilobots. These allows us to emulate a variety of ) F = 2/3 F 2 20 f F = 1/3 F dynamics, while enabling a high degree of control over robot f 10 F = 0 f function, the environment, and data collection. The kilobot, from Rubenstein et al. [20, 21] is a low-cost robot designed for 0 testing collective algorithms with large numbers of robots. It is −10 available as an open source platform or commercially from K- Team [11]. Each robot is approximately 3 cm in diameter, 3 cm Covariance (bodyLength −20 tall, and uses two vibration motors to move on a flat surface at −30 0 2 6 9 13.5 20 speeds up to 1 cm/s. Each robot has one ambient light sensor Time (s) that is used to implement phototaxis, moving towards a light source. In these experiments as shown in Fig. 13, we used Control Control n=100 kilobots, a 1 m×1 m whiteboard as the workspace, four 30W and four 50W LED floodlights arranged 1.5 m above the plane of the table at the {N,NE,E,SE,S,SW,W,NW } vertices of a 6 m square centered on the workspace. The lights Fig. 10. Open-loop simulation with 144 disc robots and varying levels of boundary friction under the same initial conditions. Without friction, were controlled using an Arduino Uno board connected to an covariance is unchangeable. As friction increases, the covariance can be 8-relay shield. Above the table, an overhead machine vision manipulated to greater degrees. system tracks the position of the swarm. Goal Region: pink robot

Starting position: pink robot t = 60 s t = 150 s t = 160 s t = 210 s

Starting position: green robot

Goal Region: green robot

Fig. 12. Position control of two kilobots (Alg. 2) steered to corresponding colored circle. Boundary walls have nearly infinite friction, so the green robot is stopped by the wall from t = 60s until the commanded input is directed away form the wall at t = 150s, while the pink robot in free-space is unhindered.

A. Hardware Experiment: Position Control of Two Robots Negave Covariance Posive Covariance The walls of the hardware platform have almost infinite friction, due to a laser-cut, zigzag border. When a kilobot is steered into the zigzag border, they pin themselves to the wall unless the global input directs them away from the wall. This wall friction is sufficient to enable independent control of two kilobots, as shown in Fig. 12. B. Hardware Experiment: Position Control of n Robots The hardware setup has a bounded platform, magnetic sliders, and a magnetic guide board. Designs for each are available at [? ]. The pink boundary is toothed with a white free space, as shown in Fig 7. Only discrete, 1 cm moves in the x and y directions are used. The goal configuration highlighted in the top right corner represents a ‘U’ made of seven sliders. The dark red configuration is the current position Fig. 14. Hardware demonstration steering 100 kilobot robots to desired of the sliders. Due to the discretized movements allowed by covariance. The goal covariance is negative in first 100 seconds and is positive the boundary, drift moves follow a 1 cm square. Free robots in the next 100 seconds. The actual covariance is shown in different trials. Frames above the plot show output from machine vision system and an return to their start positions but robots on the boundary to overlaid covariance ellipse. move laterally, generating a net sliding motion. Fig. 7 follows the motion of the sliders through iterations k=1, 2 and 7. All robots receive the same control inputs, but of many systems, including current micro- and nano-robots. boundary interactions breaks the control symmetry. Robots Current micro- and nano-robots, such as those in Martel reach their respective goal position in a first-in, first-out [15], Yan et al. [27] and Chowdhury et al. [6], lack onboard arrangement beginning with the bottom-left robot from the computation. staging zone occupying the top-right position of the build zone. Instead, this paper focuses on centralized techniques that apply the same control input to each member of the swarm. C. Hardware Experiment: Control of Covariance Precision control requires breaking the symmetry caused by To demonstrate covariance control n=100 robots were the global input. Symmetry can be broken using agents that placed on the workspace and manually steered with lights, respond differently to the global control, either through agent- using friction with the boundary walls to vary the covariance agent reactions, see work modeling biological swarms Bertozzi from -4000 to 3000 cm2. The resulting covariance is plotted et al. [3], or engineered inhomogeneity Bretl [4], Donald et al. in Fig. 14, along with snapshots of the swarm. [7], Becker et al. [2]. This work assumes a uniform control (1) with homogenous agents, as in Becker et al. [1]. The VI.RELATED WORK techniques in this paper are inspired by fluid-flow techniques Controlling the shape, or relative positions, of a swarm and artificial force-fields. of robots is a key ability for a range of applications. Cor- Fluid-flow: Shear forces are unaligned forces that push respondingly, it has been studied from a control-theoretic one part of a body in one direction, and another part of perspective in both centralized and decentralized approaches. the body in the opposite direction. These are common in For examples of each, see the centralized virtual leaders in fluid flow along boundaries. Most introductory fluid dynamics Egerstedt and Hu [8], and the gradient-based decentralized textbooks provide models, for example, see Munson et al. controllers using control-Lyapunov functions in Hsieh et al. [17]. Similarly, a swarm of robots under global control pushed [10]. However, these approaches assume a level of intelligence along a boundary will experience shear forces. This is a and autonomy in individual robots that exceeds the capabilities position-dependent force, and so can be exploited to control the configuration or shape of the swarm. Physics-based swarm [9] Ambarish Ghosh and Peer Fischer. Controlled propulsion of artificial simulations used these forces to disperse a swarm’s spatial magnetic nanostructured propellers. Nano Letters, 9(6):2243–2245, 2009. position for coverage in Spears et al. [24]. [10] M Ani Hsieh, Vijay Kumar, and Luiz Chaimowicz. Decentralized Artificial Force-fields: Much research has focused on gen- controllers for shape generation with robotic swarms. Robotica, 26(05): erating non-uniform artificial force-fields that can be used 691–701, 2008. [11] K-Team. Kilobot, www.k-team.com, 2015. to rearrange passive components. Applications have included [12] Paul Seung Soo Kim, Aaron Becker, Yan Ou, Anak Agung Julius, and techniques to design shear forces for sensorless manipulation Min Jun Kim. Imparting magnetic dipole heterogeneity to internalized of a single object by Lamiraux and Kavraki [13]. Vose et al. iron oxide nanoparticles for microorganism swarm control. Journal of Nanoparticle Research, 17(3):1–15, 2015. [25, 26] demonstrated a collection of 2D force fields generated [13] F. Lamiraux and L. E. Kavraki. Positioning of symmetric and non- by 6DOF vibration inputs to a rigid plate. These force fields, symmetric parts using radial and constant fields: Computation of all including shear forces, could be used as a set of primitives for equilibrium configurations. International Journal of Robotics Research, 20(8):635–659, 2001. motion control to steer the formation of multiple objects, but [14] Arun Viswanathan Mahadev and Aaron T. Becker. “Arranging a robot required multi-modal, position-dependent control. swarm with global inputs and wall friction [discrete].” MATLAB Central File Exchange, December 2015. URL https://www.mathworks.com/ VII.CONCLUSIONAND FUTURE WORK matlabcentral/fileexchange/54526. [15] Sylvain Martel. Magnetotactic bacteria for the manipulation and trans- This paper presented techniques for controlling the shape port of micro-and nanometer-sized objects. Micro-and Nanomanipula- of a swarm of robots using global inputs and interaction tion Tools, 2015. [16] Sylvain Martel, Samira Taherkhani, Maryam Tabrizian, Mahmood Mo- with boundary friction forces. The paper provided algorithms hammadi, Dominic de Lanauze, and Ouajdi Felfoul. Computer 3d for precise position control, as well as demonstrations of controlled bacterial transports and aggregations of microbial adhered efficient covariance control. Extending algorithms 2 and 1 nano-components. Journal of Micro-Bio Robotics, 9(1-2):23–28, 2014. [17] Bruce R. Munson, Alric P. Rothmayer, Theodore H. Okiishi, and to 3D is straightforward but increases the complexity. Future Wade W. Huebsch. Fundamentals of Fluid Mechanics. Wiley, 7th efforts should be directed toward improving the technology edition, 2012. and tailoring it to specific robot applications. [18] Yan Ou, Dal Hyung Kim, Paul Kim, Min Jun Kim, and A. Agung Julius. Motion control of magnetized tetrahymena pyriformis cells by magnetic With regard to technological advances, this includes de- field with model predictive control. Int. J. Rob. Res., 32(1):129–139, signing controllers that efficiently regulate σxy, perhaps using January 2013. Lyapunov-inspired controllers as in Kim et al. [12]. Addition- [19] Famin Qiu and Bradley J Nelson. Magnetic helical micro-and nanorobots: Toward their biomedical applications. Engineering, 1(1): ally, this paper assumed that wall friction was nearly infinite. 21–26, 2015. The algorithms require retooling to handle small µf friction [20] M. Rubenstein, C. Ahler, and R. Nagpal. Kilobot: A low cost scalable coefficients. It may be possible to rank controllability as a robot system for collective behaviors. In IEEE Int. Conf. Rob. Aut., pages 3293–3298, May 2012. function of friction. In hardware, the wall friction can be varied [21] Michael Rubenstein, Alejandro Cornejo, and Radhika Nagpal. Pro- by laser-cutting boundary walls with different of profiles. grammable self-assembly in a thousand-robot swarm. Science, 345 (6198):795–799, 2014. ACKNOWLEDGMENTS [22] Shiva Shahrokhi and Aaron T. Becker. “Moving Two Particles with Shared Control Inputs Using Wall Friction”, Wolfram Demonstrations This work was supported by the National Science Founda- Project, November 2015. URL http://demonstrations.wolfram.com/ tion under Grant No. [IIS-1553063]. MovingTwoParticlesWithSharedControlInputsUsingWallFriction/. [23] Shiva Shahrokhi and Aaron T. Becker. Stochastic swarm control with REFERENCES global inputs. In IEEE/RSJ International Conference on Intelligent [1] Aaron Becker, Golnaz Habibi, Justin Werfel, Michael Rubenstein, and Robots and Systems (IROS), page tbd, September 2015. J. McLurkin. Massive uniform manipulation: Controlling large pop- [24] Diana Spears, Wesley Kerr, and William Spears. Physics-based robot ulations of simple robots with a common input signal. In IEEE/RSJ swarms for coverage problems. The international journal of intelligent International Conference on Intelligent Robots and Systems (IROS), control and systems, 11(3), 2006. pages 520–527, November 2013. [25] T.H. Vose, P. Umbanhowar, and K.M. Lynch. Friction-induced velocity [2] Aaron Becker, Cem Onyuksel, Timothy Bretl, and James McLurkin. fields for point parts sliding on a rigid oscillated plate. The International Controlling many differential-drive robots with uniform control inputs. Journal of Robotics Research, 28(8):1020–1039, 2009. Int. J. Robot. Res., 33(13):1626–1644, 2014. [26] Thomas H Vose, Paul Umbanhowar, and Kevin M Lynch. Sliding ma- [3] Andrea L Bertozzi, Theodore Kolokolnikov, Hui Sun, David Uminsky, nipulation of rigid bodies on a controlled 6-dof plate. The International and James Von Brecht. Ring patterns and their bifurcations in a nonlocal Journal of Robotics Research, 31(7):819–838, 2012. model of biological swarms. Communications in Mathematical Sciences, [27] Xiaohui Yan, Qi Zhou, Jiangfan Yu, Tiantian Xu, Yan Deng, Tao Tang, 13(4), 2015. Qian Feng, Liming Bian, Yan Zhang, Antoine Ferreira, and Li Zhang. [4] Timothy Bretl. Control of many agents using few instructions. In Magnetite nanostructured porous hollow helical microswimmers for Proceedings of Robotics: Science and Systems, Atlanta, GA, USA, June targeted delivery. Advanced Functional Materials, 25(33):5333–5342, 2007. 2015. ISSN 1616-3028. [5] Erin Catto. User manual, Box2D: A 2D for games, [28] Haoran Zhao and Aaron T. Becker. “distribution of a swarm of http://www.box2d.org, 2010. robots in a circular workplace under gravity”, wolfram demonstra- [6] Sagar Chowdhury, Wuming Jing, and David J. Cappelleri. Controlling tions project, February 2016. URL http://demonstrations.wolfram.com/ multiple microrobots: recent progress and future challenges. Journal of DistributionOfASwarmOfRobotsInACircularWorkplaceUnderGravity/. Micro-Bio Robotics, 10(1-4):1–11, 2015. [29] Haoran Zhao and Aaron T. Becker. “distribution of a robot [7] Bruce R Donald, Christopher G Levey, Igor Paprotny, and Daniela swarm in a square under gravity”, wolfram demonstrations Rus. Planning and control for microassembly of structures composed project, January 2016. URL http://demonstrations.wolfram.com/ of stress-engineered mems microrobots. The International Journal of DistributionOfARobotSwarmInASquareUnderGravity/. Robotics Research, 32(2):218–246, 2013. [8] Magnus Egerstedt and Xiaoming Hu. Formation constrained multi-agent control. IEEE Trans. Robotics Automat., 17:947–951, 2001. Supplement to Algorithms ε w b Robot 3 For Shaping a Particle Swarm Build Goal With a Shared Control Input hb zone 5 ε+2r Move Using Boundary Interaction Staging hs zone DriftMove Abstract—Includes algorithms and equations too lengthy for ws ε main paper, but potentially useful for the community. Also links k=1 to videos and demonstration code for the algorithms. 3 1 3 1 3 1 1 3 1 1 3 1 3 1 VIII.INTRODUCTION 2 2 2 2 2 2 5 5 5 5 5 5 This supplement gives overviews of the videos and code 4 4 4 4 4 4 3 4 5 3 4 5 3 4 5 3 4 5 3 4 5 3 4 5 in §IX, provides the algorithm for y position control of two 1 2 2 2 2 robots in §X, and gives gull analytical models for fluid settling 1 2 1 2 in square-shaped tanks in §XI. k=2 1 1 1 11 1 1 1 3 3 1 3 1 3 3 3 IX.SUPPLEMENTARY VIDEOS 2 2 2 2 2 2 2 2 5 5 5 5 5 5 Five videos animate the key algorithms in this paper. 4 4 4 4 4 4 3 4 5 3 4 5 3 4 5 3 4 5 3 4 5 3 4 5 2 A. Robot Swarm in a Circle under Gravity 2 2 Robot Swarm in a Circle under Gravity The video shows the k=5 stable configuration of a swarm under a constant global input. 3 1 3 1 3 1 33 1 1 3 13 1 3 1 Animated plots show mean, variance, covariance, and correla- 2 2 2 22 2 2 2 3 1 3 1 tion for a swarm in a circular workspace. Full resolution video: 5 5 2 5 2 5 5 5 5 5 4 4 4 44 4 4 4 https://youtu.be/nPFAjVIOxYc. An online demonstration and 5 4 4 source code of the algorithm are at Zhao and Becker [29]. 5 5

B. Distribution of Robot Swarm in Square under Gravity Fig. 15. Illustration of Alg. 3, n robot position control using wall friction. The video Distribution of Robot Swarm in Square under Gravity shows the stable configuration of a swarm under a E. AutomaticCovControl.mp4 constant global input. Animated plots show mean, variance, covariance, and correlation for a swarm in a square workspace. A closed-loop controller that steers a swarm of particles to Full resolution video: https://youtu.be/ZEksDxLpAzg. An on- a desired covariance, implemented with a box2D simulator. In line demonstration and source code of the algorithm are at this video the green ellipse is the desired covariance ellipse, Zhao and Becker [28]. the red ellipse is the current covariance ellipse of the swarm and the red dot is the mean position of the robots. Robots C. Steering 2 Particles with Shared Controls Using Wall follow the algorithm to achieve the desired values for σgoalxy, Friction 2 2 σx and σy. Animates Algs. 1, 2, 3 in Mathematica to show how two X.ALGORITHMFORGENERATINGDESIRED y SPACING robots can be arbitrarily positioned in a square workspace. In this video the desired initial and ending positions of the two BETWEENTWOROBOTSUSINGWALLFRICTION robots are manipulated, and the path that the robots should XI.CALCULATIONS FOR MODELING SWARM AS FLUID IN A follow is drawn. The video ends with an extreme case where SIMPLE PLANAR WORKSPACE the robots must exchange positions. Full resolution video: Two workspaces are used, a square and a circular https://youtu.be/5TWlw7vThsM. An online demonstration and workspace. source code of the algorithm are at Shahrokhi and Becker [22]. A. Square Workspace . Arranging a robot swarm with global inputs and wall This section provides formulas for the mean, variance, friction [discrete] covariance and correlation of a very large swarm of robots An implementation of Alg. 4 in MATLAB that illustrates as they move inside a square workplace under the influence how the two robots positioning algorithm is extendable to n of gravity pointing in the direction β. The swarm is large, but robots. In this video all robots gets the same input, but by ex- the robots are small in comparison, and together cover an area ploiting wall friction each robot reaches its goal, the formation of constant volume A. Under a global input such as gravity, ”UH”. Full resolution video: https://youtu.be/uhpsAyPwKeI. they flow like water, moving to a side of the workplace and Full code is available at Mahadev and Becker [14]. Note forming a polygonal shape. The workspace is that this code uses discretized version of Algorithm 3. The The range of possible angles for the global input angle continuous-movement version is illustrated in Fig.15. β is [0,2π). In this range of angles, the swarm assumes Algorithm 4 GenerateDesiredy-spacing(s1, s2, e1, e2,L) B. Circle Workspace Require: Knowledge of starting (s1, s2) and ending (e1, e2) The area under a chord of a circle is the area of a sector positions of two robots. (0, 0) is bottom corner, s1 is less the area of the triangle originating at the circle center: rightmost robot, L is length of the walls. Current position A = S(sector) − S(triangle) = 1/2LR − 1/2C(1 − h), thus of the robots are (r1, r2). Ensure: r1x − r2x ≡ s1x − s2x A = (1/2) [LR − c(R − h)] (13) 1: ∆sy ← s1y − s2y where L is arc length, c is chord length, R is radius and h is 2: ∆ey ← e1y − e2y height. Solving for L and C gives 3: r1 ← s1, r2 ← s2 −1 4: if ∆ey < 0 then L = 2 cos (1 − h) (14) p 5: m ← (L − max(r1y, r2y), 0) . Move to top wall C = 2 h(2 − h) (15) 6: else Therefore the area under a chord is 7: m ← (− min(r1y, r2y), 0) . Move to bottom wall p 8: end if cos−1(1 − h) − (1 − h) (2 − h)h (16) 9: m ← m + (0, − min(r1x, r2x)) . Move to left For a circular workspace, with β = 0, the variance of x and 10: r1 ← r1 + m, r2 ← r2 + m . Apply move y are: 11: if ∆ey − (r1y − r2y) > 0 then 3 3 2 64(h − 2) h σ (h) = + x  2 12: m ← (min(|∆ey − ∆sy|,L − r1y), 0) . Move top 144 p−(h − 2)h(h − 1) + arccos(1 − h)   13: else 9 p−(h − 2)h(h − 1) + arccos(1 − h) (sin (4 arcsin(1 − h)) + 4 arccos(1 − h))  2 14: m ← (− min(|∆ey − ∆sy|, r1y), 0) . Move bottom 144 p−(h − 2)h(h − 1) + arccos(1 − h) 15: end if (17) 16: m ← m + (0, ) . Move right 17: r ← r + m, r ← r + m . Apply move 2 12 arccos(1 − h) − 8 sin (2 arccos(1 − h)) + sin (4 arccos(1 − h)) 1 1 2 2 σy (h) =   (18) 48 p−(h − 2)h(h − 1) + arccos(1 − h) 18: ∆ry = r1y − r2y 19: if ∆ry ≡ ∆ey then β = 0 σ = 0 20: m ← (e − r , e − r ) For , xy . These values can be rotated to calculate 1x 1x 1y 1y 2 2 σ (β, h), σ (β, h), and σxy(β, h). 21: r1 ← r1 + m, r2 ← r2 + m . Apply move x y 22: return (r1, r2) ACKNOWLEDGMENTS 23: else This work was supported by the National Science Founda- 24: y r , r , e , e ,L return GenerateDesired -spacing( 1 2 1 2 ) tion under Grant No. [IIS-1553063]. 25: end if REFERENCES [1] Aaron Becker, Golnaz Habibi, Justin Werfel, Michael Rubenstein, and J. McLurkin. Massive uniform manipulation: Controlling large pop- eight different polygonal shapes. The shapes alternate between ulations of simple robots with a common input signal. In IEEE/RSJ triangles and trapezoids when the area A<1/2, and alternate International Conference on Intelligent Robots and Systems (IROS), pages 520–527, November 2013. between squares with one corner removed and trapezoids when [2] Aaron Becker, Cem Onyuksel, Timothy Bretl, and James McLurkin. A>1/2. Controlling many differential-drive robots with uniform control inputs. Two representative formulas are attached, the outline of the Int. J. Robot. Res., 33(13):1626–1644, 2014. [3] Andrea L Bertozzi, Theodore Kolokolnikov, Hui Sun, David Uminsky, swarm shapes in (II) and x¯(β, A) in (I). and James Von Brecht. Ring patterns and their bifurcations in a nonlocal model of biological swarms. Communications in Mathematical Sciences, 13(4), 2015. [4] Timothy Bretl. Control of many agents using few instructions. In Proceedings of Robotics: Science and Systems, Atlanta, GA, USA, June mean, 2007. mean, β=π/2 [5] Erin Catto. User manual, Box2D: A 2D physics engine for games, β=π/2 http://www.box2d.org, 2010. β β [6] Sagar Chowdhury, Wuming Jing, and David J. Cappelleri. Controlling multiple microrobots: recent progress and future challenges. Journal of Micro-Bio Robotics, 10(1-4):1–11, 2015. [7] Bruce R Donald, Christopher G Levey, Igor Paprotny, and Daniela A=1/8 Locus A=5/8 Rus. Planning and control for microassembly of structures composed of stress-engineered mems microrobots. The International Journal of Robotics Research, 32(2):218–246, 2013. [8] Magnus Egerstedt and Xiaoming Hu. Formation constrained multi-agent control. IEEE Trans. Robotics Automat., 17:947–951, 2001. [9] Ambarish Ghosh and Peer Fischer. Controlled propulsion of artificial magnetic nanostructured propellers. Nano Letters, 9(6):2243–2245, Fig. 16. A swarm in a square workspace under a constant global input 2009. assumes either a triangular or a trapezoidal shape if A < 1/2. If A > 1/2 [10] M Ani Hsieh, Vijay Kumar, and Luiz Chaimowicz. Decentralized the swarm is either a squares with one corner removed or a trapezoidal shape. controllers for shape generation with robotic swarms. Robotica, 26(05): 691–701, 2008.  2 − tan (β) − A + 1 0 ≤ β ≤ tan−1(2A) ∨ 2π − tan−1(2A) < β ≤ 2π  24√A 2  1 p −1 π −1 1 − 3 2 A tan(β) tan (2A) < β ≤ 2 − tan (2A)  cot(β)  + 1 π − tan−1(2A) < β ≤ tan−1(2A) + π  12√A 2 2 2 1  1 p −1 π −1 3 2 −A tan(β) tan (2A) + 2 < β ≤ π − tan (2A) x¯(β, A) = A ≤ : 2 2 tan (β) + A π − tan−1(2A) < β ≤ tan−1(2A) + π  √24A 2  1 p −1 3π −1  2 A tan(β) tan (2A) + π < β ≤ − tan (2A)  3 2  1 − cot(β) 3π − tan−1(2A) < β ≤ tan−1(2A) + 3π  2 √12A 2 2  1 p −1 3π −1 1 − 3 2 −A tan(β) tan (2A) + 2 < β ≤ 2π − tan (2A)  2 tan (β) A −1 1  −1 1  − − + 1 0 ≤ β ≤ tan , 1 − A ∨ 2π − tan , 1 − A < β ≤ 2π  √ 24√A 2 2 2  2 2 (1−A) tan(β)(A−1)+3 −1 1  π −1 1   tan , 1 − A < β ≤ − tan , 1 − A  6A 2 2 2  6A+cot(β) π − tan−1 1 , 1 − A < β ≤ tan−1 1 , 1 − A + π  12A√ 2 2 2 2  √ 1  −2 2 (A−1) tan(β)(A−1)+6A−3 −1 1  π −1 1  6A tan 2 , 1 − A + 2 < β ≤ π − tan 2 , 1 − A < A < 1 : 2 2 tan (β) A −1 1  −1 1   24A + 2 π − tan 2 , 1 − A < β ≤ tan 2 , 1 − A + π  √ √  2 2 (1−A) tan(β)(1−A)+6A−3 −1 1  3π −1 1   tan , 1 − A + π < β ≤ − tan , 1 − A  6A 2 2 2  1 − cot(β) 3π − tan−1 1 , 1 − A < β ≤ tan−1 1 , 1 − A + 3π  2 √12A 2 2 2 2  √  2 2 (A−1) tan(β)(A−1)+3 −1 1  3π −1 1  6A tan 2 , 1 − A + 2 < β ≤ 2π − tan 2 , 1 − A 1 A = 1 : (11) 2

TABLE I x¯ INAUNIT-SQUARE WORKSPACE

[11] K-Team. Kilobot, www.k-team.com, 2015. global inputs. In IEEE/RSJ International Conference on Intelligent [12] Paul Seung Soo Kim, Aaron Becker, Yan Ou, Anak Agung Julius, and Robots and Systems (IROS), page tbd, September 2015. Min Jun Kim. Imparting magnetic dipole heterogeneity to internalized [24] Diana Spears, Wesley Kerr, and William Spears. Physics-based robot iron oxide nanoparticles for microorganism swarm control. Journal of swarms for coverage problems. The international journal of intelligent Nanoparticle Research, 17(3):1–15, 2015. control and systems, 11(3), 2006. [13] F. Lamiraux and L. E. Kavraki. Positioning of symmetric and non- [25] T.H. Vose, P. Umbanhowar, and K.M. Lynch. Friction-induced velocity symmetric parts using radial and constant fields: Computation of all fields for point parts sliding on a rigid oscillated plate. The International equilibrium configurations. International Journal of Robotics Research, Journal of Robotics Research, 28(8):1020–1039, 2009. 20(8):635–659, 2001. [26] Thomas H Vose, Paul Umbanhowar, and Kevin M Lynch. Sliding ma- [14] Arun Viswanathan Mahadev and Aaron T. Becker. “Arranging a robot nipulation of rigid bodies on a controlled 6-dof plate. The International swarm with global inputs and wall friction [discrete].” MATLAB Central Journal of Robotics Research, 31(7):819–838, 2012. File Exchange, December 2015. URL https://www.mathworks.com/ [27] Xiaohui Yan, Qi Zhou, Jiangfan Yu, Tiantian Xu, Yan Deng, Tao Tang, matlabcentral/fileexchange/54526. Qian Feng, Liming Bian, Yan Zhang, Antoine Ferreira, and Li Zhang. [15] Sylvain Martel. Magnetotactic bacteria for the manipulation and trans- Magnetite nanostructured porous hollow helical microswimmers for port of micro-and nanometer-sized objects. Micro-and Nanomanipula- targeted delivery. Advanced Functional Materials, 25(33):5333–5342, tion Tools, 2015. 2015. ISSN 1616-3028. [16] Sylvain Martel, Samira Taherkhani, Maryam Tabrizian, Mahmood Mo- [28] Haoran Zhao and Aaron T. Becker. “distribution of a swarm of hammadi, Dominic de Lanauze, and Ouajdi Felfoul. Computer 3d robots in a circular workplace under gravity”, wolfram demonstra- controlled bacterial transports and aggregations of microbial adhered tions project, February 2016. URL http://demonstrations.wolfram.com/ nano-components. Journal of Micro-Bio Robotics, 9(1-2):23–28, 2014. DistributionOfASwarmOfRobotsInACircularWorkplaceUnderGravity/. [17] Bruce R. Munson, Alric P. Rothmayer, Theodore H. Okiishi, and [29] Haoran Zhao and Aaron T. Becker. “distribution of a robot Wade W. Huebsch. Fundamentals of Fluid Mechanics. Wiley, 7th swarm in a square under gravity”, wolfram demonstrations edition, 2012. project, January 2016. URL http://demonstrations.wolfram.com/ [18] Yan Ou, Dal Hyung Kim, Paul Kim, Min Jun Kim, and A. Agung Julius. DistributionOfARobotSwarmInASquareUnderGravity/. Motion control of magnetized tetrahymena pyriformis cells by magnetic field with model predictive control. Int. J. Rob. Res., 32(1):129–139, January 2013. [19] Famin Qiu and Bradley J Nelson. Magnetic helical micro-and nanorobots: Toward their biomedical applications. Engineering, 1(1): 21–26, 2015. [20] M. Rubenstein, C. Ahler, and R. Nagpal. Kilobot: A low cost scalable robot system for collective behaviors. In IEEE Int. Conf. Rob. Aut., pages 3293–3298, May 2012. [21] Michael Rubenstein, Alejandro Cornejo, and Radhika Nagpal. Pro- grammable self-assembly in a thousand-robot swarm. Science, 345 (6198):795–799, 2014. [22] Shiva Shahrokhi and Aaron T. Becker. “Moving Two Particles with Shared Control Inputs Using Wall Friction”, Wolfram Demonstrations Project, November 2015. URL http://demonstrations.wolfram.com/ MovingTwoParticlesWithSharedControlInputsUsingWallFriction/. [23] Shiva Shahrokhi and Aaron T. Becker. Stochastic swarm control with  1 0     1 1    −1 −1  tan(β)  0 ≤ β ≤ tan (2A) ∨ 2π − tan (2A) < β ≤ 2π  −A − + 1 1   2   tan(β)  −A + + 1 0  2  1 1   √  p −1 π −1  1 − 2 A tan(β) 1  tan (2A) < β ≤ − tan (2A)  √  2  1 1 − 2pA cot(β)     1 1   0 1    π −1 −1 π  cot(β)  − tan (2A) < β ≤ tan (2A) +  0 −A + + 1  2 2  2   cot(β)  1 −A − + 1  2    0 1  √ p −1 π −1  2 −A tan(β) 1  tan (2A) + < β ≤ π − tan (2A)  √  2 1  0 1 − 2p−A cot(β) RobotRegion(β, A) = A ≤ :   2  0 0   0 1    −1 −1  tan(β)  π − tan (2A) < β ≤ tan (2A) + π  A − 1   2   tan(β)  A + 0  2    0 0  √  p  tan−1(2A) + π < β ≤ 3π − tan−1(2A)  0 2 A cot(β)   √ p 2  2 A tan(β) 0     0 0   1 0    3π −1 −1 3π  cot(β)  − tan (2A) < β ≤ tan (2A) +  1 A −  2 2  2   cot(β)  0 A +  2    1 0  √ p −1 3π −1  1 − 2 −A tan(β) 0  tan (2A) + < β ≤ 2π − tan (2A)  √  2  1 2p−A cot(β)

 1 0    1 1    −1  1  −1  1   tan(β)  0 ≤ β ≤ tan , 1 − A ∨ 2π − tan , 1 − A < β ≤ 2π  (1 − A) − 1  2 2  2   tan(β)  (1 − A) + 0  2    1 0   1 1          tan−1 1 , 1 − A < β ≤ π − tan−1 1 , 1 − A  0 1  2 2 2  √ p   0 2 (1 − A) cot(β)   √  2p(1 − A) tan(β) 0     0 1   1 1    π −1  1  −1  1  π  cot(β)  − tan , 1 − A < β ≤ tan , 1 − A +  1 (1 − A) −  2 2 2 2  2   cot(β)  0 (1 − A) +  2    1 1   0 1          tan−1 1 , 1 − A + π < β ≤ π − tan−1 1 , 1 − A  0 0  2 2 2  √ p   1 − 2 −(1 − A) tan(β) 0   √ 1  1 2p−(1 − A) cot(β) < A < 1 :   , 2  0 0   0 1    −1  1  −1  1   tan(β)  π − tan , 1 − A < β ≤ tan , 1 − A + π  −(1 − A) − + 1 1  2 2  2   tan(β)  −(1 − A) + + 1 0  2    1 0   0 0          tan−1 1 , 1 − A + π < β ≤ 3π − tan−1 1 , 1 − A  0 1  2 2 2  √ p   1 − 2 (1 − A) tan(β) 1   √  1 1 − 2p(1 − A) cot(β)     1 0   0 0    3π −1  1  −1  1  3π  cot(β)  − tan , 1 − A < β ≤ tan , 1 − A +  0 −(1 − A) + + 1  2 2 2 2  2   cot(β)  1 −(1 − A) − + 1  2    0 0   1 0          tan−1 1 , 1 − A + 3π < β ≤ 2π − tan−1 1 , 1 − A  1 1  2 2 2  √ p   2 −(1 − A) tan(β) 1   √  0 1 − 2p−(1 − A) cot(β)  1 0   0 0  A = 1 :   (12)  0 1  1 1

TABLE II ROBOTREGIONSINAUNIT-SQUARE WORKSPACE