Beckhoff Automation and Mathworks

Dr. Fabian Bause und Philipp Wallner | Yvonne Junginger,

How does the intelligence get to the controls?

Although the control software is becoming an increasingly important part of the overall machine, functional tests as part of simulations and virtual commissioning still play a subordinate role in mechanical and plant engineering. This does not have to be the case.

© Renk / SKF / Beckhoff

In the course of the digital transformation, mechanics has lost its dominant role in mechanical engineering. Even today, it is primarily the software on increasingly powerful industrial control systems that makes machines more flexible and productive. While the control software is playing an increasingly important role in the overall machine, functional tests as part of simulations and virtual commissioning continue to play a subordinate role.

Delays in delivery and machine downtimes in the field are often the result. This is despite the fact that control system manufacturers such as Beckhoff offer seamlessly integrated interfaces to simulation environments such as Simulink from MathWorks - and therefore a suitable solution. In addition to simulation-supported development, artificial intelligence also provides approaches for implementing the formulated challenges of modern machine and plant engineering.

Tested software through model-based design

Comprehensive tests of the control software can be carried out in parallel with the development of the control code using model-based design. For this purpose, Simulink offers a range of functions that allows physical simulation models of the mechanical and electrical systems to be created - and thus a digital twin of the system to be built - and also provides a wide range of methods for developing sequence logic, control and regulation code that maps the control functionality.

This means that both the plant model and the control code can be developed in a standardized environment and evaluated in the simulation. In addition, Simulink offers methods for testing and verification so that the development process can be seamlessly implemented in comprehensive development software.

Advertisement

Matlab and Simulink enable the simulation of machines and systems as well as the evaluation of large amounts of data. Twincat brings these directly into the control system at the touch of a button.

© Beckhoff

Control software at the touch of a button

The control functionality tested in the simulation together with the digital twin of the machine or system is then no longer coded manually for the industrial control platform, but automatically transferred to the industrial controller in just a few steps. Specifically, this means that a program verified in Simulink is translated into executable C/C++ code by the Simulink Coder from MathWorks and converted into a Twincat real-time object using the Twincat Target for Simulink from Beckhoff. The real-time object can then be seamlessly integrated into a control program, for example as a PLC function block.

The advantages of the automatic generation of control code are obvious: on the one hand, the functions that have already been tested are translated error-free into code that can be understood by the controller; implementation errors do not occur even in very extensive programs. Secondly, the developer can concentrate on his core competence - such as the development of a sequence controller, a control algorithm or a machine learning model - and does not have to concern himself with their implementation on different platforms. The automated workflow shortens the development time from the requirement to the finished implementation.

Overall, there is a further abstraction of control programming. Whereas in the early days the control program was implemented in machine language or assembler, modern development environments such as Twincat 3 support high-level languages such as C/C++ or the PLC languages summarized in the IEC 61131-3 standard. Due to the increasing importance of model-based development, automatic code generation from simulation models adds a further level of abstraction that makes the complexity of extensive machine applications manageable. Heterogeneous development teams are supported by the development environment when integrating different software modules on one controller.

Twincat 3 uses the modularized 'TcCOM' concept. Each software module can be created in any supported programming language and has standardized interfaces for integration into the overall control software. For example, PLC or C/C++ programmers can call up software modules via standardized interfaces and exchange data with the modules that were created from Simulink using automatic code generation. The programming language used for the modules therefore fades into the background and each team member can concentrate on the functionality and reusability of software modules.

Phases of model-based design

AI models developed in Matlab are transferred to the industrial controller from Beckhoff and run there in real time.

© Beckhoff

According to VDI/VDE 3693, complete virtual commissioning comprises three phases, starting with the model-in-the-loop (MiL) simulation. The first phase is aimed at the prototypical implementation of the control code. The focus is on the actual functionality and algorithmic correctness, not on executability on a specific hardware platform. Model-in-the-loop is characterized by the joint simulation of control functionality and digital twin in the same simulation model.

In the second phase, the software-in-the-loop (SiL) simulation, the developed control code from the MiL phase is converted into the production code for the control platform. The simulation together with the system model takes place without real-time requirements, i.e. the system model is still executed in the simulation software, while the control code in the form of the production code is already running on an emulated controller without real-time requirements. The automatic code generation of the control code ensures error-free transfer of the code tested in the MiL phase to the production code. With the Twincat Interface for Matlab/Simulink, Beckhoff offers a tool for the synchronous coupling of Simulink with the machine or system model and a Twincat user mode runtime, which receives the tick from Simulink to execute the next calculation cycle.

The third phase, hardware-in-the-loop (HiL) simulation, aims to incorporate the temporal behavior, i.e. the real-time capability of the overall system. Accordingly, the simulation model of the machine or system must also be translated into a real-time-capable module and the behavior of the communication between the controller and the system, i.e. the fieldbus, must be simulated. For HiL simulation, Beckhoff offers the option of simulating the Ethercat line with the Twincat 3 Ethercat simulation. The Ethercat devices are virtualized on a Beckhoff IPC with Twincat 3 as a simulation device. The simulation model translated with automatic code generation from Simulink is then instantiated and linked on the simulation device.

Artificial intelligence on the controller

In recent years, machine learning has experienced an unprecedented technological boom. This technology has penetrated many very different areas. In particular, it has been very successful in areas where digital technologies have been particularly advanced, such as speech and image recognition. The advance of AI in automation has so far been comparatively restrained. This is partly due to the significantly smaller amount of available measurement data and the lower fault tolerance in the area of critical production systems.

Dr. Fabian Bause is TwinCAT Product Manager at Beckhoff Automation.

© Dr. Fabian Bause, TwinCAT Product Manager at Beckhoff Automation

Nevertheless, technological pioneers are already demonstrating success in the implementation of AI technologies, for example in fully automated and machine-integrated quality control, predictive maintenance, intelligent trajectory planning and smart assistants for machine operators.

Philipp Wallner is Industry Manager at MathWorks.

© MathWorks

The integration of learned AI models into the control architecture is a crucial step that is often considered too late. Here too, the joint toolchain from MathWorks and Beckhoff provides answers. Algorithms from the fields of machine learning, deep learning or reinforcement learning can be developed using apps in Matlab and converted into control code using Matlab Coder and Twincat Target for Matlab, just like control algorithms. The AI-based program is trained in advance with measured and/or simulated data. The proximity to model-based design is immediately apparent here.

  • Xing Icon
  • LinkedIn Icon
Advertisement
Advertisement

You might also be interested in

Advertisement

Rittal

Flexible wire assembly

At SPS 2022, Rittal presented the 'Wire Terminal WT C5' and 'C10' fully automatic wire assembly machines, with which wires can be assembled ten times faster than by hand with individual wire printing (black, white and light blue) and order picking,...

read more...
Advertisement
Advertisement
Advertisement

Ifak

It's more efficient!

How can man and machine cooperate better in production? With the ITEA project Optimum, a research association has now formulated and implemented the necessary development goals. - Article 1 of 2.

read more...
Advertisement
Advertisement
Advertisement

Beckhoff

Seamless data transparency

At the Wienerberger Group, several million measured values are sent to the cloud every day for analysis purposes and used in all areas of the company as a reference point for targeted optimization measures. A field report.

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