MPC Tracking Controller Parameters Impacts in Roundabouts

: The work is proposed to design a controller of the form known as the roundabout scenario trajectory tracking problem. The road condition is a four-leg, single-lane roundabout; the reference path is given. Due to the decision choice of exits, the MPC tracking controller is used to test the effect of weight parameter and target speed on the performance of the tracking controller. Two sets of test cases are proposed to make the experimental comparison, see the relationship between the control parameters and road conditions (different curvature path), and also see how the weight parameters Q and R and sample time affect the tracking performance. Our work, MPC controller utilization in a roundabout, plays an essential role with the increasing autonomy of vehicles.


Introduction and Motivation
Self-driving vehicles are now receiving more and more attention and research from academic and industrial communities and are maturing in various research directions. Many test conditions are most intensively studied in the highway scenario, while the work on roundabouts needs more time and effort to be further studied.
Linear model predictive control (LMPC) has been widely used in the industry and developed well. Due to tight performance specification demands in the academic and industry researching process, nonlinear model predictive control (NMPC) [1][2][3] plays a significant role. For example, NMPC is the main model that used in tracking ability testing [4]. Proposed dealing with fuzzy adaptive weight variables to fit the autonomous path tracking cost function with a refined model predictive control (MPC) controller. Considering the vehicle dynamic problem, the authors mainly focused on the tracking accuracy and driving comfort. The result was verified as a comparison study with classical MPC controller and pure-pursuit controller and showed a better tracking performance. Research work in [5] built an MPC simultaneous controller to reach the trajectory planning and tracking purpose. The novel idea of the optimization problem is to use an initial and intermediate two sets of variables to define the MPC control sequence and basic information of lane-change trajectories, including velocity. Unconstrained and constrained conditions with lane change to the left and right directions are all discussed intensely in the paper. An MPC controller was used to track piecewise clothoid trajectory in work [6]. In this method, the authors considered the ego car constraints, the yaw rate conditions, and the predefined boundary constraints. The proposed idea is based on the robust control invariant (RCI) system to ensure the boundaries and constraints are fully satisfied. Demonstrating the good tracking ability of NMPC, the authors presented their work as [1], which utilized lateral driving behavior with an NMPC controller. This method was transformed through a linear time-varying (LTV) MPC to control different constraints and vehicle conditions. Two different study cases verified the validity of the NMPC controller's tracking ability and accuracy. The work in [7] calculated the ego car velocity and steering demand with a built nonlinear MPC controller framework. Using the genetic algorithms (GA) as an optimization solver, it met the flexible MPC structure requirement, and the proposed method provided the tracking accuracy based on different road conditions. Different researchers have also studied MPC with different methods and purposes. A studied MPC controller dealt with changing the horizon parameter and illustrated the key point of selecting vehicle model and optimization solver [8]. Brake and steering behavior was tested with a designed MPC controller, changing over time as the ego car front-steering angle controller followed the predefined path [9]. The paper [10] studied steering behavior with the road surface conditions, used tire parameters as variables, and estimated the initial tire-force curve slope by the NMPC control method. In this case, the nonlinear tire curve was fully adapted by the proposed NMPC controller, leading the vehicle into a stable and well-adapted driving level. To avoid the computational difficulties, a single dimension artificial potential fields approach (SDAPF) was used to obtain the environments and build a convex quadratic programming (CQP)-based MPC controller [11]. Highway lane-merge action is also an important module in autonomous vehicle simulation and testing. Researchers developed a cooperative nonlinear MPC method implementing the lane merge scenario via ACADO code. The proposal of performance-cost function and the receding horizon was also validated in the numerical results of the paper [12].
There are few research-built MPC scheme applied to the roundabout road scenario. Our goal is building a MPC system both related to the global planner and local planner, applied to the whole roundabout scenario. In this case, the controller parameter tuning is an important issue.

Hypothesis 1.
A steady state of trajectory controller can be built and run out, fitting in the curvature and changing roundabout scenario cases.

•
The ability of the MPC-optimization method for path tracking in the given roundabout environment is proven.

