# Predictive Path Following and Collision Avoidance of Autonomous Connected Vehicles

^{1}

^{2}

^{*}

Previous Article in Journal

Previous Article in Special Issue

Previous Article in Special Issue

The Institute of Cartography and Geoinformatics, University of Hannover, D-30167 Hannover, Germany

Institute of Geodesy, University of Hannover, D-30167 Hannover, Germany

Author to whom correspondence should be addressed.

Received: 20 January 2020
/
Revised: 25 February 2020
/
Accepted: 26 February 2020
/
Published: 28 February 2020

(This article belongs to the Special Issue Algorithms for Reliable Estimation, Identification and Control)

This paper considers nonlinear model predictive control for simultaneous path-following and collision avoidance of connected autonomous vehicles. For each agent, a nonlinear bicycle model is used to predict a sequence of the states and then optimize them with respect to a sequence of control inputs. The objective function of the optimal control problem is to follow the planned path which is represented by a Bézier curve. In order to achieve collision avoidance among the networked vehicles, a geometric shape must be selected to represent the vehicle geometry. In this paper, an elliptic disk is selected for that as it represents the geometry of the vehicle better than the traditional circular disk. A separation condition between each pair of elliptic disks is formulated as time-varying state constraints for the optimization problem. Driving corridors are assumed to be also Bézier curves, which could be obtained from digital maps, and are reformulated to suit the controller algorithm. The algorithm is validated using MATLAB simulation with the aid of ACADO toolkit.

Autonomous driving has gained a lot of attention in the last decade, from both industry and academia, due to its anticipated impacts on the enhancement of traffic efficiency. There are many types of controllers that can be used for autonomous driving. In [1], sensitivity analysis is used to design an automatic path following controller by means of an automatic modification of desired output trajectories. A novel path planning algorithm is presented in [2] for planning and execution of heavy multi-body vehicles with multi-axle steering. Sliding mode control is used in [3] for trajectory tracking and control of autonomous high-speed ground vehicles.

Nonlinear Model Predictive Control (NMPC) has proven successful results and has been employed in many recent publications [4,5] because it combines both control and collision avoidance into one algorithm which can be used for critical maneuvers. It is an optimization-based controller that has been widely used for various transportation systems such as autonomous ships [6] and autonomous vehicles [4]. It is mainly used for two famous problems: Trajectory tracking and path following. Recently, it started to get attention to be used for collision avoidance because of its ability to handle nonlinear constraints [7]. In [8], NMPC is used for the trajectory tracking of a scaled autonomous racing car with a higher level planner to account for collision avoidance by building local approximations of the controls from linearized time-varying models. A bi-level NMPC is developed in [9] for intersection scenarios to allocate and update optimal and collision-free timeslots when each vehicle is allowed to occupy the intersection, and provide optimal actuation commands given the allocated timeslots using another low level controller. Experimental validation of NMPC is given in [4] to show that online nonlinear optimization tools are efficient for real-time applications on hardware with limited processing resources, and a comparison of different embedded nonlinear optimization algorithms for autonomous vehicle control is provided. In [10], a legible model predictive control scheme is presented for overtaking of autonomous vehicles on highways in order to enhance the safety and improve the efficiency.

It has been shown recently in [11] that NMPC can meet the safety and robustness requirements of autonomous systems by demonstrating some real world scenarios of autonomous driving under consideration of unknown obstacles. The issue of critical maneuvers of autonomous vehicles is discussed in [12], where a real-time trajectory planning is achieved using model predictive control employing homotopic classes to avoid the computation complexity of sophisticated models.

The main contribution of this work is to fill the gap in NMPC algorithms for autonomous driving by employing paths and road corridors that could be obtained directly from existing digital maps.

This paper is organized as follows. Section 2 describes the vehicle model employed by NMPC, the generation of the reference trajectory, and clarifies the control objective. The controller synthesis is presented in Section 3: A brief introduction of NMPC is given first for the trajectory tracking of the vehicle, followed by how to utilize state and control constraints for comfort driving. After that, the development of the collision avoidance constraints is presented, followed by some guidelines for the implementation of the dynamic optimization problem and the software used for that. MATLAB-based simulation results are given in Section 4. Section 5 concludes this paper and provide our outlook for future work.

Nonlinear Model Predictive Control (NMPC) employs a vehicle dynamic model in order to predict the future trajectory of the vehicle over a predefined prediction horizon. This model is the key for a successful vehicle control system. In the literature of vehicle control, there are different models of vehicles varying in the complexity from kinematic to complex kinetic models [13]. While kinetic models provide accurate prediction of the vehicle motion, they might increase the complexity in the design of collision avoidance systems, and require, during the deployment, high computation time and small sampling interval. It has been shown in the literature that the kinematic model can provide reasonable accuracy by adding constraints on the rate of change of the inputs to be consistent with the low level controllers of the vehicle [14,15]. Therefore, the state space representation of the nonlinear kinematic bicycle model [16]
is used in this paper, where $\left(x\right(t),y(t\left)\right)$ indicates the position of the center of gravity (CG) of the vehicle, $V\left(t\right)$ is the longitudinal velocity, $\psi \left(t\right)$ is the heading angle of the vehicle, $\beta \left(t\right)=arctan(\frac{{l}_{r}}{L}tan\left(\delta \left(t\right)\right))$ is the side-slip angle between the velocity vector and the longitudinal direction of the vehicle, $a\left(t\right)$ is the longitudinal acceleration input used to control the velocity, $\delta \left(t\right)$ is the steering angle, L is the wheelbase, and ${l}_{r}$ is the distance between CG and the rear wheel (see Figure 1).

