网刊加载中。。。

使用Chrome浏览器效果最佳,继续浏览,你可能不会看到最佳的展示效果,

确定继续浏览么?

复制成功,请在其他浏览器进行阅读

Path-Following Based on Nonlinear Model Predictive Control with Adaptive Path Preview  PDF

  • Jun⁃Ting LI
  • Chih⁃Keng CHEN
Department of Vehicle Engineering, National Taipei University of Technology, Taipei, China

CLC: U461.91

Updated:2024-11-19

DOI:10.11908/j.issn.0253-374x.24723

  • Full Text
  • Figs & Tabs
  • References
  • Authors
  • About
CN CITE
OUTLINE

Abstract

This paper presents a Nonlinear Model Predictive Controller (NMPC) for the path following of autonomous vehicles and an algorithm to adaptively adjust the preview distance. The prediction model includes vehicle dynamics, path following dynamics, and system input dynamics. The single-track vehicle model considers the vehicle’s coupled lateral and longitudinal dynamics, as well as nonlinear tire forces. The tracking error dynamics are derived based on the curvilinear coordinates. The cost function is designed to minimize path tracking errors and control effort while considering constraints such as actuator bounds and tire grip limits. An algorithm that utilizes the optimal preview distance vector to query the corresponding reference curvature and reference speed. The length of the preview path is adaptively adjusted based on the vehicle speed, heading error, and path curvature. We validate the controller performance in a simulation environment with the autonomous racing scenario. The simulation results show that the vehicle accurately follows the highly dynamic path with small tracking errors. The maximum preview distance can be prior estimated and guidance the selection of the prediction horizon for NMPC.

1 Introduction

Model predict control can predict the future behavior of the system, consider the preview trajectory, and utilize these information to optimize the current control commands. In the model prediction path following controller, the information of the path ahead from vehicle is required. Path preview distance significantly affects the path following performance and several papers have investigated this topic. Zhang et al.

1 compares the path-following errors of different predict distances under double lane change maneuver. Wang et al.2 proposes a variable prediction horizon (VPH), using a particle swarm optimisation (PSO) algorithm to optimise the prediction horizon based based on comprehensive performance indexes. Xu and Peng3 compares the effects of different predict distances on the path-following error with MPC and preview control in both simulations and experiments. The experimental results demonstrate that the preview control achieves smoother steering and better ride comfort compared to the feedback control.

This paper implements vehicle path-following control with a non-linear model prediction controller. By considering the nonlinearity of the vehicle dynamics and path following dy-namics, we can accurately predict the future vehicle traveling distance and use the corresponding path curvature and refer- ence speed as the reference. These approaches can improve the path following performance of a vehicle travelling on a path with arbitrary curvature at different speeds.

2 VEHICLE MODELING

2.1 Nonlinar Single⁃Track Vehicle Model

The layout of the single-track model is shown in Fig.1. To predict the planar vehicle motion about OB, we use the angular velocity ψ˙ (yaw rate), longitudinal velocity Vx and lateral velocity Vy to formulate dynamic equations:

ψ¨=(lf[Fyfcos(δ)+Fxfsin(δ)]-lrFyrIz (1a)
V˙x=-Fyfsin(δ)+Fxfcos(δ)+Fxr-Fdm+Vyψ˙ (1b)
V˙y=Fyfcos(δ)+Fxfsin(δ)+Fyrm+Vxψ˙ (1c)

Fig.1  Schematic diagram of the single-track vehicle model. The state variables are in red and the tire forces are in blue, the arrow indicates the positive direction of the corresponding variable

where: δ is the front wheel steer angle; l is the wheelbase, lf and lr are the distance from CG to the front and rear axles; the lumped tire force Fij with the subscript {xy} denotes the longitudinal or lateral direction and {fr} denotes the front or rear wheel;drag force Fd=CdVx2 is the compact aerodynamic coefficient times velocity squared; m is the vehicle mass; Iz is the moment of inertia.

2.2 Lateral Tire Force

The Simplified Magic Formula

4 is used to capture the nonlinear behavior of lateral tire force, the model is a function of the sideslip angle α, the vertical force Fz of a single wheel, and the road friction coefficient μ

Fy0(α,Fz,μ)=μDsin(Ctan-1(Bα)) (2a)
D=d1Fz+d2 (2b)

where BC and D are fitting coefficients. The peak factor D is defined by the first-order function of Fz. The lumped sideslip angles at the front and rear axles are described by:

αf=tan-1(Vy+lf ψ˙Vx)-δ, αr=tan-1(Vy+lr ψ˙Vx) (3)

Then the combined tire lateral forces Fyf and Fyr in (4) are available to substitute into single-track model (1).

Fyi=2Fy0(αi, Fzi2, μ),  i{f,r} (4)

2.3 Longitudinal Tire Force

The longitudinal forces Fxf and Fxr are composed of rear wheel traction force Ft and all-wheel braking force Fb as following equations:

Fxf=kbFb,  Fxr=Ft+(1-kb)Fb (5)

where: kb is the braking coefficient that determines the force distribution between the front axle and rear axle, we set kb=Fzf/(mg)  to distribute the braking force according to the ratio of axle load. The system inputs are δ, Ft, and Fb, but the large difference in magnitude between these variables may increase numerical instability for an NMPC solver, therefore, the normalized acceleration at and ab are introduced:

at=Ft/m,  ab=Fb/m (6)

2.4 Constraints

During racing, we must ensure that the combined tire force is contained within the friction ellipse to avoid large tire slip and loss of grip. Thus the quadratic non-linear constraints are applied:

Fxi2+Fyi2(μFzi)21,  i{f,r} (7)

There are upper bounds and lower bounds on the system inputs due to physical limits, these bounds are expressed by inequality constraints as:

δminδδmax0atTr,maxrw m,  Tb,maxrw mab0 (8)

where: Tr,max is the maximum total traction torque of rear axle; Tb,max is the maximum braking torque of each axle; rw is the effective rolling radius of wheel.In order to achieve optimal actuation efficiency, an equality constraint is imposed,

atbb=0 (9)

This equation ensures the traction and braking commands are orthogonal, i.e., they are not active at the same time.

3 Path Modeling

The reference path is fitted by a cubic spline function to create a parametric representation. A curvilinear coordinate system is used to describe the relationship between the vehicle position and the reference waypoints (See Fig.2).

Fig.2  Single-track vehicle model in a curvilinear coordinates

3.1 Parametric Path

The discrete path data set [XY] is composed by path coordinates X=x0,x1,,xnT and Y=y0,y1,,ynT. Then a spline function Xs) with n equations is used to fit X

X(s)=an(s-sn-1)3+bn(s-sn-1)2+cn(s-sn-1),k=1,2,,n,  s[s(n-1),sn] (10)

where: s is the cumulative arc length starting from s0=0:

sk=i=1k=n(xi-xi-1)2+(yi-yi-1)2,k=1,2,,n (11)

The higher-order derivative of the spline function with respect to the progressive variable s is easily obtained by:

x'(s)=3ak(s-sk-1)2+2bk (s-sk-1)+ck (12)
x(s)=6ak(s-sk-1)+2bk (13)
k=1,2,,n,  s[sk-1,sk]

Following the above procedure,ys), y's) and y''s) are also derived based on y. The reference heading angle ψr and the reference curvature κr are calculated by:

ψr=arctan 2(y',x' ) (14)
κr=x'y''-x''y'(x'2+y'2)3/2 (15)

where the arctan 2 is the 2-argument arctangent function.

3.2 Tracking Error for Discrete Path

The vehicle CG position is pc=xc,ycT, and the closest waypoint to pc is defined as “matching point”, pm=xm,ymT, where m is the index of mathtcing point. Then the tracking error vector in global coordinate is defined as:

e=pc-pm (16)

In order to obtain the longitudinal error ex and the lateral error ey, the error vector is projected onto the curvilinear coordinate by rotation matrix:

exey=[cos ψm-sin ψmsin ψmcos ψm]e (17)

where: ψm is the reference heading angle at pm, the arc length error es can be approximated as longitudinal error ex in general. Under the assumption that the reference curvature is the same at the matching point and projection point, then the reference heading angle is given by:

ψr=ψm+κr es (18)

Consider the vehicle sideslip angle β is regulated in a small value during racing, the course angle can be approximated to heading angle, then the heading error is defined as:

eψ=ψ-ψr (19)

3.3 Tracking Error Dynamics

To predict future path tracking error, the dynamics of the heading error, lateral error, and vehicle traveling distance are given by:

e˙ψ=ψ˙-ψ˙r=ψ˙-κrs˙ (20a)
e˙y=Vycos eψ+Vxsin eψ (20b)
s˙=Vxcos eψ-Vysin eψ1-κrey (20c)