•
The relationship between MPC controller parameters and tracking performance based on roundabout road features is analyzed.
In this paper, our research is based on the roundabout global planner, which has been built to test the vehicle trajectory-tracking performance. We built an MPC tracking controller that can fit the roundabout scenario and track the continuous large curvature path smoothly. Roundabout road condition is a special case in urban scenarios. The key point of this paper is building the MPC model, which can connect to the roundabout global planner, and discussing the parameters of controller impacts on the tracking performance in a roundabout path. The optimization problem is set as a convex problem and is to be solved at each sample by an efficient quadratic programming (QP) method, the slack variable designed as a solver to the inequality constraints. Our work provides further analysis and development of applied mathematics to autonomous driving.
The remaining sections of this article are organized as follows: Section 2 describes the related work of the MPC design methodology and fundamental theory. This section gives a comprehensive and straightforward overview of MPC system from [13][14][15][16][17][18][19][20][21]. The MPC system-cost function and scenario constraints are described in Section 3. Section 4 presents the performance analysis of the proposed MPC parameters changing under various scenarios and discussion on the choice of MPC parameters for each roundabout scenario. Section 5 concludes the work with future direction.

Vehicle Kinematics Model
Since the vehicle is not considered to be driven at high speed, the state, control, and reference vectors, respectively, are denoted as The state of the model is ξ = X, Y, ϕ T , and the control quantity of the model is the steering angle of the front wheel, u = v, δ f T .

Model Predictive Control Fundamental Theory
Control system is the fundamental work for MPC. Special attention is given to the observer design in work [22]. The system model (1) obtained by kinematic modeling is a nonlinear system that cannot be directly used for linear time-varying model predictive control. The linearization of the nonlinear system needs to be performed first. As a widely used linearization method, Taylor series expansion can approximate the value at the operating point of the nonlinear system very well using polynomials. Figure 1 illustrates the reference trajectory system and MPC trajectory tracking system relationship. The state ξ re f is obtained from roundabout reference trajectory module as the waypoints X re f , Y re f , and the MPC system control inputs are the reference velocity V re f . Assume that the state ξ re f and control quantities u re f at any given moment satisfy the following equations; k is the sampling instant, .

Vehicle Kinematics Model
Since the vehicle is not considered to be driven at high speed, the state, control, and reference vectors, respectively, are denoted as The state of the model is = [ , , ] , and the control quantity of the model is the steering angle of the front wheel, = [ , ] .

Model Predictive Control Fundamental Theory
Control system is the fundamental work for MPC. Special attention is given to the observer design in work [22]. The system model (1) obtained by kinematic modeling is a nonlinear system that cannot be directly used for linear time-varying model predictive control. The linearization of the nonlinear system needs to be performed first. As a widely used linearization method, Taylor series expansion can approximate the value at the operating point of the nonlinear system very well using polynomials. Figure 1 illustrates the reference trajectory system and MPC trajectory tracking system relationship. The state is obtained from roundabout reference trajectory module as the waypoints , , and the MPC system control inputs are the reference velocity . Assume that the state and control quantities at any given moment satisfy the following equations; k is the sampling instant, The above reference equation performs a Taylor expansion at the point ξ re f , u re f , ignoring the higher-order terms and retaining only the first-order terms J f (ξ) and J f (u) are the Jacobi matrices of f concerning ξ and u, respectively. The equation after linearization is obtained as where After discretization, the system state can be represented as I is the unit matrix and T is the discrete step length; k is the sampling instant. The results of the discretization using Euler's method are And the observation equation represents as In the next process of designing the objective function, replacing the control with the control increment and adding the relaxation factor can directly restrict the control increment and prevent the situation that there is no feasible solution during the execution.

Setting new state variables as
, the control variable from the previous moment is added to the state variable, and the control increment is used as the new control variable. According to the relationship between the control volume and the control increment, it is obtained that As given the system state quantityξ(k|t) and the control increment ∆u(k|t) at the moment t, the output quantity η(k + 1|t) of the system (12) at the next moment can be calculated by equation, and the system output quantity in the prediction time domain can be obtained by continuously iterating the calculation, as The output in P step represents in the following way: The above calculation process between state, control, and output quantities in the predicted time domain can be organized as follows: Mathematics 2021, 9, 1394 5 of 18 and the system predicts the output and input sequences as . . .
in this case, the prediction matrices can be expressed, respectively, as