$$\begin{array}{cc}\hfill \dot{x}\left(t\right)& =V\left(t\right)cos\left(\delta \right(t)+\beta (t\left)\right)\hfill \\ \hfill \dot{y}\left(t\right)& =V\left(t\right)sin\left(\delta \right(t)+\beta (t\left)\right)\hfill \\ \hfill \dot{\psi}\left(t\right)& =\frac{V\left(t\right)}{{l}_{r}}sin\left(\beta \left(t\right)\right)\hfill \\ \hfill \dot{V}\left(t\right)& =a\left(t\right),\hfill \end{array}$$

In order to achieve consistency between the kinematic model and the real vehicle model, interval constraints on the control inputs and their rate of change must be imposed. These constraints play a key role in achieving comfort driving and avoids extreme driving conditions by limiting the maximum and minimum value for the longitudinal acceleration and steering angle inputs. The maximum/minimum longitudinal acceleration can be obtained experimentally and vary from one vehicle to the other based on the engine size. The steering angle can be limited in terms of a maximum safe lateral acceleration to achieve normal driving behavior and avoid extreme slipping [14]. Therefore, the acceleration and steering angle constraints
must be considered. Constraints on time derivative of the control inputs are beneficial for avoiding jerky behavior, and are represented in the model by the augmentation of the control inputs, $(a,\delta )$, as extra states and define the rate of change as a new virtual inputs, $({a}_{dot},{\delta}_{dot})$, as

$$\begin{array}{cc}\hfill {a}_{min}& \le a\le {a}_{max},\hfill \\ \hfill {\delta}_{min}& \le \delta \le {\delta}_{max},\hfill \end{array}$$

$$\begin{array}{cc}\hfill \dot{a}& ={a}_{dot}\hfill \\ \hfill \dot{\delta}& ={\delta}_{dot}.\hfill \end{array}$$

Therefore, the rate of change constraints are formulated as

$$\begin{array}{cc}\hfill -{a}_{do{t}_{max}}& \le {a}_{dot}\le {a}_{do{t}_{max}}\hfill \\ \hfill -{\delta}_{do{t}_{max}}& \le {\delta}_{dot}\le {\delta}_{do{t}_{max}}.\hfill \end{array}$$

Based on that, a compact state-space model of the system is
where $\mathit{x}={\left[\phantom{\rule{2pt}{0ex}}x\phantom{\rule{2pt}{0ex}}y\phantom{\rule{2pt}{0ex}}\psi \phantom{\rule{2pt}{0ex}}V\phantom{\rule{2pt}{0ex}}a\phantom{\rule{2pt}{0ex}}\delta \phantom{\rule{2pt}{0ex}}\right]}^{T}\in {\mathbb{R}}^{n}$, $n=6$ is the state vector, $\mathit{u}={\left[{a}_{dot}\phantom{\rule{4pt}{0ex}}{\delta}_{dot}\right]}^{T}\in {\mathbb{R}}^{m}$, $m=2$, is the control input vector, and $\mathit{f}(\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}},\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}})$ is a continuously differentiable function.

$$\dot{\mathit{x}}\left(t\right)=\mathit{f}(\mathit{x},\mathit{u}),$$

In the domain of vehicle steering control, there are two common techniques: Trajectory tracking and path following. In trajectory tracking problems, time and space reference are provided to the controller and the vehicle may accelerate/decelerate in order to compensate for the tracking error. Considering our vehicle model (5), the objective of the trajectory tracking is to design a controller that steers the system states $\mathit{x}\left(t\right)$ to follow a time-dependent reference trajectory ${\mathit{x}}^{ref}\left(t\right)$ and therefore the tracking error is $\mathit{e}\left(t\right)=\mathit{x}\left(t\right)-\mathit{x}{\left(t\right)}^{ref}\left(t\right)$ [17].

The path following problem is handled differently as the controller objective is to steer the vehicle to be geometrically on a certain path while maintaining a reference speed, and without adding strict requirements when to be where on this path [18]. Consider a path curve $\mathcal{P}$
which is parameterized by the function $\mathit{p}\left(\theta \right)$, where $\theta $ is the time-dependent path parameter whose time evolution is not specified. The objective of the controller is to choose the system input $\mathit{u}$ and the timing $\theta \left(t\right)$ such that the path is followed as exactly as possible.

$$\mathcal{P}=\{\mathit{y}\in {\mathbb{R}}^{{n}_{p}}|\theta \in [{\theta}_{0},{\theta}_{1}]\mapsto \mathit{y}=\mathit{p}\left(\theta \right)\},$$

Given the vehicle state space Model (5), which is assumed to have an output function $\mathit{h}\left(\mathit{x}\left(t\right)\right)\in {\mathbb{R}}^{{n}_{p}},{n}_{p}\le n$, and the Path (6), the path following objective could be represented as:

- Path Convergence: The system output $\mathit{y}=\mathit{h}\left(\mathit{x}\right)$ converges to the set $\mathcal{P}$, i.e.,: $\underset{t\to \infty}{lim}\Vert \mathit{h}(\mathit{x})-\mathit{p}(\theta )\Vert \phantom{\rule{3.33333pt}{0ex}}=\phantom{\rule{3.33333pt}{0ex}}0$
- Monotonous Forward Motion: The system moves along $\mathcal{P}$ in the direction of increasing values of $\theta $, i.e., $\dot{\theta}\ge 0$ and ${\theta}_{0}\le \theta \le {\theta}_{1}$.

Two of the necessary requirements of any autonomous driving controller is the ability to handle the road boundaries generated from digital maps and have a path representation that could be followed by the motion controller.

