Professional Documents
Culture Documents
Citation Distributed MPC For Multi-Vehicle Systems Moving in Formation
Citation Distributed MPC For Multi-Vehicle Systems Moving in Formation
(2017),
Distributed MPC for multi-vehicle systems moving in formation
Robotics and Autonomous Systems, Volume 97, Pages 144-152, November,
2017.
Archived version Author manuscript: the content is identical to the content of the published
paper, but without the final typesetting by the publisher
IR https://lirias.kuleuven.be/handle/123456789/590813
Abstract
This work presents a novel distributed model predictive control (DMPC) strategy for controlling multi-vehicle systems
moving in formation. The vehicles’ motion trajectories are parameterized as polynomial splines and by exploiting the
properties of the B-spline basis functions, constraints on the trajectories are efficiently enforced. The computations for
solving the resulting optimization problem are distributed among the agents by the Alternating Direction Method of
Multipliers (ADMM). In order to reduce the computation time and the amount of inter-vehicle interaction, only one
ADMM iteration is performed per control update. In this way the method converges over the subsequent control up-
dates. Simulations for various nonholonomic vehicle types and an experimental validation on in-house developed robotic
platforms prove the capability of the proposed approach. A supporting software toolbox is provided that implements
the proposed approach and that facilitates its use.
Keywords: Distributed Model Predictive Control (DMPC), Nonholonomic multi-vehicle system, Alternating Direction
Method of Multipliers (ADMM), B-spline.
q̈1 = u1 sin q3 ,
q̈2 = u1 cos q3 − g , (4)
2. Problem formulation
q̇3 = u2 ,
This section describes the class of vehicles examined in where g denotes the gravitational acceleration. This sys-
this work. Afterwards the multi-vehicle optimal control tem is differentially flat with flat output (y1 , y2 ) = (q1 , q2 ).
problem is presented. Indeed, from (4) it follows that the third state q3 and both
2
u1 (y1 , y2 ) = (ũ1 , z) as follows:
u1
q3 Z t
q3 q1 (t) = y1 (τ )(1 − y2 (τ )2 )dτ + q1 (0) ,
q2 q2 0
u2 u2 Z t
q2 (t) = 2y1 (τ )y2 (τ )dτ + q2 (0) ,
q1 q1 0
q3 = 2 arctan y2 ,
(a) 2D quadrotor (b) Differential wheeled robot
u1 = y1 (1 + y22 ) ,
Figure 1: Examples of nonlinear vehicle models that allow poly- 2ẏ2
nomial constraints. u2 = .
1 + y22
When replacing bounds on q3 by constraints on
inputs can be written as a function of these outputs and y2 = tan q23 , all state and input constraints can be written
their derivatives: as polynomials in y, its derivatives and anti-derivatives.
Note that this approach does not require u1 to be positive
ÿ1 and allows backwards driving.
q3 = arctan ,
ÿ2 + g
q 2.2. Multi-vehicle optimal control problem
u1 = ÿ12 + (ÿ2 + g)2 , The problems considered in this work search for state
... ...
y (ÿ2 + g) − ÿ1 y 2 and input trajectories, both included in yi (·), for N dif-
u2 = 1 2 . ferent vehicles i in order to steer them from an initial
ÿ1 + (ÿ2 + g)2
condition, at t = 0, to a terminal condition, at t = T .
Bounds on the inputs can be formulated polynomially by Optimal trajectories are obtained by minimizing the sum
squaring the constraint on u1 and multiplying the con- of all vehicles’ objectives Ji while respecting their input
straint on u2 by its (nonnegative) denominator. When and state constraints hi , which include collision avoidance
replacing constraints on q3 by constraints on tan q3 and constraints. In addition the vehicles should move in for-
multiplying them by (ÿ2 + g), these become polynomial as mation. This is enforced by constraints gi,j which imply
well. Note that in the above derivations it is assumed that relations between the outputs yi and yj of respectively a
u1 ≥ 0 and ÿ2 + g > 0. vehicle i and its neighbor j. As illustrated in Section 4, this
Another example of a nonlinear vehicle model that al- formation can be described in absolute or relative terms,
lows polynomial constraints is a differential wheeled robot, depending on the definition frame. With Ni the neigh-
illustrated in Figure 1b. Its inputs are the tangential veloc- bor set of an agent i, this multi-vehicle problem generally
ity u1 and rotational velocity u2 . Its states are the position translates into an optimization problem of the following
q1 , q2 and orientation q3 , and the model is described by form:
N
X
q̇1 = u1 cos q3 , minimize Ji (yi )
yi (·), i=1,...,N
q̇2 = u1 sin q3 , (5) i=1
(j) (j)
q̇3 = u2 . subject to yi (0) = y0,i , j ∈ {0, . . . , r − 1}
(j)
yi (T ) =
(j)
yT,i , j ∈ {0, . . . , r − 1} (7)
When using a similar approach as with the two-
(−p) (r)
dimensional quadrotor, the transformed system would suf- hi (yi (t), . . . , yi (t)) ≥ 0
fer from singularities when u1 = 0. Furthermore, the gi,j (yi (t), yj (t)) = 0, ∀j ∈ Ni
relative formation constraints, introduced in Section 4.2,
∀t ∈ [0, T ], ∀i ∈ {1, . . . , N } .
would not allow a polynomial formulation. Therefore an-
other approach is used. The model is rewritten by intro- Collision avoidance constraints, included in hi , are func-
ducing z = tan q23 and using relations tion of a vehicle’s position and orientation. Position
and orientation are states of a vehicle and are assumed
1 − z2 2z to depend polynomially on the output trajectories yi ,
cos q3 = , sin q3 = . (6) their derivatives and anti-derivatives. The collision avoid-
1 + z2 1 + z2
ance constraints are formulated by a technique described
u1
After substituting ũ1 = 1+z 2 , the first two lines of the in [25, 26], which is recapitulated in Appendix A.
model (5) are transformed to
3. Spline-based DMPC
q̇1 = ũ1 (1 − z 2 ) , q̇2 = 2ũ1 z .
This section describes the proposed approach for solving
The states and inputs can be expressed as a function of the multi-vehicle formation control problem in an efficient
3
and distributed fashion. First, problem (7) is translated Algorithm 1 Spline-based MPC
into a nonlinear program by adopting a spline parame- 1: Repeat every ∆T : k = 0, 1, . . .
terization for the motion trajectories and an efficient en- 2: Extract qik (t), uki (t) from yki
forcement of constraints on these trajectories. Second, a 3: Vehicle i starts following trajectories qik (t), uki (t)
scheme is proposed for solving the resulting problem in 4: Estimate q̂ik = qik ((k + 1)∆T ), ûki = uki ((k + 1)∆T )
receding-horizon. Finally, this scheme is further adapted 5: Update horizon and compute ỹki
to a DMPC strategy in order to distribute the computa- 6: Compute yik+1 by solving (8), using q̂ik , ûki as initial
tional load among the vehicles. conditions and ỹki as hot-start
7: Until target reached
3.1. Spline parameterization
Problem (7) is infinite dimensional, comprising both in-
finitely many optimization variables and constraints, as Following these steps, problem (7) is reformulated in
the optimization variables yi (·) are functions and con- terms of the spline coefficients yi of the agents’ trajectories:
straints on them are enforced at all time instances. This
N
problem is transformed into a small-scale optimization X
problem along the lines of [24]. To cope with the infinitely minimize Ji (yi )
yi , i=1,...,N
many optimization variables, the trajectories yi (·) are ap- i=1
5
By maximizing this dual function, the optimum is found. Algorithm 2 ADMM based Distributed MPC
ADMM solves this dual problem by using gradient ascent. 1: Perform n ADMM iterations and get y0i , z0i , z0j,i , λ0i ,
The gradient of q with respect to the dual variables is eval-
λ0j,i
uated by first searching for y+ + +
i , zi and zi,j that minimize 2: Repeat every ∆T : k = 0, 1, . . .
Lρ . In this way, the gradient is evaluated as:
3: Extract qik (t), uki (t) from yki
4: Start following trajectories qik (t), uki (t)
∇λi q = y+ +
i − zi ,
5: Estimate q̂ik = qik ((k + 1)∆T ), ûki = uki ((k + 1)∆T )
∇λi,j q = y+ +
j − zi,j . 6: Update horizon and compute ỹki , z̃ki , z̃kj,i , λ̃ki , λ̃kj,i
7: Compute yk+1i , using q̂ik , ûki as initial conditions:
In ADMM, the search for y+ + +
i , zi and zi,j is split in two
consecutive steps. First Lρ is minimized over yi and in a yk+1
i := argmin Lρ,i (yi , z̃ki , λ̃ki , yi , z̃kj,i , λ̃kj,i )
second step it is minimized over zi and zi,j . In this way, yi ∈Yi (q̂ik ,ûk
i)
The proposed DMPC strategy is illustrated and ana- where ∆yi,j represents the desired relative position be-
lyzed by means of three example cases. The first one con- tween a vehicle i and j. The interconnection between
siders the numerical simulation of a formation of quadro- the vehicles is circular. This means that each agent has
tors flying in a changing environment. The second one two neighbors, one on the left and one on the right. The
considers differential wheeled robots moving in relative for- nominal control horizon length equals T = 5 s, the control
mation. The third example validates the DMPC approach period ∆T = 0.1 s and nominal width of the polynomial
experimentally on three robotic platforms. Additional ex- interval ∆ξ = 0.5 s. Applied to this example, step 7 of Al-
amples are found in the supporting toolbox [27]. gorithm 2 is a nonconvex nonlinear program, while step 9
6
t = 0.7 s t = 0.9 s t = 1.2 s t = 1.8 s t = 2.4 s
Figure 3: Motion trajectories for a formation of three quadrotors in a dynamic environment. At t = 0.8 s, the vehicles observe
an obstacle approaching with a constant velocity. The proposed DMPC approach allows to avoid this obstacle while flying in
formation.
ck
problems CasADi [36] is used as symbolic framework, algo-
rithmic differentiation tool and interface to the numerical 10−6
solvers. 100
A receding-horizon algorithm is especially beneficial in
the presence of disturbances. This is illustrated for a for- kF 10−2
mation of three quadrotors that suddenly encounter a mov-
ing object in their airspace. The resulting motion is illus-
10−4
trated in Figure 3. At t = 0.8 s, the aerial vehicles ob- 0 0.5 1 1.5 2 2.5 3
serve the object and determine its position and (constant) t (s)
velocity. This information is used to adapt the trajecto-
ries in order to avoid collisions during the considered con- Figure 4: Combined residual ck and formation error kF as a
trol horizon. The first adapted trajectories are applied at function of time for a formation of three quadrotors in a dy-
t = 0.9 s. One can observe in Figure 3 that these trajecto- namic environment. At t = 0.9 s, a jump occurs in the residual
ries contain large formation violations. This is possible as and formation error due to a change in the environment. From
these constraints are implicitly relaxed in the augmented that point, the DMPC approach converges to a new optimum.
Lagrangian. However, as the updates proceed, these tra-
jectories converge towards a new optimum such that the
quadrotors can avoid the object while attaining the for- jump occurs in both the residual and formation error due
mation. to the change in the environment. From that point, the
The convergence is monitored in Figure 4 by means of DMPC approach converges to the new optimum and the
the combined residual ck and formation error kF . The formation error is quickly reduced during the subsequent
combined residual measures both the primal and the dual iterations.
residual simultaneously [37] and is formulated as Solving the quadrotor formation problem with the pro-
posed DMPC approach takes on average 57 ms per control
N
X X update1 . As a comparison, solving this problem with a
ck = ρkyki − zki k22 + ρkykj − zki,j k22 + central MPC approach as described in Algorithm 1, takes
i=1 j∈Ni 187 ms per update.
X
ρkzki − z̃k−1
i k22 + ρkzki,j − z̃k−1
i,j k2
2 .
j∈Ni 4.2. Relative formation of differential wheeled robots
In order to further illustrate the versatility of the pro-
The formation error is computed as the average relative
posed approach, a different example case is presented. It
deviation of a vehiclePwith respect to the formation cen-
considers three differential wheeled robots as described in
ter. With yck (t) = N1 i yik (t) the formation center of the
Section 2.1. They should move in a relative formation.
planned trajectories during iteration k and ∆yi,c the ideal
This means that the formation is defined with respect to
relative position of a vehicle i with respect to the formation
the local robot frames, and acts as if the vehicles were
center, this becomes
rigidly attached to each other. This is desired in appli-
1
Z N
1 X kyik (t) − yck (t) − ∆yi,c k2 cations as cooperative transportation. Each vehicle ex-
kF = dt , presses in its local robot frame its desired relative position
|T k | Tk N i=1 k∆yi,c k2
where T k indicates the considered control horizon at it- 1 All simulations are performed on a notebook with Intel Core
eration k and |T k | represents its length. At t = 0.9 s, a i5-4300M CPU @ 2.60 GHz x 4 processor and 8 GB of memory.
7
T
∆qi,c = [∆xi,c , ∆yi,c ] with respect to the formation cen-
ter, where ∆xi,c and ∆yi,c are expressed along respectively
the longitudinal and lateral direction. The formation cen- (a)
c T
ter qic = qi,1
c
, qi,2 , seen from vehicle i and expressed in
the inertial frame becomes
c
qi,1 = qi,1 − ∆xi,c cos qi,3 + ∆yi,c sin qi,3 ,
(12) 1
ui,1 (m/s)
c
qi,2 = qi,2 − ∆xi,c sin qi,3 − ∆yi,c cos qi,3 .
0.5
The variables qic are introduced as slack (spline) variables (b)
in the optimization problem. After substituting (6), and 0
relaxing the equality constraint, (12) is reformulated as 0 1 2 3 4 5
polynomial constraints t (s)
− ≤ (1 + zi2 )(qi,1 − qi,1
c
) − (1 − zi2 )∆xi,c + 2zi ∆yi,c ≤ , Figure 5: Three differential wheeled robots moving in relative
− ≤ (1 + zi2 )(qi,2 − qi,2
c
) − 2zi ∆xi,c − (1 − zi2 )∆yi,c ≤ , formation. (a) illustrates the the motion, while (b) represents
(13) the corresponding tangential velocity.
where is a small positive number. The constraint relax-
ation is necessary to find a feasible solution in the pro-
posed spline parameterization. Inequality constraints (13) solving the non-linear program of step 7 in Algorithm 2 by
are added to the local constraint set Yi of vehicle i. The Ipopt on the Odroid XU4. The DMPC algorithm gener-
formation is implied by enforcing consensus on the forma- ates state and input trajectories that are provided as refer-
tion center, expressed in the inertial frame: ence to a low-level feedback controller running at 100 Hz.
Figure 7 presents two point-to-point tasks performed on
gi,j (qic , qjc ) = qic − qjc = 0 . the robotic platforms illustrated by snapshots taken from
the ceiling camera. In the first example a triangular for-
Using this approach, step 9 of Algorithm 2 is again reduced mation should avoid a static obstacle in the environment.
to a linear equality constrained quadratic program. The target position for the formation center is indicated
For this example, the proposed DMPC approach is ap- by the concentric gray circles. The gray lines indicate the
plied and the resulting point-to-point motion and tangen- predicted position trajectories for each platform. The rect-
tial velocity ui,1 for each vehicle are presented in Figure 5. angles indicate the shapes used for avoiding collisions be-
The robots form a rigid triangle that can translate and tween vehicles and obstacle. To account for disturbances
rotate in order to reach the destination in an obstructed and model-plant mismatch it is desired to stay further
environment. Figure 5b illustrates how an outer lying ve- away from obstacles than strictly necessary for avoiding
hicle is constrained by its maximum velocity of 1 m/s while collisions. Therefore a similar construction as described
covering the S-turn. As a similar objective as (11) is used, in [26] is used to motivate the vehicles to move an extra
this proves the optimality of the solution. Note that the distance of 5 cm away from the obstacle. The second ex-
gradual increase and decrease in velocity at the beginning ample considers a formation of two vehicles. The platform
and the end is due to the spline parameterization. The located in the center of the field, indicated by the red rect-
average required time to perform a control update equals angle, acts as an obstacle which is steered manually with
392 ms. Currently ways of reducing this update time are a gamepad. At t = 1 s it suddenly starts to move down-
investigated. wards. The other vehicles are using an estimate of the
obstacle’s position and velocity in order to predict its mo-
4.3. Experimental validation on holonomic platforms
tion. In this way they can adapt their trajectories to pass
The presented approach is implemented and demon- the vehicle from above in stead of trying to move under-
strated on three in-house developed robotic platforms as il- neath the vehicle, which was the initial plan. The DMPC
lustrated in Figure 6. Each platform is equipped with four algorithm makes sure the two vehicles attain their forma-
independently driven Mecanum wheels, which renders the tion. A video illustrating the experiments is found in the
system holonomic. The platform contains an Odroid XU4 readme file of the supporting toolbox [27].
single board computer on which the DMPC algorithm is
implemented. The platforms’ hardware communicate with
4.4. OMG-tools
each other over Wi-Fi. The setup also includes a ceiling
camera that detects the platforms’ absolute position and The proposed DMPC approach is implemented as part
orientation. Each robot merges this information with its of a more general spline-based motion control toolbox with
local encoder measurements for retrieving a fast and accu- the name Optimal Motion Generation-tools [27]. This
rate state estimate. toolbox is written in Python and uses CasADi [36] as
The DMPC iterations are performed periodically with symbolic framework and interface to solvers. The goal
a rate of 4 Hz. The bottleneck for increasing this rate is of OMG-tools is to facilitate the modeling, simulation and
8
(a)
(b)
Figure 7: Experimental validation of the DMPC approach on a formation of robotic platforms moving (a) in a static environment
and (b) in a dynamic environment.
10
constraint satisfaction, Mechanical Sciences 6 (2) (2015) 163– Goele Pipeleers is an assistant pro-
171. fessor at the Department of Mechani-
[25] T. Mercy, W. Van Loock, G. Pipeleers, Real-time motion plan- cal Engineering of the KU Leuven. She
ning in the presence of moving obstacles, in: Proceedings of the
2016 European Control Conference, 2016, pp. 1586–1591.
received her M.Sc. degree in mechan-
[26] R. Van Parys, G. Pipeleers, Spline-based motion planning in an ical engineering and her Ph.D. degree
obstructed 3D environment, in: Proceedings of the 20th IFAC in mechanical engineering from the KU
World Congress, 2017, pp. 8998–9003. Leuven, in 2004 and 2009, respectively.
[27] R. Van Parys, T. Mercy, OMG-tools, https://github.com/
meco-group/omg-tools (2016). She has been a Post-doctoral Fellow
[28] R. Van Parys, G. Pipeleers, Online distributed motion planning of the Research Foundation Flanders,
for multi-vehicle systems, in: Proceedings of the 2016 European and a visiting scholar at the Colorado
Control Conference, 2016, pp. 1580–1585. School of Mines and at the University of California Los
[29] C. R. Hargraves, S. W. Paris, Direct trajectory optimization
using nonlinear programming and collocation, Journal of Guid- Angeles. Her research interests include convex optimiza-
ance, Control, and Dynamics 10 (4) (1987) 338–342. tion, optimal and robust control, and their applications in
[30] N. Petit, M. B. Milam, R. M. Murray, Inversion based con- mechatronics.
strained trajectory optimization, in: 5th IFAC symposium on
nonlinear control systems, Vol. 5, Citeseer, 2001.
[31] P. Martin, R. M. Murray, P. Rouchon, Flat systems, equivalence
and trajectory generation, Tech. rep., California Institute of
Technology (2003).
[32] M. Fliess, J. Lévine, P. Martin, P. Rouchon, Flatness and de-
fect of non-linear systems: introductory theory and examples,
International Journal of Control 61 (6) (1995) 1327–1361.
[33] C. De Boor, A practical guide to splines, revised edition, vol.
27 of applied mathematical sciences (2001).
[34] R. Findeisen, F. Allgöwer, Computational delay in nonlinear
model predictive control, in: Proc. Int. Symp. Adv. Contr. of
Chem. Proc, 2004, pp. 427–432.
[35] A. Wächter, L. T. Biegler, On the implementation of an interior-
point filter line-search algorithm for large-scale nonlinear pro-
gramming, Mathematical programming 106 (1) (2006) 25–57.
[36] J. Andersson, A general-purpose software framework for
dynamic optimization, Ph.D. thesis, Arenberg Doctoral
School, KU Leuven, Department of Electrical Engineering
(ESAT/SCD) and Optimization in Engineering Center, Kas-
teelpark Arenberg 10, 3001-Heverlee, Belgium (2013).
[37] T. Goldstein, B. O’Donoghue, S. Setzer, R. Baraniuk, Fast alter-
nating direction optimization methods, SIAM Journal on Imag-
ing Sciences 7 (3) (2014) 1588–1623.
[38] M. Quigley, K. Conley, B. Gerkey, J. Faust, T. Foote, J. Leibs,
R. Wheeler, A. Y. Ng, Ros: an open-source robot operating
system, in: ICRA workshop on open source software, Vol. 3,
Kobe, 2009, p. 5.
[39] N. Koenig, A. Howard, Design and use paradigms for gazebo,
an open-source multi-robot simulator, in: Intelligent Robots
and Systems, 2004.(IROS 2004). Proceedings. 2004 IEEE/RSJ
International Conference on, Vol. 3, IEEE, 2004, pp. 2149–2154.
[40] S. Boyd, L. Vandenberghe, Convex optimization, Cambridge
university press, 2004.
11