zuruck zur Themenseite

Articles and background information on the topic

Mathworks

Jens Lerche und Dr. Marc Segelken | Andrea Gillhuber,

Agile development with model-based design

More and more functionalities in production machines are being implemented using software. This makes the development and testing of machines more complex, and conventional methods are reaching their limits. Model-based design enables the agile development of mechatronic systems.

© magr80; papa papong/stock.adobe.com / Mathworks

As mechatronic devices, machines are usually developed in series. This means that the mechanics are designed first, then the electrics and finally the software. However, as the complexity and scope of the software in particular are constantly increasing, there is a greater risk of errors or problems only being noticed during commissioning and therefore losing time to competitors or not being able to meet delivery deadlines.

In addition, CAD models of the physical components are often used to create kinematic models, which are then simulated. Basically, however, it should be the other way around: The first step should be a tested and validated kinematics model from which CAD assemblies are derived. In this way, virtual commissioning of the machine can take place at an early stage using simulatable models before the parts to be manufactured are finalized. This gives the developers time to test the functioning of the software with the mechanics of the machine at an early stage, try out alternatives and refine the mechanics before the final appearance of the components has been determined.

Advertisement

Advantages of virtual commissioning

Figure 1: 3D modeled example of a route for material transport with two robot arms.

© Mathworks

Commissioning a machine or system can account for up to 25 percent of the total time required, of which around 70 percent is currently spent on completing the software. To shorten this time-consuming step, machine manufacturers are increasingly using virtual commissioning (VIBN) with the help of executable system models. This allows the machine to be simulated, sometimes even in 3D, and the functionality of the mechanical system and its interaction with the software to be tested(Fig. 1).

The advantages of such a VIBN are up to 75 percent shorter commissioning times and significantly more mature hardware and software at the start of construction. Software developers in particular can also start their work earlier. In addition, a VIBN allows critical states to be tested without having to fear damage. In addition to shortened commissioning on site, the use of models allows early detection of design errors and thus indirectly a higher capacity for innovation, as new ideas can be "tried out" more quickly(Fig. 2).

It should be noted that greater accuracy in modeling is always accompanied by a non-linear increase in effort. You therefore need to be clear from the outset about the level of detail you want and actually need.

Figure 2: Comparison of conventional development (top) with parallelization using model-based design (bottom).

© Mathworks

Using models right from the start

Creating models only for a VIBN also wastes their actual potential to accelerate and improve development. The highest return on investment is achieved when models form the basis of development from day one, starting with the system architecture and the definition of the individual components. This methodology is called model-based development or model-based design(Fig. 3). The consistent use of models as a core element of model-based design, on the other hand, offers clear advantages, as this development methodology already includes the concept of VIBN.

The underlying models are mainly constructed graphically. This is done, for example, using libraries with blocks, functional equations or completely preconfigured components. These are available for all relevant domains such as mechanics, electrics, electronics, hydraulics and pneumatics etc. as well as for the design of controls, regulations, logics, state machines or user interfaces. Program code or AI components can also be integrated into models.

Figure 3: Model-based design workflow for the development of technical systems.

© Mathworks

Such models clearly represent the system as an executable specification and contain its components, including the connections and interfaces.

Requirements can be directly and traceably linked to components and software. At every point in the development process, tests can be used to verify whether the system works as intended and fulfills the requirements.

Each component is iteratively refined and contains well-defined interfaces. This modularity makes it possible to develop components in parallel that would normally be created one after the other, which speeds up the process. In this way, the model grows step by step into an increasingly realistic representation of the overall system, which can be tested and validated from the outset. Errors are thus detected earlier and can be rectified more easily, more cost-effectively and with less delay(Fig. 4).

Figure 4: Robot arm: Integration of CAD and electrical control to optimize trajectories and control logic.

© Mathworks

Signal flows and states can be monitored and logged at any point. Once created, test cases are used continuously and can be processed and evaluated overnight in a batch-controlled and parallelized manner. In particular, the hardware can also be easily modified without having to be available. This allows hardware and software to be optimized in a depth that would not be possible in terms of time or cost without simulation. The traceability of requirements to the model and back as well as automatic report generation ensure transparent documentation of the entire process with comparatively little effort.

Code generation and validation of the real control system

One of the key advantages of model-based design is the ability to automatically generate software from the model, such as code for structured text and ladder diagrams in accordance with IEC 61131-3. Code generators and integration tools are also available for other programming languages such as C/C++ and various hardware platforms, such as FPGAs, microcontroller systems-on-chip or web and cloud services, which enable the efficient and optimized implementation of technical systems in a wide range of application fields (Figure 5).

Figure 5: Use of models and code generation in different development phases.

© Mathworks

The platform on which this code is later executed is primarily unimportant. The starting point is always the same model - so the developers do not have to commit themselves from the outset. This flexibility makes it possible, for example, to use different control systems depending on the region without having to develop the software multiple times. It is also possible to switch to a more powerful system at a later date and reuse functions in subsequent projects with different requirements. In this way, libraries with reusable functionalities and modules can be built up successively.

