DEVICE AND METHOD FOR SIMULATING A CONTROLLED MACHINE OR INSTALLATION

20190236224 · 2019-08-01

Assignee

Inventors

Cpc classification

International classification

Abstract

A device for simulating a controlled machine or installation includes a process simulation apparatus designed to perform simulation steps that simulate a physical process of the machine or installation, and a controller simulation apparatus designed to perform simulation steps that simulate a controller of the machine or installation. The process simulation apparatus and the controller simulation apparatus exchange particular output values so as to simulate the controlled machine or installation in the respective simulation steps. The controller simulation apparatus transmits an item of information to the process simulation apparatus, which item of information describes a result time for an end of a simulation step performed by the controller simulation apparatus, while the process simulation apparatus is designed to adjust a duration of at least one of the simulation steps depending on the result time.

Claims

1. A device for simulating a controlled machine or installation, the device comprising: a process simulation apparatus configured to perform first simulation steps so as to simulate a physical process of the machine or installation, and a controller simulation apparatus configured to perform second simulation steps so as to simulate a controller of the machine or installation, wherein the process simulation apparatus and the controller simulation apparatus exchange respective output values so as to simulate the controlled machine or installation in the respective first and second simulation steps, wherein the controller simulation apparatus is configured to transmit an item of information to the process simulation apparatus, which item of information describes a result time for an end of a second simulation step, and wherein the process simulation apparatus is configured to adjust a duration of at least one of the first simulation steps depending on the result time.

2. The device of claim 1, wherein the process simulation apparatus adjusts the duration of the at east one first simulation step such that the at least one first simulation step ends at the result time.

3. The device of claim 1, wherein the process simulation apparatus comprises a device configured to adjust the duration of the at least one first simulation step depending on the result time.

4. The device of claim 1, wherein the controller simulation apparatus comprises an event generator configured to generate an event signal which defines the result time, and wherein the process simulation apparatus comprises an event receiver configured to receive the event signal.

5. The device of claim 1, wherein the controller simulation apparatus is configured to transmit the determined output values to the process simulation apparatus, and wherein the process simulation apparatus is configured to use the transmitted output values as input values for performing at least one first simulation step.

6. The device of claim 5, wherein the process simulation apparatus comprises a buffer for storing the input values.

7. The device of claim 6, wherein the process simulation apparatus is configured to select at least one of the stored input values depending on a time at which the at least one input value was determined.

8. The device of claim 1, wherein the process simulation apparatus comprises a buffer for storing the respective output values of the process simulation apparatus, wherein output values determined after the result time are deleted.

9. The device of claim 1, wherein the controller simulation apparatus comprises an emulator for performing a control program for the controller of the machine or installation.

10. The device of claim 1, wherein the device comprises a plurality of process simulation apparatuses and/or a plurality of controller simulation apparatuses.

11. A method for simulating a controlled machine or installation, comprising: with a process simulation apparatus, simulating a physical process of the machine or installation by performing first simulation steps, with a controller simulation apparatus, simulating a controller of the machine or installation by performing second simulation steps, determining output values in the first and second simulation steps, exchanging the output values between the process simulation apparatus and the controller simulation apparatus so as to simulate the controlled machine or installation, defining an item of information describing a result time of an end of a step of the second simulation step, transmitting the item of information from the controller simulation apparatus to the process simulation apparatus, and with the process simulation apparatus, adjusting a duration of at least one first simulation step depending on the result time.

12. The method of claim 11, further comprising adjusting in the process simulation apparatus the duration of the at least one of the first simulation steps such that the at least one first simulation step ends at the result time.

13. The method of claim 11, further comprising adjusting in the process simulation apparatus the duration of the at least one first simulation step depending on the result time.

14. The method of claim 11, further comprising with an event generator in the controller simulation apparatus, generating an event signal which defines the result time, and receiving the event signal with an event receiver in the process simulation apparatus.

15. The method of claim 11, further comprising transmitting the determined output values from the controller simulation apparatus to the process simulation apparatus, and performing in the process simulation apparatus at least one first simulation step based on input values defined by the transmitted output values.

