User Stories

Vehicle Systems Integration Designs Hardware-in-the-Loop Simulator for the U.S. Department of Transportation


Design a hardware-in-the-loop simulator that integrates and tests all of the major electronic components of a heavy truck


Use Simulink to design and validate plant models, Simulink Coder to automatically generate C code, and Simulink Real-Time to run the code on real-time hardware


  • Development time reduced by months
  • Design changes implemented quickly
  • Costs reduced by detecting problems in the lab

“Simulink, Simulink Coder, and Simulink Real-Time exceeded our expectations for this project. The speed with which we designed and ran our models on our target hardware was astonishing!"

Larry Long, Vehicle Systems Integration

By 2005, industry researchers predict that the average vehicle will include more than 50 electronics controllers. Integrating all of the electronics connected to the vehicle network and ensuring everything works properly can be a difficult and costly task for suppliers to address on a test track.

Vehicle Systems Integration (VSI) of College Park, Maryland, used MathWorks tools to design a hardware-in-the-loop simulator as part of a heavy truck networking study for the U.S. Department of Transportation (DOT).

The simulator integrates all of the electronic control units (ECUs) from a heavy truck in a laboratory environment, enabling VSI to simulate the vehicle dynamics and perform repeatable maneuvers without conducting costly test track runs.

“MathWorks tools enabled us to develop a modular system that lets us pull one subsystem of the truck out of the loop and replace it with a similar subsystem,” says Larry Long, cofounder of Vehicle Systems Integration. “We can swap engine models and engine ECUs very quickly to ensure they can be integrated and are fully functional.”


VSI sought to design a hardware-in-the-loop simulator that consists of models representing each major heavy truck electronic component. The models would need to be run on multiple target PCs that were networked
together to simulate the truck’s dynamics.

To avoid customizing components, they would also need to use a range of off-the-shelf hardware for the target computers and various vendors’ I/O cards for their simulator.

“Our customers are experiencing integration issues associated with the large number of ECUs on heavy trucks,” explains Long. “Marrying all of those ECUs together from different vendors and ensuring they work correctly and safely is critical.”


After defining the simulator requirements, VSI identified the major components of the truck and purchased off-the-shelf hardware to build the simulator. This enabled them to begin testing the Society of Automotive Engineers’ J1939 recommended heavy trucking networking practice for the Department of Transportation, Federal Motor Carrier Administration.

Using Simulink®, VSI developed and simulated plant models for all of the major heavy truck components, including the engine, transmission, vehicle, instrument panel, collision avoidance system with adaptive cruise control, and anti-lock braking system with traction control.

They then validated their models by comparing the performance with data obtained from an actual truck with a similar configuration as the simulator. Tuning the parameters within the Simulink models helped them obtain a high-fidelity representation of the physical plant of the truck.

VSI then automatically generated C code from their models using Simulink Coder™, and ran the code in real time on the simulator’s distributed PC processors using Simulink Real-Time™. The PCs use Athlon processors, I/O cards for each ECU, and a high-speed CAN network that enables parameters to be exchanged among the models in real time. This configuration lets VSI run simulations of the entire truck dynamics.

“The predefined libraries within Simulink Real-Time expedited the development process for us,” notes Long. “We just drag and drop new I/O blocks and get them running much more quickly than if we had to write I/O drivers at the code level in C.”

For their hardware, they used counter timer cards, buffered and nonbuffered digital I/O cards, and other I/O hardware from several vendors—all connected using the PCI bus. The separate ECU simulators were interconnected using the CAN networking support provided by Simulink Real-Time. This multiprocessor system was run at 1 KHz.

“Simulink Real-Time gave us the greatest range of target hardware and I/O interface cards on which we could run our models,” says Long. “We really liked the breadth of hardware support.”

VSI is currently testing the system using a driver’s station. The target PC connected to the driver’s station sends out timing signals and serves as the timing master for all of the other target PCs. They will deliver the results of the J1939 study to the DOT.


  • Development time reduced by months. “It took us under two weeks to get our hardware running using Simulink Real-Time,” says Long. “I estimate that using C would have taken us months given the complexity of our setup.”

  • Design changes implemented quickly. "To make changes, we simply open a Simulink model, fix a parameter or rewire a block, and then compile the models and download and run them on the target,” explains Long. “Doing this takes us less than three minutes for any target model and less than seven minutes for all six targets.”

  • Costs reduced by detecting problems in the lab. Using Simulink Real-Time to run hardware-in-the-loop simulations, VSI can now quickly solve their customers’ costly integration issues by identifying and resolving problems in the lab instead of in the field.