Main Content

lane Keeping Assist System

使用自适应模型预测控制器模拟车道辅助

  • 图书馆:
  • Model Predictive Control Toolbox / Automated Driving

  • lane Keeping Assist System block

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

expand all

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 in m/s.

自我车辆横向偏差,距车道中心线米。横向偏差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.

Ego vehicle longitudinal axis angle in radians from the centerline of the lane, defined as:

e 2 = θ e θ C

Here,θeis the ego vehicle angle andθCis the centerline angle, with both angles defined in the global coordinate frame.

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 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.

控制器优化启用信号。当此信号为:

  • 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.

一个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.

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.

我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.

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.

输出

expand all

控制器生成的弧度中的前转向角控制信号。前转向角是从车辆的纵轴前轮胎的角度。转向角度朝向自我车辆的正侧轴。

参数

expand all

参数选项卡

Ego Vehicle

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"

选择此参数以定义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"

自我车辆质量在公斤。

dependencies

To enable this parameter, select theUse vehicle parametersparameter.

程序化使用

block Parameter:vehicleMass
类型:string, character vector
默认:"1575"

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"

从质量的自我车辆中心到其前轮胎的距离,沿车辆的纵轴测量。

dependencies

To enable this parameter, select theUse vehicle parametersparameter.

程序化使用

block Parameter:lengthToFront
类型:string, character vector
默认:"1.2"

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"

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 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”

我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]”

我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]”

我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]"

当自我车辆的初始速度模型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,τ,在自我车辆型号中以秒为单位。该滞后包括执行器,传感器和通信滞后。对于每个输入输出通道,传输滞后近似:

1 τ s + 1

程序化使用

block Parameter:TransportLag
类型:string, character vector
默认:"0"
lane Keeping Controller Constraints

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 constraint in radians.

如果最大转向角随时间变化,请添加最大转向角通过选择输入端口块Use external source

dependencies

此参数必须大于Minimum steering angleparameter.

程序化使用

block Parameter:MaxSteering
类型:string, character vector
默认:“ 0.26”
Model Predictive Controller Settings

Controller sample time in seconds.

程序化使用

block Parameter:Ts
类型:string, character vector
默认:"0.1"

控制器的公关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"

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

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 number of controller optimization iterations.

dependencies

To enable this parameter, select the使用次优的解决方案parameter.

程序化使用

block Parameter:Maxiter
类型:string, character vector
默认:"10"

To add theEnable optimization输入块到块,选择此参数。

程序化使用

block Parameter:optmode
类型:string, character vector
默认:"off"

To add theExternal control signal输入块到块,选择此参数。

程序化使用

block Parameter:trackmode
类型:string, character vector
默认:"off"

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.

一个lgorithms

expand all

Extended Capabilities

C/C++代码生成
Generate C and C++ code using Simulink® Coder™.

PLC代码生成
Generate Structured Text code using Simulink® PLC Coder™.

版本历史记录

在R2018A中引入