Baker Hughes used Model-Based Design with MATLAB® and Simulink® to establish a new development process. They began by testing their existing algorithms in desktop simulations, and then used modeling and automatic code generation to improve the algorithms.
Working in Simulink, Baker Hughes engineers created an environment model that captured the effects of downhole shocks and vibrations, as well as sensor models that included filters, analog-to-digital converters, and other electrical and mechanical components.
The team then used S-functions to create Simulink blocks of their existing C algorithms. They combined these blocks with the environment and sensor models to run system-level simulations.
Together with other experts at Baker Hughes, the team created test cases to replicate drilling scenarios, and ran simulations in Simulink to test the existing algorithms in these scenarios.
The team used the result of the simulations to debug and improve their existing C algorithms and to guide improvements to the hardware design, including the analog filters.
To conduct hardware-in-the-loop (HIL) tests, the team generated code from the environment and sensor models using Embedded Coder® and deployed it to a real-time processor. This setup enabled the team to run tests of their entire system—including algorithms, sensors, and environment—in the lab for the first time.
Analysis of simulation and HIL results revealed opportunities for algorithm improvements, which the team implemented by redesigning and improving the original C algorithm in Simulink. During this phase, the team developed Simulink unit tests for each function in the new design. These tests were run continually throughout development.
They used Simulink Check™ and Simulink Coverage™ to check compliance with MathWorks Automotive Advisory Board (MAAB) modeling standards and measure model coverage of their test cases.
Using Embedded Coder they generated the algorithmic part of the system code from the Simulink algorithm model for their production floating-point processor. This accounts for approximately half of the code for the complete system.
The group shared their system model with other engineering teams within Baker Hughes, enabling those teams to run system-level tests on their own projects.