lane Keeping Assist System
使用自适应模型预测控制器模拟车道辅助
- 图书馆:
Model Predictive Control Toolbox / Automated Driving
![](http://www.tianjin-qmedu.com/au/au/help/mpc/ref/mpc-lka-library-block.png)
desCription
这lane Keeping Assist SystemBlock模拟了车道保持辅助系统(LKA)系统,该系统可以通过调节前转向角度来保持自我车辆沿着直线或弯曲道路的中心行驶。控制器减少了相对于车道中心线的自我车辆的横向偏差和相对偏航角。该块计算最佳控制动作,同时使用自适应模型预测控制(MPC)满足转向角约束。
To customize your controller, for example to use advanced MPC features or modify controller initial conditions, clickCreate LKA subsystem。
Ports
我nput
Curvature
— Road curvature
sCalar
road curvature, specified as1/r,,,,whereris the radius of the curve in meters.
这road curvature is:
Positive when the road curves toward the positive Y axis of the global coordinate system.
Negative when the road curves toward the negative Y axis of the global coordinate system.
zero for a straight road.
控制器将道路曲率建模为预览的测量干扰。您可以将曲率指定为:
——指定咕咕叫曲率标量信号ent control interval. The controller uses this curvature value across the prediction horizon.
veCtor signal with length less than or equal to thePrediction Horizon— Specify the current and predicted curvature values across the prediction horizon. If the length of the vector is less than the prediction horizon, then the controller uses the final curvature value in the vector for the remainder of the prediction horizon.
纵向速度
— Ego vehicle velocity
nonnegative scalar
Ego vehicle velocity in m/s.
lateral deviation
— Ego vehicle lateral deviation
sCalar
自我车辆横向偏差,距车道中心线米。横向偏差e1is positive when the ego vehicle is to the right of the centerline and negative when the ego vehicle is to the left of the centerline.
relative yaw angle
— Angle from lane centerline
sCalar
Ego vehicle longitudinal axis angle in radians from the centerline of the lane, defined as:
Here,θeis the ego vehicle angle andθCis the centerline angle, with both angles defined in the global coordinate frame.
Minimum steering angle
- 最小前转向角
sCalar
Minimum front steering angle constraint in radians. Use this input port when the minimum steering angle varies at run time.
dependencies
To enable this port, selectUse external sourcefor theMinimum steering angleparameter.
最大转向角
— Maximum front steering angle
sCalar
Maximum front steering angle constraint in radians. Use this input port when the maximum steering angle varies at run time.
dependencies
To enable this port, selectUse external sourcefor the最大转向角parameter.
Enable optimization
— Controller optimization enable signal
sCalar
控制器优化启用信号。当此信号为:
Nonzero, the controller performs optimization calculations and generates aSteering angle控制信号。
zero, the controller does not perform optimization calculations. In this case, theSteering angle在禁用优化时,输出信号保持其值。控制器继续更新其内部状态估计。
dependencies
要启用此端口,请选择使用外部信号启用或禁用优化parameter.
External control signal
- 将转向角应用于自我车辆
sCalar
一个Ctual steering angle in radians applied to the ego vehicle. The controller uses this signal to estimate the ego vehicle model states. Use this input port when the control signal applied to the ego vehicle does not match the optimal control signal computed by the model predictive controller. This mismatch can occur when, for example:
这lane Keeping Assist Systemis not the active controller. Maintaining an accurate state estimate when the controller is not active prevents bumps in the control signal when the controller becomes active.
这steering actuator fails and does not provide the correct control signal to the ego vehicle.
dependencies
要启用此端口,请选择使用外部控制信号进行PFC和其他控制器之间的漫不经心转移parameter.
vehicle dynamics matrix A
— State matrix of ego vehicle predictive model
square matrix
State matrix of ego vehicle predictive model. The number of rows in the state matrix corresponds to the number of states in the predictive model. This matrix must be square.
这ego vehicle predictive model defined byvehicle dynamics matrix A,,,,vehicle dynamics matrix B,,,,andvehicle dynamics matrix Cmust be minimal.
dependencies
要启用此端口,请选择Use vehicle modelparameter.
vehicle dynamics matrix B
— Input-to-state matrix of ego vehicle predictive model
Column vector
我nput-to-state matrix of ego vehicle predictive model. The number of rows in this signal must match the number of rows invehicle dynamics matrix A。
这ego vehicle predictive model defined byvehicle dynamics matrix A,,,,vehicle dynamics matrix B,,,,andvehicle dynamics matrix Cmust be minimal.
dependencies
要启用此端口,请选择Use vehicle modelparameter.
vehicle dynamics matrix C
— State-to-output matrix of ego vehicle predictive model
带有两行的矩阵
State-to-output matrix of ego vehicle predictive model. The number of columns in this signal must match the number of rows invehicle dynamics matrix A。
这ego vehicle predictive model defined byvehicle dynamics matrix A,,,,vehicle dynamics matrix B,,,,andvehicle dynamics matrix Cmust be minimal.
dependencies
要启用此端口,请选择Use vehicle modelparameter.
输出
Steering angle
- 前转向角控制信号
sCalar
控制器生成的弧度中的前转向角控制信号。前转向角是从车辆的纵轴前轮胎的角度。转向角度朝向自我车辆的正侧轴。
参数
参数选项卡
Ego VehicleUse vehicle parameters
— Define ego vehicle model using vehicle properties
on
(默认)|off
Select this parameter to define the ego vehicle model used by the MPC controller by specifying properties of the ego vehicle. The ego vehicle model is the linear model from the front steering angle to the lateral velocity and yaw angle rate. For more information, seeEgo Vehicle Predictive Model。
要定义车辆模型,请指定以下块参数:
Total mass
Yaw moment of inertia
从重心到前轮胎的纵向距离
longitudinal distance from center of gravity to rear tires
Cornering stiffness of front tires
后轮胎的转弯刚度
有关自我车辆型号的更多信息,请参见Ego Vehicle Predictive Model。
Selecting this parameter clears theUse vehicle modelparameter.
程序化使用
block Parameter:ModelType |
类型:string, character vector |
默认:"Use vehicle parameters" |
Use vehicle model
— Define ego vehicle model using state-space matrices
off
(默认)|on
选择此参数以定义MPC控制器使用的自我车辆模型的状态空间矩阵。该模型是从弧度的前转向角到横向速度的线性模型,每秒以米为单位,偏航角度速率为每秒。有关自我车辆型号的更多信息,请参见Ego Vehicle Predictive Model。
To define the initial internal model, specify the一个,,,,b,,,,andCstate-space matrices. The internal model must be a minimal realization with no direct feedthrough, and the dimensions of一个,,,,b,,,,andCmust be consistent.
Typically, the ego vehicle steering model is velocity-dependent, and therefore, it varies over time. To update the internal model at run time, use thevehicle dynamics A,,,,vehicle dynamics B,,,,andvehicle dynamics Cinput ports.
Selecting this parameter clears theUse vehicle parametersparameter.
程序化使用
block Parameter:ModelType |
类型:string, character vector |
默认:"Use vehicle parameters" |
Total mass
- 自我车辆质量
1575年
(默认)|positive scalar
自我车辆质量在公斤。
dependencies
To enable this parameter, select theUse vehicle parametersparameter.
程序化使用
block Parameter:vehicleMass |
类型:string, character vector |
默认:"1575" |
Yaw moment of inertia
— Moment of inertia about the ego vehicle vertical axis
2875
(默认)|positive scalar
Moment of inertia about the ego vehicle vertical axis in Kg·m2。
dependencies
To enable this parameter, select theUse vehicle parametersparameter.
程序化使用
block Parameter:vehicleYawInertia |
类型:string, character vector |
默认:"2875" |
从重心到前轮胎的纵向距离
— Distance from the ego vehicle center of mass to its front tires
1。2
(默认)|positive scalar
从质量的自我车辆中心到其前轮胎的距离,沿车辆的纵轴测量。
dependencies
To enable this parameter, select theUse vehicle parametersparameter.
程序化使用
block Parameter:lengthToFront |
类型:string, character vector |
默认:"1.2" |
longitudinal distance from center of gravity to rear tires
— Distance from the ego vehicle center of mass to its rear tires
1。6
(默认)|positive scalar
distance from the ego vehicle center of mass to its rear tires in meters, measured along the longitudinal axis of the vehicle.
dependencies
To enable this parameter, select theUse vehicle parametersparameter.
程序化使用
block Parameter:lengthToRear |
类型:string, character vector |
默认:"1.6" |
Cornering stiffness of front tires
— Front tire stiffness
19000
(默认)|positive scalar
Front tire stiffness in N/rad, defined as the relationship between the side force on the front tires and the angle of the tires to the longitudinal axis of the vehicle.
dependencies
To enable this parameter, select theUse vehicle parametersparameter.
程序化使用
block Parameter:FrontTireStiffness |
类型:string, character vector |
默认:"19000" |
后轮胎的转弯刚度
— Rear tire stiffness
33000
(默认)|positive scalar
rear tire stiffness in N/rad, defined as the relationship between the side force on the rear tires and the angle of the tires to the longitudinal axis of the vehicle.
dependencies
To enable this parameter, select theUse vehicle parametersparameter.
程序化使用
block Parameter:rearTireStiffness |
类型:string, character vector |
默认:“ 33000” |
一个
— Initial state matrix of ego vehicle predictive model
square matrix
我nitial state matrix of ego vehicle predictive model. The number of rows in the state matrix corresponds to the number of states in the predictive model. This matrix must be square.
最初的自我车辆预测模型由一个,,,,b,,,,andCmust be minimal.
通常,自我车辆模型会随着时间而变化。要在运行时更新状态矩阵,请使用vehicle dynamics Ainput port.
dependencies
To enable this parameter, select theUse vehicle modelparameter.
程序化使用
block Parameter:EgoModelMatrixA |
类型:string, character vector |
默认:“ [-4.4021,-12.4603; 1.3913,-5.1868]” |
b
— Initial input-to-state matrix of ego vehicle predictive model
Column vector
我nitial input-to-state matrix of ego vehicle predictive model. The number of rows in this parameter must match the number of rows in一个。
最初的自我车辆预测模型由一个,,,,b,,,,andCmust be minimal.
通常,自我车辆模型会随着时间而变化。To update the input-to-state matrix at run time, use thevehicle dynamics Binput port.
dependencies
To enable this parameter, select theUse vehicle modelparameter.
程序化使用
block Parameter:EgoModelMatrixB |
类型:string, character vector |
默认:“ [24.1270; 15.8609]” |
C
— Initial state-to-output matrix of ego vehicle predictive model
带有两行的矩阵
我nitial state-to-output matrix of ego vehicle predictive model. The number of columns in this parameter must match the number of rows in一个。
最初的自我车辆预测模型由一个,,,,b,,,,andCmust be minimal.
通常,自我车辆模型会随着时间而变化。To update the state-to-output matrix at run time, use thevehicle dynamics Cinput port.
dependencies
To enable this parameter, select theUse vehicle modelparameter.
程序化使用
block Parameter:EgoModelMatrixC |
类型:string, character vector |
默认:"[1,0;0,1]" |
最初的纵向速度
— Initial velocity of the ego vehicle
15
(默认)|positive scalar
当自我车辆的初始速度模型lane-keeping assist is enabled in m/s. This velocity can differ from the actual ego vehicle initial velocity.
笔记
一个very small initial velocity, for exampleeps
,,,,Can produce a nonminimal realization for the controller plant model, causing an error. To prevent this error, set the initial velocity to a larger value, for example1e-3
。
程序化使用
block Parameter:初始长篇小说 |
类型:string, character vector |
默认:"15" |
模型输入和输出之间的传输滞后
— Total transport lag in ego vehicle model
0
(默认)|nonnegative scalar
Total transport lag,τ,在自我车辆型号中以秒为单位。该滞后包括执行器,传感器和通信滞后。对于每个输入输出通道,传输滞后近似:
程序化使用
block Parameter:TransportLag |
类型:string, character vector |
默认:"0" |
Minimum steering angle
- 最小前转向角
-0.26
(默认)|之间的标量-pi/2
andpi/2
Minimum front steering angle constraint in radians.
我f the minimum steering angle varies over time, add theMinimum steering angle通过选择输入端口块Use external source。
dependencies
This parameter must be less than the最大转向角parameter.
程序化使用
block Parameter:MinSteering |
类型:string, character vector |
默认:“ -0.26” |
最大转向角
— Maximum front steering angle
0.26
(默认)|之间的标量-pi/2
andpi/2
Maximum front steering angle constraint in radians.
如果最大转向角随时间变化,请添加最大转向角通过选择输入端口块Use external source。
dependencies
此参数必须大于Minimum steering angleparameter.
程序化使用
block Parameter:MaxSteering |
类型:string, character vector |
默认:“ 0.26” |
Sample time
- 控制器样本时间
0。1
(默认)|positive scalar
Controller sample time in seconds.
程序化使用
block Parameter:Ts |
类型:string, character vector |
默认:"0.1" |
预测范围
— Controller prediction horizon
10
(默认)|positive integer
控制器的公关ediction horizon steps. The controller prediction time is the product of the sample time and the prediction horizon.
程序化使用
block Parameter:PredictionHorizon |
类型:string, character vector |
默认:"30" |
Controller behavior
— Closed-loop controller performance
0。5
(默认)|之间的标量0
and1
Closed-loop controller performance. The default parameter value provides a balanced controller design. Specifying a:
Smaller value produces a more robust controller with smoother control actions.
较大的价值会产生更具侵略性的控制器,并具有更快的响应时间。
When you modify this parameter, the change is applied to the controller immediately.
程序化使用
block Parameter:ControllerBehavior |
类型:string, character vector |
默认:"0.5" |
block Tab
使用次优的解决方案
— Apply suboptimal solution after specified number of iterations
off
(默认)|on
Configure the controller to apply a suboptimal solution after a specified maximum number of iterations, which guarantees the worst-case execution time for your controller.
For more information, seeSuboptimal QP Solution。
dependencies
选择此参数后,指定Maximum iteration numberparameter.
程序化使用
block Parameter:suboptimal |
类型:string, character vector |
默认:"off" |
Maximum iteration number
— Maximum optimization iterations
10
(默认)|positive integer
Maximum number of controller optimization iterations.
dependencies
To enable this parameter, select the使用次优的解决方案parameter.
程序化使用
block Parameter:Maxiter |
类型:string, character vector |
默认:"10" |
使用外部信号启用或禁用优化
— Add port for enabling optimization
off
(默认)|on
To add theEnable optimization输入块到块,选择此参数。
程序化使用
block Parameter:optmode |
类型:string, character vector |
默认:"off" |
使用外部信号进行LKA和其他控制器之间的易于转移
— Add external control signal input port
off
(默认)|on
To add theExternal control signal输入块到块,选择此参数。
程序化使用
block Parameter:trackmode |
类型:string, character vector |
默认:"off" |
Create LKA subsystem
— Create custom controller
button
Generate a custom LKA subsystem, which you can modify for your application. The controller configuration data for the custom controller is exported to the MATLAB®workspace as a structure.
You can modify the custom controller subsystem to:
修改默认MPC设置或使用高级MPC功能。
Modify the default controller initial conditions.
Model Examples
一个lgorithms
Ego Vehicle Predictive Model
这default ego vehicle predictive model is the following state-space model:
Here:
vXis the longitudinal velocity of the car. At the start of the simulation, this velocity is equal to the我nitial condition for longitudinal velocityparameter. At run time, this velocity is equal to the纵向速度input signal.
mis theTotal massparameter.
我zis theYaw moment of inertiaparameter.
lFis the从重心到前轮胎的纵向距离parameter.
lris thelongitudinal distance from center of gravity to rear tiresparameter.
CFis theCornering stiffness of front tiresparameter.
Cris the后轮胎的转弯刚度parameter.
该模型的输入是弧度的转向角,输出是以每秒米为单位的横向速度,而每秒弧度的偏航角速率为偏航角速率。
To define a different ego vehicle predictive model, select theUse vehicle model参数,并指定初始状态空间模型。然后,使用该状态空间矩阵的运行时值vehicle dynamics A,,,,vehicle dynamics B,,,,andvehicle dynamics C输入信号。
这Controller creates its internal predictive model by augmenting the ego vehicle dynamic model. The augmented model includes the road curvature as a measured disturbance input signal.
初始状态
by default, the model predictive controller assumes the following initial conditions for the ego vehicle:
纵向速度is equal to the最初的纵向速度parameter.
侧速度为零。
Steering angle is zero.
Yaw angle rate is zero.
如果您的模型中的初始条件与这些条件不符,则Steering angleoutput can exhibit an initial bump at the start of the simulation.
To modify the controller initial conditions to match your simulation, create a custom lane-keeping control system by, on theblock选项卡,单击Create LKA subsystem。
Extended Capabilities
C/C++代码生成
Generate C and C++ code using Simulink® Coder™.
PLC代码生成
Generate Structured Text code using Simulink® PLC Coder™.
版本历史记录
MATLAB Command
您单击了与此MATLAB命令相对应的链接:
run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
You can also select a web site from the following list:
How to Get Best Site Performance
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
一个mericas
- 一个mérica Latina((Español)
- Canada((English)
- United States((English)
Europe
- belgium((English)
- denmark((English)
- deutschland((deutsch)
- España((Español)
- 芬兰((English)
- France(Français)
- 我reland((English)
- 我talia(意大利语)
- luxembourg((English)
- Netherlands((English)
- Norway((English)
- Österreich((deutsch)
- 葡萄牙((English)
- Sweden((English)
- Switzerland
- United Kingdom((English)
一个sia Pacific
- 一个ustralia((English)
- 我ndia((English)
- New Zealand((English)
- 中国
- 日本((日本語)
- 한국((한국어)