4 Nonlinear Model Predictive Controller

In this section, the path following problem is transformed to nonlinear programming (NLP) problem.

4.1 Control Architecture

The overall control structure of path following is shown in Fig.3. The tracking error evaluation module outputs the path tracking error eψ and ed according to the current position of the vehicle. The preview module looks forward over the preview path and sends the corresponding reference curvature and reference speed to the NMPC. The lower controller distributes the desired acceleration commands at,ab as the rear driving torques or four-wheel braking torques.

Fig.3  Control architecture of NMPC path-following

4.2 Prediction Model

Consider the vehicle dynamics (1), path following dynamics (20), and extended system input dynamics u=δ˙,a˙t,a˙bT, the prediction model is formulated as (21).Given a prediction horizon Npp=κr1,,κrNpT is the parameter trajectory composed by the reference curvature at each prediction stage. The first six equations in (21) can predict future vehicle states, path tracking errors, and driving distance. In the last three equations we assign the slew rate of system inputs as extended states,

x˙=ψ¨V˙xV˙ye˙ψe˙ys˙δ˙a˙ta˙b=MzIzFxm-Vyψ˙Fym-Vxψ˙ψ˙-κrs˙Vycos eψ+Vxsin eψVycos eψ+Vxsin eψVxcos eψ-Vysin eψ1-κreya˙ta˙b=f(x,u,p) (21)similar to Ref.[

5]. This approach allows to reduce drastic changes of the inputs to obtain smooth command signals.

4.3 Discretization

The multi-step Euler method is used to discrete model in a simple but also precise way:

k1=f(xk,uk,p)kn=f(xk+hkn-1,uk,p),xk+1=xk+hi=1nki=fd(xk,uk,p),  k=0,1,,Np-1 (22)

where h =ts/n is the step size of Euler method, with the sampling time ts and the discrete step n. The model is integrated with smaller steps to increase the model prediction accuracy. In this study, h=0.02 s and ts=0.1 s.

4.4 Adaptive Preview Distance

The optimal state vector at the kth prediction step is denoted by

xk*=Vx,k*  Vy,k*  ψ˙*  sk*  cy,k*  cψ,k*  δf,k*  at,k*  ab,k*T (23)

The predicted vehicle traveling distances over prediction horizon at the current time step are given by

s0  s1*    sNp* (24)

where the first element s0 is the current vehicle traveling distance. To provide the preview vector for the next time step, we remove s0 and add a correction term that predicts one more step by multiplying sampling time with last predicted velocity, yielding preview distance vector,

sp=s1*      sNp*   sNp*+tsVx,Np* (25)

with this approach, the preview distance can be adaptively adjusted based on the predicted vehicle longitudinal velocity in each prediction step. The required preview distance can be prior estimated by

sp=sNp*+tsVx,Np*-s0 (26)

The preview distance vector is used to query the corresponding reference curvature and velocity using linear interpolation,

Vx,r*=Vx,r(sp) (27)
κr*=κr(sp) (28)

4.5 Reference Outputs

To stabilize the lateral dynamics, track the reference velocity, and minimize path tracking error, the output vector of NMPC is y=Vx,Vy,ey, and the reference output states at each stage over the prediction horizon Np are given by

k=1,,Np,ykref=Vx,krefVy,krefey,kref=Vx,r(sp,k)lrlδf,k*Vx,k*0 (29)

where sp,k denotes the kth element in (25). The reference lateral velocity is derived from the steady-state kinematic sideslip angle, which can be found in Ref.[

6] as βs=(lr/l)δfVy/Vx.

4.6 Cost Function

Compose tracking and control costs over the prediction horizon, the cost function J to be minimized is defined as:

J=k=1Np12Sy-1(yk-ykref)Q2+k=0Np-112Su-1ukR2 (30)

where Sy and Su are square matrices with diagonal scaling factors. Set these factors to the maximum acceptable values of the variables for normalisation. Q is a positive weighting matrix to penalize the difference between reference states and actual system states, R penalizes the control effort to obtain the smooth input trajectory.

Finally we collect cost function, prediction model, and constraints to formulate path-following optimization problem:

minx0,,xNpu0,,uNp-1  J (31a)
s.t.x0=x^(t) (31b)
xk+1=fd(xk,uk,p) (31c)
constraints (7),(8),(9) (31d)

