Introduction to model-based software development
Model-based software development fuels Industry 4.0 as it enables the integration of cyber-physical systems, the Internet of Things, smart manufacturing, and other processes. Since it facilitates system design, simulation, and execution, it empowers industries to optimise processes, reduce development time, and maintain precision in implementing cutting-edge technologies. In this article, you will learn about the fundamentals of model-based software development, how it supports Industry 4.0, and what you can do to implement it in your manufacturing.
Model-based development, also referred to as MDB, is a software development approach that uses models to design and simulate complex systems, from automated code generation, testing, to validation. This streamlines development, reduces errors, and accelerates the release of software.
Model-based development assumes that the models created accurately represent the real-world system or application. The accuracy of these models is crucial for reliable simulation and prediction of system performance.
The approach includes a few other important assumptions about the system’s dynamics, behavior, and interactions.
What are the key assumptions of model-based development?
MDB assumes that models are the primary source of information for developing systems, replacing traditional code-based development in many aspects. Model-based development is based on a few ideas:
- Models accurately represent the real-world system or application. This includes assumptions about the system’s dynamics, behaviour, and interactions.
- All necessary requirements for the system are well-defined and captured within the model. This includes both functional and non-functional requirements.
- The simulation environment used to test and validate the models accurately mimics real-world conditions.
- MBD often relies on the ability to automatically generate production-ready code from models. This assumes that the generated code will be correct, efficient, and reliable.
- The development process will be iterative, allowing for continuous refinement and validation of the models based on feedback from simulations and testing.
How model-based development influences Industry 4.0?
MBD is widely used in industries such as automotive, aerospace, industrial automation, and robotics where they perform different tasks.
Enhanced predictive maintenance
This approach allows the creation of digital twins that simulate real-world machinery behaviour. These models feed machine learning algorithms to predict equipment failures and optimise maintenance schedules.
Use case: Machine learning models like CNNs and LSTMs analyse data from digital twins to forecast remaining useful lifetimes of industrial components, such as bearings or batteries.
This helps to reduce downtime and costs, particularly in sectors like energy and manufacturing.
Optimisation of energy and resource use
MBD can create dynamic simulations which identify inefficiencies in energy consumption. Models integrate IoT data to forecast energy demand and optimise usage in real time, for example, in heat pumps and smart grids
Use case: Techniques like reinforcement learning help MBD-generated models to optimise UAV trajectories in agriculture or logistics.
Autonomous operations
Model-based development enhances the development of autonomous systems through robotic control and smart manufacturing. Combining reinforcement learning and CNNs for tasks like object detection and pick-and-place operations.
Use case: MDB can be also used to simulate production lines to test robotic workflows before physical implementation.
Digital transformation
MBD helps integrate Industry 4.0 components, such as IoT or AI, into enterprise architecture models, allowing interoperability between legacy systems and new technologies. At the same time, virtual models reduce reliance on physical prototypes, cutting development cycles and costs.
This approach is used for developing complex systems like control systems that involve significant control logic. This is particularly important in the case of electric vehicles, aircraft systems, or industrial machinery.
What are the limitations of model-based development?
It’s a powerful methodology, but comes with several limitations in terms of costs, complexity, tools, or skills.
Initial setup cost
Implementing model-based development requires significant investment in tools, software, and training. Acquiring licenses for specialised tools like MATLAB/Simulink or dSPACE can be expensive, especially for smaller organisations or projects with limited budgets.
Covering learning materials, trainers, and time spent in training sessions can further strain resources. On average, companies spend hundreds of dollars per employee annually on training, which also includes indirect costs such as productivity loss during training periods.
Complexity in large systems
Managing models for complex systems presents challenges in synchronisation and debugging. As systems scale, the interdependencies between components increase, making it difficult to ensure consistency between the model and the code generated from it.
In large-scale applications like aerospace systems, even minor discrepancies in models can propagate errors throughout the system. Debugging such systems often requires additional reporting mechanisms to track updates and changes effectively.
Tool dependency
Model based development workflows often rely on specific tools, for example, MATLAB/Simulink or dSPACE, which can lead to vendor lock-in.
This dependency limits flexibility and adaptability, as switching tools or integrating alternative solutions can be costly and time-consuming. Moreover, incompatibilities between tools used by different teams or supply chain partners can create integration challenges.
Specialised skill set
Engineers working with MBD need specialised knowledge of modeling languages, methodologies, and tools. The steep learning curve associated with mastering these tools can temporarily reduce productivity during the initial adoption phase.
Are there clients from the industry and automotive sectors who won’t be interested in MBD?
Indeed, there are certain types of clients who might not find model-based development suitable or appealing.
- Companies with established traditional workflows: Organisations heavily reliant on traditional development methods, such as manual coding or 2D drawings, may resist adopting MBD due to entrenched processes and cultural inertia. For example, industries like mining equipment manufacturing or smaller automotive suppliers often prefer sticking to workflows that prioritise simplicity and familiarity over the complexity of MBD. Resistance from veteran staff who are accustomed to traditional approaches can further hinder adoption, as they may perceive MBD as unnecessary or too complicated.
- Small and medium businesses: SMBs with limited budgets may struggle with the high initial costs of implementing MBD, tools like MATLAB/Simulink, and investing in training programmes. The upfront investment may outweigh the perceived benefits for companies with smaller-scale operations. Also, SMEs often lack the specialised workforce required to effectively use MBD tools, making it impractical for them to adopt this methodology.
- Industries with low complexity products: Companies producing relatively simple products or systems may not see the need for MBD’s sophisticated modelling capabilities. For instance, manufacturers of basic mechanical components or non-electronic automotive parts might find MBD excessive for their needs. In such cases, the complexity added by MBD workflows may not justify the benefits, especially when simpler design and testing methods are enough.
- Companies facing integration challenges: Industries where interoperability between different teams and systems is critical may find MBD difficult to implement due to the lack of a universally accepted integrated approach. This can lead to inefficiencies and miscommunication among stakeholders. For example, automotive OEMs and their suppliers often face challenges in synchronising models across different platforms, which can complicate collaborative efforts.
Is MDB only applicable to large players? Can smaller companies also be interested?
Even though MDB is mostly associated with large players in automotive, aerospace, and heavy industry, smaller companies can also benefit, especially if they develop systems with control logic or embedded software.
With the increasing availability of cost-effective tools and cloud-based platforms, model-based is gradually becoming more and more accessible to smaller firms as well.
- Cost reduction and efficiency: MBD reduces reliance on physical prototypes by enabling virtual simulations, which can save costs and accelerate development cycles. This is beneficial for smaller firms with limited resources. Low-code platforms like Mendix make MBD accessible to teams with varying skill levels, allowing smaller companies to develop applications faster and more efficiently.
- Improved product quality: MBD supports iterative testing and refinement through techniques like Model-In-Loop and Software-In-Loop, ensuring high-quality products even for smaller-scale operations.
- Adaptability to Industry 4.0: Small and medium businesses in Industry 4.0 can use MBD to innovate their processes and integrate smart technologies into their operations, such as IoT or automation systems.
- Access to low-cost tools: Open-source tools like Sirius provide affordable options for smaller companies to adopt MBD without the need for expensive proprietary software.
What are the main benefits of MBD compared to traditional software development methods?
The advantages of model-based development compared to traditional software development methods are particularly visible in complex systems.
Automatic code generation
MBD tools like MATLAB/Simulink and Simulink Coder automatically generate production-ready code from models, significantly reducing the risk of manual coding errors. By automating code generation, MBD shortens development timelines, allowing teams to focus on higher-level tasks rather than repetitive coding efforts.
Better integration across teams
MBD provides a shared visual representation of the system through models, facilitating collaboration between software, hardware, and system engineers. This unified approach ensures alignment across teams and reduces miscommunication.
Models are accessible to both technical and non-technical stakeholders, fostering better understanding and coordination between departments such as engineering, testing, and business analysis.
Increased efficiency
MBD automates many aspects of testing through techniques like Model-In-the-Loop (MIL) and Software-In-the-Loop (SIL), speeding up iterative refinement processes.
For real-time systems, MBD enables rapid adjustments during simulation to meet performance requirements without extensive manual intervention.
Model as a single source of truth
In MBD, the model serves as the single source of truth throughout the development lifecycle. This ensures traceability from requirements to implementation and minimises discrepancies between design intent and final output.
Maintaining consistency reduces rework and improves overall reliability by ensuring that all stakeholders work from a unified design blueprint.
Are there any specific industry standards that must be met when using MBD?
Certain industry standards are critical for compliance and reliability when using model-based development. This is particularly important in safety-critical domains. These standards provide frameworks for validation, verification, and traceability, aligning model-based development practices with industry requirements.
Automotive sector: ISO 26262
Purpose: ISO 26262 is the international standard for functional safety in automotive systems. It provides guidelines for the development of safety-critical electrical and electronic systems in vehicles.
Role in MBD: MBD supports ISO 26262 compliance by enabling rigorous validation and verification processes. For example, simulations can be used to test system behaviour against functional safety requirements, while automatic code generation ensures consistency between models and implementation.
Impact: Automotive manufacturers use MBD to meet ISO 26262’s requirements for Safety Integrity Levels (SILs), ensuring the reliability of embedded software in systems such as Advanced Driver Assistance Systems (ADAS) or autonomous vehicles.
Aerospace sector: DO-178C
Purpose: DO-178C is the standard for software development in airborne systems, focusing on safety-critical applications such as flight control or navigation systems.
Role in MBD: MBD facilitates compliance by providing traceability between requirements, design, and implementation. Techniques like Model-In-the-Loop and Software-In-the-Loop testing are used to verify system behaviour under simulated conditions.
Impact: Aerospace companies rely on MBD to meet DO-178C’s requirements for software verification, ensuring that models and generated code are reliable, and certifiable.
Industrial sector: IEC 61508
Purpose: IEC 61508 is the foundational standard for functional safety across industrial sectors. It applies to electrical, electronic, and programmable electronic systems.
Role in MBD: MBD supports IEC 61508 compliance by enabling systematic design processes that reduce risks of systematic errors. Validation tools ensure that models align with safety requirements throughout the development lifecycle.
Impact: Industries such as chemical processing, manufacturing, and energy use MBD to develop systems that meet IEC 61508’s requirements for fault tolerance and hazard mitigation.
Construction sector: BIM Standards (ISO 19650)
Purpose: In construction and infrastructure projects, Building Information Modeling standards like ISO 19650 define processes for managing digital information throughout the asset lifecycle.
Role in MBD: MBD integrates BIM practices by embedding all necessary product information directly into 3D models. This ensures consistency across design, simulation, manufacturing, and maintenance phases.
Impact: Construction firms use MBD to streamline collaboration among stakeholders and ensure compliance with BIM standards for data exchange and project execution.
How do these standards benefit model-based development?
Industry standards enhance the effectiveness of model-based development by providing structured frameworks for traceability, validation, consistency, and compliance.
Traceability
- Requirement alignment: Standards like ISO 26262 and DO-178C mandate traceability between requirements, design models, code generation, and testing results. MBD inherently supports this by using centralised models as the single source of truth, so all artefacts are linked and traceable throughout the development lifecycle.
- Error identification: Traceability allows developers to pinpoint the root cause of issues by linking runtime errors back to specific model elements or requirements. This facilitates efficient debugging and ensures that changes are applied at the model level rather than directly in code.
- Impact analysis: Traceability matrices derived from MBD help assess the impact of proposed changes on system requirements, design, and code, improving decision-making during maintenance or updates.
Validation and verification
- Simulation-based testing: Standards require rigorous validation processes, which MBD facilitates through simulations such as Model-In-the-Loop MIL, Software-In-the-Loop SIL, and Hardware-In-the-Loop HIL. These techniques verify system behaviour under various scenarios before physical implementation.
- Early verification: MBD enables validation early in the development cycle, reducing the cost of fault propagation and decreasing the time spent on testing at later stages. This aligns with industry standards that emphasise proactive error detection.
- Formal verification: For safety-critical systems governed by standards like IEC 61508, MBD can integrate formal methods to complement simulation-based testing. This provides mathematical proof of correctness for critical system components.
Consistency and interoperability
- Uniform modelling practices: Standards promote consistent modelling practices across teams and organisations. For example, MAAB guidelines ensure uniform interfaces in automotive applications, enhancing collaboration and reducing errors caused by inconsistent designs.
- Cross-team collaboration: By adhering to industry standards, MBD fosters interoperability between software, hardware, and systems engineering teams. This ensures alignment across disciplines and simplifies integration efforts.
Compliance automation
- Automatic code generation: Standards like MISRA-C (automotive) or DO-178C (aerospace) require adherence to strict coding guidelines. MBD tools automate code generation directly from models, ensuring compliance without manual intervention.
- Certification support: Compliance with standards often involves submitting safety cases or evidence of risk mitigation. MBD’s traceability and validation capabilities streamline certification processes by providing clear documentation of requirements fulfillment and testing outcomes.
What are the most common customer problems that model-based development solves?
Model-based development addresses several common customer problems across industries by leveraging its capabilities in simulation, automation, and system integration.
Time-to-market
- Accelerated development cycles: MBD significantly reduces the time required to develop and deploy systems by enabling early testing and validation through simulations. Developers can identify and resolve design flaws during the initial stages, avoiding delays caused by late-stage corrections.
- Automatic code generation: Tools like MATLAB/Simulink automate the generation of production-ready code directly from models, eliminating manual coding efforts and reducing development time. This streamlined process delivers faster iterations and quicker transitions from design to implementation.
- Real-time collaboration: Cloud-based platforms enable teams to collaborate on designs, prototypes, and testing from anywhere, further speeding up the product development process. For example, Fusion 360 facilitates agile workflows that shorten engineering change order cycles.
Quality assurance
- Error reduction: By minimising manual coding efforts, MBD reduces human errors that often lead to bugs in software systems. Automatic code generation ensures consistency between the model and the final implementation, improving overall reliability.
- Frontloaded testing: MBD allows for verification and validation early in the development cycle through techniques like Model-In-the-Loop and Software-In-the-Loop. This proactive approach catches errors before they propagate into later stages.
- Continuous improvement: Iterative development supported by MBD enables teams to refine models over multiple cycles, continuously improving system performance.
System complexity
- Simplified management of complex systems: MBD provides abstract representations of complex systems through models, making them easier to understand and manage. This is particularly beneficial for industries like automotive and aerospace, where embedded systems often involve intricate control algorithms and interactions between multiple subsystems.
- Integrated design approach: By serving as a single source of truth, MBD allows engineers to maintain consistency across hardware, software, and system-level designs. This integration ensures that all components work harmoniously within complex environments.
- Scalability: MBD supports modular design principles, enabling developers to reuse models across projects or scale them for larger systems without compromising quality or functionality.
What does the code library look like?
In model-based development, MBD, a “code library” is a collection of reusable, validated models or blocks of code that encapsulate standard functions or systems. These libraries streamline development processes by providing pre-tested components that can be easily integrated into new projects.
Are these libraries created for a specific business unit, or are they dedicated to specific projects?
Code libraries are versatile tools that can support both specific business units and individual projects.
On one hand, generic libraries are designed to be reusable across multiple projects within a business unit, providing a foundation of standardised components that enhance efficiency and consistency. These libraries often include common functionalities such as control algorithms or signal processing modules that are applicable across various projects.
On the other hand, some libraries are highly customised to meet the unique requirements of specific projects or product lines. These tailored libraries ensure that specialised needs are addressed without compromising performance or safety standards.
How does the process of adding missing parts of the code work?
Integrating missing code, such as external functions or legacy algorithms, can be achieved through various methods, each tailored to specific requirements and environments.
- Incorporating external code as standalone functions: MBD platforms like Simulink allow for the integration of external C/C++ code directly into models. This is often accomplished using S-Function blocks, which serve as interfaces between the Simulink environment and custom code. The Legacy Code Tool can automate the creation of these S-Function blocks, facilitating seamless integration.
- Embedding code within models: For scenarios where code needs to be embedded directly within the model, Simulink offers the C Function block. This block enables users to define and execute custom C/C++ code snippets as part of the model’s execution, allowing for precise control over the integration process.
- Direct invocation of external functions: Certain MBD environments support the direct calling of external functions written in languages like Python or C/C++. In Simulink, for example, the MATLAB Function block can utilise the coder.ceval command to invoke external C functions during simulation. Additionally, integrating Python code is feasible, enabling the incorporation of Python-based algorithms or data processing routines within the model.
Filling in the missing code
Addressing missing code involves a systematic process to ensure the model accurately reflects the intended functionality and meets all requirements.
- Initially, a thorough analysis is conducted to understand the feature’s objectives, the issues prompting the update, or the new specifications necessitating the change. This involves reviewing system requirements and identifying how the existing model aligns with or deviates from these goals.
- Following this, the model is updated to incorporate the necessary changes, adhering to established guidelines to maintain consistency and quality.
- Once the model is refined, code is automatically generated from it.
- This generated code then undergoes both static and dynamic analysis to detect potential errors or inefficiencies. Static analysis examines the code without execution to identify structural issues, while dynamic analysis involves executing the code in a controlled environment to observe its behavior and performance.
- After these analyses, testing is conducted to validate that the implemented changes function as intended, and that the overall system performance remains robust.
Implementing model-based development in your company
If model-based development is something that you need at your company, don’t hesitate to contact us.
At Spyrosoft, our team of experts specialises in delivering comprehensive model-based software development services tailored for Industry 4.0 and other sectors. Our expertise involves the entire development lifecycle, from initial requirements analysis to final implementation and testing.
Learn more and contact us to gain access to a team of seasoned professionals dedicated to delivering innovative and reliable software solutions.
About the author
Contact us