Main Content

Automated Driving Using Model Predictive Control

Model predictive control (MPC) is a discrete-time multi-variable control architecture. At each control interval, an MPC controller uses an internal model to predict future plant behavior. Based on this prediction, the controller computes optimal control actions. For more information on model predictive control, see MPC Design.

You can use MPC in automated driving applications to improve vehicle responsiveness while maintaining passenger comfort and safety. Applications can include:

MPC has several features that are useful for automated driving.

MPC FeatureDescriptionMore Information
Explicitly handle input and output constraints

When computing optimal control moves, an MPC controller accounts for any input and output constraints on the system. For example, you can specify constraints for:

  • Speed limits

  • Safe following distance

  • Physical vehicle limits, such as maximum steering angle

  • Obstacles for the controller to avoid

Predict ego vehicle behavior across a receding horizonAn MPC controller uses an internal model of the vehicle dynamics to predict how the vehicle will react to a given control action across a prediction horizon. This behavior is analogous to a human driver understanding and predicting the behavior of their vehicle.
Preview reference trajectories and disturbances across prediction horizonIf you can anticipate reference trajectories or disturbances across the prediction horizon, an MPC controller can incorporate this information when computing optimal control actions. This behavior is analogous to a human driver previewing the road ahead of their vehicle.Signal Previewing
Update internal vehicle model at run timeIf the dynamics of the ego vehicle vary over time, such as for velocity-dependent steering dynamics, you can update the controller internal model using adaptive MPC.Adaptive MPC
Generate codeYou can automatically generate code for deploying model predictive controllers.Generate Code and Deploy Controller to Real-Time Targets

Simulation in Simulink

To simplify the initial development of automated driving controllers, Model Predictive Control Toolbox™ software provides Simulink® blocks for adaptive cruise control, lane-keeping assistance, path following, and path planning. These blocks provide application-specific interfaces and options for designing an MPC controller.

Adaptive Cruise Control SystemTrack a set velocity and maintain a safe distance from a lead vehicle by adjusting the longitudinal acceleration of an ego vehicle.
Lane Keeping Assist SystemKeep an ego vehicle traveling along the center of a straight or curved road by adjusting the front steering angle.
Path Following Control SystemKeep an ego vehicle traveling along the center of a straight or curved road while tracking a set velocity and maintaining a safe distance from a lead vehicle. To do so, the controller adjusts both the longitudinal acceleration and front steering angle of the ego vehicle.
Vehicle Path Planner SystemPlan a collision-free trajectory from an initial pose to a target pose. You can use this block to plan a path for a vehicle, such as entering and exiting a parking spot.

For other automated driving applications, such as obstacle avoidance, you can design and simulate controllers using the other model predictive control Simulink blocks, such as the MPC Controller, Adaptive MPC Controller, and Nonlinear MPC Controller blocks. For an example that uses an adaptive model predictive controller, see Obstacle Avoidance Using Adaptive Model Predictive Control.

Controller Customization

For the Adaptive Cruise Control System, Lane Keeping Assist System, Path Following Control System, and Vehicle Path Planner System blocks, you can generate a custom subsystem, which you can then modify for your application. This option is useful when you want to:

  • Modify default MPC settings or use advanced MPC features

  • Modify the default controller initial conditions

  • Use different application settings, such as a custom safe following distance definition for adaptive cruise control

To create a custom subsystem, click the corresponding button for the block you are using. For example, to create a custom subsystem for an Adaptive Cruise Control System block, on the Block tab, click Create ACC subsystem. The software creates a Simulink model that contains a subsystem with the same configuration as your original controller. You can modify this subsystem and directly substitute it back into your original model, replacing the controller block.

Integration with Automated Driving Toolbox

If you have Automated Driving Toolbox™ software, you can integrate your model predictive controller with systems for:

  • Object detection and tracking

  • Lane boundary detection

  • Path planning

  • Sensor fusion

For examples, see: Adaptive Cruise Control with Sensor Fusion, Lane Keeping Assist with Lane Detection, and Lane Following Control with Sensor Fusion and Lane Detection.

Automated Driving Toolbox software is not supported in MATLAB® Online™.

See Also


Related Topics