Method for realizing virtual-real fusion of PLC (Programmable Logic Controller) based on digital twinning
By building a digital twin and PLC physical attribute model, the virtual and real fusion between PLC equipment and digital twin is achieved, and the problems of equipment loss and safety hazards in PLC programming practice are solved, providing a safe and zero-cost operating environment.
Patent Information
- Application Number
- CN202411749066.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, when PLC programming practice is practiced, the equipment is prone to loss or safety hazards, and there is a lack of practical operation experience when practicing through virtual experiments.
By building a digital twin, establishing a PLC physical attribute model, and realizing real-time two-way data interaction between PLC devices and digital twins, real-time fusion of virtual and real between PLC devices and digital twins.
During the operation, students can not only obtain the operating feel of the PLC equipment real machine, but also have the characteristics of digital twin safety, zero pollution and zero consumables, reducing the cost of purchasing real machine equipment.
Smart Images

Figure CN119694177A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital twin technology, and in particular to a method for realizing PLC virtual-real fusion based on digital twin. Background Art
[0002] The idea of digital twin originated from the concept of "mirror space model" proposed by Michael Grieves, a professor at the University of Michigan, in his PLM (Product Lifecycle Management) course in 2002: a virtual digital expression equivalent to a physical product. From a conceptual description, digital twin is based on models and data, and uses multidisciplinary coupled simulation and other methods to complete the precise mapping of physical entities in the real world to mirror digital models in the virtual world.
[0003] As the country vigorously promotes and popularizes intelligent manufacturing, schools are also paying more and more attention to the training of talents in intelligent manufacturing related majors. The training of talents in intelligent manufacturing related majors cannot be separated from a large number of practical exercises on professional skills.
[0004] At present, most schools organize students to conduct PLC programming practice exercises in two ways: experiments through real equipment and experiments through virtual simulation software. The advantage of the former is that students have a real operating experience and it is easy for students to get started with actual equipment after graduation. Its disadvantages are limited equipment quantity, serious material loss, safety hazards and many other problems; the advantage of the latter is that it can avoid the disadvantages of the former very well, but the disadvantage is that it is impossible to get a real operating feel during the operation, and students will be unfamiliar with the real equipment on site after graduation. The digital twin technology combines the advantages of the above two practical exercise methods and avoids the disadvantages of the above two methods. Summary of the invention
[0005] In order to solve the problems in the prior art of equipment loss or equipment safety hazards during PLC programming practice or lack of practical operation experience during practice through virtual experiments, the present invention provides a method for realizing PLC virtual-real fusion based on digital twins.
[0006] The technical solution of the present invention is as follows:
[0007] The present invention provides a method for realizing PLC virtual-real fusion based on digital twin, comprising the following steps:
[0008] S1: Build several digital twins based on PLC devices;
[0009] S2: constructing a PLC physical property model on any of the digital twins, wherein the PLC physical property model interactively connects the PLC device and other digital twins;
[0010] S3: Establish interactive attribute connections between digital twins as described in step S1;
[0011] S4: Construct a virtual interactive interface in the virtual environment to realize port mapping between the PLC physical property model and the digital twin;
[0012] S5: Obtain data of PLC devices through the PLC physical property model;
[0013] S6: disassemble the data acquired in step S5 through the PLC physical property model and distribute it to the shared memory module of the PLC physical property model;
[0014] S7: driving the PLC physical property model to execute the change action of parameter properties, interactive properties and motion properties and generate a feedback signal through the digital twin action execution module on the digital twin;
[0015] S8: receiving a feedback signal from the digital twin action execution module through the digital twin sensor monitoring module on the digital twin, and feeding back the output signal of the digital twin sensor monitoring module to other digital twins or PLC devices;
[0016] S9: Repeat steps S5 to S8 to achieve real-time two-way data interaction between the PLC device and the digital twin, and then achieve virtual-real fusion of data between the PLC device and the digital twin.
[0017] Furthermore, the step S1 comprises:
[0018] S11: Create a three-dimensional virtual model of the physical structure of the digital twin with the same parameter attributes as the PLC device through a modeling tool;
[0019] S12: adding motion attributes to the digital twin;
[0020] S13: Adding interactive attributes to the digital twin.
[0021] Furthermore, the step S2 comprises:
[0022] A PLC physical property model is constructed by applying the parameter attributes, interaction attributes and motion attributes of the digital twin, and data is exchanged between the PLC physical property model and the PLC device to achieve real-time data transmission and synchronization.
[0023] Furthermore, the step S3 comprises:
[0024] The action execution signal generated by the digital twin action execution module inside other digital twins outside the PLC physical property model is connected to the digital twin sensor monitoring module to enable the feedback signals on other digital twins to be transmitted to the PLC physical property model.
[0025] Furthermore, the step S3 further includes:
[0026] Connecting the control signals of other digital twins other than the PLC physical property model to the digital twin action execution module, so that the other digital twins drive the digital twin action execution module to perform corresponding actions after receiving the control signals;
[0027] The control signal comes from a PLC device.
[0028] Furthermore, the step S4 comprises:
[0029] A virtual interactive interface is established in the virtual environment, and the PLC physical property model is mapped with the interface of the digital twin action execution module and the digital twin sensor monitoring module on the digital twin in the interactive interface, so that the data of the PLC device can be accurately transmitted to the corresponding digital twin according to the programmed control intention to execute the expected results.
[0030] Furthermore, the step S4 further includes:
[0031] The mapping content includes: IO port and digital control interface mapping, data register and shaping control interface mapping.
[0032] Furthermore, the step S5 comprises:
[0033] The PLC physical property model and the PLC device are connected through a computer interface. The PLC physical property model obtains register data from the PLC device in real time through a communication protocol, and transmits the data generated by the feedback signal from the digital twin sensor monitoring module on other digital twins received by the PLC physical property model to the PLC device, thereby realizing iterative calculation and data update of the PLC device.
[0034] Furthermore, the step S6 comprises:
[0035] A data processing thread is allocated in the PLC physical property model to process the data received from the PLC device through the communication protocol in real time, and the data is disassembled and allocated to the shared memory module of the PLC physical property model;
[0036] Or according to the mapping relationship established in step S4, the disassembled data is allocated to the digital twin action execution module of the corresponding other digital twins.
[0037] Further, the step S7 comprises:
[0038] When the control signal generated by the PLC device is transmitted to the digital twin action execution module, the digital twin action execution module drives the PLC physical property model of the digital twin to execute the change action of parameter properties, interactive properties and motion properties;
[0039] The motion attributes include one or more changes in geometric structure size, material, movement or rotation parameters, or interactive changes, or changes in internal motion laws.
[0040] Furthermore, the step S8 comprises:
[0041] The PLC physical property model of the digital twin will calculate the action signal in real time through the digital twin action execution module during the execution of the action, and convert the state of the action execution into a feedback signal to feed back to the outside world;
[0042] After receiving the feedback signal, the digital twin sensor monitoring module determines whether it is necessary to switch the current monitoring state of the sensor based on its own state. When the sensor monitoring state changes, the digital twin sensor module feeds back the changed sensor state to the outside world through the output signal to interact with other digital twins or PLC devices.
[0043] The beneficial effects of the present invention include at least: when the school organizes students to conduct PLC programming practice exercises, they can freely program the PLC equipment to achieve free control of the digital twin control objects. During the operation, students can get the operating feel of the real PLC equipment, so as to keep in touch with the future working environment and improve the ability of students to integrate into the employment environment after employment. At the same time, the digital twin has the characteristics of safety, zero pollution and zero consumables, which reduces the cost of purchasing real equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of the process structure of a method for realizing PLC virtual-reality fusion based on digital twin provided by the present invention.
[0045] Figure 2 A schematic diagram of the virtual-reality fusion structure between PLC and digital twin in a method for realizing virtual-reality fusion of PLC based on digital twin provided by the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Combination Figure 1-2 As shown, the present invention provides a method for realizing PLC virtual-real fusion based on digital twin, comprising the following steps:
[0048] S1: Build several digital twins based on PLC devices;
[0049] S2: constructing a PLC physical property model on any of the digital twins, wherein the PLC physical property model interactively connects the PLC device and other digital twins;
[0050] S3: Establish interactive attribute connections between digital twins as described in step S1;
[0051] S4: Construct a virtual interactive interface in the virtual environment to realize port mapping between the PLC physical property model and the digital twin;
[0052] S5: Obtain data of PLC devices through the PLC physical property model;
[0053] S6: disassemble the data acquired in step S5 through the PLC physical property model and distribute it to the shared memory module of the PLC physical property model;
[0054] S7: driving the PLC physical property model to execute the change action of parameter properties, interactive properties and motion properties and generate a feedback signal through the digital twin action execution module on the digital twin;
[0055] S8: receiving a feedback signal from the digital twin action execution module through the digital twin sensor monitoring module on the digital twin, and feeding back the output signal of the digital twin sensor monitoring module to other digital twins or PLC devices;
[0056] S9: Repeat steps S5 to S8 to achieve real-time two-way data interaction between the PLC device and the digital twin, and then achieve virtual-real fusion of data between the PLC device and the digital twin.
[0057] Furthermore, the step S1 comprises:
[0058] S11: Create a three-dimensional virtual model of the physical structure of the digital twin with the same parameter attributes as the PLC device through a modeling tool;
[0059] S12: adding motion attributes to the digital twin;
[0060] S13: Adding interactive attributes to the digital twin.
[0061] Furthermore, the step S2 comprises:
[0062] A PLC physical property model is constructed by applying the parameter attributes, interaction attributes and motion attributes of the digital twin, and data is exchanged between the PLC physical property model and the PLC device to achieve real-time data transmission and synchronization.
[0063] Furthermore, the step S3 comprises:
[0064] S31: Connect the action execution signal generated by the digital twin action execution module inside other digital twins outside the PLC physical property model to the digital twin sensor monitoring module, so that the feedback signal on other digital twins can be transmitted to the PLC physical property model.
[0065] Furthermore, the step S3 further includes:
[0066] S32: connecting the control signals of other digital twins other than the PLC physical property model to the digital twin action execution module, so that the other digital twins drive the digital twin action execution module to perform corresponding actions after receiving the control signals;
[0067] S33: The control signal comes from a PLC device.
[0068] Furthermore, the step S4 comprises:
[0069] S41: Establish a virtual interactive interface in the virtual environment, and map the PLC physical property model with the interface of the digital twin action execution module and the digital twin sensor monitoring module on the digital twin in the interactive interface, so as to realize that the data of the PLC device is accurately transmitted to the corresponding digital twin according to the programming control intention to execute the expected results.
[0070] Furthermore, the step S4 further includes:
[0071] S42: The mapping content includes: IO port and digital quantity control interface mapping, data register and shaping control interface mapping.
[0072] Furthermore, the step S5 comprises:
[0073] The PLC physical property model and the PLC device are connected through a computer interface. The PLC physical property model obtains register data from the PLC device in real time through a communication protocol, and transmits the data generated by the feedback signal from the digital twin sensor monitoring module on other digital twins received by the PLC physical property model to the PLC device, thereby realizing iterative calculation and data update of the PLC device.
[0074] Furthermore, the step S6 comprises:
[0075] A data processing thread is allocated in the PLC physical property model to process the data received from the PLC device through the communication protocol in real time, and the data is disassembled and allocated to the shared memory module of the PLC physical property model;
[0076] Or according to the mapping relationship established in step S4, the disassembled data is allocated to the digital twin action execution module of the corresponding other digital twins.
[0077] Further, the step S7 comprises:
[0078] When the control signal generated by the PLC device is transmitted to the digital twin action execution module, the digital twin action execution module drives the PLC physical property model of the digital twin to execute the change action of parameter properties, interactive properties and motion properties;
[0079] The motion attributes include one or more changes in geometric structure size, material, movement or rotation parameters, or interactive changes, or changes in internal motion laws.
[0080] Furthermore, the step S8 comprises:
[0081] The PLC physical property model of the digital twin will calculate the action signal in real time through the digital twin action execution module during the execution of the action, and convert the state of the action execution into a feedback signal to feed back to the outside world;
[0082] After receiving the feedback signal, the digital twin sensor monitoring module determines whether it is necessary to switch the current monitoring state of the sensor based on its own state. When the sensor monitoring state changes, the digital twin sensor module feeds back the changed sensor state to the outside world through the output signal to interact with other digital twins or PLC devices.
[0083] The present invention abstracts the PLC physical property model by applying the parameter attributes, interaction attributes and motion attributes of the digital twin. The PLC physical property model is both a digital twin and a virtual PLC. It can receive control signals from external physical PLC devices, and can also transmit the status monitored by the digital twin sensor to the physical PLC device, bidirectionally connecting the physical PLC in the physical world and the virtual digital twin.
[0084] The PLC physical property model can receive data and signals from the physical PLC, and use the interactive properties of the digital twin to pass the received signals to other digital twins. After receiving the signals, other digital twins perform corresponding actions according to their own parameters and motion properties.
[0085] Digital twins in the present invention: Digital twins are digital twins of physical objects, with three properties: (1) Parameter properties: the appearance and internal structure model of the twin are the same as the corresponding physical object; (2) Interaction properties, the digital twin is a living body that can autonomously receive, send and transmit signals, and can autonomously interact with other digital twins or physical real machines; (3) Motion properties: the internal movement and change laws of the digital twin are the same as those of physical objects, that is, it lives like a physical object and corresponds to physical objects or processes in the real world. A digital twin is an application example with the above digital twin properties, such as a digital twin with multiple properties such as material, structural size, displacement, and multiple control mechanisms such as action execution and sensor detection.
[0086] Digital twin action execution: A module responsible for driving the physical property model of the digital twin to perform various change actions. The action execution module can drive the physical property model of the digital twin to perform change actions such as parameter attributes, interactive attributes, and motion attributes (such as changes in geometric structure size / material / movement / rotation parameters, changes in interactive signals, and changes in internal motion laws).
[0087] Digital twin sensor monitoring: During the execution of an action, the physical property model of the digital twin will calculate the action signal through the action execution module in real time, and feedback the execution status of the action to the outside world. The digital twin sensor monitoring module is responsible for receiving and processing this feedback signal; when the sensor monitoring module receives the feedback signal, it determines whether to switch the current monitoring state of the sensor based on its own state; when the sensor monitoring state changes, the changed sensor state is fed back to the outside world through the output signal of the sensor monitoring module to interact with other digital twins or real machines in the physical world.
[0088] PLC physical property model: A mathematical model used to describe the physical properties of PLCs of various brands and types. It has the same data structure, operating rules, logical programming control, and signal transmission mechanism as the physical PLC, and can conduct two-way data communication with the physical PLC.
[0089] The present invention aims to realize a digital twin system centered on the central control equipment PLC of the production line or laboratory bench commonly used in schools. That is, the digital twin production line or laboratory bench equipment is controlled by a real PLC, and the sensor information of the digital twin production line or laboratory bench equipment can be returned to the real PLC to realize two-way interactive feedback, iterative operation, and virtual-real integration, so that students can operate and control the production line in an environment with both the feel of real PLC operation and no safety hazards and consumables. In this way, there is no need to build an expensive real machine production line to achieve a training effect close to the real machine, which greatly reduces the training cost of students.
[0090] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for realizing PLC virtual-real fusion based on digital twin, characterized by: The following steps are involved: S1: Build several digital twins based on PLC devices; S2: constructing a PLC physical property model on any of the digital twins, wherein the PLC physical property model interactively connects the PLC device and other digital twins; S3: Establish interactive attribute connections between digital twins as described in step S1; S4: Construct a virtual interactive interface in the virtual environment to realize port mapping between the PLC physical property model and the digital twin; S5: Obtain data of PLC devices through the PLC physical property model; S6: disassemble the data acquired in step S5 through the PLC physical property model and distribute it to the shared memory module of the PLC physical property model; S7: driving the PLC physical property model to execute the change action of parameter properties, interactive properties and motion properties and generate a feedback signal through the digital twin action execution module on the digital twin; S8: receiving a feedback signal from the digital twin action execution module through the digital twin sensor monitoring module on the digital twin, and feeding back the output signal of the digital twin sensor monitoring module to other digital twins or PLC devices; S9: Repeat steps S5 to S8 to achieve real-time two-way data interaction between the PLC device and the digital twin, and then achieve virtual-real fusion of data between the PLC device and the digital twin.
2. According to claim 1, the method for realizing PLC virtual-real fusion based on digital twin is characterized in that: The step S1 comprises: S11: Create a three-dimensional virtual model of the physical structure of the digital twin with the same parameter attributes as the PLC device through a modeling tool; S12: adding motion attributes to the digital twin; S13: Adding interactive attributes to the digital twin.
3. According to claim 1, the method for realizing PLC virtual-real fusion based on digital twin is characterized in that: The step S2 comprises: A PLC physical property model is constructed by applying the parameter attributes, interaction attributes and motion attributes of the digital twin, and data is exchanged between the PLC physical property model and the PLC device to achieve real-time data transmission and synchronization.
4. According to claim 1, the method for realizing PLC virtual-real fusion based on digital twin is characterized in that: The step S3 comprises: S31: connecting the action execution signal generated by the digital twin action execution module inside other digital twins outside the PLC physical property model to the digital twin sensor monitoring module, so that the feedback signal on other digital twins can be transmitted to the PLC physical property model; S32: connecting the control signals of other digital twins other than the PLC physical property model to the digital twin action execution module, so that the other digital twins drive the digital twin action execution module to perform corresponding actions after receiving the control signals; S33: The control signal comes from a PLC device.
5. According to claim 1, the method for realizing PLC virtual-real fusion based on digital twin is characterized in that: The step S4 comprises: S41: Establish a virtual interactive interface in the virtual environment, and map the PLC physical property model with the interface of the digital twin action execution module and the digital twin sensor monitoring module on the digital twin in the interactive interface, so as to realize that the data of the PLC device is accurately transmitted to the corresponding digital twin according to the programming control intention to execute the expected result; S42: The mapping content includes: IO port and digital quantity control interface mapping, data register and shaping control interface mapping.
6. The method for realizing PLC virtual-real fusion based on digital twin according to claim 1 is characterized in that: The step S5 comprises: The PLC physical property model and the PLC device are connected through a computer interface. The PLC physical property model obtains register data from the PLC device in real time through a communication protocol, and transmits the data generated by the feedback signal from the digital twin sensor monitoring module on other digital twins received by the PLC physical property model to the PLC device, thereby realizing iterative calculation and data update of the PLC device.
7. The method for realizing PLC virtual-real fusion based on digital twin according to claim 1 is characterized in that: The step S6 comprises: A data processing thread is allocated in the PLC physical property model to process the data received from the PLC device through the communication protocol in real time, and the data is disassembled and allocated to the shared memory module of the PLC physical property model; Or according to the mapping relationship established in step S4, the disassembled data is allocated to the digital twin action execution module of the corresponding other digital twins.
8. The method for realizing PLC virtual-real fusion based on digital twin according to claim 1 is characterized in that: The step S7 comprises: When the control signal generated by the PLC device is transmitted to the digital twin action execution module, the digital twin action execution module drives the PLC physical property model of the digital twin to execute the change action of parameter properties, interactive properties and motion properties; The motion attributes include one or more changes in geometric structure size, material, movement or rotation parameters, or interactive changes, or changes in internal motion laws.
9. The method for realizing PLC virtual-real fusion based on digital twin according to claim 1 is characterized in that: The step S8 comprises: The PLC physical property model of the digital twin will calculate the action signal in real time through the digital twin action execution module during the execution of the action, and convert the state of the action execution into a feedback signal to feed back to the outside world; After receiving the feedback signal, the digital twin sensor monitoring module determines whether it is necessary to switch the current monitoring state of the sensor based on its own state. When the sensor monitoring state changes, the digital twin sensor module feeds back the changed sensor state to the outside world through the output signal to interact with other digital twins or PLC devices.