Model Predictive Control for Torque Vectoring in Electric Vehicles
This repository contains an implementation of Model Predictive Control (MPC) for addressing the torque vectoring problem in four-wheel-drive electric vehicles (EVs).
The project is built around a lightweight passenger EV model generated using Virtual Vehicle Composer, which is then exported to Simulink. The control architecture focuses on torque distribution among the four wheels to enhance handling, stability, and safety.
MPC-based controllers are implemented as selectable variants within the Torque Vectoring (TV) subsystem of the Vehicle Control Unit. These MPC variants are intended as performance-enhancing alternatives to the built-in PI controllers provided by MATLAB.
This repository contains a research-oriented Simulink implementation of nominal MPC-based torque-vectoring control for a four-wheel-drive electric vehicle model.
The goal is to study vehicle-level torque distribution and yaw/lateral stability behavior using model predictive control in simulation.
- Formulated the torque-vectoring control problem as an optimal control problem using reduced-order vehicle dynamics.
- Implemented nominal nonlinear MPC for torque-vectoring control in MATLAB/Simulink.
- Integrated the controller with a Simulink vehicle model for simulation-based validation.
- Compared controller behavior using vehicle-response signals such as yaw rate, lateral motion, and torque-vectoring inputs.
This repository is a research and simulation project. It is not production-ready control software. Real-time optimization, embedded deployment, actuator-level integration, and real-vehicle validation would require additional development.
The MPC variants solve an Optimal Control Problem (OCP) formulated using a reduced-order vehicle planar dynamics model. The key characteristics of this model include:
- State reduction: From 3 states (longitudinal/lateral velocity, yaw rate) to 2 (lateral velocity, yaw rate)
- Input simplification: From 4 individual wheel torques (front-left, front-right, rear-left, rear-right) to 2 torque difference signals: front torque difference (front-right − front-left) and rear torque difference (rear-right − rear-left)
- Modularity: Exploits front-rear torque distribution provided by the Energy Management block upstream of the TV module
The reduced complexity enables faster prototyping while retaining control effectiveness. The OCP is solved using MATLAB’s fmincon, a general-purpose nonlinear optimization solver.
The detailed OCP formulation is provided in the accompanying PDF in this repository.
- Nonlinear MPC: Based on the full nonlinear vehicle dynamics model
- Linear Time-Varying (LTV) MPC: A simplified linearized variant. It shows significant reduction in computation time compared to the nonlinear MPC.
- Open the Simulink project: VirtualVehicle_24b_NMPC_TV/VirtualVehicle/VirtualVehicle.prj
- Open the main simulation model: VirtualVehicle_24b_NMPC_TV/VirtualVehicle/System/ConfiguredVirtualVehicle/ConfiguredVirtualVehicleModel.slx
- Select a driving scenario and choose the desired torque vectoring control variant.
- Run the simulation and tune key parameters (prediction/control horizons, objective weights, ...) to achieve desired performance.