Basics of Real-Time Testing

Introduction

Real-Time Testing (RTT) can be used for tests that require high timing precision. Automated testing is usually performed by executing tests on a standard PC connected to a hardware-in-the-loop (HIL) system. But this method often cannot cope where greater timing precision is required, for example, if ECU interaction has to be captured and responded to in a range of milliseconds.

Real-Time Testing uses Python scripts (RTT sequences), which run on the simulation platform, for example, a dSPACE HIL system. RTT sequences run synchronously with the simulation application, so all test actions are performed on a real-time basis and are 100% reproducible. This opens up expanded test options. Reactive tests which respond to changes in model variables within the same simulation step can be implemented. Time measurements in tests are more precise. The simulation step size is the only limit to the maximum time resolution of measurements. RTT sequences can be executed on real-time hardware and on VEOS as offline simulation. Therefore, the RTT sequences can be reused seamlessly throughout the entire development process – from SIL to HIL testing.


Real-Time Testing (RTT)

RTT sequences are downloaded to the simulation platform and a Python interpreter embedded on the simulation platform executes the RTT sequences in each sampling step. The simulation application and the RTT sequences are executed in the same sampling step and the execution of the RTT sequences requires additional computing time. View the following illustration:


Example used in this tutorial

Introduction

A running simulation application is mandatory for Real-Time Testing. You can execute RTT sequences only interleaved to a simulation application. The simulation application used for this tutorial has the name turnlamp and is included in the ready-to-use demos of Real-Time Testing. The turnlamp simulation application controls the turn signals and the warning light of a vehicle.

Simulation application

Simulation applications can be executed in real-time on dSPACE real-time hardware or on a host PC with VEOS. Simulation applications can be built from MATLAB®/Simulink® simulation models. For this tutorial, simulation applications as well as ControlDesk projects are already provided for all supported platforms. You can use ControlDesk to load and start the turnlamp simulation application on your simulation platform.

Simulation model

A simulation model implemented in MATLAB/Simulink is required for the build process of a simulation application. View the following illustration to get an overview of the simulation model used for the turnlamp simulation application.

Controlling the simulation application

You will use a ControlDesk layout to control the simulation application.

The ControlDesk layout provides the following control elements:

  • Turn signal lever with the positions: Left, Right or Off.

  • Warning light switch with the positions: On or Off.

  • Adjustable battery voltage between 6 … 15 V:

    • UBattery ≤ 8.2 V: The receiver in the front ECU and rear ECU becomes unstable.

    • UBattery ≤ 7.2 V: The ECUs will collapse completely.

Real-Time Testing

In this tutorial, you will use RTT sequences:

  • To get basic information about RTT features.

  • To access and stimulate variables from the simulation application.

  • To implement observer functions.

  • To automate tests and to exchange data between the simulation platform and the host PC.

  • To experiment with a realistic use case.

  • To implement CAN and Ethernet communication.


Redaction