16. The method of claim 15, further comprising storing the input values in a buffer of the process simulation apparatus.

17. The method of claim 16, further comprising selecting in the process simulation apparatus at least one of the stored input values depending on a time at which the at least one input value was determined.

18. The method of claim 11, further comprising storing the respective output values of the process simulation apparatus in a buffer of the process simulation apparatus, and deleting output values determined after the result time.

Description

BRIEF DESCRIPTION OF THE DRAWING

[0022] Other features and advantages of the present invention will be more readily apparent upon reading the following description of currently preferred exemplified embodiments of the invention with reference to the accompanying drawing, in which:

[0023] FIG. 1 shows a device for simulating a controlled machine or installation according to the prior art;

[0024] FIG. 2 shows a chronology of simulation steps that are performed using the device according to FIG. 1;

[0025] FIG. 3 shows a device for simulating a controlled machine or installation according to one embodiment of the invention; and

[0026] FIG. 4 shows a chronology of simulation steps that are performed using the device according to FIG. 3.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

[0027] Throughout all the figures, same or corresponding elements may generally be indicated by same reference numerals. These depicted embodiments are to be understood as illustrative of the invention and not as limiting in any way. It should also be understood that the figures are not necessarily to scale and that the embodiments are sometimes illustrated by graphic symbols, phantom lines, diagrammatic representations and fragmentary views. In certain instances, details which are not necessary for an understanding of the present invention or which render other details difficult to perceive may have been omitted.

[0028] Turning now to the drawing, and in particular to FIG. 1, there is shown a device 4 for simulating a controlled machine or installation according to the prior art. The device 4 comprises a process simulation apparatus 1, which is used to simulate a physical process of the machine or installation. The device 4 furthermore comprises a controller simulation apparatus 2, which is used to simulate a controller by way of which the machine or installation is controlled. The controller that is simulated by way of the controller simulation apparatus 2 may be a programmable logic controller, for example. The controller simulation apparatus 2 may be provided through software emulation or an emulator. In the present case, co-simulation is performed by way of the process simulation apparatus 1 and the controller simulation apparatus 2 so as to replicate the operation of the controlled machine or installation.

[0029] The process simulation apparatus 1 and the controller simulation apparatus 2 are connected to one another for data transmission purposes. Simulation steps S.sub.1 are able to be performed by way of the process simulation apparatus 1, and output values are able to be determined in the process. This is indicated in the present case by the arrow 5. These output values describe physical variables of the machine or installation. The output values or the physical variables may describe for example a position, a speed and/or an acceleration. The output values provided by the process simulation apparatus 1 may be received by the controller simulation apparatus 2 as input values (arrow 6). Output values may likewise be provided by way of the controller simulation apparatus 2. This is shown in the present case by the arrow 7. These output values may describe for example an electric current, an electric voltage and/or a frequency. The output values provided by the controller simulation apparatus 2 may in turn be received by the process simulation apparatus 1 as input values (arrow 8). In the present example, the process simulation apparatus 1 and the controller simulation apparatus 2 are connected to one another by way of a component 3. The data exchange between the process simulation apparatus 1 the controller simulation apparatus 2 is able to be controlled by way of the component 3. In this way, an indirect data connection is produced between the process simulation apparatus 1 and the controller simulation apparatus 2.

[0030] FIG. 2 shows a chronology of the simulation steps S.sub.1 that are performed using the process simulation apparatus 1 and the controller simulation apparatus 2. In this case, the respective simulation steps S.sub.1 are shown with respect to a virtual time t. The respectively described durations and times are given in ma (milliseconds) in this case. Since the process simulation apparatus 1 and the controller simulation apparatus 2 have to exchange the input values and/or output values in the co-simulation, they are not able to be operated in parallel, but rather the respective simulation steps S are performed sequentially. At a time t=0, the controller simulation apparatus 2 is started using initial input values (event A). In this case, a simulation step S.sub.2 is performed and the output values are calculated in the process. This simulation step S.sub.2 ends at a time t=35 (event C). The virtual time t for the controller simulation apparatus 2 is then stopped or frozen.

