Hitachi Automotive Systems Develops a Model Predictive Controller for Adaptive Cruise Control with Model-Based Design


Develop a high-performance adaptive cruise control system for stop-and-go traffic


Use Simulink to design, simulate, and tune a model predictive controller and use Embedded Coder to generate efficient code


  • Controller development time halved
  • Months of hand-coding eliminated
  • Testing speed and efficiency increased

“We were able to conduct multiple parameter studies via simulation in Simulink to tune our controller and reduce its computational load. Simulation gives us deep insight into the internal details of the design, which contributes to improved accuracy and time savings when adjustments are needed.”

Taku Takahama, Hitachi Automotive Systems

The latest adaptive cruise control (ACC) systems are designed to handle the stop-and-go driving common in traffic jams. One limitation of stop-and-go control features is that they tend to have slower response times than human drivers. When slow response times create gaps between vehicles, drivers in adjacent lanes are tempted to cut in to the gaps, which can cause a traffic jam.

Engineers at Hitachi Automotive Systems have developed an ACC system for stop-and-go driving that responds as quickly as a typical human driver when the vehicle in front accelerates. The system, which is based on a model predictive controller (MPC), was built using Model-Based Design with MATLAB® and Simulink®.

“We decided to use MATLAB and Simulink right from the start of the project,” says Taku Takahama, senior engineer at Hitachi Automotive Systems, Ltd. “Without these tools, development would have taken much longer, and we would have had difficulty achieving our goals for system performance and driver comfort.”


ACC system behavior changes depending on the speed and acceleration of the car in front. Hitachi Automotive Systems engineers concluded that a standard proportional-integral-derivative (PID) controller was difficult to design, and instead opted for an MPC. MPC algorithms are well suited for balancing multiple objectives, such as keeping a safe distance from a lead car in a traffic jam, and maintaining a set speed in traffic-free highway driving. However, the computational load required to solve an optimization problem on every time step makes MPC algorithms more challenging to implement on embedded targets with less processing power and memory than PID controllers.

Takahama’s team at Hitachi had previously developed a relatively simple control system by hand-writing the control algorithms in C. The team felt that hand-coding a much more complex MPC would be a significant challenge. They needed to design the new controller to meet the stringent timing requirements of a stop-and-go ACC system, implement it on an embedded microprocessor, and minimize hand-coding to reduce development time.


Hitachi Automotive Systems used Model-Based Design with MATLAB and Simulink to model, simulate, and generate code for the MPC-based embedded ACC system.

Working in Simulink with Model Predictive Control Toolbox™, the engineers modeled the controller and set up tunable parameters to adjust the prediction horizon, control horizon, and weights, as well as actuator and acceleration response constraints.

To create a plant model for prediction, they used Simulink S-functions to create an interface to legacy C code that captured the nonlinear characteristics of the vehicle’s engine, torque converter, and brakes.

The team ran closed-loop simulations in Simulink to assess controller performance under various driving scenarios, including traffic jams and high-speed driving. They postprocessed and visualized simulation results in MATLAB.

Based on the simulation results, they modified controller weights and constraints to prevent the vehicle from braking suddenly and from allowing wide gaps to open between vehicles if the lead vehicle accelerated sharply. They also evaluated different choices for sample time, prediction time, and control time to reduce the computational load of solving an optimization problem.

The team generated more than 3400 lines of code optimized for execution speed from their MPC-based adaptive cruise controller with Embedded Coder®. The generated code included the quadratic programming (QP) solver used by the MPC.

After testing the generated code via software-in-the-loop (SIL) simulation, they deployed it to the production 32-bit microprocessor. Hitachi Automotive Systems is currently conducting on-road tests of the MPC-based ACC system on public roads.

The engineering team has expanded its use of Model-Based Design with MATLAB and Simulink to several other projects, including one in which they shortened development time for a controller for four-wheel steering vehicles.


  • Controller development time halved. “With our traditional approach it would have taken about a year to develop a controller as complex as the MPC; with Model-Based Design it took us about six months to develop a prototype,” says Takahama. “The generated code for the QP solver was extremely efficient, so there was no need for us to explore other solvers.”
  • Months of hand-coding eliminated. “Writing all the code for the MPC by hand for each design iteration would have added two months or more to our schedule,” says Takahama. “With Embedded Coder, once we had confirmed the functionality of the controller it took almost no time to implement it on the embedded processor.”
  • Testing speed and efficiency increased. “Model-Based Design saved us a tremendous amount of testing time,” says Takahama. “We recreated the test results in SIL simulations, which enabled us to identify the causes of problems that occurred, evaluate proposed countermeasures, generate code with the needed changes, and repeat the process as needed to verify correctness.”