Validation of the real control system against the system model

Hybrid simulations are possible in order to prove that the generated software behaves in reality as it does in the model. To do this, the application is loaded onto the physical control system and tested against a system model simulated on a real-time computer. The same test cases as in the simulation can be used for this and their results compared numerically.

Based on the Simulink model, Simulink Real-TimeTM can be used to create, control and instrument real-time applications, for example a controlled system model, which are executed on Speedgoat real-time computers. This approach is also known as Hardware-in-the-Loop (HiL).

With an additional PC running Simulink, the entire process can be monitored and logged live. Errors and problems are rectified directly in the model and new real-time code can be generated immediately to test success. Iterations are possible without interruption and in rapid succession. This configuration also allows operating parameters to be changed during the simulation. This means that the software can be pre-optimized without the need for a physical machine.

Agile development approaches

In the software industry, a separate branch of development approaches called "agile" has emerged for the type of incremental development with continuous refinement described above. It should make complexity manageable and be more efficient than traditional methods. Small teams work on one part of a piece of software at a time, such as the architecture or a component. With this iterative working method, requirements and solutions are often only worked out during development(Fig. 6).

Figure 6: Agile system development with model-based design focuses on simulation and code generation for the incremental provision of design and test artifacts, studies and evaluations.

© Mathworks

At the end of each iteration - called a "sprint" - we evaluate where we are, what is missing and what the next steps should look like. This type of development is characterized by a high degree of flexibility and resilience. Errors or changing requirements can be dealt with more easily than with conventional development.

Agile development is particularly suitable for further developing and updating products while they are already in operation with the user. With this method, known as Continuous Integration/Continuous Delivery (CI/CD), the product continues to grow and is improved or provided with security updates.

The similarities with model-based design are obvious, as here too a product is ultimately created through incremental development of the overall system. With mechatronic systems, the product of a single sprint is not necessarily ready for use, but is initially part of a model. As with model-based design, this is not monolithic, but consists of components that can be changed without disrupting the overall architecture.

In general, Agile places less emphasis on documentation or reports and more on a functioning product, which can be perceived as a gap. Model-based design tools are the ideal complement here, as they offer extensive functions for automatic documentation and report generation. Those who are already familiar with model-based design can therefore continue to use them seamlessly.

Future viability through model-based design and agile


Adding agile methods to model-based design in mechanical engineering has a number of advantages. Firstly, the working methods of hardware and software developers are aligned. New synergies and improved communication are created. Administrators are relieved because the software landscape is also standardized.

Hardware should also be increasingly flexible and upgradeable, and customers are increasingly requesting new functions at a later date. Speed of response will be one of the key competitive factors in this environment. Mastering CI/CD is one of the ways to achieve this. Companies that combine model-based design with agile are better positioned for CI/CD and new business areas. Their engineers have the necessary skills and attitudes, the internal processes support it and the appropriate software tools make it possible.

The authors

Jens Lerche is Senior Application Engineer at Mathworks.

Dr. Marc Segelken is Principal Application Engineer at Mathworks.

Article series "Agile development with model-based design"

Part 2 of the article series will be published in Computer&Automation issue 6 on June 3, 2024. Sign up for the e-paper newsletter now and never miss another issue!

>> Click here to subscribe to the newsletter - please scroll down!

  • Xing Icon
  • LinkedIn Icon
Advertisement
Back to topic page
Advertisement

You might also be interested in

Advertisement

Most read

The top articles in July 2024

Innovative spirit and entrepreneurial thinking characterize the most-read articles from July. Find out more about competitive advantages through AI, click through award-winning developments and read more about model-based design and quantum sensor...

read more...
Advertisement
Advertisement

In focus: Agriculture

The e-paper of issue 05/2024

Strategies for the future are one of the topics covered in the current issue of Computer&Automation. Read about the reforms that associations are demanding from politicians, the opportunities offered by technologies such as ChatGPT and SPE and...

read more...
Advertisement

Most read

The top articles in January 2024

The year is off to a fast start for companies and is already bringing with it all kinds of collaborations and changes at this early stage. Developments in the field of robotics and control technology are not standing still either, as our top...

read more...

Mathworks

Automation in the high-voltage sector

High-voltage direct current transmission is increasingly being used to transmit large amounts of energy over long distances. An application example from Siemens Energy shows what such a solution has to do with model-based engineering and PC-based...

read more...
Advertisement
Advertisement
Advertisement

Advertorial

AI trends for engineers in 2023

Studies show: Companies that use AI engineering practices to develop and manage adaptive AI systems have a competitive advantage. Consequently, it is important to drive forward the introduction of AI in order not to fall behind.

read more...

In focus: HMI

The e-paper of issue 06/23

How can digitalization and artificial intelligence help to make production processes sustainable? How can cobots and automated guided vehicles bring variety to everyday working life and how can they support people? Starting points in this issue.

read more...
Subscribe to our newsletter
Advertisement
Back to home