In [19], an automatic procedure for generating driving boundaries from OpenStreetMap is presented, which expands its original representation, replacing polylines by polynomial-based roads, whose sections are defined using Bézier curves. This method has been validated successfully on a peri-urban environment without any human intervention. Therefore, we assume that the road is represented by polynomials whose sections are defined using Bézier curves. The road corridor is represented by two Bézier curves, one for the left boundary and the other for the right one. The path that should be follow by the vehicle, which is assumed to be the at the center of the lane is represented also by a Bézier curve.

Bézier curves [20] have recently attracted many researchers for digital map representation for autonomous driving [19]. They are defined as
where n is the order of the polynomial, ${\mathit{P}}_{n}\in {\mathbb{R}}^{2}$ are the control points defining the curvature of the curve (see Figure 2), and ${b}_{i,n}$ the Bernstein coefficients given by
with ${{}^{n}{}^{\phantom{\rule{-0.27771pt}{0ex}}}C}_{i}=\frac{n!}{i!(n-i)!}$.

$$\mathcal{B}(\theta ,n)=\sum _{i=0}^{n}{b}_{i,n}\left(\theta \right){\mathit{P}}_{i},\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}0\le \theta \le 1,$$

$${b}_{i,n}\left(\theta \right)={{}^{n}{}^{\phantom{\rule{-0.27771pt}{0ex}}}C}_{i}{\theta}^{i}{(1-\theta )}^{n-i},\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}i=0,\cdots ,n,$$

Depending on the Bézier polynomial degree, it would be possible to define any arbitrary road as one Bézier curve. However, higher degrees of the polynomial leads to high computation time and difficulties in calculating the control points. Moreover, for the purpose of autonomous driving, defining the whole road in just one huge polynomial is not required and makes the control problem intractable. Therefore, the common approach in computer graphics is to define complex paths by concatenating quadratic and cubic curves, taking into consideration the continuity constraints [19]. The overall control problem is to utilize the kinematic bicycle Model (5) to design a controller that follows the planned reference path defined by a Bézier Curve (7) and avoid collision with nearby objects, that are assumed to be connected with our own vehicle, by doing necessary maneuvers. The controller should be able to respect the road boundaries or corridor which are also assumed to be represented by a left and right Bézier curves.

Nonlinear Model Predictive Control (NMPC), also known as Receding Horizon Control and Moving Horizon Optimal Control, is a famous control technique for vehicle control systems that has roots in optimal control. It has been widely adopted in industry as an effective way to deal with multi-variable constrained control problems [21]. The basic concept of MPC is to optimize the forecast of the system, generated by a nominal dynamic model, and optimize it to produce the best decision, i.e., the control signal at the current time slot, while planning the nominal future control actions. This is achieved by employing the prediction of the system model to formulate and solve a dynamic optimization problem online where tracking errors, namely the difference between the predicted output and the desired reference, is minimized over a future horizon, possibly subject to constraints on the control inputs (the manipulated variables) and the states. These constraints could be nonlinear and time-varying over the prediction horizon.

This optimization problem is solved in discrete control intervals suitable for the system dynamics. At each step, the MPC algorithm computes an open-loop sequence of control input adjustments. The first input in the optimal sequence is injected into the system, and the entire optimization is repeated for the subsequent control intervals.

Consider a nonlinear state space Model (5) with $\mathit{x}\in {\mathbb{R}}^{n}$ and $\mathit{u}\in {\mathbb{R}}^{m}$ subject to generic state and control constraints
where $\mathcal{X}$ and $\mathcal{U}$ define the admissible state and control sets, respectively. These admissible sets will be designed later to achieve comfort driving, respect physical constraints of the vehicle, and perform collision avoidance.

$$\begin{array}{cc}\hfill \mathit{x}\left(t\right)& \in \mathcal{X}\subset {\mathbb{R}}^{n}\hfill \\ \hfill \mathit{u}\left(t\right)& \in \mathcal{U}\subset {\mathbb{R}}^{m},\hfill \end{array}$$

In order to include the Path (6) into the control problem, we treat its parameter $\theta $ as an extra virtual state whose time evolution $t\mapsto \theta \left(t\right)$ is controlled by an extra virtual input [18]. Therefore, an additional differential equation
is added to the system where $z=\theta $ is the extra state that represents the path time evolution, and ${u}_{z}$ is the virtual control input that adds an extra degree of freedom in the controller design.

$$\dot{z}={u}_{z},$$

The optimal control problem (OCP) of the NMPC used for path following will be
where $\ell (\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}},\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}},\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}},\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}})$ is the stage cost given by a positive definite function, ${T}_{p}$ is the prediction horizon, $\mathcal{Z}$ is the admissible set for the path parameter, and ${\mathcal{U}}_{\u2021}$ is the admissible set for the path timing law. The stage cost function for the path following problem of the autonomous vehicle could be defined as

$$\begin{array}{cc}\hfill \underset{\mathit{x}\left(t\right),\mathit{u}\left(t\right),z\left(t\right),{u}_{z}\left(t\right)}{\mathrm{min}}J(\mathit{x},\mathit{u},z,{u}_{z})=& {\int}_{t={t}_{k}}^{{T}_{p}+{t}_{k}}\ell (\mathit{x}\left(t\right),\mathit{u}\left(t\right),z\left(t\right),{u}_{z}\left(t\right))dt+F\left(\mathit{x}({t}_{k}+{T}_{p})\right)\hfill \\ & \mathrm{subject}\phantom{\rule{2pt}{0ex}}\mathrm{to}:\hfill \\ & \dot{\mathit{x}}\left(t\right)=f(\mathit{x},\mathit{u})\hfill \\ & \dot{z}\left(t\right)={u}_{z}\left(t\right)\hfill \\ & \mathit{x}\left(t\right)\in \mathcal{X},\hfill \\ & \mathit{u}\left(t\right)\in \mathcal{U},\hfill \\ & z\left(t\right)\in \mathcal{Z},\hfill \\ & {u}_{z}\left(t\right)\in {\mathcal{U}}_{\u2021},\hfill \end{array}$$

