Vehicle Stability Upper-Level-Controller Based on Parameterized Model Predictive Control

This paper presents an upper-level vehicular stability controller based on parameterized MPC strategy. The proposed system computes the additional moment applied on the vehicle’s yaw axis to improve the lateral stability. In the MPC formulation, the optimization problem is defined as a quadratic programming derived from a linear time-invariant model of vehicle dynamics. The control system is implemented based on a model that considers the rolling movement and on a simpler model that does not consider it, in order to evaluate the effects of using a more representative linear model for more accurate prediction or a simplified model for faster calculation. Constraints are imposed on the optimization problem to deal with the limits in the corrective yaw moment. A parameterized MPC approach is designed to reduce the number of optimization variables, and hence, reducing the computation time required for real-time implementation. Model-in-the-loop simulations are proposed to evaluate the effectiveness of the MPC strategy to avoid steering instability. Simulations are performed for profiling the calculation time, tuning the parameters, and testing algorithm running in an ARM-Cortex A8 on real-time control. Simulation results show that the proposed control strategy is effective in preventing destabilization and demonstrates that even with a longer computation time, the resulting MPC scheme meets the control requirements successfully, even under the presence of model disturbances.


I. INTRODUCTION
Vehicle movement may divert from the driver's intention in adverse driving conditions. Electronic stability control (ESC) systems are active safety systems designed to correct undesired actions that may take the vehicle off the desired path or make driving too complicated for not skillful drivers. They have played a significant role in reducing the risk of fatal car crashes in recent years [1]. Thus, several research topics have been developed to design a proper control structure for these systems. In many cases [2]- [7], a hierarchical architecture is often used, where an upperlevel controller calculates a virtual control input (e.g., the direct yaw moment, the tire-slip ratio, the force generated on tires). In contrast, a low-level controller commands the available actuation system to change the torque transferred to the wheels, to cause a difference between the forces acting on the tires that ensure the virtual command calculated by the upper-level controller. .
Regarding control methodologies used in ESC design, advances in computational power of embedded systems have made possible the exploration of different control theories, such as sliding mode control [8]- [11], backstepping technique [12] and robust gain schedule [13], [14].
Another optimal control strategy applicable to ESC's control problem is the Model Predictive Control (MPC). According to MPC definition [15], [16], the controller solves, at each sampling instant, a constrained optimization problem to find the sequence of yaw moments applied to the car at the next sampling instants over a finite prediction horizon. In this process, just the first element of this sequence is applied to the vehicle. In this sense, it may be interesting to consider the potential use of MPC strategies in ESC design, due to its ability to predict future response using vehicle dynamics models and to address the physical limits of actuation. Thus, the MPC has excellent features to meet vehicle stability control requirements. Vector of side-slip of the tires Fy ∈ R 4×1 Vector of lateral forces acting on the tires Indeed, in the literature, some recent contributions emerged concerning MPC for vehicle stability control [17]- [21]. Despite the reasonably satisfactory performances of the algorithms used in these works, an issue that must be considered for MPC-based stability control is not taken into account in any of these papers, which is the computational efficiency in real-time applications. In fact, the main drawback of the MPC controller is that running an on-line optimization problem at each time step requires substantial time and computational resources, which is the biggest obstacle to apply this controller to commercial vehicles.
An aspect that affects the MPC's real-time performance is the choice of the prediction model since the use of more simplified models provides less accurate predictions. In contrast, the use of more precise and complex models reduces the commands update rate by increasing the processing time to solve the optimization problem. In general, more accurate predictions are obtained using a nonlinear model to represent vehicle dynamics. However, those models result in nonlinear programming that is a computationally hard problem and is often impractical in real-time applications [17].
In this sense, the main strategy used in the literature is to use a linear model for prediction helps to fit the optimization into the quadratic programming (QP) form. However, the complexity of the QP problem is still a challenge for real-time MPC applications with low-cost hardware. For example, in [18], [22], reconfigurable MPC-based ESCs are proposed to vehicles with different actuation systems. The MPC is designed based on a linear model that considers the roll motion and can predict the response to different combinations of control inputs. The set-up is performed by setting a selector matrix that makes the prediction model unresponsive to unavailable control inputs, without taking off those inputs from the linear model, which does not affect the length of the Hessian matrix of the optimization problem.
Simulations are performed to demonstrate the effectiveness of proposed ESCs with different configurations. However, the implementation of the embedded control system to execute the proposed algorithm is not presented, as well as no simplification of the optimization problem is applied to the QP to improve the computation time required to solve it.
Stability control based on MPC to handle with constraints on control inputs has been presented in [20], [23]- [25]. In [20], [23], [24], the rotations of the wheels are included as state variables of the prediction model, and in [25], the slip angles of the rear and front axis are considered. Results from simulation and experimental tests are presented to demonstrate the effectiveness of proposed ESCs to improve vehicle stability. However, real-time implementation issues are not addressed.
An unconstrained MPC for yaw stability with practical concerns is presented in [26], where the cost function of MPC is defined without inequality constraints such that a closed-form solution can be defined as the optimization problem. Therefore, the computational efficiency of ESC is improved by avoiding the QP solving. Nevertheless, the proposed approach excludes the MPC capability to handle the constraints of the actuation system.
In [5], an MPC is designed to integrate the objectives of the longitudinal collision avoidance and lateral stability. The algorithm dynamically alters the weight matrices of the quadratic programming (QP) problem according to driving conditions. The MPC is designed based on the two-degreeof-freedom (DOF) vehicle's lateral model that includes only the yaw rate and the side-slip of the vehicle body. Hardwarein-the-loop (HIL) simulations are performed in a platform where the vehicle motion and the control algorithm are simulated by computers that access from a CAN bus a brake system, a yaw rate sensor, and a wheel-speed simulator. Again, the embedded control system is also not presented, and no method is shown to reduce MPC's computation time.
Thus, at the best of the authors' knowledge, no work in the literature addresses issues involving the real-time implementation of a constrained MPC-based ESC with limited processing hardware. In this context, the present paper proposes a constrained parameterized MPC-based upper-level ESC that computes the additional yaw moment to improve lateral stability. Therefore, this can be used as input for a low-level controller that commands an available actuation system able to generate a moment at the vehicle yaw axis. To reduce the complexity of the optimization problem, the MPC is designed using the parametrization of the input vector to reduce the number of optimization variables and, hence, the computation time.
The reduction in processing time allows us to investigate the advantages of using a more representative prediction model for lateral stability control. Thus two versions of the control system proposed in this paper are implemented using different prediction models: a more realist one that uses the rolling motion and a simpler one that does not consider it. Although the objective of this work is not to propose a system that integrates the stability control and rollover prevention, the implementation of the MPC using a linear model that includes the rolling movements, in addition to providing a more realistic prediction, enables some roll control. This capability can be used to avoid solutions that improve lateral stability performance at the cost of a significant increase in rollover risk.
Lateral stability controllers based on linear models that include the roll motion have been presented in [4], [18], [22], [27], [28]. In [4], [18], [22], [27], The MPC is implemented with an optimization problem defined to combine the objectives of the rollover prevention and lateral stability control. And [28] introduces an index to measure the loss of adhesion between the tire and the road, which, along with a rollover index, is used to define the objectives of a robust control developed to mitigate the accident risk. Nevertheless, such papers do not present the effects on the stability performance in comparison with the use of a simpler model taking into account the computation time.
Therefore, the main contribution of this paper consists of designing a computational efficient MPC strategy that reduces the complexity of solving the optimization problem by applying an exponential parameterization to the control vector over the prediction horizon. In addition to that, this paper also presents: • The implementation and testing of a parameterized MPC strategy embedded on BeagleBoneBlack Rev C. • Tuning and evaluation of MPC with Processor-in-theloop (PIL) simulations, enabling validation, and implementation of the embedded controller in real hardware with limited resources and processing capacity. • Comparison results for lateral stability between the proposed MPC strategy and Linear Quadratic Regulator (LQR), which is more computationally efficient but unable to handle with system's constraints. • Comparison results for lateral stability between two versions of the proposed ESC based on different prediction models: one simplified model that includes only the side-slip angle and the yaw rate, and another that adds the roll angle and the roll rate within the states.
This paper is organized as follows. First, the vehicle model is presented in section II. Then the control problem is presented in section III. The parameterized MPC scheme is then detailed in section IV. Section V presents the methodology used for experiments with a complete hardware description. Simulation and experimental results are presented in section VI. This paper ends with conclusions and future works in section VII.

