Skip to main content
UPM Racing Workflow search search close
Designing, prototyping, and testing formula student racing cars

Digital Twin Innovation in Automotive Applications

The Formula Student team of Universidad Politécnica de Madrid, UPM Racing, successfully developed and tested a torque vectoring system and secured the runner-up position at the Simulink Student Challenge 2020.

We congratulate the whole team, especially Daniel Garcia, for this excellent performance and are pleased to contribute to the success with our sponsoring support.

Torque Vect., ECU programming and HIL test bench development using Simulink

Torque Vect., ECU programming and HIL test bench development using Simulink

Watch video

Project Overview

To successfully develop and test their race car's torque vectoring control system, UPM implemented a strategy using Simulink, Stateflow, and Simscape together with a Baseline real-time target machine. To test the system, UPM team members had to build a Simulink model containing the driver inputs, including actuators and vehicle dynamics. To achieve authentical race car dynamics, they relied on the Vehicle Dynamics Blockset™and the Powertrain Blockset™ from MathWorks.

Deploying this digital twin from within Simulink seamlessly onto the Speedgoat real-time target machine enabled the controller's validation using generated code from PLC Coder and running it against the plant model. To implement the torque vectoring algorithm, the UPM team used the initial torque, yaw control, and traction control using state machines feeding the data back into the racecar's digital twin.

Furthermore, Simulink Real-Time Explorer™ is used to provide actuator inputs and modify driving conditions for real-time testing. Overall, this project showcases an entire workflow of the torque vectoring algorithm's implementation from model to deployment on hardware in a Hardware-in-the-Loop (HIL) environment entirely using MathWorks' products. 

Why Hardware-in-the-Loop Testing of Digital Twins?

There are different reasons why Formula Student teams use digital twins to perform HIL testing. Let's look into the most important ones:


Speed and Safety

Formula Student teams don't have a vehicle to test their new control designs during most of the season since it's usually being manufactured in parallel. HIL testing using digital twins allows testing control algorithms early and optimizing them in virtual design and testing loops.

UPM Racing Workflow

Racetrack testing is time- and resource-demanding. Most teams apply it only in later stages where the real-world car is required. To ensure the real-world car can maneuver various racing situations, a scheme similar to the one of UPM Racing, allows for testing edge cases and simulation system failure systematically.


Just One Prototype

Like F1 and America's Cup teams, there aren't many prototypes or light vehicles available due to the enormous production and service costs. Formula Student teams also strive a season-long to appear reach-ready with their single racecar at an event and be competitive. It is just not worth it to employ your only prototype for tests that can be done in simulation. 


Instrumentation and Test Automation

Digital twin simulation leveraging Speedgoat hardware, the ecosystem of Simulink and its toolboxes allows for establishing two lean testing workflows. You can design apps with App Designer to tune parameters and monitor signals from real-time applications. This allows even non-Simulink users to carry out testing tasks. Simulink Test™ provides tools for automating executing routine, simulation-based tests of models, generated code, and simulated or physical hardware. 

MathWorks products used

  • Simulink®
  • Simulink Coder™
  • Simulink PLC Coder™
  • Vehicle Dynamics Blockset™
  • Powertrain Blockset™
  • Stateflow®



Follow Speedgoat LinkedIn