where x^(t) is the estimated or measured states at the current time. All the programs are deployed on a desktop computer with Intel i5-12500 @3.0 GHz processor, and we show that the problem of each step can be solved within milliseconds.

5 Simulation Results

5.1 Simulation Results

The optimal reference raceline is generated by the minimum curvature algorithm and the corresponding reference speed is generated by the quasi-steady-state lap time simulation tool all these programs are open source and available in Ref.[

7]. The reference curvature and heading angle of the race line are obtained by following the process in Section III-A.

5.2 Vehicle Configuration

The CarSim built-in B-class sports car was used as the test vehicle in this study, which is a neutral-steering vehicle. The main vehicle parameters are: m=1 209 kg; Iz=1 020 kg·m2lf=1.165 m; lr=1.165 m; hc=0.35 m.

5.3 Path tracking performance

Fig.4 presents the overall path tracking response. Since the lateral tracking error is very small we omit the reference path in the plot for clarity. The path displays the position of the vehicle's CG along with its longitudinal velocity indicated by a color gradient. The corresponding values for colors are displayed in a colorbar located on the right side. The average longitudinal velocity of the vehicle was 87.22 km/h, and the lap time was 92.07 s.

Fig.4  Path tracking result in Cartesian coordinates

Fig.5 shows the path tracking errors and primary vehicle states. The root mean square (RMS) and maximum lateral error are 0.430 m and 0.094 m, the RMS and maximum heading error are 1.09° and 1.92°. The velocity profile shows that the vehicle decelerated properly before the apex, accelerated during the exit, and maintained high speeds on straight lines. During the turn, the yaw rate was used to track the curvature profile thus they have similar trends. The vehicle’s sideslip angle is kept below 2° during racing, which means that the vehicle maintains excellent lateral stability in the high-speed turns.

Fig.5  Path tracking errors and vehicle states

Fig.6 shows the maximum preview distance during racing. With the preview distance vector that takes into account the path following dynamics, the length of preview path can be adaptively adjusted based on the vehicle speed, heading error, and path curvature. This approach allows us to evaluate the required preview distance in advance. As the prediction time of the NMPC gets longer, the preview distance will increase. We need to consider the practical application conditions (e.g., limitations of sensing technology, visibility of the path ahead) to set a prediction time with feasible preview distance.

Fig.6  Maximum preview distance

6 Conclusions

This paper presents a NMPC for the path following of autonomous vehicles and an algorithm to adaptively adjust the preview distance. The proposed controller scheme coordinates the vehicle’s lateral and longitudinal dynamics to follow the racing line at high speed. By combining path dynamics and vehicle dynamics to build a prediction model for NMPC, path following performance and driving stability are significantly improved. The simulation results show that the vehicle accurately follows the highly dynamic path with small tracking errors.

References

1

ZHANG C YCHU D FLIU S Det al. Trajectory planning and tracking for autonomous vehicle based on state lattice and model predictive control[J]. IEEE Intelligent Transportation Systems Magazine2019112): 29. [Baidu Scholar] 

2

WANG H RWANG Q DCHEN W Wet al. Path tracking based on model predictive control with variable predictive horizon[J]. Transactions of the Institute of Measurement and Control20214312): 2676. https: //doi.org/10.1177/01423312211003809. [Baidu Scholar] 

3

XU S BPENG H. Designanalysis, and experiments of preview path tracking control for autonomous vehicles[J]. IEEE Transactions on Intelligent Transportation Systems2020211): 48. [Baidu Scholar] 

4

METZLER MTAVERNINI DGRUBER Pet al. On prediction model fidelity in explicit nonlinear model predictive vehicle stability control[J]. IEEE Transactions on Control Systems Technology2020295): 1964. [Baidu Scholar] 

5

LOT RBIRAL F. A curvilinear abscissa approach for the lap time optimization of racing vehicles[J]. IFAC Proceedings Volumes (19th IFAC World Congress)2014473): 7559. https://www.sciencedirect.com/science/article/pii/S1474667016428041. [Baidu Scholar] 

6

Abe M. Vehicle handling dynamics: theory and application[M]. Oxford, UKButterworth-Heinemann2015. [Baidu Scholar] 

7

Heilmeier A. Quasi-steady-state lap time simulation[DB/OL]. Github Repositoryhttps://github.com/TUMFTM/laptimesimulation. [Baidu Scholar]