II. VEHICLE DYNAMICS
The vehicle dynamics model considered in this work for implementation of simulations environments and for obtaining the linear model used in control design includes the lateral, yaw and roll motions, and assumes a constant longitudinal speed [4], [29]- [31]. Figure 1 shows this model represented by the following equations of motions: where v denotes the lateral speed, u the longitudinal speed, φ the roll angle, ψ the yaw angle, m the vehicle total mass, m s the sprung mass, h s the sprung height, I xx and I zz the yawing and rolling inertial moments, respectively, I xz the inertial product related to yawing and rolling. F y , the lateral forces generated by tires on vehicle's CG, M z are M x are the moments on yaw and roll axes, respectively. The lateral forces and moments on vehicle CG are resultant of the forces acting on tires, are obtained as follows: where a denotes the distance from front axis to CG, b the distance from rear axis to CG, t f and t r the front and rear track width, respectively, M u the extra yaw-moment, k φf and k φr the front and rear roll stiffness coefficient, respectively, c φf and c φr the front and rear roll dumping coefficient, respectively. F yf l , F yf r , F yrl , and F yrr are the components of the forces generated by front-left, frontright, rear-left, and rear-right tires in the direction of lateral axis of the vehicle. And F xf l , F xf r , F xrl , and F xrr are the component of forces generated by front-left, front-right, rear-left, and rear-right tires in the direction of longitudinal axis of the vehicle. The projection of the forces acting on tires on the longitudinal and lateral axes of the vehicle depends on the steering angle of the wheels, and it is given by the following equation of vector rotation: where i ∈ f l, f r, rl, rr, in which f l, f r, rl, rr index the front-left, front-right, rear-left and rear-right tires, respectively, and δ i is the steering angle of i th tire. A constant longitudinal speed means no longitudinal acceleration, which means that there is a balance between the forces on longitudinal direction generated by tires and friction. For approximation, it is considering that such balance is obtained because the longitudinal forces acting on each tire are the same. In this way, the longitudinal forces of the tires cancel out each other in the in the yaw moment equation in (2). And that is the reason why the longitudinal forces of the tires are not included in this model [25], [32]- [34].
A metric to analyze lateral stability performance is the side-slip angle β, which is the angle between the total speed and vehicle's longitudinal axis, such as β = arctan v/u. It is a measure of how much the vehicle is laterally slipping from the desired trajectory.