[0031] Following this, the process simulation apparatus 1 is started (event B). In this case, simulation steps S.sub.1 are performed in a temporally consecutive manner using the process simulation apparatus 1, four simulation steps S.sub.1 whose respective duration is 10 ms being performed in the present case. In this case, the simulation steps S.sub.1 are performed until a time is reached that lies after the time t=35, namely the time t=40 (event E). In this case, the results determined in the last performed simulation step S.sub.1 are not able to be used as input values for the controller simulation apparatus 2 as this would violate the correct order of the events. Therefore, the result that was determined at the time t=30 is used as input value for the controller simulation apparatus 2 (event D). For the same reason, the result of the controller simulation apparatus 2 that was determined at the lime t=35 is used as input value for the process simulation apparatus 1 at the time t=40 (event G).

[0032] A further simulation step S.sub.2, which ends at the time t=51 (event F), is subsequently performed by way of the controller simulation apparatus 2. Three consecutive simulation steps S.sub.1 having a respective duration of 10 ms are then performed by way of the process simulation apparatus 1. In this case, the results that the controller simulation apparatus 2 determined for the time t=51 are used as input values for the time t=60 (event H). Overall, this leads to a situation whereby both simulations that are performed operate using input values that are not synchronized in terms of time. A simulation error in the entire co-simulation would therefore become unnecessarily large.

[0033] FIG. 3 shows a device 4 according to one embodiment of the invention. This device 4 also comprises a process simulation apparatus 1 and a controller simulation apparatus 2 that are connected to one another for data transmission purposes. The process simulation apparatus 1 comprises an execution system 16 by way of which the simulation of the physical process of the machine or installation is able to be performed. A simulation model 17 or a logic model is supplied to this execution system 16. The process simulation apparatus 1 furthermore comprises a buffer 11 for the input values and a buffer 12 for the output values. The process simulation apparatus 1 furthermore comprises a virtual clock 13 that progresses in accordance with the performance of the simulation. The process simulation apparatus 1 furthermore comprises an event receiver 14 that is explained in more detail further on. The process simulation apparatus 1 lastly comprises an apparatus 15 for adjusting an increment of the simulation steps S.sub.1.

[0034] The controller simulation apparatus 2 comprises an execution system 25 for performing the simulation, which may be configured for example in accordance with the IEC 61131 standard. A simulation model 26 is also supplied to this execution system 25. The controller simulation apparatus 2 furthermore comprises a buffer 21 for the input values and a buffer 22 for the output values. The controller simulation apparatus 2 also comprises a virtual clock 23 that advances when the simulation is performed. The controller simulation apparatus 2 lastly comprises an event generator 24.

[0035] It is provided in this case that the event generator 24 outputs an event signal every time a simulation step S.sub.2 using the controller simulation apparatus 2 has ended. By way of example, the event generator 24 may output an event signal if a main cycle of the controller or the programmable logic controller has been performed in the simulation. This event signal in this case comprises the corresponding result time t.sub.i of the virtual clock. The event signal is in this case transmitted to the event receiver 14 of the process simulation apparatus 1. Furthermore, the output values for this result time t are transmitted to the process simulation apparatus 1 by way of the controller simulation apparatus 2. After reception of the event signal, the increments or durations of the respective simulation steps S.sub.1 are adjusted by way of the process simulation apparatus 1 using the device 15 such that they deliver a result at the result time t. Depending on the execution system 16 or a solver of the simulation, intermediate steps may also be calculated.

[0036] Numerical solvers are expanded so as to adjust the increment by way of the apparatus 15. By way of example, in the present case, the explicit Euler method is used, which is used to solve simple differential equations having a given starting value. In this case, the problem may be given in the form of a differential equation:

[00001] dy dt = f ( t , y ) , y ( 0 ) = y 0 .

[0037] The approximation y.sub.k of the current function value y(t.sub.k) with the discrete time steps t.sub.k=t.sub.0+kh and the increment h may then be calculated:


