Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use SIL(Software in the Loop) before HIL(Hardware in the Loop) if MIL(Model in the loop) simulation is already performed?

I have implemented a new controller logic in simulink and tested it using MIL(Model in the Loop) simulation.

  1. Is it mandatory to perform SIL before going to HIL?
  2. What kind of errors can be found in SIL which can't be detected in MIL?

Please help me with one example.

like image 688
Leo Avatar asked Mar 15 '23 13:03

Leo


1 Answers

I wouldn't say it's mandatory, but it's good practice.

By doing MIL testing, you are testing the controller logic is functionally and algorithmically correct. When you move to SIL testing, you are actually testing the code generated from the model (for the controller part), whereas in MIL, you are testing the controller algorithm as implemented in Simulink, not the C code. Granted, the C code is generally compiled as a Windows DLL for SIL testing, so you are not testing the final implementation of your controller, but it's still a step in the right direction. If you are generating the C code and compiling on the final controller hardware (with a serial connection to the PC running the plant model), it's even better. The other thing you are not testing for is real-time execution.

Basically, with MIL you are detecting errors in whether your controller as implemented in Simulink is suitable for code generation (data types, sample times, etc...) and whether there any bugs/issues with the code generation process (unlikely but still possible).

Moving to HIL gives you even higher confidence as now both the plant model and controller model run in real-time, so you are exercising the code generated from your controller logic, implemented on its final hardware, in as realistic conditions as possible.

It's all about reducing risks and increasing confidence as you progress through the development cycle.

like image 178
am304 Avatar answered Apr 29 '23 06:04

am304