$$\ell (\mathit{x},\mathit{u},z,{u}_{z})={\Vert \mathit{h}\left(\mathit{x}\right)-\mathit{p}\left(z\right)\Vert}_{{Q}_{1}}+{\Vert V-{V}^{ref}\Vert}_{{Q}_{2}}+{\Vert \mathit{u}\Vert}_{{R}_{1}}+{\Vert {u}_{z}\Vert}_{{R}_{2}}.$$

Here, $Q=\mathrm{diag}(Q1,Q2)$ is positive semi-definite matrix, $R=\mathrm{diag}(R1,R2)$ is strictly positive-definite, $\mathit{h}\left(\mathit{x}\right)$ is the output function for the vehicle state space Model (5) and is defined as: $\mathit{h}\left(\mathit{x}\right)={\left[x\phantom{\rule{4pt}{0ex}}y\phantom{\rule{4pt}{0ex}}\psi \right]}^{T}$, and
is the reference path which is defined using quadratic Bézier curves.

$$\mathit{p}\left(z\right)=\left[\begin{array}{c}\mathcal{B}(z,2)\\ {\psi}^{ref}\end{array}\right]\in {\mathbb{R}}^{3},$$

In order to account for collision avoidance of nearby vehicles, an NMPC is employed, due to its ability to handle time-varying nonlinear constraints by adding coupling constraints to the vehicle optimization problem with its neighbors to guarantee that the solution of the OCP provides a collision-free trajectory. The vehicles are assumed to be connected and they are exchanging information about their future predictions.

Consider ${N}_{o}$ encountered vehicles indexed by a superscript $\left[i\right]$, for instance, the state vector of each neighbor is denoted by ${\mathit{x}}^{\left[i\right]}$. Each of them is represented geometrically by an elliptic disk (see Figure 3) which is parameterized by the center position $(x,y)$, orientation (heading angle) $\psi $, semi-major radius ${r}_{1}$, and semi-minor radius ${r}_{2}$. The elliptic disk is the closed type of conic section results from the intersection of a cone by a plane, and is expressed as
where $X={\left[x\phantom{\rule{2pt}{0ex}}y\phantom{\rule{2pt}{0ex}}1\right]}^{T}$ is the 3-D column vector containing the homogeneous coordinates,
$A=(\frac{cos{\left(\psi \right)}^{2}}{{{r}_{1}}^{2}}+\frac{sin{\left(\psi \right)}^{2}}{{{r}_{2}}^{2}})$, $B=\frac{sin\left(2\psi \right)}{2}(\frac{1}{{{r}_{1}}^{2}}-\frac{1}{{{r}_{2}}^{2}})$, and $C=(\frac{sin{\left(\psi \right)}^{2}}{{{r}_{1}}^{2}}+\frac{cos{\left(\psi \right)}^{2}}{{{r}_{2}}^{2}})$.

$$\overline{\mathcal{A}}\equiv \left\{X\phantom{\rule{2pt}{0ex}}\right|\phantom{\rule{2pt}{0ex}}{X}^{T}\mathcal{A}X\le 0\},$$

$$\mathcal{A}=\left[\begin{array}{ccc}A& -B& B{y}_{p}-A{x}_{p}\\ -B& C& B{x}_{p}-C{y}_{p}\\ B{y}_{p}-A{x}_{p}& B{x}_{p}-C{y}_{p}& A{x}_{p}^{2}-2B{x}_{p}{y}_{p}+C{y}_{p}^{2}-1\end{array}\right],$$

Based on that, the collision avoidance is formulated in terms of coupling state constraints that represent the separation condition between the moving elliptic disk of the vehicle $\overline{\mathcal{A}}$ and the neighbor vehicle ${\overline{\mathcal{A}}}^{\left[i\right]}$. In the following, we recall a proposition that formulates the collision avoidance constraints.

Consider a pair of moving elliptic disks$\overline{\{\mathcal{A}}\left(t\right),{\overline{\mathcal{B}}}^{\left[i\right]}\left(t\right)\}$in the Euclidean plane${\mathit{E}}^{2}$represented by the matrices $\mathcal{A}$ and${\mathcal{B}}^{\left[i\right]}\left(t\right)$, respectively. Let${\mathcal{P}}^{\left[i\right]}(\lambda ,t)={C}_{3}^{\left[i\right]}\left(t\right){\lambda}^{3}+{C}_{2}^{\left[i\right]}\left(t\right){\lambda}^{2}+{C}_{1}^{\left[i\right]}\left(t\right)\lambda +{C}_{0}^{\left[i\right]}\left(t\right)$be their characteristic polynomial and${\mathsf{\Delta}}^{\left[i\right]}\left(t\right)$denote the discriminant of${\mathcal{P}}^{\left[i\right]}(\lambda ,t)$with respect to λ. Suppose that every pair$\{\overline{\mathcal{A}}\left({T}_{0}\right),{\overline{\mathcal{B}}}^{\left[i\right]}\left({T}_{0}\right)\}$is separate, then the motions of them are collision-free for all$t\in [{t}_{k},{t}_{k}+{T}_{p}]$if

- ${C}_{2}^{\left[i\right]}\left(t\right)<0$
- ${\mathsf{\Delta}}^{\left[i\right]}\left(t\right)>0$, $\forall t\in [{t}_{k},{t}_{k}+{T}_{p}].$

See [17]. ☐

