Discrete event dynamic system PLC program design method based on Petri net modeling
Through the Petri network modeling method, DEDS and PLC system are effectively combined, which solves the problem of limited application effect of DEDS in industrial control in the prior art, realizes real-time dynamic display of DEDS status and simplifies feedback control, and improves the applicability and control accuracy of the system.
Patent Information
- Application Number
- CN202510081309.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is difficult to effectively combine discrete event dynamic systems (DEDS) with PLCs in industrial control systems, resulting in limited application effects in actual industrial scenarios. Specific problems include: static analysis cannot reflect system state changes in real time, feedback control design is complex and difficult to implement, system parameter configuration is inflexible, and it is difficult to adapt to different application scenarios and control needs.
Using the Petri network modeling method, the Petri network model of DEDS is constructed, the ladder diagram in the Blog software describes the event logic, the HMI human-computer interface dynamically simulates the system status, provides parameter configuration and operation control functions, adds timing functions to record event trigger time, uses the huge-added algebra method to design the feedback control mechanism, and design manual and automatic control modes.
It realizes efficient modeling and control of DEDS. The PLC program can accurately simulate the evolution of DEDS state, display the system status in real time, dynamically display the system behavior, and provide operation control functions, which improves the applicability and practicality of the system.
Smart Images

Figure CN119937445A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of industrial automation control, in particular to a discrete event dynamic system PLC program design method based on Petri net modeling. Background Art
[0002] Discrete Event Dynamic System (DEDS) refers to a dynamic system whose state changes only when certain discrete events occur. Its state has the characteristics of discreteness, event-driven, asynchronous and random. Such systems are widely used in production scheduling, traffic management, computer networks, aerospace and other fields in industrial automation, aiming to optimize system performance, reduce resource waste and improve production efficiency. Petri net is a mathematical modeling tool used to describe and analyze concurrent, synchronous and asynchronous event systems. It provides an intuitive and formal description method for DEDS, which can help designers understand phenomena such as concurrency, synchronization and conflict in the system. In the prior art, Petri net, as a classic DEDS modeling tool, is widely used to analyze the state flow and resource allocation of the system. However, its application is mainly limited to theoretical modeling and academic research, and it is difficult to directly map it to actual industrial control systems, thus limiting the application effect of the model in actual industrial scenarios. PLC is usually used in the field of industrial control to implement control logic. Petri net is mainly used for theoretical modeling of DEDS, while PLC is used in actual industrial control, but there is a lack of effective connection between the two. There are many problems that need to be solved in the connection process, as follows:
[0003] Traditional DEDS modeling methods are mostly used for static analysis of systems. The evolution of states usually relies on offline simulation or mathematical derivation, and lacks intuitive dynamic display capabilities. This static analysis method cannot reflect the dynamic changes of states during system operation in real time, which is not convenient for engineers to intuitively understand the control logic and system operation status. In addition, existing models usually cannot record real-time state information during system operation, and it is difficult to meet the monitoring needs of complex industrial control systems. In DEDS, feedback control is the key to optimizing system behavior and improving system performance. Its design usually involves complex nonlinear relationships, especially in resource scheduling, priority control and other links. These nonlinear relationships not only make the mathematical expression cumbersome, but also put forward higher requirements for the implementation of control logic. Most existing methods use numerical calculations or approximate methods to deal with nonlinear feedback control, but these methods are difficult to guarantee control accuracy and difficult to directly apply in actual industrial control. How to convert complex nonlinear feedback control mechanisms into linear forms that are easy to implement is still one of the difficulties in the current field. In existing DEDS simulation tools, initial parameters and control parameters are usually preset and fixed, and users often cannot flexibly adjust and configure them. This limitation makes the system lack of adaptability when dealing with different application scenarios or control requirements. Especially when facing complex industrial control tasks, users often need to rely on programming to adjust system parameters, which increases the complexity and difficulty of simulation tools. Therefore, it is urgent to develop a method that can organically combine DEDS with PLC modeling and simulation to improve its applicability and practicality in actual industry. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a PLC programming method for discrete event dynamic systems based on Petri net modeling. Through the deep integration of theoretical models and engineering practices, dynamic display of system states, linear expression of feedback control mechanisms, and configurable design of system parameters, efficient modeling and control of DEDS are achieved, and the PLC program can accurately simulate the state evolution process of DEDS, display the system state in real time, dynamically display the system behavior, and provide operation control functions.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a discrete event dynamic system PLC programming method based on Petri net modeling, including the following specific steps:
[0006] Step 1: Construct the Petri net model of DEDS;
[0007] Step 2: Use the ladder diagram in the Botu software to describe the event logic of the Petri net model;
[0008] Step 3: Design the HMI human-machine interface of the Petri net model and dynamically simulate the system state evolution process;
[0009] Step 4: Provide parameter configuration and operation control functions;
[0010] Step 5: Add a timing function to record event triggering time and batch status information;
[0011] Step 6: Design the feedback control mechanism using the max-plus algebraic method;
[0012] Step 7: Design two modes: manual control and automatic control;
[0013] Step 8: Design simulation animation to dynamically display system behavior.
[0014] The further improvement of the technical solution of the present invention is that: the specific steps of step 1 are as follows:
[0015] Step 1.1: Identify the resources, events and related time parameters in DEDS;
[0016] Step 1.2: Determine the place and initial identifier Token, where the place represents the storage location of the Token, the distribution of the Token in the place represents the system state of the DEDS, and the initial identifier represents the number of resources or the initial state of the DEDS system;
[0017] Step 1.3: Determine the transition and its triggering rules. Transitions represent events. Transition triggering will change the system state, that is, the distribution of tokens in the library.
[0018] Step 1.4: According to the causal relationship between events and states in DEDS, use directed arcs to connect places and transitions. The arc from the place to the transition indicates that the resources in the place are the prerequisite for the transition to be triggered, and the arc from the transition to the place indicates the flow direction of resources after the transition is triggered.
[0019] The further improvement of the technical solution of the present invention is that the specific steps of step 2 are as follows:
[0020] Step 2.1: Use normally open contacts in series to represent multiple input transitions. The closure of the normally open contacts represents the triggering of the input event.
[0021] Step 2.2: The passage through the coil indicates the enabling of the transition emission;
[0022] Step 2.3: Use the on-delay timer to indicate the retention time of the token in the library;
[0023] Step 2.4: Use the counter function to record the number of tokens in the library.
[0024] The further improvement of the technical solution of the present invention is that the specific steps of step 3 are as follows:
[0025] Step 3.1: Determine the graphical representation of places, transitions, and directed arcs;
[0026] Step 3.2: Connect the icon representing the library place in the HMI with the Boolean variable in the PLC that records the token in the library place, and describe the existence status of the token in the library place by changing the color of the icon;
[0027] Step 3.3: Connect the I / O field on the icon representing the library in the HMI to the integer variable that records the number of tokens in the PLC, and display the number of tokens in the corresponding library through the change of the value in the I / O field;
[0028] Step 3.4: The transfer of tokens is described by the color change of the icon and the change of the value in the I / O field.
[0029] The further improvement of the technical solution of the present invention is that the specific steps of step 4 are as follows:
[0030] Step 4.1: Add "Start, Pause, Continue, Reset" operation control buttons on the HMI interface and implement the button functions through programming;
[0031] Step 4.2: Set the system initial state and system constants by directly entering and changing system parameters in the specified I / O domain on the HMI interface. The configurable parameters include the emission time of each initial transition of the Petri net, the initial number of tokens in each library, and the retention time of tokens in the library.
[0032] The further improvement of the technical solution of the present invention is that the specific steps of step 5 are as follows:
[0033] Step 5.1: When DEDS is started, a 1Hz pulse signal is input to the counter to record the running time of DEDS;
[0034] Step 5.2: When each state of DEDS responds, the current running time of DEDS is output to the corresponding I / O domain, and the response time of each state of different batches is recorded.
[0035] The further improvement of the technical solution of the present invention is that the specific steps of step 6 are as follows:
[0036] Step 6.1: Let the input vector be u = (u1u2…u m )', the output vector is y=(y1y2…y n )', the input represents the synchronization triggering conditions of each event in DEDS, and the output represents the feedback result of the current system status;
[0037] Step 6.2: Introduce the feedback matrix F = (f ij )m×n , where f ij Represents input event u i With the output state y j The delay relationship between the input events u i The triggering depends on the output state y j and has a time delay f ij ;
[0038] Step 6.3: Apply the maximum Operation represents input event u i The trigger condition depends on the status of all relevant outputs y j The latest trigger time of addition The operation represents the delay relationship, that is, the output y j For input u i The effect needs to be delayed by f ij , calculate the next input through the output state of the current system, the mathematical expression is k=1,2,…,where Represent matrix multiplication in max-add algebra;
[0039] Step 6.4: In the PLC ladder diagram, use the normally open contacts in series to implement the synchronous triggering of the input event corresponding to the maximum operation, and use the on-delay timer to implement the time delay corresponding to the addition operation of the event triggering;
[0040] Step 6.5: In the HMI interface, use an m×n matrix composed of I / O fields to represent the feedback matrix, and enter feedback parameters in the matrix to describe the logical delay relationship between the next input and the current output.
[0041] The further improvement of the technical solution of the present invention is that the specific steps of step 7 are as follows:
[0042] Step 7.1: Design and use m on-delay timers to describe the control input. The m input transitions need to be triggered after a corresponding time delay.
[0043] Step 7.2: Design an m-dimensional vector composed of I / O domains to represent the input vector, enter the control parameters in the vector, and click Start to implement manual control;
[0044] Step 7.3: Enter the control parameters in both the input vector and the feedback matrix, and click Start to achieve automatic control.
[0045] The further improvement of the technical solution of the present invention is that the specific steps of step 8 are as follows:
[0046] Step 8.1: Draw an abstract HMI diagram of the system, map each element in the diagram to each event in the Petri net, and connect them to the corresponding PLC variables;
[0047] Step 8.2: Differentiate the different states of the display system by changing the fill color of the graphics in the HMI abstract diagram.
[0048] Due to the adoption of the above technical scheme, the technical progress achieved by the present invention is: by using the graphical representation of Petri nets, the state and event logic of DEDS are described intuitively and accurately, and converted into executable PLC control logic with the help of the ladder diagram of Botu software. By connecting normally open contacts, coil paths, delay timers and counters in series, the triggering conditions, Token retention time and resource allocation process of the transition in the system are dynamically portrayed, taking into account the rigor of the theoretical description of the Petri net model and the operability of the actual industrial control implementation. By using Petri nets as a medium, DEDS modeling and PLC control technology are organically combined. With the help of functional modules such as counters and delay timers, the flow of Tokens between libraries and transitions is realized, the real-time changes of the system state are dynamically displayed, and the state information at each moment is recorded. This dynamic display function can intuitively reflect the dynamic behavior of the system and help understand the control logic of the system. By adopting the maximum-add algebra method, the nonlinear feedback control law is converted into a linear form in the sense of maximum-add algebra, thereby simplifying the mathematical expression of event triggering, state transition and resource allocation. This method is highly compatible with the control elements of the PLC ladder diagram. It uses normally open contacts and delay timers to implement the logical operations of maximum and addition operations, which facilitates the direct implementation of complex feedback control through the PLC and improves the controllability and response speed of the system. The HMI human-machine interaction interface provides users with parameter setting functions, supporting users to flexibly configure the initial number of Tokens, control input parameters, and feedback matrix parameters of the Petri net. Users can easily adjust system parameters without programming and flexibly adapt to different control requirements. This parameter configurability design not only increases the versatility of the simulation program, but also facilitates users to make customized adjustments for different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 It is a schematic flow chart of the design method of the present invention;
[0051] Figure 2 It is the production flow chart of the flexible workshop production line;
[0052] Figure 3 It is a network diagram of the sequence of events;
[0053] Figure 4 It is the Petri net model of the flexible job shop production line;
[0054] Figure 5 It is a partial ladder diagram;
[0055] Figure 6 It is HMI that initializes the human-machine interface;
[0056] Figure 7 It is the "Start" and "Reset" button function program segment;
[0057] Figure 8 It is the "Pause" and "Continue" button function program segment;
[0058] Fig. 9 It is the program segment for setting initial parameters;
[0059] Fig.10 It is the operation interface after HMI sets parameters;
[0060] Fig.11 It is the timing function program segment;
[0061] Fig.12 It is the data display interface;
[0062] Fig.13 It is the feedback control program segment;
[0063] Fig.14 It is the control input program segment;
[0064] Fig.15 It is a simulation animation of production line M1 processing P2;
[0065] Fig.16 It is a simulation animation of production line M2 processing P1;
[0066] Fig.17 It is a simulation animation of production line M2 processing P3 and M3 processing P2; DETAILED DESCRIPTION
[0067] The present invention is further described in detail below in conjunction with embodiments:
[0068] like Figure 1 As shown in FIG. 1 , a flow chart of a discrete event dynamic system PLC programming method based on Petri net modeling is shown. The specific steps are as follows:
[0069] Step 1: Construct the Petri net model of DEDS; Petri net (PN) is a special directed graph, which can be represented as a five-tuple (P, Q, F, M, μ0), where P = {p1, p2, …, p m} is a finite set of positions; Q = {q1,q2,…,q n} is a finite set of transitions (a transition with only output arcs but no input arcs is called a source, and a transition with only input arcs but no output arcs is called a sink); and F∈(P×Q)∪(Q×P) is a directed arc set; It is a status identifier and is described by the number of tokens in the library; For the initial identification.
[0070] A Petri net in which each position has only one upstream transition and one downstream transition is called an event graph.
[0071] If the time parameter is given to the library of the basic form of Petri net, it is called a timed Petri net (TPN), which can be expressed as a six-tuple (PN,θ) = (P,Q,F,M,μ0,θ), where PN is the basic form of Petri net, θ = {θ1,θ2,…,θ m} is a set of delay parameters associated with the library, and specifies the time delay of the Token in the library place p i After being generated in (i={1,2,…,m}), it needs to go through θ i The delay of time units can be used, θ i Place p i residence time.
[0072] If the change q j For each input position p i Contains at least 1 Token, then the transition q j The emission is enabled. After an enabled transition in the Petri net completes the emission, each input position decreases by one Token, and the output position increases by one Token.
[0073] Step 1.1: Identify the resources, events and related time parameters in DEDS;
[0074] Step 1.2: Determine the place and initial identifier Token, where the place represents the storage location of the Token, the distribution of the Token in the place represents the system state of the DEDS, and the initial identifier represents the number of resources or the initial state of the DEDS system;
[0075] Step 1.3: Determine the transition and its triggering rules. Transitions represent events. Transition triggering will change the system state, that is, the distribution of tokens in the library.
[0076] Step 1.4: According to the causal relationship between events and states in DEDS, use directed arcs to connect places and transitions. The arc from the place to the transition indicates that the resources in the place are the prerequisite for the transition to be triggered, and the arc from the transition to the place indicates the flow direction of resources after the transition is triggered.
[0077] Step 2: Use the ladder diagram in the Botu software to describe the event logic of the Petri net model;
[0078] Step 2.1: Use normally open contacts in series to represent multiple input transitions. The closure of the normally open contacts represents the triggering of the input event.
[0079] Step 2.2: The passage through the coil indicates the enabling of the transition emission;
[0080] Step 2.3: Use the on-delay timer to indicate the retention time of the token in the library;
[0081] Step 2.4: Use the counter function to record the number of tokens in the library.
[0082] Step 3: Design the HMI human-machine interface of the Petri net model and dynamically simulate the system state evolution process;
[0083] Step 3.1: Determine the graphical representation of places, transitions, and directed arcs;
[0084] Step 3.2: Connect the icon representing the library place in the HMI with the Boolean variable in the PLC that records the token in the library place, and describe the existence status of the token in the library place by changing the color of the icon;
[0085] Step 3.3: Connect the I / O field on the icon representing the library in the HMI to the integer variable that records the number of tokens in the PLC, and display the number of tokens in the corresponding library through the change of the value in the I / O field;
[0086] Step 3.4: The transfer of tokens is described by the color change of the icon and the change of the value in the I / O field.
[0087] Step 4: Provide parameter configuration and operation control functions;
[0088] Step 4.1: Add "Start, Pause, Continue, Reset" operation control buttons on the HMI interface and implement the button functions through programming;
[0089] Step 4.2: Set the system initial state and system constants by directly entering and changing system parameters in the specified I / O domain on the HMI interface. The configurable parameters include the emission time of each initial transition of the Petri net, the initial number of tokens in each library, and the retention time of tokens in the library.
[0090] Step 5: Add a timing function to record event triggering time and batch status information;
[0091] Step 5.1: When DEDS is started, a 1Hz pulse signal is input to the counter to record the running time of DEDS;
[0092] Step 5.2: When each state of DEDS responds, the current running time of DEDS is output to the corresponding I / O domain, and the response time of each state of different batches is recorded.
[0093] Step 6: Use the max-plus algebra method to design a feedback control mechanism; the max-plus algebra is a commutative idempotent semifield, denoted by for Regulation
[0094] express The set of all m×n matrices on . Addition and multiplication operations are defined above: for A = (a ij ), for
[0095] The general nonlinear form of the maximal-additive system is
[0096] y i =max{a i1 +x1,a i2 +x2,…,a in +x n},i=1,2,…,m.
[0097] Using the special operation rules of maximum-add algebra, it can be transformed into the following linear form:
[0098]
[0099] Using the max-add matrix operation, it can be converted into a matrix form: in
[0100]
[0101] Step 6.1: Let the input vector be u = (u1u2…u m)', the output vector is y=(y1y2…y n )', the input represents the synchronization triggering conditions of each event in DEDS, and the output represents the feedback result of the current system status;
[0102] Step 6.2: Introduce the feedback matrix F = (f ij ) m×n , where f ij Represents input event u i With the output state y j The delay relationship between the input events u i The triggering depends on the output state y j and has a time delay f ij ;
[0103] Step 6.3: Apply the maximum Operation represents input event u i The trigger condition depends on the status of all relevant outputs y j The latest trigger time of addition The operation represents the delay relationship, that is, the output y j For input u i The effect needs to be delayed by f ij , calculate the next input through the output state of the current system, the mathematical expression is k=1,2,…,where Represent matrix multiplication in max-add algebra;
[0104] Step 6.4: In the PLC ladder diagram, use the normally open contacts in series to implement the synchronous triggering of the input event corresponding to the maximum operation, and use the on-delay timer to implement the time delay corresponding to the addition operation of the event triggering;
[0105] Step 6.5: In the HMI interface, use an m×n matrix composed of I / O fields to represent the feedback matrix, and enter feedback parameters in the matrix to describe the logical delay relationship between the next input and the current output.
[0106] Step 7: Design two modes: manual control and automatic control;
[0107] Step 8: Design simulation animation to dynamically display system behavior.
[0108] Embodiment 1:
[0109] In order to better illustrate the method of the present invention, the following uses an embodiment of a flexible manufacturing workshop production line to illustrate a discrete event dynamic system PLC programming method based on Petri net modeling:
[0110] As a key link in manufacturing enterprises, the rationality of production line design is directly related to production efficiency and product quality. Production line optimization is an important strategy to improve production efficiency and reduce production costs, and can significantly enhance the overall competitiveness of enterprises. Traditional production line optimization usually relies on experience or experiments. Although it can achieve good results in some cases, it is time-consuming and accompanied by certain risks. Through production line simulation technology, enterprises can effectively foresee and optimize production processes in the planning stage, thereby achieving more scientific decision-making and planning.
[0111] The production process of the flexible manufacturing workshop production line is as follows Figure 2 As shown, P1, P2, and P3 are three workpieces that need to be processed, and M1, M2, and M3 are machine tools used to process the workpieces. The processing rules for the workpieces are as follows:
[0112] Workpiece P1 is processed by machine tools M2 and M3 in turn;
[0113] Workpiece P2 is processed by machine tools M1, M2 and M3 in sequence;
[0114] Workpiece P3 is processed by machine tools M1 and M2 in turn;
[0115] Each machine tool can only process one workpiece at any time and cannot process multiple workpieces at the same time;
[0116] The processing order of the workpiece on each machine tool is P1, P2, and P3.
[0117] The specific steps of designing the PLC simulation program of the flexible workshop production line according to the design method of the present invention are as follows:
[0118] Step 1: Establish a Petri net model with the production line as DEDS;
[0119] Step 1.1: Determine resources, events, and related time parameters. Resources include workpieces P1, P2, P3 and machine tools M1, M2, M3. Suppose x ij Indicates workpiece P i In machine tool M j The processing event on the workpiece P i In machine tool M j The processing time on is t ij (i,j=1,2,3);
[0120] Step 1.2: The initial state of the system is as follows Figure 6 As shown, each click starts from u j Input a token to the downstream library, indicating that the workpiece is put into the machine tool M j ;
[0121] Step 1.3: Event x ij The trigger rule is machine tool M j There is no workpiece being processed, and workpiece P i Not processed on other machine tools;
[0122] Step 1.4: Determine the order of events according to the processing rules. The network diagram can be described as follows: Figure 3 The directed graph shown in the figure, where nodes represent processing events and directed arcs represent the sequence of events, is established based on the event sequence network diagram. Figure 4 The Petri net model shown.
[0123] Step 2: Use the Botu software to describe the logic in the Petri net as follows Figure 5 The ladder diagram shown.
[0124] Step 3: Design the HMI interface of the Petri net model as follows Figure 6 As shown, it is used to describe the dynamic evolution process of various events in the production line.
[0125] Step 4: Implement the "Start" and "Reset" functions of the operation control button program segment as follows Figure 7 As shown in the figure, the program segment of the operation control button to realize the "pause" and "continue" functions is as follows Figure 8 As shown in the figure, the program segment for setting the initial parameters is as follows Fig. 9 As shown, the parameter configuration and operation control interface is as follows Figure 6 (before parameter configuration) and Fig.10 (After parameter configuration) as shown.
[0126] Step 5: Timing function program segment such as Fig.11 As shown, it is used to record the occurrence time of different batches of various processing events and provide reference data for system control optimization. The data display interface is as follows Fig.12 As shown, it indicates that the time when the machine tool starts processing the (second batch) workpieces is 15, the time when the machine tool processes the (first batch) workpieces is 5, and the time when the (first batch) workpieces are completed is 7.
[0127] Step 6: Feedback control program segment such as Fig.13 As shown, the "Feedback" module in the HMI interface (such as Figure 6 As shown in Figure 2, it is used to set the feedback matrix parameters to achieve feedback control of the system. Fig.10 The feedback control law in k=1,2,…
[0128] Step 7: Control the input program segment as follows Fig.14 As shown, the "input" module in the HMI interface (such as Figure 6As shown in the figure, it is used to set the input vector parameters to realize manual control of the system; by setting the initial input and feedback matrix parameters, the system can be automatically mass-produced.
[0129] Step 8: The simulation animation of the production line is as follows Figure 15-17 As shown in the figure, the large rectangle represents the machine tool, and the lines depict the processing route of each workpiece; the elongated rectangle represents the system status, and its color filling change is used to indicate the processing status of the workpiece. For example, Fig.15 It means M1 processes P2; Fig.16 It means M2 processes P1; Fig.17 Indicates that M2 processes P3, and M3 processes P2. Figure 2 In comparison, simulation animation provides an intuitive and clear demonstration of the dynamic process of the flexible job shop production line, and can more effectively display the real-time operation of the production line.
[0130] In summary, the use of the method of the present invention to verify the rationality and efficiency of the flexible manufacturing workshop production line can significantly reduce time and labor costs. At the same time, the method effectively avoids the safety hazards caused by production line logic problems, reduces the risks in the production line optimization and planning process, and improves the safety and reliability of system design.
[0131] The embodiments described above are merely descriptions of preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A discrete event dynamic system PLC programming method based on Petri net modeling, characterized by: The specific steps are as follows: Step 1: Construct the Petri net model of DEDS; Step 2: Use the ladder diagram in the Botu software to describe the event logic of the Petri net model; Step 3: Design the HMI human-machine interface of the Petri net model and dynamically simulate the system state evolution process; Step 4: Provide parameter configuration and operation control functions; Step 5: Add a timing function to record event triggering time and batch status information; Step 6: Design the feedback control mechanism using the max-plus algebraic method; Step 7: Design two modes: manual control and automatic control; Step 8: Design simulation animation to dynamically display system behavior.
2. The method for PLC programming of a discrete event dynamic system based on Petri net modeling according to claim 1, characterized in that: Step 1 The specific steps are as follows: Step 1.1: Identify the resources, events and related time parameters in DEDS; Step 1.2: Determine the place and initial identifier Token, where the place represents the storage location of the Token, the distribution of the Token in the place represents the system state of the DEDS, and the initial identifier represents the number of resources or the initial state of the DEDS system; Step 1.3: Determine the transition and its triggering rules. Transitions represent events. Transition triggering will change the system state, that is, the distribution of tokens in the library. Step 1.4: According to the causal relationship between events and states in DEDS, use directed arcs to connect places and transitions. The arc from the place to the transition indicates that the resources in the place are the prerequisite for the transition to be triggered, and the arc from the transition to the place indicates the flow direction of resources after the transition is triggered.
3. The method for discrete event dynamic system PLC programming based on Petri net modeling according to claim 1, characterized in that: Step 2 The specific steps are as follows: Step 2.1: Use normally open contacts in series to represent multiple input transitions. The closure of the normally open contacts represents the triggering of the input event. Step 2.2: The passage through the coil indicates the enabling of the transition emission; Step 2.3: Use the on-delay timer to indicate the retention time of the token in the place; Step 2.4: Use the counter function to record the number of tokens in the library.
4. The method for discrete event dynamic system PLC programming based on Petri net modeling according to claim 1, characterized in that: Step 3 The specific steps are as follows: Step 3.1: Determine the graphical representation of places, transitions, and directed arcs; Step 3.2: Connect the icon representing the library place in the HMI with the Boolean variable in the PLC that records the token in the library place, and describe the existence status of the token in the library place by changing the color of the icon; Step 3.3: Connect the I / O field on the icon representing the library in the HMI to the integer variable that records the number of tokens in the PLC, and display the number of tokens in the corresponding library through the change of the value in the I / O field; Step 3.4: The transfer of tokens is described by the color change of the icon and the change of the value in the I / O field.
5. The method for discrete event dynamic system PLC programming based on Petri net modeling according to claim 1, characterized in that: Step 4 The specific steps are as follows: Step 4.1: Add "Start, Pause, Continue, Reset" operation control buttons on the HMI interface and implement the button functions through programming; Step 4.2: Set the system initial state and system constants by directly entering and changing system parameters in the specified I / O domain on the HMI interface. The configurable parameters include the emission time of each initial transition of the Petri net, the initial number of tokens in each library, and the retention time of tokens in the library.
6. The method for discrete event dynamic system PLC programming based on Petri net modeling according to claim 1, characterized in that: Step 5 The specific steps are as follows: Step 5.1: When DEDS is started, a 1Hz pulse signal is input to the counter to record the running time of DEDS; Step 5.2: When each state of DEDS responds, the current running time of DEDS is output to the corresponding I / O domain, and the response time of each state of different batches is recorded.
7. The method for PLC programming of discrete event dynamic system based on Petri net modeling according to claim 1, characterized in that: Step 6 The specific steps are as follows: Step 6.1: Let the input vector be u = (u1u2…u m )', the output vector is y=(y1y2…y n )', the input represents the synchronization triggering conditions of each event in DEDS, and the output represents the feedback result of the current system status; Step 6.2: Introduce the feedback matrix F = (f ij ) m×n , where f ij Represents input event u i With the output state y j The delay relationship between the input events u i The triggering depends on the output state y j and has a time delay f ij ; Step 6.3: Apply the maximum Operation represents input event u i The trigger condition depends on the status of all relevant outputs y j The latest trigger time of addition The operation represents the delay relationship, that is, the output y j For input u i The effect needs to be delayed by f ij , calculate the next input through the output state of the current system, the mathematical expression is in Represent matrix multiplication in max-add algebra; Step 6.4: In the PLC ladder diagram, use the normally open contacts in series to implement the synchronous triggering of the input event corresponding to the maximum operation, and use the on-delay timer to implement the time delay corresponding to the addition operation of the event triggering; Step 6.5: In the HMI interface, use an m×n matrix composed of I / O fields to represent the feedback matrix, and enter feedback parameters in the matrix to describe the logical delay relationship between the next input and the current output.
8. The method for discrete event dynamic system PLC programming based on Petri net modeling according to claim 1, characterized in that: Step 7 The specific steps are as follows: Step 7.1: Design and use m on-delay timers to describe the control input. The m input transitions need to be triggered after a corresponding time delay. Step 7.2: Design an m-dimensional vector composed of I / O domains to represent the input vector, enter the control parameters in the vector, and click Start to implement manual control; Step 7.3: Enter the control parameters in both the input vector and the feedback matrix, and click Start to achieve automatic control.
9. The method for discrete event dynamic system PLC programming based on Petri net modeling according to claim 1, characterized in that: Step 8 The specific steps are as follows: Step 8.1: Draw an abstract HMI diagram of the system, map each element in the diagram to each event in the Petri net, and connect them to the corresponding PLC variables; Step 8.2: Differentiate the different states of the display system by changing the fill color of the graphics in the HMI abstract diagram.