A. TIRE DYNAMICS
The Magic Formula of Pacejka (MF) is an empirical formulation derived from experimental tests that can be used to compute forces acting on tires [35]. Using Pacejka's MF, the lateral force F yi and the longitudinal force F xi acting in each tire, indexed by i, can be obtained from values of wheel vertical force F zi , tire slip angle α i , camber angle γ i , and slip ration λ as follows: where a 1 , a 2 , a 3 , ..., a 14 and b 1 , b 2 , b 3 , ..., b 10 are the Pacejka's Magic Formula coefficients [35]. The side-slip angle is the angle between the tire's longitudinal axis and its velocity vector. The side-slip angle of the front-left tire α lf is illustrated in Figure 1. The side-slip angle of the four tires are given by: The slip ratio is the relative difference of the rolling speed of the tire and the vehicle's longitudinal speed, and its given by: in which ω is the angular speed of the wheel, R ef f is the effective radius of the wheel-tire set, and u is the vehicle longitudinal speed. The vertical load on each wheel is given by the vehicle weight transferred to it. When vehicle is moving, the vertical force in each wheel are given by [4], [31]: in the above equations, h denotes the height of the center of gravity, and l the wheelbase. In this work, to take into account the effects of roll motion on tire dynamic, the camber angle of four wheels are considered ideally the same, simplified as follows: K γ denotes the camber-by-roll gradient, which represents variation of camber due to rolling given by K γ = ∂γ ∂φ [36]. The steering angle of wheels is obtained by summing a part relating to the driver's command and a component generated by rolling motion. For a passenger car, where the steering wheel controls only the front wheels, the front, and rear steer angles can be obtained as follows: where δ D is the steering wheel angle, I s is the steering coefficient, and ∂δ r /∂φ and ∂δ f /∂φ are rear and front steerby-roll coefficient, respectively.

B. LINEAR MODEL
In the literature on lateral stability control, the vehicle linear model used in control design is often obtained from simplifications for constant longitudinal speed u = u ref and small angles [18], [22], [37], such that sin(φ) ≈ φ, This strategy is used in this work to obtain the linear model used in MPC implementation from linearization of the presented non-linear model. Thus, the linearization of the equations of motion (Eq. 1 and Eq. 2) is given by: The consideration of small angles places the linearization point within the stability zone so that while the control is successful in preventing instability, the vehicle's response remains close to that predicted by the linear model. A drawback of this approach consists in considering the constant speed in the linear model so that whenever the vehicle speed is different from the linearization point, there will be a mismatch between the vehicle's response and that predicted by the model.

Equation 11
presents a linear model of the movement response to the lateral forces generated in each tire. Thus, the second stage of linearization consists of obtaining a linear model of the forces generated in the tires. For small tire slip and camber angles, a good approximation of the force generated in the tires is given by [30], [35]: where C αi and C γi denote cornering stiffness and camber stiffness coefficients, which can be obtained from Equations (4) and (12) [35]. Fig. 2 shows the forces generated by the MF and this linear approximation, where one can see that for small angles the Equation (12) gives a good approximation.
Replacing the Equation (9) in (12), the vector F Y of VOLUME 4, 2016 lateral forces generated on tires can be expressed as: The front and rear wheels slip angle are approximated by linear functions of vehicle slip angle, yaw rate, and wheels steer angle [21], [31]: Combining Equations (10) and (14), the following equation is obtained: The linear model of vehicle dynamics in the state space form can be obtained by combining equations from (11) to (15) The resulting linear model (16) is fully controllable since the controllability matrix obtained from the pair (A, B * ), with B * = K −1 x G u related to the controllable input M u , is of full rank.

III. CONTROL PROBLEM
This high-level controller is designed to compute moment applied on yaw axis to keep the steering stability. This corrective yaw moment is resultant of differences in the tire's longitudinal forces on left and right sides of vehicle. Since there is a limit for the forces generated on tires, there are constraints for the corrective yaw moment that must be taken into account by the control algorithm. This imposes that the control input M u must satisfy: There is also a limit to the difference between consecutive command updates. The design of high-level control does not consider a specific actuation system. However, the control algorithm must be able to take into account this limitation, and thus the control input must satisfy: Th corrective yaw moment is defined as the one that minimizes a cost function that includes the actuation energy and the yaw error error over a finite horizon, which are predicted based on the linear model presented in Section II-B. This cost function and the optimization problem is formulated as a quadratic programming by following the MPC method.