In this subsection, we develop the sufficient constraints that could be added to the optimization Problem (11) to guarantee our vehicle respect the driving corridors, generated from digital maps, in all the maneuvering. As for the reference path, it is assumed that we get two Bézier curves from the map; one for the left boundary and the other for the right one. Explicit representations of Bézier Curves (7) are not suitable for formulating the nonlinear constraints, and therefore we want to turn (7) into an implicit curve equation, that is one where we have no dependence on the parameter $\theta $, i.e., $F(x,y)=0$. This can be done using the resultant (or the Bézout’s determinant). The advantage is that $F(x,y)>0$ holds for points on one side of the Bézier curve, and $F(x,y)<0$ for those on the other side. As a result, we get the following representation for quadratic curves [20]:
where $x\left(\theta \right)={a}_{2}{\theta}^{2}+{a}_{1}\theta +{a}_{0}$, and $y\left(\theta \right)={b}_{2}{\theta}^{2}+{b}_{1}\theta +{b}_{0}$. The right and left boundary constraints are ${F}_{R}(x,y)>0$ and ${F}_{L}(x,y)<0$, respectively.

$$F(x,y)={(({a}_{0}-x){b}_{2}-{a}_{2}({b}_{0}-y))}^{2}-(({a}_{0}-x){b}_{1}-{a}_{1}({b}_{0}-y))({a}_{1}{b}_{2}-{a}_{2}{b}_{1})$$

In order to utilize the aforementioned infinite dimensional OCP of the NMPC, a proper formulation of the optimization problem implementation is required. There are two possible categories when it comes to dynamic optimization problems; indirect and direct methods. Indirect methods, such as calculus of variations and dynamic programming, consider the continuous NMPC as it is and does not require discretization of the problem. They provide exact analytic solution of the optimal control problem [22], but they are not common to be used for nonlinear optimal control problems due to their inability to handle a wide class of systems because they require a guess of the optimal control structure [22].

Direct methods, such as collocation [23] and multiple shooting [24], are the most desirable technique for formulating and parameterizing NMPC optimization problem. The main idea behind them is introducing the discretization and finite parameterization into the optimal control problem formulation which results in a Nonlinear Programming Problem (NLP), and then solve it directly with numerical methods. In the multiple shooting technique, the one used in this paper, the nonlinear continuous ordinary differential equation (ODE) and the OCP are discretized at a proper sampling interval ${T}_{s}=\frac{{T}_{p}}{N},N=2,3,\cdots $ [24].

Consider a general OCP of the form
where $\dot{\overline{\mathit{x}}}\left(t\right)=f(\overline{\mathit{x}}\left(t\right),\overline{\mathit{u}}\left(t\right))=0$ is the ODE model of the system, $\overline{\mathit{x}}\left({t}_{k}\right)$ is the initial condition, and $h(\overline{\mathit{x}},\overline{\mathit{u}})$ is a vector function which represents the optimization state and control constraints. The control input $\overline{\mathit{u}}\left(t\right)$ is discretized at the time instants
such that

$$\begin{array}{cc}\hfill \underset{\overline{\mathit{x}}\left(\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}}\right),\overline{\mathit{u}}\left(\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}}\right)}{\mathrm{min}}=& {\int}_{t={t}_{k}}^{{T}_{p}+{t}_{k}}\ell (\overline{\mathit{x}}\left(t\right),\overline{\mathit{u}}\left(t\right))dt\hfill \\ & \mathrm{subject}\phantom{\rule{4pt}{0ex}}\mathrm{to}:\hfill \\ \hfill \overline{\mathit{x}}\left({t}_{k}\right)-{\overline{\mathit{x}}}_{k}& =0\hfill \\ \hfill \dot{\overline{\mathit{x}}}\left(t\right)-f(\overline{\mathit{x}}\left(t\right),\overline{\mathit{u}}\left(t\right))& =0,\phantom{\rule{16pt}{0ex}}t\in [{t}_{k},{t}_{k}+{T}_{p}],\hfill \\ \hfill r(\overline{\mathit{x}},\overline{\mathit{u}})& =0,\phantom{\rule{1.em}{0ex}}\hfill \\ \hfill h(\overline{\mathit{x}},\overline{\mathit{u}})& \ge 0,\phantom{\rule{16pt}{0ex}}t\in [{t}_{k},{t}_{k}+{T}_{p}],\hfill \end{array}$$

$${T}_{d}=\{{t}_{k+1},{t}_{k+2},\cdots ,{t}_{k+N}={t}_{k}+{T}_{p}\},$$

$$\overline{\mathit{u}}\left(t\right)={\mathit{q}}_{i}\phantom{\rule{8pt}{0ex}}\forall t\in [{t}_{i},{t}_{i+1}].$$

The nonlinear ODE, which can not be solved analytically, must be solved numerically on each subinterval $[{t}_{i},{t}_{i+1}]$ using a suitable integration technique, e.g., fourth-order Runge–Kutta, and starting with an artificial initial value ${\mathit{s}}_{i}$. The trajectory pieces $\overline{\mathit{x}}(t;{\mathit{s}}_{i},{\mathit{q}}_{i})$ are obtained by solving the initial value problem (IVP)
as function of $\mathit{s}$ and $\mathit{q}$, and also and compute numerically the integral

$$\begin{array}{cc}\hfill \dot{\overline{\mathit{x}}}(t;{\mathit{s}}_{i},{\mathit{q}}_{i})& =f({\overline{\mathit{x}}}_{i}(t;{\mathit{s}}_{i},{\mathit{q}}_{i}),{\mathit{q}}_{i}),\phantom{\rule{16pt}{0ex}}t\in [{t}_{k},{t}_{k}+{T}_{p}],\hfill \\ \hfill \overline{\mathit{x}}(t;{\mathit{s}}_{i},{\mathit{q}}_{i})& ={\mathit{s}}_{i},\hfill \end{array}$$

