MATLAB® and Simulink® have grown worldwide and become established programming environments for diverse applications, including among budding engineers. There are many reasons for this development. MATLAB® and Simulink® provide solutions that enable a complete focus on the engineering task. This is perfect for didactic concepts in teaching environments and efficient in industrial applications.
Advantages of MATLAB® and Simulink®
- early validation of software functionality through simulation
- virtual commissioning based on physical model
- direct import of CAD models
- development and test of control software and process logic
- analysis of measurement and process data
- interactive apps for the development of algorithms
- train and optimize AI algorithms
- Parallel Computing
From MATLAB® and Simulink® to TwinCAT3
Using TwinCAT 3 Target for MATLAB® and TwinCAT 3 Target for Simulink®, it is possible to transfer directly into the world the analyses and simulations developed in the globally used programming languages MATLAB® and Simulink®. The programming, which was first validated and transferred to the actually connected TwinCAT system landscape, can immediately assume the control and monitoring tasks in the customer applications as a productive code without incurring the risk of unforeseeable errors in the development phase.
Target for MATLAB®: Data Science in control
With TwinCAT 3 Target for MATLAB®, it is possible to use the MATLAB® functions in TwinCAT 3. The functions are automatically transferred into the TwinCAT objects and used seamlessly in TwinCAT 3 Engineering. The modules that are automatically generated can be integrated both as a TcCOM object and as a PLC function module in the TwinCAT solution. The integrated modules are downplayed with the complete TwinCAT project in the TwinCAT-3 runtime and are executed there like all other objects within a real-time environment.
Predictive maintenance, Machine Learning or Test and measurement technology – these MATLAB® key functions can be seamlessly integrated in the control with the TwinCAT 3 Target for MATLAB®.
Predictive maintenance is one of the most important factors for increasing OEE. The Predictive Maintenance ToolboxTM from Mathworks is ideal for developing state indicators and perform predictions. The integration of algorithms in the PLC makes it possible to synchronously access all relevant machine data. The monitoring system is transparently integrated in the control and is not a separate black box solution.
Machine Learning functions from MATLAB®, in combination with TwinCAT 3, present great advantages: classifiers perform product tests synchronously and directly in the control or detect system faults. Regression algorithms execute virtual sensors, parameterize a system depending on the situation or are embedded directly in a control loop for model-predictive regulation. The algorithms are trained outside TwinCAT real-time and can be changed on-the-fly during the machine runtime without stopping the machine.
The integration of Test and measurement technology in the machine control system reduces the complexity and costs of the testing systems, eases engineering and leads to faster testing procedures. The Beckhoff I/O portfolio provides the raw data to the control. There these can be both saved directly in databases for documentation and (pre-)processed in the real-time environment. The extensive MATLAB® signal processing algorithms, in combination with integrated simulation models for HiL testing, constitute an outstanding basis for the realization of integrated, modern and powerful test systems.
Target for Simulink®: seamless Model-Based Design
With TwinCAT 3 Target for Simulink®, it is possible for models developed in Simulink® to be used in TwinCAT 3. Various toolboxes, such as SimScape™ or Stateflow™ or DSP System Toolbox™ can be integrated in Simulink®. Embedded MATLAB® function modules can also be supported. The models are automatically translated into C/C++-Code using the Simulink Coder™ and converted in TwinCAT objects with TwinCAT 3 Target for Simulink®. TwinCAT objects created from Simulink® have the same interfaces and properties as all other TwinCAT objects. They can be used fully in TwinCAT 3 Engineering, e.g. expand to a complete project with a PLC source code, debug and link with fieldbus stations. The block diagram visualization from Simulink® is assumed in TwinCAT Engineering. The block diagram embedded in Engineering can, in addition to the Simulink® External Mode, be used as a control for parameters adjustment, debugging, signal and state monitoring. The modules that are automatically generated can be both integrated as a TcCOM object and as a PLC function module in the TwinCAT solution. The integrated modules are downplayed with the complete TwinCAT project in the TwinCAT-3 runtime and are executed there like all other objects within a real-time environment.
TwinCAT objects can be assigned to different CPU cores in real-time environment. This means that even large projects can be easily scaled, e.g. for the simulation of an entire windfarm. If speed is required in individual objects, it is also possible to parallelize calculations on several cores. That way applications from simple controllers to complete machine controls and real-time simulations can be comprehensively supported with one tool.
MATLAB® and Simulink® customer applications in TwinCAT 3
Test system of a heavy-duty bearing test bench for the main bearing of wind turbines
Using leading automation technology, wind turbines with diameters up to 6 meters can be tested on the world’s most powerful heavy-duty bearing test bench on SKF main bearing. The highly complex control system was developed and tested in MATLAB®/Simulink® and does not need to be re-programmed for the controller. The test bench is a custom-made product, i.e. the control cannot be tested on a prototype. It was possible to meet this challenge thanks to the automatic code generation and integration of the controller developed in MATLAB®/Simulink® in the test control (Rapid Control Prototyping) as well as the virtual commissioning of the controllers based on a model of the machine.
That way risks due to malfunctions during commissioning could be reduced as well as commissioning time and costs.
Yarn and fiber production with the Zero Twist Feeder
The Zero Twist Feeder feeds yarn into the weaving machines without a single rotation. Weaving machines operate at high speeds and pull on the spool at highly irregular intervals. A buffer arm is used to balance between the spool and the gripper. The buffer arm feeds the weaving machines with the exact required amount of yarn at optimum speed for weft insertion. Speeds of up to 850 meters/minute per entry can be achieved during production. The problem that can arise when weaving carbon fibers, glass fibers or plastic strips is the occurrence of twists or loops at these high speeds.
The problem was solved by first creating a digital twin of the machine. The programming of the entire software was done in Simulink®. The model was divided into several partial models that each represented an aspect of the mechanical engineering. Before IRO tested the algorithms on the actual hardware in Sweden, Vintecc conducted extensive virtual simulations in Belgium to ensure the machine worked as designed.
Combining Simulink® with the Beckhoff TwinCAT Technologie via the TwinCAT 3 Target was a great advantage in this application since it requires no PLC code. The model could be directly integrated in detail into TwinCAT. Changes made to the parameters in the model, TwinCAT or the hardware can be immediately transferred.
Magway Transport system – shifting a sophisticated algorithm to the lowest possible level
Magway uses MATLAB® and Simulink® for the implementation of an encoder-less control of linear synchronous motors that allow for an autonomous, sustainable package delivery through subsurface tubes.
Using the TwinCAT Target for Simulink®, control algorithms are implemented directly on an industrialized platform, and do so with fewer components, decentralization, higher system availability and shorter development cycles. This way the development cycles are shortened thanks to the in-loop debugging. The core IP was developed in MATLAB® and Simulink®. By using this software directly instead of through an inconvenient port, Magway always has the right tool for the right job.
Control software for 6 MW offshore wind turbines
Offshore wind turbines must ensure high availability levels with low maintenance requirements. The operation of this facility must be predictable and safe to control at all times. It is hardly possible to test the highly sensitive control software under real conditions.
By using the concept of the model-based design with Simulink® and TwinCAT, each function of the system can be developed, tested and verified. The safe and reliable control software can also be developed faster and more cost-effectively. This is possible because the easy integration of the Target for Simulink® in the model-based design process ensures the efficient generation and testing of productive codes on an industrial platform. Furthermore, the communication capabilities of the interface for MATLAB®/Simulink® provide all the tools required for the comprehensive software-in-the-loop testing after the implementation of the code on the Beckhoff controller.
At the same time, the functions of the TE1400 and TE1410 not only resulted in a successful application of the main control software designed in Simulink® for the 6-MW prototype facility but also for each large-scale production after the prototype.
TwinCAT 3 Target for Simulink® provides an interface between Simulink® and TwinCAT. The Simulink® software is developed and distributed by the MathWorks company. The programming environment is based on MATLAB® and is widely used both in science and in industry. Simulink® is a graphic programming environment that is ideally suited to the model-based development process. Simulation models of systems can be created and, for example, control and feedback control algorithms in order to test the models created.
TwinCAT 3 Target for MATLAB® provides an interface between MATLAB® and TwinCAT. MATLAB®, "The language of technical computing", is developed and distributed by the MathWorks company. The programming environment is widely used both in science and in industry. MATLAB® is a script language that is ideally suited for the development of algorithms and mathematical models.
MATLAB® and Simulink® are developed and distributed by the MathWorks company. The two programming environments are widely used both in science and in industry. Simulink® is a graphic programming environment that is ideally suited to the model-based development process. MATLAB® is a script language for the development of algorithms and mathematical models.