IV. CONTROL DESIGN
The architecture of the proposed control system is presented in Fig. 3. The MPC receives the current and desired states, and calculates the corrective yaw moment required to keep the steering stable. It is assumed that measures of yaw rate, roll rate, and roll angle are available, whereas side-slip angle is calculated from measures of lateral and front speed.
In the formulation of the MPC, the controller must define, at each instant of sampling, the desired value of the regulated states over the prediction horizon. In the optimal configuration, obtained from the tuning of MPC coefficients presented in Section VI-A, only the yaw and roll rates are included within the regulated states. As rolling is an unwanted movement that increases the rollover risk and decreases passenger comfort, the desired roll rate is assumed equal to zero over the prediction horizon, such that the cost function of the optimization problem penalizes any value different from zero. The desired yaw rate depends on the steering wheel angle commanded by the driver in response to vehicle movement. For a given vehicle, characterized by its geometric parameters and cornering stiffness coefficients, the desired yaw rate can be computed as follows [31]:

A. MPC FORMULATION
The MPC method used in this paper follows the formulation presented by [16]. This method needs a discrete linear model of vehicle dynamics, which is obtained from the discretization of the linear model presented in Section II, and represented by: where x(k) and u(k) are the state and input at sampling instant k, respectively, and A d ∈ R 4×4 and B d ∈ R 4x2 are state and input discrete matrices, respectively. The next control sequence over a prediction horizon N and the next states, obtained by applying this control sequence, are represented by:ũ . . .
As shown in [16] the states at any sampling instant over the prediction horizon can be obtained from the current states and the future control sequence: where Φ i ∈ R 4×2 and Ψ i ∈ R 4×nũ are the state and input prediction matrices, respectively, which can be computed from discrete model matrix as follows: The regulated output vector can be any linear combination of the states. The proposed ESC directly controls the yaw rate and roll angle, therefore the regulated output is defined as follows: The cost function of MPC formulation is defined depending on current states x(k), desired output y d (k) = (φ d 0) and desired input u d . This can be expressed as: in which, Q u and Q y are the matrices that weight the energy of command and the errors of regulated output, respectively, and u d the desired input. The desired yaw moment is assumed to be zero and for the uncontrolled input, δ D the desired value is its current value. The Equation (28) can be expanded in the classical representation of Quadratic Programming (QP) withũ as a decision variable: where The next step consists in defining the constraints on the controlled and uncontrolled input variables. The MPC formulation developed in this paper includes δ D as part of the command vector, however the ESC has no direct control of the steering angle. To handle this scenario, the optimal δ D computed by the MPC is constrained such that the only possible optimal solution is equal to its current measured value. Thus, one can define the constraints on the input variables and its rates of change as follows: The above expression also imposes that the MPC assumes that the uncontrolled input δ D is constant over the prediction horizon.

B. MPC PARAMETERIZATION
In [16], parameterizations of MPC are proposed to increase the computational efficiency by reducing the number of variables of QP solution. In the proposed controller employs the exponential parameterization, in which the the solution of the optimal control inputs over the predication horizon are restrict to the sum of few exponential terms: where k is the discrete time index that starts the prediction horizon, ν and α are constant coefficients of exponential parameterization, T s is the sampling time, and p 1 , p 2 and p δ are the parameters to be optimized by the MPC algorithm. Thus, instead of optimizing the whole control sequenceũ(k) over the prediction horizon, the MPC needs to optimize just the parameter vector defined by T . Following this definition, the parameterized control vector is defined by: And the parameterized control sequence over the prediction horizon defined in Equation (21) can be expressed as fallows:ũ As the target result of this parameterization, the cost function presented in Equation (28) comes down to a QP in terms of p(k), i.e.: And the constraints to control inputs presented in Equation (31) lead to the following constraints for the parameter vector: And since the solution of the steering input is restrict to its value measured at the beginning of the prediction horizon, the solution is also constrained to p δ = δ D (k).
The stability of parameterized control schemes was presented in [38], and the necessary and sufficient conditions regarding the classical structure of the MPC were formalized in the survey paper [15]. Such a situation requires a substantial constraint at the final state with longer horizons of prediction (tending to infinity) together with a penalty at the end of the predicted trajectory. Besides, another necessary condition generally requires weighting over the whole state vector along the prediction trajectory. Thus, according to [16], practical and feasible conditions for obtaining all necessary and sufficient conditions for MPC-type strategies can be quite challenging to obtain. As far as embedded systems are concerned, such a scenario can prevent practical implementation of the MPC scheme since the resulting controller may become unfeasible for real-time applications. For this reason, an analysis of the influence of the prediction horizon N as a function of the minimum computation time required to carry out the optimization process efficiently is shown later.

