Combine was commissioned to develop a model in Simulink, automatically generate C code with Simulink Embedded Coder and integrate the code into the customer’s existing toolchain.
We began by carrying out a pre-study to investigate the introduction of Model-Based Design (MBD) using the Mathworks toolchain. The project was implemented for part of the control system that controlled the torque limit.
Using the Simulink tool we developed a complete model for torque control. Combine also created a test environment and library. This would allow the customer to continue using MBD after completion of the pre-study. By developing a trial plan and generating measurement data from a measurement rig, the project team was able to verify agreement between the simulated and measured results. Code was then automatically generated and the C code was run in a Texas Instruments C2000 environment.
In the final stage of the pre-study the generated code was run in the test rig. The results were satisfactory and showed that the torque was regulated correctly.
Thanks to the use of a model-based approach the project team was able to identify and correct a previously unidentified error in the existing code. The customer had been aware of problems with the control system in its products for some time, but had not been able to identify them.
We learned from this project that it was feasible and appropriate to use Simulink to develop the customer’s control algorithms. The automatically generated code was easy to integrate and the ability to carry out simulations and virtual verification instead of manual tests on a physical product shows excellent potential.