$${l}_{i}({\mathit{s}}_{i},{\mathit{q}}_{i}):={\int}_{t={t}_{i}}^{{t}_{i+1}}\ell ({\overline{\mathit{x}}}_{i}({t}_{i};{\mathit{s}}_{i},{\mathit{q}}_{i}),{\mathit{q}}_{i})dt.$$

Based on that, the NLP formulation of Problem (14) is represented as
where (16b) represents the initial condition, Equation (16c) represents the continuity condition between each two consecutive subintervals, Equations (16d) and (16e) represent the discretized constraints, and ${\overline{\mathit{x}}}_{i}\left({t}_{i+1}\right)\ne {\mathit{s}}_{i+1}$ is the solution of the IVP (15). The NLP (16) is solved using sequential quadratic programming (SQP), with the aid of the method of Lagrange multipliers where the Hessian matrix is approximated using Gauss–Newton [25]. Each quadratic problem (QP) is then solved using active-set method [26].

$$\begin{array}{cc}\hfill \underset{\mathit{s},\mathit{q}}{\mathrm{min}}=& \sum _{i=k}^{k+N}l({\mathit{s}}_{i},{\mathit{q}}_{i})\hfill \\ & \mathrm{subject}\phantom{\rule{4pt}{0ex}}\mathrm{to}:\hfill \end{array}$$

$$\begin{array}{cc}\hfill {\mathit{s}}_{i}-{\overline{\mathit{x}}}_{i}& =0\hfill \end{array}$$

$$\begin{array}{cc}\hfill {\mathit{s}}_{i+1}-{\overline{\mathit{x}}}_{i}({t}_{i+1};{\mathit{s}}_{i},{\mathit{q}}_{i})& =0,\phantom{\rule{16pt}{0ex}}i=0,\cdots ,N-1,\hfill \end{array}$$

$$\begin{array}{cc}\hfill r({\mathit{s}}_{i},{\mathit{q}}_{i})& =0,\phantom{\rule{16pt}{0ex}}i=0,\cdots ,N,\hfill \end{array}$$

$$\begin{array}{cc}\hfill h({\mathit{s}}_{i},{\mathit{q}}_{i})& \ge 0,\phantom{\rule{16pt}{0ex}}i=0,\cdots ,N,\hfill \end{array}$$

The open-source ACADO Code Generation toolkit [26] is used in the implementation of the NMPC algorithm. Based on a symbolic representation of optimal control problems, ACADO generates an optimized and self-contained C code for the SQP formulation with static memory for a good real-time performance. The C code can be integrated into MATLAB as MATLAB executable (mex) files.

The main steps of the implementation are briefly described as follows:

- The continuous state space model is symbolically defined using C-code or the MATLAB interface, then it is simplified employing automatic differentiation tools and using zero entries in the Jacobian matrix. The result is an efficient real time C-code for the integration of the continuous nonlinear system which will be used for the prediction.
- The optimization problem cost function and constraints are symbolically defined, parametrized by the aforementioned direct multiple shooting technique, and the resulting, large but sparse, Quadratic Problem (QP) is condensed.
- The discretized QP is then solved using
`qpOASES`solver.

A representation of the usage of NMPC for path-following and collision avoidance is shown in Figure 4, and Algorithm 1 describes the NMPC usage as follows.

Algorithm 1 NMPC Algorithm for Path Following. |

1: Set the time index $k=0$, the sampling interval ${T}_{s}$, the prediction horizon ${T}_{p}=N{T}_{s}$, weight matrices Q and R. |

2: Measure the values of the states $\overline{\mathit{x}}\left({t}_{k}\right)$ or estimate them. |

3: Solve the optimization Problem (16) over the discrete time instants ${T}_{d}=[{t}_{k+1}\cdots {t}_{k+N}={T}_{p}]$ and get the optimal control sequence $[\overline{\mathit{u}}\left({t}_{k}\right)={\mathit{q}}_{k}\cdots \overline{\mathit{u}}({t}_{k+N-1}={\mathit{q}}_{k+N-1})]$ and the corresponding predicted states $[\overline{\mathit{x}}\left({t}_{k}\right)={\mathit{q}}_{k}\cdots \overline{\mathit{x}}({t}_{k+N}={\mathit{q}}_{k+N})]$. |

4: Apply only the first control element $\overline{\mathit{u}}\left({t}_{k}\right)$. |

5: wait for the next sample and set the time index $k=k+1$, then go to step 2. |

There are many state estimation techniques in the literature that could be used to get the state vector$\overline{\mathit{x}}\left({t}_{k}\right)$. A survey for these techniques is given in [27].

In this section, simulation results are presented to demonstrate the validity and assess the performance of the proposed NMPC scheme for path-following and collision avoidance of autonomous vehicles. Simulation is done in MATLAB 2017b using the static C-code generated from the ACADO toolkit [26]. These results have been obtained on a $2.8$ GHz core i5 CPU with 16 GB RAM. In the simulation scenario, there are two vehicles; the own vehicle and the encountered one. It is assumed that the encountered vehicle has the priority and therefore its collision avoidance algorithm was not triggered, and it sends its future prediction states to the own vehicle. In Table 1, the parameters of the vehicle Model (1), which are obtained from [28], and the NMPC parameters are given.