y.sub.k+1=y.sub.k+hf(t.sub.k,y.sub.k).

[0038] The increment h is typically controlled such that the steps are as large as possible (but limited) and it is ensured that the local error is below a threshold:


[[y.sub.k+1y(t.sub.k+1)]]=c.sub.nh.sub.n, where c.sub.nk=.

[0039] This results in:

[00002] h k + 1 = h k .Math. .Math. .Math. y k + 1 - y ( t k + 1 ) .Math. .

[0040] By expanding the algorithm, the following can be introduced: t is said to be the virtual time of the last event. For each of the simulation steps S.sub.1, the increment h.sub.k+1 and the virtual time t.sub.k+1 resulting therefrom are determined. If t.sub.k+1>t.sub.i, the increment is set to h.sub.k+1=t.sub.it.sub.k. Furthermore, the event is discarded.

[0041] Overall, this results in the process simulation apparatus 1 and the controller simulation apparatus 2 always operating with up-to-date input values. This is depicted in FIG. 4, which shows a chronology of the simulation steps S.sub.1 and S.sub.2 that are performed using the device 4 according to FIG. 3. It is evident here that the duration or the increment of the first performed simulation steps S.sub.1 has been adjusted by the process simulation apparatus 1. The duration of the last simulation step S.sub.1 has been reduced from 10 ms to 5 ms. The four consecutive simulation steps S.sub.1 thus end overall after a time of t=35 (event E), which corresponds to the result time t. In the same way, the simulation steps S.sub.1 performed subsequently using the process simulation apparatus 1 have been adjusted such that they end at the time t=51.

[0042] According to one development, parallel performance of the simulations may also be provided. As already described, the process simulation apparatus 1 comprises the buffer 11 for the input values and the state of the simulation model. Previously determined results that have been received from the controller simulation apparatus 2 may also be stored in this buffer 11. In the same way as for the previously described method or algorithm, the received result time t.sub.i, which is determined on the basis of the virtual clock 23 of the controller simulation apparatus 2, is compared by the process simulation apparatus 1 with the time t.sub.k+1 of the virtual clock 13 of the process simulation apparatus 1 upon reception of the event signal. The process simulation apparatus 1 then deletes all of the calculated results or output values in the buffer 12 that were determined after the result time t. Following this, the process simulation apparatus 1 performs a new simulation, the input values with the greatest timestamp that were determined before the result time t being used in this case. For this simulation, the increments of the simulation steps S.sub.1 are adjusted depending on the result time t, as described above. For the next simulation, the process simulation apparatus 1 then empties the buffer 11 and uses the values that it obtained together with the event signal. It is thus made possible for the process simulation apparatus 1 and the controller simulation apparatus 2 to always operate with up-to-date values.

[0043] The method may also be expanded to a plurality of process simulation apparatuses 1 and/or a plurality of controller simulation apparatuses 2. In this case, all of the simulation apparatuses that exchange data with at least one controller simulation apparatus 2 are able to adjust the increment or the duration of the simulation steps S.sub.1, as described above.

[0044] In the present case, the duration of the simulation steps S.sub.2 of the controller simulation apparatus is not changed, as these reflect the real behaviour of a programmable logic controller in accordance with the IEC 61131 standard. A requirement here is that the controller (with the exception of special events) reads the input values at the beginning of a main cycle and ignores all changes to the input values during the performance of the main cycle. In contrast thereto, a realistic simulation of the controlled process should take into account the exact time at which the controller influences the process.

[0045] While the invention has been illustrated and described in connection with currently preferred embodiments shown and described in detail, it is not intended to be limited to the details shown since various modifications and structural changes may be made without departing in any way from the spirit and scope of the present invention. The embodiments were chosen and described in order to explain the principles of the invention and practical application to thereby enable a person skilled hi the art to best utilize the invention and various embodiments with various modifications as are suited to the particular use contemplated.

[0046] What is claimed as new and desired to be protected by Letters Patent is set forth in the appended claims and includes equivalents of the elements recited therein: