Control / Rules

Thilo Glas | Günter Herkommer,

From modeling directly into the PLC

Despite digitalization and I4.0, the technical functions in a process plant do not become simpler if you break them down to the smallest detail. Nevertheless, the high level of difficulty can be overcome by combining the right tools in the right way.

© Phoenix Contact

There are a large number of applications in the process technology environment that are difficult to implement: cascaded controls, fast torque controls or even the implementation of a complex mathematical formula in a control application. Although such applications can usually be programmed in IEC 61131 code for a PLC, this is not necessarily convenient. If the programmer has created a difficult formula according to IEC 61131 in structured text, for example, it is often unrecognizable. Accordingly, optimization or troubleshooting is also not easy. The next step is to test the complex function. Obstacles also arise here if there is no clear overview. This is because improving a control system proves to be time-consuming even for less difficult tasks.

The challenges mentioned above are, so to speak, classics that have been occupying programmers for a long time. However, new topics are being added. In the process industry, automation is increasingly based on modular approaches, especially since a standardized software interface has found its way into the industry with MTP (Module Type Package) in accordance with VDI/VDE/NAMUR 2658. The individual modules now have their own controller, which takes over the controls. This reduces the load on the central control system. However, the programming environment in which the user implements the control system cited as an example changes: previously the control system environment, now general control technology.

Matlab Simulink software can be used to implement such complex tasks more simply and elegantly in control technology. The tool is a highly developed tool with which both mathematical and control engineering solutions can be developed, tested and converted into code. The idea for Matlab was born back in the 1970s in the USA by Cleve Moler at the University of New Mexico. The software was then turned into a commercial product in the mid-1980s. From the 2000s onwards, Matlab became more widespread, partly because the tool was included in university curricula.

The subsequent expansion of Matlab to include the Simulink module means that the programs created can now be simulated and blocks of them used to model systems. This allows the systems to be visualized clearly and graphically. Numerous so-called toolboxes are available for the software, which allow the use of ready-made function modules such as the 'Signal Processing Toolbox' or the 'Fuzzy Logic Toolbox'.

As already mentioned, such solutions have been around since the 1980s. What is new is that the user can now easily combine the system with an industrial controller. Where previously pure microcontrollers were available as a runtime environment or C code could be generated, the PLC has now been added as a 'target' for the code. This means that a complex controller can now be designed in Simulink, tested in the entire frequency range under the influence of disturbance variables, optimized with the help of Simulink tools and finally exported as a program for the PLC controller.

Advertisement

Figure 1: Typical representation of a control loop in Simulink

© Phoenix Contact

Export to the PLC system

Figure 2: Selection of the AXC F 2152 PLCnext controller as a target. A target is the 'target' controller on which the application is to run.

© Phoenix Contact

This opens up a wide range of possibilities for the user that are not usually available in an engineering environment for controllers. In particular, testing and improving the controllers proves to be a tedious process in which the engineer is grateful for any relief. Matlab Simulink includes all the classic methods of control engineering, such as the Bode diagram, root locus curves or the locus curve of the frequency response, which simplifies code development. Another advantage of the software is the use of graphical blocks for designing the controller. For example, a gain can be added simply by drag & drop, whereby the design takes place in a level more suitable for control engineering than in a PLC environment(Fig. 1).

If the programmer has planned the controller in a conventional PLC environment, he is confronted with the problem of testing. Although input signals can be simulated in such an environment, this proves to be difficult over the entire frequency range, as a conventional PLC system does not provide a function for this. With the extensive possibilities of Simulink, commissioning in the field can be considerably shortened if the programmer has already been able to check the behavior of the controller in advance. Once the controller has finally been modeled and tested, the innovation in the system comes into play: the designed controller can be exported to suit the respective PLC system. Targets - so-called PLC coders - are available for the TIA Portal from Siemens, B&R, Codesys, Phoenix Contact and several other manufacturers. Connection to hard real-time systems with the complete I/O portfolio and fieldbus systems is now also easier. From a modeling perspective, Matlab Simulink has thus developed into a tangible and useful tool for automation technology(Fig. 2).

With PLCnext Technology, Phoenix Contact has launched a new, open controller generation based on the Linux operating system, which offers various advantages. The AXC F 2152 controller, for example, with two independent 800 MHz processors, offers a good platform for running a Simulink model on one core and executing standard tasks on the other core, for example.

Apps from the online store

Figure 3: Inserting a Simulink model as a library in the PLCnext Engineer engineering environment. This is an easy way to implement the Simulik model.

© Phoenix Contact

Figure 4: Inserting the Simulink model as an independent task whose task time is freely selectable. Other tasks can be conventional 61131 programs.

© Phoenix Contact

The code generated in Simulink can be easily integrated into the project as a program and processed as a task on one of the two processors with any task time. The user is now able to open the created models in the engineering environment and observe them online during runtime, which leads to comprehensive transparency. For licensing reasons, the model can only be modified in Matlab Simulink(Figure 3).

However, control technology today offers even more possibilities. With the PLCnext Store, for example, users can load all or part of an application program onto the controller, just as they do with apps for their smartphones. To do this, they connect the AXC F 2152 to the store using its user ID. The controller is then registered using its UUID (Universally Unique Identifier) and the user selects which application they want to install on the controller in the store. He thus receives a ready-made application program without using an engineering system and without programming knowledge of IEC 61131.

The store also includes libraries and program components. An institute could therefore design a complex controller and make it easily available online via this platform - either free of charge or for a license fee. In short: Industry 4.0 has also arrived in the process industry.

Parallel and agile programming

The ecosystem behind PLCnext Technology allows program sequences created in different programming languages to be combined in real time. To this end, the patent-pending task handling allows program routines to run like classic IEC 61131 code. High-level language programs created in C/C++ or C#, for example, are thus processed simultaneously with the IEC 61131 program. This ensures consistent data exchange and synchronous execution of the program code and makes high-level language programs automatically deterministic. Developers can therefore work on individual parts of a complex application in parallel and independently of each other in an agile manner and in their preferred programming language. In this way, the know-how of IEC 61131 experts can be combined with new ideas and program parts from the world of high-level languages and the knowledge of young developers from the IT environment.

Author:
Thilo Glas is Senior Specialist Engineering in the Industry Management Process at Phoenix Contact.

  • Xing Icon
  • LinkedIn Icon
Advertisement
Advertisement

You might also be interested in

Advertisement

Miba

The first steps towards digitization

Real-time transparency in the material flow: this was the goal set by Miba when it set out to digitalize its internal logistics processes. But how successful was the close link between ERP and MES in the end? - A field report.

read more...
Advertisement
Advertisement
Advertisement

Big Data

Online machine data under control

Turning huge amounts of data into valuable information - how can this smart industry approach be implemented? Linking PC-based controllers with Matlab and a cloud-based IoT analytics service can be a viable approach.

read more...
Advertisement
Advertisement
Advertisement

Industry 4.0

Why predictive maintenance?

Investments in predictive maintenance systems are worthwhile in order to proactively detect damage. Not only does this increase the service life of a machine, it also opens up new business models for machine manufacturers.

read more...

Industry 4.0

First customer projects via BaSys 4.0

The BMBF project 'Basissystem Industrie 4.0' expired at the end of June 2019. Together with NetApp and Objective Partner, Fraunhofer IESE now offers Industry 4.0 solutions with support and adaptation to customer systems on the basis of this project....

read more...

Cloud technology

The multi-cloud under control

German companies have been hesitant about the cloud for a long time, but now things are really taking off. More and more manufacturers are using multiple cloud providers - whether strategically or due to shadow IT. But how can the complexity of the...

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