C. ESC ACTIVATION CRITERIA
The MPC may give a non-zero command when the error of regulated states is non-zero. To avoid unnecessary actuation in maneuvers which states are different from its desired values, without risk of the driver losing control of the steering, the ESC control is kept inactive when side-slip angle and yaw error is not greater than a threshold. To avoid constant switching of control activation, the ESC is activated when the condition β > β th or ψ e > ψ eth is fulfilled for a minimum period T on , and it is deactivated when it is not fulfilled for a minimum period T of f .

V. METHODOLOGY
The PIL platform was based on the framework proposed by [39]. Fig. 4 illustrates the development and evaluation process followed in this work.
As the MPC design is based on the vehicle model, the first project stage is the definition of the reference vehicle model. This model is linearized and discretized for obtaining the discrete linear model needed for MPC design. Once the reference model and the discrete linear model are defined, the control algorithm is designed and implemented as a model for computational simulation using Matlab/Simulink.
Model-in-the-loop (MIL) simulations are performed to validate the control algorithm. In MIL, the whole control system is implemented for computational simulation. And test scenarios are simulated for observation of control effectiveness. MIL simulation is performed until results show that the proposed ESC can improve lateral stability. When the results show that the lateral performance of a vehicle with ESC assistance does not meet the requirements, the algorithm is updated before the next MIL testing run.
Once the algorithm is approval in MIL tests, the proposed controller is implemented as an embedded Linux software for BeagleBoneBlack and submitted to Processorin-the-loop (PIL) simulations. In this platform, the Beagle-BoneBlack executes and tests the controller together with a platform that runs a Simulink Real-Time simulation of vehicle dynamics. The whole procedure is repeated until the controller achieves the required performance on improving lateral stability. When the controller fails in embedded test due to algorithm error, the later is updated, and all the development stages since MIL simulations are repeated. When the controller fails due to implementation error, it is fixed, and just PIL simulations are performed again.
The platform used to test the embedded control consists of a host computer, a digital-analog converter PCI-DAC6703DA2 and Ethernet connection. The host PC runs the Simulink Real-Time environment, which is a realtime simulation of vehicle response to control yaw-moment command. Simulink Real-Time provides real-time updated signals read by the controller, which are longitudinal speed, lateral speed, yaw rate, roll rate, roll angle, and front wheels steering angle. The PCI-DAC6703 is used to send such signals to the analog inputs of the controller, which is the Beaglebone Black. And Ethernet connection is used to send over UDP the yaw-moment given as control input to host. Fig. 5 illustrates the proposed testbench.

A. INTELLIGENT DRIVER MODEL
The intelligent driver model presented in [40] is included in the simulation environments to compute the steering wheel angle commanded by the driver based on the vehicle states.  It is important to make clear that this model is not integrated into the control algorithm and is only used to build the simulation environments.
This model considers that the driver controls the movement direction to achieve the needed trajectory for moving towards a target point A at a distance L a . The input signals measured by the simulated driver are the current position y os , the desired position y d , and yaw angle ψ. The Fig. 7 shows the block diagram of control law used to simulate driver behavior to obtain a steering wheel angle δ D . The parameters of this model are the distance L a from the vehicle position to target point, actuation delay T k , and steering gain W that represents driver expertise. Figures 6  and 7 illustrate this model.  0.003 a 9 -0.002

VI. RESULTS
Simulations were performed for the double lane change (DLC) test of standard No. ISO 3888:1975 as presented in [40]. In this test, an attempt to maneuver is considered to be successful when the vehicle does not exceed the boundaries of lateral displacement from the desired path. The nonlinear model of vehicle dynamics presented in Section II is used to simulate vehicle motions. The model presented in Section V-A is used for generating the steering wheel commanded by an average human driver. Table 2 shows the parameters used in the simulation of vehicle dynamics. Table 3 shows the parameters of the linear model used in the implementation of the control algorithms.
The command constraint of MPC algorithm is defined to ensure that the ESC provides feasible vales of external yaw moment. The feasibility limit is defined as presented Section III, based on the limit of the longitudinal force generated on tires. Figure 8 shows the chart of the Pacejka's Magic Formula, and its linear approximation for the coefficients presented in Table 2. According to this tire model, the maximum longitudinal force obtained in the linear operation of the tire is 1548N. And thus, the yaw moment obtained when the difference between the longitudinal forces of the tires on the left and right side of the vehicle is equal than 15% of 1548 N given by: in which t f and t r is the widths of the longitudinal and rear track, respectively.

FIGURE 8. Tire's longitudinal force calculated by the Pacejka's Magic Formula and its linear approximation
Following the criteria presented in Section III, the constraint of the yaw moment M th configured in MPC algorithm must be less than 326 [Nm]. In this sense, the configuration of M th for all the tests presented in this paper is 250 [Nm].