The vehicle starts from the initial position $(x,y),=(0\phantom{\rule{4pt}{0ex}}\mathrm{m},0\phantom{\rule{4pt}{0ex}}\mathrm{m})$ and the NMPC steers it to follow the reference quadratic Bézier path with the control points ${P}_{0}={[0,0]}^{T}$, ${P}_{1}={[100,50]}^{T}$, and ${P}_{2}={[300,0]}^{T}$ As shown in Figure 5, the NMPC steers the vehicle to follow the reference path, and when the slower vehicle impedes this path, the NMPC steers the vehicle to avoid collision with the encountered vehicle by overtaking it, while respecting the control input constraints and the road corridors. In Figure 6a, it is shown that the vehicle could achieve the desired speed except during the collision avoidance maneuvering. It is clear in Figure 6e,f that maneuvering of the vehicle does not have any abrupt change in the steering angle and therefore it is consistent with the steering system dynamics. In Figure 6c,d, it is shown that the maximum allowed acceleration is obeyed while avoiding any jerky actions due to the constraints on the acceleration rate of change. The distance between the centers of both vehicles at the closest point of approach is about $3.4\phantom{\rule{4pt}{0ex}}\mathrm{m}$ which is quite smaller compared to selecting circular disks, as presented in [14], which gives a minimum distance of at least $4.4\phantom{\rule{4pt}{0ex}}\mathrm{m}$. The maximum execution time of the presented scheme is about $50\phantom{\rule{4pt}{0ex}}\mathrm{m}\mathrm{s}$ which qualifies it to be used for experimental evaluation, and the maximum number of iterations is 100.

An NMPC scheme is presented in this paper for the problem of path-following of autonomous vehicles with integrated collision avoidance based on ellipse geometry. A bicycle model is used with both acceleration and steering angle as control inputs. Employing a quadratic cost function that penalizes the deviation from the path, a dynamic optimization problem is formulated with linear inequality state and control constraints to achieve comfort driving. Collision avoidance is achieved by adding nonlinear time-varying state constraints based on the separation condition between elliptic disks. To guarantee staying within the road boundaries, implicit Bézier constraints are added to the OCP. The optimization problem is parametrized and solved using ACADO toolkit and is evaluated on MATLAB platform. The NMPC shows good performance for following of the predefined path while avoiding jerky behavior and collision with nearby vehicles.

Our future aim is to increase the safety levels of the presented scheme by considering robust NMPC techniques for uncertain nonlinear models. The upper bound of the path-following error is parametrized with the aid of an auxilary control law, and then included into the optimization problem as a decision variable to make it as small as possible. Moreover, a maximum permissible error could be added as a reference to the optimization problem.

Methodology, M.A.; Writing—original draft preparation, M.A. and S.S.; Writing—review and editing, M.A. and S.S.; Supervision, S.S.; All authors have read and agreed to the published version of the manuscript.

This research was funded by the German Research Foundation (DFG) as a part of the Research Training Group Integrity and Collaboration in dynamic SENSor networks (i.c.sens) [GRK2159].

The authors declare no conflict of interest.