Model Predictive Control System
The essential point of MPC controller is to control the input by designing and solving the cost function. Minimizing the error between the future system output and the reference output obtains a stable vehicle state tracking system. As shown in Figure 2, the main steps of the model predictive control system are built. In this section, model calculation and optimization are the key content.

Objective Function
For the path tracking controller, the goal in this section is to follow the reference path quickly and stably, so the objective function is designed as follows: 2 is used to be the deviation between the state output of the predicted system and the reference system reference in the prediction horizon, reflecting the system's tracking ability to the reference trajectory. ∑ N−1 i=0 ∆u(t + i|t) 2 reflects the constraints on the control quantity, i.e., the smoothness of the control. By adjusting the weight matrices Q and R, the system can quickly and stably follow the reference trajectory. The slack variable is mainly to avoid the situation that there is no feasible set.

Objective Function
For the path tracking controller, the goal in this section is to follow the reference path quickly and stably, so the objective function is designed as follows: The role of ∑ ‖ ( + | )− ( + | )‖ is used to be the deviation between the state output of the predicted system and the reference system reference in the prediction horizon, reflecting the system's tracking ability to the reference trajectory. ∑ ‖∆ ( + | )‖ reflects the constraints on the control quantity, i.e., the smoothness of the control. By adjusting the weight matrices Q and R, the system can quickly and stably follow the reference trajectory. The slack variable is mainly to avoid the situation that there is no feasible set.

QP (Quadratic Programming) Standard Form Transformation
To solve the objective function and constraints upward, some corresponding matrices transform are needed, and let those functions turn to quadratic programming problem, which is easier to calculate.
H is the positive definite Hessian matrix; A, b are the inequality constraint matrices of the control variables; A eq and b eq are the equation constraint matrices of the control variables; lb, ub are the upper and lower constraints of the control variables, respectively.
Define the deviation of the output quantity in the predicted horizon with where the reference value Y re f (t) = [η re f (t + 1 t), · · · η re f (t + P t)] . Substituting (23) into (20), the function is transformed as where Q e and R e are expanded forms of the weight matrices Q and R, respectively.
The final form of the objective function is described in the following way:

Constraints Setting
The constraints adopted MPC controller are mainly set in three aspects, respectively: • Control incremental constraints • Output constraints The above three constraints need to be transformed according to the standard form. The relationship between the control quantity and the control increment can be described as (35) In the prediction horizon, we can obtain the Equation (36), and 1 N is the N-dimensional column vectors with elements of 1, L N is the N-dimensional all-one lower triangular matrix, I u is the unit matrix with the same dimension as the control variable dimension, and ⊗ is the Kronecker product. Finally, the constraint (32) can be transformed as: constraint (34) can be illustrated as: Calculate the Kronecker product of matrices A and B, and combine with the optimization formulation we mentioned at (30),

Geometric Constraints for Vehicles and Structured Roads
Based on the real vehicle steering demand and the roundabout road constraints, the system needs to follow three constraints: To restrict the lateral stability of the vehicle, predefine the turning angle as ±0.25 rad, the front-wheel steering angle constraint is − 0.25 δ f 0.25 (41) Considering the ego car safety and comfort, the lateral acceleration set in the range of To assure vehicles are driving inside the road, the feasible domain boundary in the road coordinate system is predefined in constraints setting at a half-car width away from the edge of the road.
SL max /SL min are the maximum and minimum offsets of the road edges, and W c set as the vehicle width.

Experimental Results
In this section, the model predictive controller performance is validated through coding in MATLAB 2017b, and the quadratic programming problem is run by MATLAB quadprog solver. Two road conditions are carried out and used to determine N p and N c parameter values after many tests. Taking the initial control parameters N p = 60, N c = 30, and T = 0.027 s, the target speed takes 50 km/h. This work sets a simple PI controller to drive the longitudinal speed.
Case 1 tests the MPC performance while changing the weight parameters Q and R; Case 2 makes the MPC performance comparison of only changing the target speed and tuning the sample time corresponding to the different speed.