A. CONTROLLER TUNING
In addition to testing the proposed controller, simulations are useful for tuning of controller parameters. The MPC effectiveness depends on the value of its parameters, such as the weight matrices of QP cost function, Q u , and Q y , the coefficients of exponential parameterization λ and α and the prediction horizon N . Theoretically, a long prediction horizon increases the capacity of ESC to act before a dangerous driving condition happens, and also contributes to the stability of MPC [15]. But in practical terms, the increasing of prediction horizon increases the memory required to store the QP matrices and the latency of the algorithm to solve the QP problem, which decreases the stability performance.
The proposed controller was implemented as software for embedded Linux running on ARM CORTEX A8 of BeagleBoneBlack. Th parameters Q u , Q y , λ, α and N were defined with an iterative procedure. The following procedure describes the tuning method starting with the prediction horizon N = 15.
1) Tuning of Q u , Q y , ν, α: The control model of MIL simulation is configured with the chosen horizon. The others parameters are defined by the minimization of the accumulation of states square error, path square error and yaw moment energy, obtained from results of MIL simulation for double lane change maneuver (standard No. ISO 3888:1975 as presented in [40]) at 80km/h, 100km/h, and 120km/h.

2) Profiling the effective computation times
The controller is configured with the optimum parameters found in the previous step. Than it is tested embedded on the BeagleBoneBlack for each horizon N ∈ [15,20,25,30,35,40,45,50,55,60,65]. The profiling tool of GNU ARM embedded toolchain is used during these simulations to measure the command update time achieved for each horizon. Since, the PIL platform enables the test of update times multiple of the sampling time of the real-time simulation of vehicle response (0.8ms), the effective computation time is defined as the minimum multiple of 0.8ms greater than the measured computation time.

3) Measure of the stability performances
The mean square error (MSE) of the lateral displacement is measured, from results of MIL simulations of the DLC maneuver at 120km/h, for the control model configured with each prediction horizon and its effective update time measured in the previous step. The horizon that gets the smallest MSE measured is the chosen one.

4) Completion and iteration
The procedure repeats while the chosen horizons of the current and the last iterations are not the same. Figure 9 shows the results obtained in the last iteration of this tuning procedure. One can see that for horizons smaller than 50 sampling times, the MSE of lateral displacement decreases as long as the horizon increases. The effect of increasing N clearly improves the system performance since model-plant mismatches are not significant, and higher prediction horizons are desirable for stability and optimality [15]. On the other hand, for N > 50, model uncertainties become more significant, and the closed-loop performance starts degrading since the mean square error of lateral displacement rises almost exponentially. Based on these results, the optimal prediction horizon of the proposed control scheme was set to N = 50.
The tables 4 and 5, show the optimal configuration obtained from the tuning procedure for the MPC algorithm implemented with a linear model that includes the roll motion (i.e., roll control on) and with a linear model that does not include the roll motion (i.e., roll control off). In the configuration of the algorithm with roll control on, the optimal matrix Q Y weights only errors in yaw rate and roll angle, so the regulated output matrix C C is defined such that only these states are included within the regulated states. And in the configuration of the MPC with roll control off, the optimal Q y weights only the yaw rate, thus the C c matrix is defined such that only the yaw rate is regulated. Since the use of a simpler prediction model reduces the computational complexity of the MPC algorithm, the calculation time of 12.2 ms measured for the MPC with roll control off is smaller than the 13.6 ms measured for the MPC with roll control on. The parameters of activation/deactivation criteria were defined from manual adjustment. Table 6 shows the configuration of the activation criteria. This tuning procedure was also performed to find the optimal configuration for the MPC without parameterization. However, it is worth mentioning that there is no configuration in which the MPC without parameterization, running on embedded hardware based on the ARM Cortex A8 of BeagleBoneBlack Rev C, is feasible or effective to avoid handling destabilization in real-time simulation. For this reason, only simulations using parameterized MPC are presented in this section.
In this case, to study the benefits of MPC capabilities to predict the vehicle motion and deal with command constraints, simulations also were performed for the proposed control architecture, replacing the MPC with an LQR control, as presented in [41]. The LQR was chosen because it is also an optimal control technique, that although it does not have the benefits of MPC, its control algorithm has low computational complexity that leads to higher command updating rate. This comparison is interesting because the command update time is one of the main challenges for applying the MPC in real-time applications, for which the proposed system intends to present a solution.
For a fair comparison, the LQR is set up to run with the higher update rate enabled by the PIL platform, which is the sample time of the real-time simulation of vehicle response (0.8ms). It is derived from the same linear model that MPC, and the weighting matrices Q y and Q U are optimized by the following procedure: VOLUME 4, 2016 The optimization problem of the second step of the LQR tuning procedure is solved by using the Particle Swarm Optimization (PSO), to perform a global search for the optimal values, and the interior point method, to perform linear programming towards the PSO results for fine-tuning. Table 7 shows the results of LQR tuning, in which the command update period equal to 0.5 ms is 27.2 times faster than the rate obtained with the MPC with roll control on.

