- Dynamic test loading during model and test execution
- CAN support of real-time tests (based on RTI CAN MultiMessage Blockset)
- Use of MAT file data located on host PC for real-time stimulation of model variables
- Transparent variable access in multiprocessor systems
- Python objects can be easily exchanged between real-time tests and the PC Python script
- Real-time test management by scripting and dedicated graphical user interface
- Easy integration into customer test frameworks (AutomationDesk or others)
- Real-Time Test Library in AutomationDesk for convenient script management
Example Use Cases for Real-Time Testing
- Testing reactivity in a range of milliseconds
- Time-precise stimulation of several model signals
- Time-precise measurement of model changes
- Reliable determination of minimum and maximum values of model variables
- Dynamic execution of a Python restbus simulation not included in the simulation model
- Exact replay of recorded bus communication (like CAN or FlexRay log files)
- Parallel execution of several independent ECU tests
|
Implementing Real-Time Observer
A common test case is the detection of an event being generated by the real-time model. An event is specified by a condition referencing one or more real-time model variables. As soon as the event has been detected, a test action is triggered in the same sample step. In this example, the real-time script observes the speed of a simulated vehicle and reacts by performing an emergency stop maneuver immediately when the vehicle exceeds 80 km/h. This test case can be easily implemented by a real-time Python script. The condition is observed continuously within a While loop. The included yield command has the effect that the test execution is paused and afterwards resumed in the next simulation step. This means the script can easily be time-controlled. When the speed exceeds 80 km/h, the While loop is left, and the brake maneuver is initiated by setting the associated model parameter in the same simulation step.
|
 |
|
Implementing CAN Restbus Simulation
For programming a CAN restbus simulation, Real-Time Testing is conveniently integrated with the RTI CAN MultiMessage Blockset. The blockset contains an option for preparing CAN access for Real-Time Testing, so that real-time scripts are able to send and receive CAN messages with freely definable CAN IDs and contents. This makes it very easy to test case specific restbus simulation. These dynamic restbus parts (like ECU-specific CAN test messages) can be loaded and executed on the real-time hardware as required and have no longer to be a static part of the simulation model.
An example test scenario is the monitoring of an analog input signal. When a defined trigger threshold is exceeded, a predefined CAN message is sent cyclically every 50ms until the value goes below the threshold again. Another application example is taking CAN communication that was recorded during a test drive and replaying it in the laboratory with correct timing.
For programming a CAN restbus simulation, Real-Time Testing is conveniently integrated with the RTI CAN MultiMessage Blockset. The blockset contains an option for preparing CAN access for Real-Time Testing, so that real-time scripts are able to send and receive CAN messages with freely definable CAN IDs and contents. This makes it very easy to test case specific restbus simulation. These dynamic restbus parts (like ECU-specific CAN test messages) can be loaded and executed on the real-time hardware as required and have no longer to be a static part of the simulation model.
|
 |
Describing Real-Time Tests in Python
|
Automated testing usually is performed by executing tests on a standard PC connected to the hardware-in-the-loop (HIL) system. However, 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. AutomationDesk’s Python scripts for real-time testing are the answer. They run on the processor board of the HIL system in real time, i.e., synchronously with the model, so all test actions are performed on a real-time basis. This opens up expanded test options with dSPACE simulator. Reactive tests which respond to changes in model variables within the same simulation step can be implemented. Time measurements in tests are also far more precise, as there are no latencies in communication. Simulation step size is now the only limit to the maximum time resolution of measurements.
|
 |
Many customers asked for portation of Real-Time Testing for the MicroAutoBox. This support was released in late 2008, so that Real-Time Testing can also be used for rapid control prototyping and in-vehicle scenarios. Real-time replay of measured data and implementing a CAN gateway on the MicroAutoBox are examples of applications.
Real-Time-Capable Python Interpreter
A real-time Python interpreter, running on the processor board along with the model, allows the script to execute synchronously with the model. The interpreter can execute several real-time tests simultaneously and independently of one another. The tests can interact with the simulation model in real-time via the memory on the processor board. You can therefore observe and influence the ECUs connected to the HIL simulator in every individual simulation step.
The Python interpreter is added to the application during the translation process via a Real-Time Workshop build option. You can formulate real-time tests using standard Python scripts from the real-time testing libraries provided with AutomationDesk (for example, for accessing model variables and executing several test branches within one real-time test in parallel). You can also create your own Python libraries and reuse them in several tests. The tests you have created can be loaded from the PC to the simulator’s processor board or MicroAutoBox and executed regardless of whether there is a real-time test already running. Even though executing the real-time tests requires additional memory capacity and computing time, it is no problem to implement typical test scenarios. On HIL processor boards, they even run in parallel to complex engine and vehicle dynamics models, at simulation step sizes of 1 ms.
|
Implementing Real-Time Stimulus
In many test scenarios, recorded data for ECU stimulation has to be replayed with correct timing. For this, Python real-time scripts can perform precisely timed stimulus generation on predefined model variables. One example is a sine generator that can be implemented by means of the standard sine functionality of Python’s math module (see scripting example).
|
 |
Recorded measurement data can also be replayed via an intelligent load mechanism, in which the Python real-time script references a recorded file (MAT file) on the PC's hard disk. The script links data vectors in the file to the target parameters in the model. If the real-time test requires data to be replayed exactly 50 ms after a specific CAN message is received, for example, a simple replay command in the Python script triggers real-time-capable data transport from the PC to the real-time hardware in time for that to happen. The automatic load mechanism supports the replay of large data volumes, such as test drive log files several hundred MByte in size. Several replay processes can run simultaneously, and they can all be controlled independently of one another. In a multiprocessor system, it is even possible to stimulate on several subnodes time-synchronously.