Model-Based Development Offers Many Possibilities
Model-based development is part of a development process, e.g., the V-model. Model-based development starts by describing the requirements for functions or algorithms that the new system should cover. Step by step, detailed requirements are derived from an initial rough description and then a model is created. The next step is to test against the requirements. In model-based development, the system requirements are modeled mathematically. The model described in this way is then tested in the simulation. The program code is then generated at the click of a button. The goal: At the end of the development, the C code for a controller function has been generated and tested.
Very different use cases can be covered with model-based development. At dSPACE, the focus is often on the development, adaptation, or expansion of control functions in electronic control units.
As part of a development project, functions or devices have to be developed, simulated, and tested. Many different methods and techniques are used, from the initial question of what the system should be able to do, the creation of prototypes with which functions are tested (rapid control prototyping, RCP), to the associated model tests (model-in-the-loop, MIL), and the tests of the software and hardware of the finished product (software-in-the-loop (SIL), hardware-in-the-loop (HIL)).
Developing Software Architecture and Testing with MIL
The first step in model-based development is always to describe the problem: What are my requirements? What should a new system be able to do, which function should be developed, or does an existing control algorithm need to be revised? With the help of various software products, executable models are created with which these functions can be developed, programmed, and tested better.
With the model-in-the-loop (MIL) method, a model of the technical system can be created on the computer using MATLAB®/Simulink® and then simulated in order to draw initial conclusions about the system.
Rapid Control Prototyping (RCP): Testing in a Real Environment
Rapid control prototyping is used to develop or test functions or controllers of a control unit – in a real environment. In an existing test setup, such as a vehicle, the real-time prototyping system replaces the controller or control unit.
The real-time prototyping system can serve either as a complete replacement for the full range of functions of the target ECU (full-passing) or as an extension to the target ECU in order to develop new additional controller functions (bypassing).
The RCP system offers high computing power as well as numerous different interfaces and enables fast development cycles and efficient data monitoring at run time, thanks to easy access to the platform. This means that the application possibilities for development and testing are significantly greater than if the actual control unit were used.
Code Generation: Automatic Code Generation TargetLink
The functions have been tested and are running. In a last step, production code is required to implement the functions on the control unit. Production code generation is the logical step for converting models into efficient, production-ready code. Here, dSPACE offers a wide range of products that support this process. Versatile code configuration options ensure that the production code can handle processor constraints.
HIL Tests: Hardware-in-the-Loop-Simulation
To keep it short: In hardware-in-the-loop testing, the real electronic control unit is connected to a real-time simulation system that simulates the real environment of the electronic control unit using a simulation model. Through the interaction between the simulation system and the test object, control loops (in-the-loop) can be closed and the system behavior can be validated in addition to the pure software functionality. A typical task is the integration of a new electronic control unit function into a vehicle. The HIL test offers the advantage that simulated vehicles and environments can be used to test safety-critical situations under reproducible conditions without endangering the user.
SIL: Software-in-the-Loop
Software-in-the-loop (SIL) tests can be used for almost all development phases within the development and implementation process. From early individual function tests to comprehensive validation of entire systems. Only the pure software, i.e., the C code of the function, is required for these SIL tests. The real hardware of an ECU, on which the code is later executed in the vehicle, is not necessary for this test phase. The simulation and test execution can be carried out on standard PCs (or in the cloud).
The tests can start at an early stage of the development process. Any errors in the developed function code can therefore be detected and eliminated at a very early stage. This accelerates the development of the control units. Costs for complex hardware test procedures can also be saved.
SIL tests are carried out using simulation platforms on normal PCs. The functions to be developed can thus be put through their paces – as much and as often as the developer wants or needs. The test environment simulates both the control function to be tested and the system to be controlled, e.g., a vehicle on a road. With SIL tests, a large number of faults can be detected and rectified long before the real system, e.g., the vehicle, is available.