B. RESULTS FROM MIL SIMULATIONS
The DLC at 80 km/h was simulated, in MIL environment, for a vehicle with proposed ESC, to observe if the controller acts unnecessarily or impairs steering when a driver is able to drive without assistance. MIL simulations of DLC at higher speeds also were performed to compare the effectiveness in improving the lateral stability of LQR-based ESC, MPC-based ESC with roll control on and off, and MPCbased ESC with roll control on without the exponential parameterization applied to reduce the calculation time.
The DLC at 80 km/h was simulated to observe if the ESC effect unnecessary interferes on steering in a scenario where the driver can perform the maneuver without ESC assistance, The Figures 10 and 11 show the result from this simulation.

1) DLC at 80 km/h
From results shown in Fig. 10, where the yaw moment given as control signal remains equal to zero, and from the vehicle's trajectory shown on Fig. 11, where the DLC test is successfully performed, one can confirm that driver is able to perform this maneuver without ESC assistance. Therefore, the obtained yaw rate is command only by the driver steering command, and it remains close to its desired valued given by the Equation ( (19)). This result indicates a coherence between models of driver, vehicle and desired yaw rate. The actuation remains null because of the control algorithms The side-slip angle β and roll angle φ of the vehicle body and the tire slip angles α remain smaller than 5 degrees during all the simulation, which means that the vehicle states remains within the trust region of the vehicle-linearprediction model.

2) DLC at 100 km/h
The DLC at 100km/h was simulated to observe the ESC effectiveness in a scenario where initially the vehicle response is at the trim point of the prediction model, and the driver is not able to perform the double lane changing without assistance. The Figures 12 and 13 show the results obtained from this simulation. From the trajectory shown in Fig. 13, and side-slip, yaw rate, and roll rate angle shown in Fig. 12, one can confirm that the driver loses control of the vehicle without ESC assistance, whereas with LQR or MPC-based ESCs, the driver does not lose the vehicle control. With both FIGURE 10. Results from MIL simulation of DLC at 80km/h for vehicle with MPC-based ESC. In this maneuver, the ESC actuation is not required. The target yaw rate is computed by Eq. 19, which depends on the driver's behavior in steering wheel control during the maneuver. The indexes f. and r. denote the front and rear tires, respectively. controllers, the side-slip and the roll angles of the vehicle body and tires slip angle remains smaller than 5 degrees, which means that vehicle states remain in the trust region of the vehicle-linear-prediction model.
By comparing the results obtained with LQR and MPCbased ESCs shown in Fig. 12, one can see that even running at 22.4 times lower command update rate, better lateral stability improvements are achieved with the MPC since the vehicle with MPC-based ESC exhibits smaller side-slip and tire slip angles than those obtained with LQR. One can also see that the steering input in results for MPC is lower than the obtained for LQR. This means that the driver needs less effort to drive when assisted by the MPC-based ESC, i.e., better maneuverability improvement is also achieved with the MPC-based ESC.
Besides, only the vehicle equipped with the MPC-based ESC performs the maneuver without exceeding the lateral displacement limits from the desired trajectory. The LQRbased ESC exhibits a more aggressive actuation, achieving the saturation of yaw moment most of the simulation time, and, even so, it is not able to allow the maneuver without slipping away from the DLC test boundaries.
The DLC at 100 km/h also was simulated for the MPCbased ESC with roll control disabled. The Fig. 14 shows the trajectory obtained from the simulation of DLC at 100km/h performed for vehicles with proposed MPC-based ESC with roll control on and off. One can see that the vehicles equipped with both controllers are able to perform this maneuver successfully. As, in this scenario, the stability improvements achieved with both the controllers are almost the same, no benefits can be noted for the inclusion of roll control, but at least no performance losses are observed.

3) DLC at 120 km/h
The DLC at 120km/h was simulated to test the ESC on control of the vehicle at a higher speed than the trim point of the prediction model. The Figures 15 and 16 show the results obtained for vehicles without ESC assistance, and with LQR and MPC-based ESC.
From the trajectory shown in Fig. 16, obtained for the vehicle without ESC, one can see that the driver is not able to perform the double lane changing at 120 km/h without losing the vehicle control. The trajectories obtained with LQR and MPC-based ESCs have different performances, but with both controllers, the results show that the driver does not lose vehicle control. The vehicle with LQR-based ESC exhibits a rude escape from DLC boundaries, whereas the vehicle with MPC-based ESC briefly crosses the bounds of DLC once at the exiting of the second lane changing.
From the results shown 15, it is possible to see that the MPC-based ESC exhibits a softer actuation on yaw moment input, and is still more efficient in reducing of side-slip and roll angles error. With the MPC-base ESC, the side slip and roll angles of the vehicle body and the tire slip angles remain smaller than 5 degrees, which means that the effectiveness   of the stability control keeps the vehicle states in the trust region of the vehicle-prediction-linear model.
The DLC at 120 km/h also was simulated for the MPCbased ESC with roll control disabled. The results obtained with roll control on and off are presented Fig. 17 and Fig.  18. From which one can see the benefits of including roll control, since the trajectory presented in in Fig. 18 obtained from simulation with roll control off exhibits a larger error at the exit of the second lane changing than the obtained with roll control on. In the states of vehile dynamics presented  Fig. 17 obtained from these simulations, one can see that the vehicle equiped with an ESC without roll control has a higher roll rate, which means a higher risk of rollover and lower passenger comfort. In addition to the extra roll rate, the vehicle without roll control also has a higher yaw rate, side-slipping, and tire-slipping, which means a lower stability performance. And comparing the energy of the steer angle signal controlled by the driver, the amplitude without roll control is greater than with roll control, which means that the driver needs to make an extra effort to maneuver. Therefore, in this scenario, stability performance is greatly improved by the inclusion of roll control. The increased influence of roll motion on the vehicle at high speeds is theatrically expected, because, at higher speeds, the roll rate has a stronger influence on yaw rate and tire dynamics, because it affects the vertical load transference between tires, which changes the lateral force acting on tires.

