Absolute nonsense! This is what some colleagues have to say when it comes to 3D simulation, digital twins or virtual commissioning in control engineering. The fact is, however, that many of these colleagues do not fully understand what is behind the topic of 3D simulation and what advantages it offers for control programmers. The possibilities are revolutionary – if you dare…
My Approach to Simulation
For a long time I worked as a control engineer for precision measuring instruments. Anyone who is serious about control engineering does simulations long before a line of code is even written. First, mathematical models of the controlled system are created. Only these models make it possible to design efficient controls with the help of smart algorithms. The fact that controller and controlled system exist as a mathematical model makes a simulation of the entire control loop obvious: The control is simulated, i.e. tested, on the model of the controlled system. And testing means torpedoing the simulated control loop with every conceivable disturbance, pushing model parameters to their limits, trying out switch-on behavior under a wide variety of conditions – even calculation inaccuracies in the controller are tested in the simulation. Only when it is really guaranteed that the controller works as desired, code is written and tested on the real controlled system.
And now guess what: The control actually works in reality! Of course, in most cases fine-tuning of the control parameters is necessary because the mathematical model usually represents reality only by approximation. But the structure of the controller, the switch-on behaviour, the reaction to disturbances, it all works!
Mathematical Modeling of a Machine?
In most applications, control engineering tasks do not require a mathematical model. They require engineering skills and logical thinking. Control engineers know their machine and are able to create PLC programs for the most complex devices by means of a specification sheet and an electrical plan. Since programming is usually done parallel to the mechanical production of the machine, the control program can only be tested rudimentarily during development. Proper testing is carried out during the in-house commissioning or, if not otherwise possible, at the customer’s plant.
Hold on. At the customer’s plant. You have to let that sink in.
Is it really possible that we can only test PLC programs at the very end, namely when the machine has been fully assembled? Many conversations with control engineers and managers in the industry have reconfirmed one thing for me: Nobody wants to voluntarily change an existing and functioning PLC program, especially not if it has been growing over the years. Precisely because changes and their effects can only be tested on the actual machine. Nevertheless, we have to do exactly that.
Why Is That So?
Complete testing of control software is not exactly a trivial matter. The mechanical production and assembly of machines usually takes a long time, i.e. the programming of the controller starts even before the machine is actually available. The machines are often large and can be set up only partially, if at all, within the own company premises. When retrofitting existing systems – meaning upgrading the control technology components – downtime should be kept as short as necessary, so testing is only possible to a limited extent.
Now it would be wrong to say that control programs are not being tested today. On the contrary! Control engineers are creative and have developed various simulation modes and modules in their code. The problem with that? These are mostly structures which are not based on physical laws and therefore difficult to extend or unfortunately very prone to errors.
Let me give you an example: Consider a conveyor belt with a light barrier at the beginning and end of the line. The direction of the conveyor belt is supposed to change when a bottle interrupts the corresponding light barrier. A simple approach to test the function would be to program a simulation module that switches the signals of the light barriers accordingly after a fixed time. But what if the size of the bottles changes? What if there are two bottles on the conveyor belt?