- Rauh, A.; Kersten, J.; Auer, E.; Aschemann, H. Sensitivity-based feedforward and feedback control for uncertain systems. Computing
**2012**, 94, 357–367. [Google Scholar] [CrossRef] - Beyersdorfer, S.; Wagner, S. Novel model based path planning for multi-axle steered heavy load vehicles. In Proceedings of the 16th International IEEE Conference on Intelligent Transportation Systems (ITSC 2013), The Hague, The Netherlands, 6–9 October 2013; pp. 424–429. [Google Scholar] [CrossRef]
- Wang, J.; Steiber, J.; Surampudi, B.; Member, S. Autonomous Ground Vehicle Control System for High-Speed and Safe Operation. In Proceedings of the American Control Conference, Seattle, WA, USA, 11–13 June 2008; pp. 218–223. [Google Scholar]
- Quirynen, R.; Berntorp, K.; Cairano, S.D. Embedded Optimization Algorithms for Steering in Autonomous Vehicles based on Nonlinear Model Predictive Control. In Proceedings of the Annual American Control Conference (ACC), Milwaukee, WI, USA, 27–29 June 2018; pp. 3251–3256. [Google Scholar] [CrossRef]
- Abbas, M.A.; Milman, R.; Eklund, J.M. Obstacle Avoidance in Real Time with Nonlinear Model Predictive Control of Autonomous Vehicles. Can. J. Electr. Comput. Eng.
**2017**, 40, 12–22. [Google Scholar] [CrossRef] - Abdelaal, M. Nonlinear Model Predictive Control for Trajectory Tracking and Collision Avoidance of Surface Vessels. Ph.D. Thesis, University of Oldenburg, Oldenburg, Germany, 2018. [Google Scholar] [CrossRef]
- Pereira, G.C. Model Predictive Control for Autonomous Driving of Over-Actuated Research Vehicle. Ph.D. Thesis, KTH Royal Institute of Technology, Stockholm, Sweden, 2016. [Google Scholar]
- Liniger, A.; Domahidi, A.; Morari, M. Optimization-based autonomous racing of 1: 43 scale RC cars. Optim. Control Appl. Methods
**2015**, 36, 628–647. [Google Scholar] [CrossRef] - Hult, R.; Zanon, M.; Gros, S.; Falcone, P. Optimal Coordination of Automated Vehicles at Intersections: Theory and Experiments. In Proceedings of the European Control Conference, Naples, Italy, 25–28 June 2019. [Google Scholar] [CrossRef]
- Brüdigam, T.; Ahmic, K.; Leibold, M.; Wollherr, D. Legible Model Predictive Control for Autonomous Driving on Highways. IFAC-PapersOnLine
**2018**, 51, 215–221. [Google Scholar] [CrossRef] - Rick, M.; Clemens, J.; Sommer, L.; Folkers, A.; Schill, K.; Büskens, C. Autonomous Driving Based on Nonlinear Model Predictive Control and Multi-Sensor Fusion. IFAC-PapersOnLine
**2019**, 52, 182–187. [Google Scholar] [CrossRef] - Yi, B.; Bender, P.; Bonarens, F.; Stiller, C. Model Predictive Trajectory Planning for Automated Driving. IEEE Trans. Intell. Veh.
**2018**, 4, 24–38. [Google Scholar] [CrossRef] - Rajamani, R. Vehicle Dynamics and Control; Springer: Berlin, Germany, 2006; p. 470. [Google Scholar]
- Alrifaee, B. Collision Avoidance Networked Model Predictive Control for Vehicle Collision Avoidance. Ph.D. Thesis, RWTH Aachen University, Aachen, Germany, 2017. [Google Scholar] [CrossRef]
- Polack, P.; Altché, F.; D’Andréa-Novel, B.; De La Fortelle, A. Guaranteeing Consistency in a Motion Planning and Control Architecture Using a Kinematic Bicycle Model. In Proceedings of the American Control Conference, Milwaukee, WI, USA, 27–29 June 2018; pp. 3981–3987. [Google Scholar] [CrossRef]
- Guanetti, J.; Kim, Y.; Borrelli, F. Control of connected and automated vehicles: State of the art and future challenges. Annu. Rev. Control
**2018**, 45, 18–40. [Google Scholar] [CrossRef] - Abdelaal, M.; Schön, S. Distributed Nonlinear Model Predictive Control for Connected Vehicles Trajectory Tracking and Collision Avoidance with Ellipse Geometry. In Proceedings of the 32nd International Technical Meeting of the Satellite Division of The Institute of Navigation (ION GNSS+ 2019), Miami, FL, USA, 16–20 September 2019; pp. 2100–2111. [Google Scholar]
- Faulwasser, T.; Matschek, J.; Zometa, P.; Findeisen, R. Predictive path-following control: Concept and implementation for an industrial robot. In Proceedings of the IEEE International Conference on Control Applications, Hyderabad, India, 28–30 August 2013; pp. 128–133. [Google Scholar] [CrossRef]
- Godoy, J.; Artuñedo, A.; Villagra, J. Self-Generated OSM-Based Driving Corridors. IEEE Access
**2019**, 7, 20113–20125. [Google Scholar] [CrossRef] - Borrelli, H.; Boehm, W.; Paluszny, M. Bézier and B-Spline Techniques; Springer: Berlin, Germany, 2002. [Google Scholar]
- Rubagotti, M.; Raimondo, D.M.; Ferrara, A.; Magni, L. Robust model predictive control with integral sliding mode in continuous-time sampled-data nonlinear systems. IEEE Trans. Autom. Control
**2011**, 56, 556–570. [Google Scholar] [CrossRef] - Borrelli, F.; Bemporad, A.; Morari, M. Explicit Nonlinear Model Predictive Control: Theory and Applications; Springer: Berlin, Germany, 2012. [Google Scholar]
- Tsang, T.; Himmelblau, D.; Edgar, T. Optimal control via collocation and nonlinear programming. Int. J. Control
**1975**, 21, 763–768. [Google Scholar] [CrossRef] - Bock, H.G.; Plitt, K.J. Multiple Shooting Algorithm for Direct Solution of Optimal Control Problems. In Proceedings of the 9th IFAC World Congress, Budapest, Hungary, 2–6 July 1984; Elsevier: Budapest, Hungary, 1985; Volume 17, pp. 1603–1608. [Google Scholar] [CrossRef]
- Bock, H.G. Recent Advances in Parameter identification Techniques for O.D.E. In Numerical Treatment of Inverse Problems in Differential and Integral Equations: Progress in Scientific Computing; Birkhäuser: Basel, Sweden, 1983; Volume 2, pp. 95–121. [Google Scholar] [CrossRef]
- Houska, B.; Ferreau, H.J.; Diehl, M. ACADO toolkit-An open-source framework for automatic control and dynamic optimization. Optim. Control Appl. Methods
**2011**, 32, 298–312. [Google Scholar] [CrossRef] - Jin, X.; Yin, G.; Chen, N. Advanced estimation techniques for vehicle system dynamic state: A survey. Sensors
**2019**, 19, 1–26. [Google Scholar] [CrossRef] [PubMed] - Kong, J.; Pfeiffer, M.; Schildbach, G.; Borrelli, F. Kinematic and Dynamic Vehicle Models for Autonomous Driving Control Design. In Proceedings of the IEEE Intelligent Vehicles Symposium (IV), Seoul, Korea, 28 June–1 July 2015 ; pp. 2–7. [Google Scholar]

${a}_{max}=1\phantom{\rule{4pt}{0ex}}\mathrm{m}/{\mathrm{s}}^{2}$ | ${\delta}_{max}=20deg$ | ${a}_{do{t}_{max}}=0.4\phantom{\rule{4pt}{0ex}}\mathrm{m}/{\mathrm{s}}^{3}$ |

${\delta}_{do{t}_{max}}=4deg/\mathrm{s}$ | $N=80$ | ${T}_{s}=0.1\phantom{\rule{4pt}{0ex}}\mathrm{s}$ |

${T}_{p}=8\phantom{\rule{4pt}{0ex}}\mathrm{s}$ | $m=1573\phantom{\rule{4pt}{0ex}}\mathrm{k}\mathrm{g}$ | ${l}_{f}=1.1\phantom{\rule{4pt}{0ex}}\mathrm{m}$ |

${l}_{r}=1.57\phantom{\rule{4pt}{0ex}}\mathrm{m}$ | ${r}_{1}=2.2\phantom{\rule{4pt}{0ex}}\mathrm{m}$ | ${r}_{2}=1.6\phantom{\rule{4pt}{0ex}}\mathrm{m}$ |

$Q=\mathrm{diag}(1.0,10,0.2,0.002)$ | $R=\mathrm{diag}(0.001,0.001,0.002)$ |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).