Case 1. Fourth-Leg Enter, Second-Leg Exit
Case 1 tracks the path through the fourth-leg enter area and second-leg exit area and tests the MPC performance while changing the weight parameters Q and R, as shown in Table 1. Changing three sets of weight parameters alters the tracking performance. Figure 3 shows the tracking route used to change the weight parameter Q and the weight parameter R. Considering the ego car safety and comfort, the lateral acceleration set in the range of [−1,1], −1m/s < < 1m/s To assure vehicles are driving inside the road, the feasible domain boundary in the road coordinate system is predefined in constraints setting at a half-car width away from the edge of the road.

− 2 ⩽ ⩽ + 2 (43)
/ are the maximum and minimum offsets of the road edges, and set as the vehicle width.

Experimental Results
In this section, the model predictive controller performance is validated through coding in MATLAB 2017b, and the quadratic programming problem is run by MATLAB quadprog solver. Two road conditions are carried out and used to determine

Case 1. Fourth-Leg Enter, Second-Leg Exit
Case 1 tracks the path through the fourth-leg enter area and second-leg exit area and tests the MPC performance while changing the weight parameters Q and R, as shown in Table 1. Changing three sets of weight parameters alters the tracking performance. Figure  3 shows the tracking route used to change the weight parameter Q and the weight parameter R.  The tracking controller performs well when the ego vehicle is going along the straight road and stable curvature curve area. The tracking performance is altered mainly in the two merging zones of the roundabout. Both Figure 4a,b emphasize their tracking differences on the lateral axis when the ego car is approaching the roundabout merging zones. When changing the parameter R, the blue line (Q = 40, R = 0.8) in Figure 4a is the most stable line and is also closer to the reference trajectory. Figure 4b demonstrates that the pink line, Q = 80, R = 0.8, is the most stable tracking route even in the merging zones. The specific tracking error on longitudinal and later directions are shown in Figure 5a,b. ences on the lateral axis when the ego car is approaching the roundabout merging zon When changing the parameter R, the blue line (Q = 40, R = 0.8) in Figure 4a is the m stable line and is also closer to the reference trajectory. Figure 4b demonstrates that pink line, Q = 80, R = 0.8, is the most stable tracking route even in the merging zones. T specific tracking error on longitudinal and later directions are shown in Figure 5a Figure 5a,b are the steady-state errors in longitudinal direction, lateral position, and yaw angle. The idea of the steady-state errors is consistent with the literature [21].
Since the value of errors were positive, the ego car started measurement of yaw angle at the beginning of the simulation, while the longitudinal axis of the actual vehicle was pointing to the right.
At the end of the following path, the ego car was actually on a straight path, as demonstrated clearly by the shape of the lateral position plotting and zero steering angle. Furthermore, the measured yaw angle can be seen as the orientation error, both illustrated in Figure 5a Figure 5a,b are the steady-state errors in longitudinal direction, lateral position, an yaw angle. The idea of the steady-state errors is consistent with the literature [21].
Since the value of errors were positive, the ego car started measurement of yaw ang at the beginning of the simulation, while the longitudinal axis of the actual vehicle w pointing to the right.
At the end of the following path, the ego car was actually on a straight path, demonstrated clearly by the shape of the lateral position plotting and zero steering ang Furthermore, the measured yaw angle can be seen as the orientation error, both illustrat in Figure 5a,b. Figure 6a,b show the vehicle tracking heading performance and the longitudinal v locity. The yaw rate changes rapidly when passing through the curve area.

Case 2. Fourth-Leg Enter, Third-Leg Exit
Case 2 tracks the path through the fourth-leg enter area and third-leg exit area an tests the MPC performance while changing the target speed and sample time T. Figure shows the Case 2 tracking route used to change the target speed and sample time. Tw scenario sets are tested in Case 2. As Table 2 shows, tests 1-4 change the vehicle targe speed without tuning the sample time, and tests 5-8 adjust the vehicle target speed an the sample time to reach the trajectory tracking purpose.