4) DLC at 110 km/h with vehicle parameters diverting from prediction model
The effectiveness of proposed controller on a vehicle whose response is different from that predicted by linear model also is evaluated. MIL simulation was performed for DLC at  110km. Besides the different speed, the vehicle simulated in this scenario has mass, center of mass position and tire-road friction different from values assumed by control algorithms. Parameters used in this simulation are shown in Table 8, parameters not shown in this table are equal to parameters shown on Table 2. The Fig. 19 shows results from this simulation. It is possible to see that performance decreases in comparison with vehicle whose parameters match the prediction model's parameters, but ESC remains effective in prevent the driver from losing the control.

C. RESULTS FROM EMBEDDED SIMULATIONS
The PIL simulations were performed to test the algorithm running on ARM Cortex A8 of BeagleBoneBlack Rev C, with 0.8ms sample time of feedback signals. This sampling time is the fastest rate achieved by the platform running a real-time simulation of vehicle response. The Figure 20 shows the results obtained from this simulation of DLC at 110 Km/h. Besides disturbances in acquisition of feedback signals read by the controller through analog inputs, this scenario test the control in presence of disturbances in vehicle response in respect with prediction model, due to difference between simulated vehicle speed and constant speed assumed by prediction model.
The Figure 20 shows the results from PIL simulation in comparison with MIL simulation. The control signal observed in MIL and PIL simulations are different from each other. This can be understood as the effect of disturbances in control activation when errors are close to decision threshold. However, from observation of yaw and roll rates, side-slip angle and the trajectory during maneuver, one can see that performance in embedded testing is close to the observed in MIL simulation.

1) Comparison between MPC-based ESCs with and without parameterization
To demonstrate the benefits of exponential parameterization, DLC maneuver at 120 km/h was simulated for MPC-based ESC, with roll control, and without parameterization. In such a scenario, the computation time increased from 13.6 ms to 231 ms. The trajectory obtained from this simulation is shown in Figure 21, where only the MPC with exponential parameterization is effective in avoiding the instability. This is because the control without parameterization has an insufficient update rate of the commands.

VII. CONCLUSIONS
In this paper, a parameterized constrained MPC strategy for an upper-level ESC system was presented and discussed. The proposed approach uses as a prediction model, a 3DOF model that considers lateral, yaw, and roll motions linearized for constant longitudinal speed and considering small roll and side-slip angles. The main contribution of this work lies FIGURE 17. Results from MIL simulation of DLC at 120km/h for vehicles with MPC-based ESCs with roll control on and off.The target yaw rates are computed by Eq. 19, which depends on the driver's behavior in steering wheel control during the maneuver. The indexes f. and r. denote the front and rear tires, respectively. in to use exponential parameterization of the input vector to reduce the complexity of the optimization problem without loss of performance. The parameterization contributes to reducing the computation time from 231.2 ms to 13.6, and thanks to that, the stability performance is increased. Thus, this approach makes it possible to implement this control strategy in commercial vehicles that have limited processing hardware. Results from the embedded testing show that the proposed control algorithm is computationally efficient for real-time applications, even running in a hardware with limited resources. These results also demonstrated the controller's robustness to acquisition system errors.
The results obtained from MIL simulations show that the proposed algorithm does not interfere when it is not required; it can prevent the driver from losing control of the vehicle. Moreover, its performance remains in the presence of disturbances in vehicle response with respect to a prediction model. The stability improvement achieved by addressing the MPC technique was better than the obtained with similar LQR-based ESC. The comparison between for DLC at 100 km/h and 120 km/h indicates that for lower speeds, the performance of ESC with and without roll control is almost the same. For higher values of speed, the enabling of roll control considerably improves the stability performance without significant changes regarding the computational cost of proposed MPC-based ESC.
Future works consist of implementing a real-time estimation of the tire-road friction coefficient by replacing the actual fixed value used in the tire model. Another point to investigate is to develop a lower-level algorithm to control rotation torque of each wheel, such that the resultant yaw moment equals the correcting yaw moment. Further works will also investigate the use of a lateral stability index to analyze the control performance to re-define the control objectives and the ESC activation criteria.