## 1 Introduction
### Motivation and Contribution  
All relevant aspects of how the implemented graphical model is carried out remain hidden when using one of these commercial HIL devices. The transition from prototyping to use in a real-world environment is an extensive, manual, and tedious process that often lacks the precision or continuous time solver solution capabilities used in the prototyping system.  
Furthermore, the development and testing process needs to be reconsidered from a software point of view, as it is not feasible to invest many years in developing software for embedded platforms given the current life expectancy. Mandatory security measures related to integrity, stability, error-free coding, and code quality assurance (e.g., MISRA C coding guidelines) must be considered. Nowadays, there is an increase in agile methods for software development, where testing is not complicated and occurs naturally after partial implementation of the code. The higher the level of abstraction in programming, the easier it is to test and find algorithm errors. Consequently, low-level hardware drivers are provided as graphical blocks, coded as a one-time implementation, and focusing on integrity and security reliability for this low-level and hardware-related part of the code.  
In trying to solve these problems and deficiencies, this work proposed a HIL workbench that is based on a COTS platform. It is designed to be suitable for prototype development and the deployment of controllers within a software development environment that includes custom MBD support. Additionally, the controller prototyping process is allowed for both industry and research purposes.  
Moreover, it can be employed for implementing control solutions and teaching control concepts in hands-on classes. This approach allows trainees to attain an appropriate level of complexity within a limited number of practical sessions, such as modeling and controlling actuators. Students themselves experiment with the results of their work on the HILtestbed and find that some algorithms, while useful in theory, are difficult to use on the HIL testbed due to computational limitations; or, conversely, they are only feasible with a highly abstract language.  
One of the main advantages of the proposed system is that when using a COTS-enabled HIL benchmark, the developer only needs to focus on solving the real problem and can abstract from the low-level hardware. Furthermore, another important advantage of the proposed system is that it generates an optimized C source code and avoids the complexity of having to program the algorithms and associated continuous-time solvers, such as Runge-Kutta. It should be pointed out that implementing these types of solvers without CAD-assisted tools take considerable time.  
In this sense, the proposed solution combines control hardware based on an STM32H7 microcontroller and a software development environment using graphics-based languages developed for MATLAB. This solution provides robust and energy-saving controllers and demonstrates that an advanced control algorithm can be set up in a critical safety-compliant low-cost embedded controller via a custom model-based design.  
Algorithms and tools are transferred to the controller without recoding tasks, avoiding losing the advantages gained in the prototyping phase.