Back to the glossary
Embedded and systems
Model-in-the-loop (MiL)
Model-in-the-loop refers to tests in which a functional model, such as a controller in Simulink, is simulated together with a model of its environment before any code exists.
Also known as: MIL testing
Where does MiL fit into development?
In model-based development, a function is first created as an executable model. With MiL, this model is simulated in a closed loop with a model of its environment, for example a motor controller with a model of the motor. This makes it possible to evaluate algorithms long before code is generated or hardware is built.
The chain MiL → SiL → HiL
- MiL: model against a simulated environment. Checks the concept.
- SiL: generated or hand-written code on a PC. Checks the implementation.
- HiL: code on the real control unit. Checks how it works with the hardware.
Reusing the same test cases at every stage makes it possible to pinpoint differences between model, code and hardware.