Case 2. Fourth-Leg Enter, Third-Leg Exit
Case 2 tracks the path through the fourth-leg enter area and third-leg exit area and tests the MPC performance while changing the target speed and sample time T. Figure 7 shows the Case 2 tracking route used to change the target speed and sample time. Two scenario sets are tested in Case 2. As Table 2 shows, tests 1-4 change the vehicle target speed without tuning the sample time, and tests 5-8 adjust the vehicle target speed and the sample time to reach the trajectory tracking purpose.      Figure 8a,b show the tracking route after changing the weight parameter Q and the weight parameter R.
The tracking controller did not perform well in the case of only changing the speedrelated parameters. The tracking performance was altered from the first merging zone of the roundabout. The yellow line (target speed 50 km/h) reached the destination first, but the tracking error was significant. Even after changing the target speed, the controller did not reach the destination as planned. When the target speed decreased, the pink line test set (target speed 35 km/h) did not reach the final destination. However, after tuning the sample time T, the test sets all cleared the final goal successfully, as shown in Figure 8b. The specific tracking error on longitudinal and later directions are shown in Figure 9a The tracking controller did not perform well in the case of only changing the speedrelated parameters. The tracking performance was altered from the first merging zone of the roundabout. The yellow line (target speed 50 km/h) reached the destination first, but the tracking error was significant. Even after changing the target speed, the controller did not reach the destination as planned. When the target speed decreased, the pink line test set (target speed 35 km/h) did not reach the final destination. However, after tuning the sample time T, the test sets all cleared the final goal successfully, as shown in Figure 8b. The specific tracking error on longitudinal and later directions are shown in Figure 9a,b.

Conclusions and Future Works
In this work, an MPC controller is designed for path tracking purposes, and it is va idated that the proposed MPC controller can fully track the given path in roundabou Case 1 and Case 2 used the same set of control horizons parameters; however, the case tracking performance was not as advantageous as the Case 1 road condition. Predictio horizon and control horizon parameters need to be tuned according to the reference pa curvature. Weight parameters Q, R did affect the tracking performance significantly whe changing the target speed. Sample time T did not greatly affect the tracking performanc In this work, we present a novel combination of MPC scheme and roundabout co dition considering the effects of road constraints. Accounting for the effect of path curv ture, a single-track vehicle model is derived. In the future, our research would like to e able collision avoidance and improve the prediction accuracy in the short-term. Managing a MPC system from Matlab coding for real practice is also a future cha lenge for us. Simulations carried out in the MATLAB/CarSim environment validated th effectiveness and real-time ability of the proposed scheme. In the case of our study, seems programming the algorithm in Matlab and then simulating the MPC system f verification is a method for practice. Setting up the compilation environment for C/C++

Conclusions and Future Works
In this work, an MPC controller is designed for path tracking purposes, and it is validated that the proposed MPC controller can fully track the given path in roundabouts. Case 1 and Case 2 used the same set of control horizons parameters; however, the case 2 tracking performance was not as advantageous as the Case 1 road condition. Prediction horizon and control horizon parameters need to be tuned according to the reference path curvature. Weight parameters Q, R did affect the tracking performance significantly when changing the target speed. Sample time T did not greatly affect the tracking performance.
In this work, we present a novel combination of MPC scheme and roundabout condition considering the effects of road constraints. Accounting for the effect of path curvature, a single-track vehicle model is derived. In the future, our research would like to enable collision avoidance and improve the prediction accuracy in the short-term. Managing a MPC system from Matlab coding for real practice is also a future challenge for us. Simulations carried out in the MATLAB/CarSim environment validated the effectiveness and real-time ability of the proposed scheme. In the case of our study, it seems programming the algorithm in Matlab and then simulating the MPC system for verification is a method for practice. Setting up the compilation environment for C/C++ is achieved by creating an S-function file in Matlab. Once the requirements are met, it can be combined with software such as Carsim and connected to the automation hardware controller module for real vehicle tests. If the simulation results verify the positive real-time performance of the designed control system in engineering applications, the robustness in trajectory tracking performance and the effectiveness in lateral stability can be verified as well; then, a real-world test with a real vehicle should be carried out in the near future. In this case, the calculated output is sent to the simulator, which, in practice, would be sending signals to the steering wheel and pedals. There are also predicted track points as output to the simulator. In the near future, the work should continue to contribute to applied mathematics and autonomous vehicle aspects.