Next Article in Journal
Efficiency of Hydrogen Peroxide and Fenton Reagent for Polycyclic Aromatic Hydrocarbon Degradation in Contaminated Soil: Insights from Experimental and Predictive Modeling
Previous Article in Journal
Correction: Radaš et al. A Method for Estimating the State of Charge and Identifying the Type of a Lithium-Ion Cell Based on the Transfer Function of the Cell. Processes 2024, 12, 404
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Petri Net Model Predictive Control Method for Batch Chemical Systems

1
College of Information Science and Engineering, Huaqiao University, Xiamen 361021, China
2
Fujian Engineering Research Centerof Motor Control and System Optiomal Schedule, Xiamen 361021, China
*
Author to whom correspondence should be addressed.
Processes 2024, 12(3), 620; https://doi.org/10.3390/pr12030620
Submission received: 13 February 2024 / Revised: 10 March 2024 / Accepted: 19 March 2024 / Published: 21 March 2024
(This article belongs to the Section Automation Control Systems)

Abstract

:
In order to address the problem of the real-time scheduling and control of batch chemical systems, this work proposes a model predictive control method based on Petri nets. First, a method is presented to construct a batch chemical system’s timed Petri net model. Second, a control structure is designed to augment the Petri net model to control the valves. This results in timed Petri nets that formally represent the process specifications of a batch chemical system. Third, a model predictive control method is developed to schedule and control timed Petri nets, where a proposed heuristic function is utilized to perform the optimization computation. The model parameters are dynamically adjusted using online data, and both scheduling and valve control instructions are calculated in real time. Finally, a series of experiments is carried out in a beer canning plant to verify the proposed method. According to the experimental results, the scheduling and control problem can be solved in real time, where the online computations can be performed in milliseconds, and the resulting scheduling strategies are optimal or near-optimal.

1. Introduction

Under the influence of the Internet of Things and intelligent manufacturing technologies, the resource units and task numbers in batch chemical systems are increasing. The logical relationships among processes in competition for resource units are becoming increasingly complex, leading to a combinatorial explosion of system states. Simultaneously, the system must deal with unforeseen events such as urgent orders, process adjustments, and equipment failures. This necessitates rapid real-time solutions for scheduling strategies and control commands, posing highly complex scheduling and control problems.
Batch chemical systems are driven by events such as the opening or closing of valves and the initiation and completion of operations, making them a typical group of discrete event systems. Petri nets are an excellent tool for discrete event systems [1,2] and are widely used in research on fault diagnosis, supervisory control, and optimization scheduling [3,4].
Batch chemical systems involve complex scheduling strategies and specific valve control commands translated from scheduling strategies [5,6,7,8,9,10,11,12,13,14]. Since scheduling and control commands require real-time computation and execution, responding quickly to unforeseen events, such as emergency orders and equipment failures, becomes challenging.
Regarding real-time scheduling, modeling via Petri nets and the use of model predictive control (MPC) are possible [15,16,17]. However, they fail to address the mismatch between the system model and the physical plant, and the repeated expansion of the reachability tree leads to unnecessary computation.
To overcome these drawbacks, this work presents an MPC method using place-timed Petri nets, which not only addresses the mismatch between the Petri net model and the actual plant but also fulfills the real-time scheduling requirement. It is summarized as follows.
(1)
For batch chemical systems, a systematic method is proposed to obtain its place-timed Petri net model by analyzing the relationship between the process specifications and logical operations.
(2)
A heuristic function is designed based on the place-timed Petri net mode to estimate states’ time costs, which can be used to smartly adjust the searching direction within a reachability graph to reduce the computation required.
(3)
A predictive control algorithm is designed to search for an optimal or near-optimal control action (transition) under the guidance of a heuristic function within each prediction time domain (time step). It has a model correction module that collects data online about operational times and device failures, and we can dynamically modify the Petri net model accordingly.
(4)
We conduct experiments on a beer canning plant. The online computations of control actions are completed within milliseconds, and the makespan is close to the optimal one. The results show that the proposed method provides an efficient and practical solution for the real-time scheduling of a batch chemical plant.
Compared to the approaches in [15,16,17], our approach addresses the issue of the mismatch between the Petri net model and the actual plant. The model calibration is performed in real-time according to abrupt events, such as rush orders and device failures. Furthermore, we retain a portion of the reachability graph of the previous time step, and the expanded part of the graph is saved in each predictive time domain. This enables us to explore more states and thereby enhance the scheduling performance.
The rest of this paper consists of the following sections. Section 1 presents some related works and describes contributions concerning the existing methods. Section 2 reviews basic definitions and notions regarding Petri nets and MPC. Section 3 describes the optimization issue of batch chemical systems. Section 4 proposes the method to model batch chemical systems using place-timed Petri nets. Section 5 presents an MPC method to schedule a batch chemical system based on Petri nets and the proposed heuristic function. Section 6 describes a series of experiments to verify the proposed method. Section 7 provides the conclusions of the work.

2. Related Works

The control and scheduling problems of batch chemical systems have received widespread attention, leading to valuable research efforts. Tittus and Lennartson et al. [5] propose a hierarchical Petri net control method for batch chemical systems that can prevent deadlock states, allocate material transport equipment and reactors reasonably, and execute multiple process flows in parallel. Wang et al. [6,7] introduce a control approach based on hierarchical Petri nets for batch chemical systems, capable of generating control instructions for the production and transportation of multiple materials, thereby increasing the system’s stability. Susumu et al. [8] develop a Petri net model for a batch chemical production process and propose a method to design reliable operation instructions. Falkman et al. [9] introduce a process algebra Petri net, which is helpful in accurately describing the complex request relationships between operations and resources. Ghaeli et al. [10] establish a place-timed Petri net model for batch factories and present a branching and bounding algorithm to compute optimal scheduling strategies. Lai et al. [11] model a pipeline network of a batch chemical plant as a Petri net and use integer programming to determine the shortest material transfer paths. With max-plus algebra, Weyerman et al. [12] construct a scheduling optimization model of batch flow shops to find optimal processing sequences. Given a batch chemical system, Lin et al. [13] design a Petri-net-based A* algorithm to obtain the optimal paths within a reachable graph and map the paths to valve operational instructions. Given a place-timed Petri net, Zhou et al. [14] propose a state space approximation method to reduce the computational complexity in searching for optimal or suboptimal scheduling strategies. These works show promising progress in scheduling batch chemical systems. However, they fail to compute scheduling strategies real time.
Model predictive control (MPC) is an important type of advanced control approach that can utilize system information through well-developed models and real-time process measurements to predict the future trajectories of processes. Cahyono et al. [18] propose a model predictive allocation method that integrates berth and dockside crane models to enhance the efficiency during the berthing process. However, in the rolling optimization part, an exhaustive search algorithm is employed, resulting in time-consuming computation. Lefebvre et al. [15] introduce a Petri-net-based model predictive control method that can be used to calculate the shortest or approximate shortest transition firing sequences to reach target states. Lefebvre et al. [16,17] extend the method in [15] to a timed Petri net such that approximate shortest-duration scheduling strategies can be calculated even if there exist uncontrollable transitions. These works have achieved good results in real-time scheduling using MPC. However, they do not consider abrupt events, which may cause the MPC methods to fail.

3. Preliminaries

An ordinary Petri net is N = ( P , T , F , W ) , where P is a finite non-empty set of places and T is a finite non-empty set of transitions, where P T P T = . F ( P × T ) ( T × P ) is the set of directed arcs connecting the nodes, i.e., the directed arcs from the place to the transition or from the transition to the place. W : F N + denotes the weights mapped to the directed arcs. [ N ] denotes the P × T integer matrix such that
[ N ] ( p , t ) = W ( t , p ) , if ( t , p ) F ( p , t ) F W ( p , p t ) , if ( t , p ) F ( p , t ) F W ( t , p ) W ( p , t ) , if ( t , p ) F ( p , t ) F 0 , otherwise
Given that x P T is a node in a Petri net, define the x forward set as   x = { y P T | ( y , x ) F } ; define the x backward set as x = { y P T | ( x , y ) F } . This representation can be extended to a set of nodes, i.e., given that X P T ,   X = x X   x and X   = x X x .
A marking m is a vector indicating a distribution of tokens among places. Given a Petri net, a transition t is state-enabled at m, if  m ( p ) W ( p , t ) p   t , i.e., m [ t . If transition t can fire, the net reaches a new marking m such that
p P , m ( p ) = m ( p ) + [ N ] ( p , t ) ,
and this is denoted as m [ t m . If there exists a transition sequence σ = e 1 e 2 . . . e n and marking m 1 , m 2 , , m n such that m 0 [ e 1 m 1 [ e 2 m 2 m n 1 [ e n m n holds, then the marking m m is reachable from marking m 0 , denoted as m 0 [ σ m n .
A place-timed Petri net (P-TPN) is defined as G t = ( N , m 0 , d ) , where N is an ordinary Petri net structure, m 0 is the initial marking, and  d : P { 0 } R + is the function mapping the set of places to the set R + of non-negative real numbers, where d ( p ) denotes the delay of the place. A place-timed Petri net is used for system modeling, and the delay of the place corresponding to a time-consuming task is not zero. In this paper, the number of tokens in the place is not greater than one.
The state of a place-timed Petri net is X = ( m , w , g ) , where m is the marking of state X, g is the cost function of the system, and  w : P { 0 } R + is a function in which the set P of places has a token for the set R + , specifying the waiting time of the token in the place. If there exists a transition sequence σ such that m 0 [ σ m n , where m 0 and m n are the markings of X 0 and X n , respectively, then the state X n is reachable from marking X 0 , denoted as X 0 [ σ X n .
Given the state X K = ( m k , w k , g k ) of a place-timed Petri net at the k-th moment, if the transition e k is enabled, we update the marking m k + 1 , the waiting time w k + 1 , and the cost time g k + 1 according to Equations (2)–(4).
p P , w k + 1 = min ( w k + 1 + max ( d ( p ) , w k ) , d ( p ) ) , if m k + 1 ( p ) 0 p e k 0 , if m k + 1 ( p ) = 0 p e k
g k + 1 = g k + λ k + 1 ,
where λ k + 1 is the time interval between X k and X k + 1 , i.e.,  λ k + 1 m a x ( d ( p ) w k ( p ) ) .
Dijkstra and A * algorithms are frequently used as tree and graph searching methods to obtain an optimal solution. The former selects the node with the smallest cost to explore a state graph and can guarantee that its solution is an optimal path. The latter utilizes the sum of the cost and heuristic function to adjust the searching direction and outperforms the former in terms of computational efficiency if its heuristic function is appropriate.
Model predictive control (MPC) is an optimal control method that uses a dynamic model to predict future behavior and solves for the optimal control action at each time step to satisfy constraints and performance metrics [19]. It is commonly used in various dynamic systems, including industrial process control, robot control, etc. MPC dynamically adjusts the control strategy through real-time sensor feedback to match the system behavior more accurately and achieve stability and performance optimization.

4. Problem Description

A batch chemical system carries out a series of operations, each requiring a certain amount of time and a set of resources, such as valves, storage tanks, and filters. Additionally, it may encounter unexpected events such as process adjustments, urgent orders, and equipment failures. Therefore, control instructions for valves need to be calculated in real time to adjust the order of operations, ensuring the system’s productive efficiency.
To describe a batch chemical system, let D represent the set of resources and O the set of all production operations. Specifically, D has two subsets V and U. Set V = { v 1 , , v i } is the set of valves, where each valve v i has two states, i.e., the open state v s i and the closed state v ¯ s i . Set U = { u 1 , , u j , f 1 , , f z } is the set of tanks and filters, where j , z N + . u 1 , , u j are buffer tanks, and  f 1 , , f z are filters. Note that, for each tank or filter, u ¯ s j ( f ¯ s z ) , i.e., the tank is full, and the filter is used. Therefore, the set of resource states is denoted as D s = { v s 1 , . . . , v s i , v ¯ s 1 , . . . , v ¯ s i , u s 1 , . . . , u s j , u ¯ s 1 , . . . , u ¯ s j , f s 1 , . . . , f s z , f ¯ s 1 , . . . , f ¯ s z } . For an operation o O , its required set of resource states is represented as r ( o ) D s , and  δ ( o ) : o N + is the execution time of o.
As shown in Figure 1, a beer canning plant [20] is considered. The plant performs four tasks: filling, filtering, bottling, and cleaning. u s is the tank for raw beer; u 1 and u 2 are two buffer tanks. f 1 , f 2 , and f 3 are three filters. C I P stands for the supply and recovery module for cleaning agents, while the bottling module is responsible for canning. v 1 , , v 20 are double piston valves. Each one can be switched to either an “open“ or “closed“ position. When a valve is open, beer flows through the horizontal pipeline under its control. When a valve is closed, beer flows through the vertical pipeline under its control. There are 12 operations, denoted by o 1 , , o 12 , as summarized in Table 1.
A filling operation seeks to transport raw beer from u s through the pipeline to the buffer tank u 1 . There are two types of filling operations, o 1 and o 2 . Operation o 1 requires the opening of valves v 2 and v 3 ; the closing of valves v ¯ 1 , v ¯ 8 , v ¯ 9 , and v ¯ 12 ; and an execution time of five seconds. The set of resource states required by o 1 is r ( o 1 ) = { v s 2 , v s 3 , v ¯ s 1 , v ¯ s 8 , v ¯ s 9 , v ¯ s 12 , u s 1 } , and the execution time of o 2 is δ ( o 2 ) = 6 s.
A filtering operation serves to transfer liquid from buffer tank u 1 , through filters ( f 1 , f 2 , f 3 ), to buffer tank u 2 . There are three types of filtering operations, o 3 , o 4 , and o 5 . Operation o 3 requires the opening of valves v 3 and v 4 ; the closing of valves v ¯ s 1 , v ¯ s 2 , v ¯ s 8 , v ¯ s 9 , v ¯ s 7 , and v ¯ s 10 ; and the execution time 11 s. Hence, r ( o 3 ) = { v s 3 , v s 4 , v ¯ s 1 , v ¯ s 2 , v ¯ s 8 , v ¯ s 7 , v ¯ s 10 , u ¯ s 1 , u s 2 , f s 1 } , and  δ ( o 3 ) = 11 s. Similarly, r ( o 4 ) = { v s 13 , v s 14 , v ¯ s 3 , v ¯ s 4 , v ¯ s 7 , v ¯ s 8 , v ¯ s 9 , v ¯ s 10 , v ¯ s 11 , v ¯ s 12 , u ¯ s 1 , u s 2 , f s 2 } , δ ( o 4 ) = 12 s, r ( o 5 ) = { v s 18 , v s 19 , v ¯ s 3 , v ¯ s 4 , v ¯ s 7 , v ¯ s 8 , v ¯ s 9 , v ¯ s 10 , v ¯ s 13 , v ¯ s 14 , v ¯ s 17 , u ¯ s 1 , u s 2 , f s 3 } , and  δ ( o 5 ) = 13 s.
A bottling operation transfers liquid from buffer tank u 2 to the bottling module for beer bottling. There are two types of bottling operations, o 6 and o 7 . In detail, r ( o 6 ) = { v s 4 , v s 5 , v ¯ s 1 , v ¯ s 6 , v ¯ s 7 , v ¯ s 10 , u ¯ s 2 } , δ ( o 6 ) = 7 s, r ( o 7 ) = { v s 14 , v s 15 , v ¯ s 5 , v ¯ s 4 , v ¯ s 7 , v ¯ s 10 , v ¯ s 11 , v ¯ s 16 , u ¯ s 2 } , and  δ ( o 7 ) = 8 s.
A cleaning operation cleans the resources in U, and there are five cleaning operations:
(1)
Operation o 8 (cleaning buffer tank u 1 ): It is required that the cleaning liquid flows from C I P into buffer tank u 1 for 120 s. The set of required resources is r ( o 8 ) = { v s 8 , v s 9 , v ¯ s 3 , v ¯ s 7 , v ¯ s 7 , v ¯ s 10 , v ¯ s 13 , v ¯ s 18 , u s 1 } , and the cleaning time is δ ( o 8 ) = 120 s. The buffer tank u 1 must be cleaned after every two uses.
(2)
Operation o 9 (cleaning buffer tank u 2 ): It is required that the cleaning liquid flows from C I P into buffer tank u 2 for 120 s. The set of required resources is r ( o 9 ) = { v s 7 , v s 10 , v ¯ s 4 , v ¯ s 14 , v ¯ s 19 , u ¯ s 2 } , and the cleaning time is δ ( o 9 ) = 120 s. The buffer tank u 2 must be cleaned after every two uses.
(3)
Operation o 10 (cleaning filter f 1 ): It is required that the cleaning liquid flows from C I P into filter f 1 for 120 s. The set of required resources is r ( o 10 ) = { v s 1 , v s 6 , v ¯ s 2 , v ¯ s 3 , v ¯ s 4 , v ¯ s 5 , v ¯ s 7 , v ¯ s 8 , v ¯ s 11 , v ¯ s 17 , f ¯ s 1 } , and the cleaning time is δ ( o 10 ) = 120 s. The filter f 1 must be cleaned after every use.
(4)
Operation o 11 (cleaning filter f 2 ): It is required that the cleaning liquid flows from C I P into filter f 2 for 120 s. The set of required resources is r ( o 11 ) = { v s 11 , v s 16 , v ¯ s 7 , v ¯ s 8 , v ¯ s 12 , v ¯ s 13 , v ¯ s 14 , v ¯ s 15 , v ¯ s 17 , f ¯ s 2 } , and the cleaning time is δ ( o 11 ) = 120 s. The filter f 2 must be cleaned after every two uses.
(5)
Operation o 12 (cleaning filter f 3 ): It is required that the cleaning liquid flows from C I P into filter f 3 for 120 s. The set of required resources is r ( o 12 ) = { v s 17 , v s 20 , v ¯ s 7 , v ¯ s 8 , v ¯ s 18 , v ¯ s 19 , f ¯ s 3 } , and the cleaning time is δ ( o 12 ) = 120 s. The filter f 3 must be cleaned after every three uses.
Evidently, an operation cannot be performed simultaneously with another one once there are resource conflicts. For example, o 1 and o 2 cannot be simultaneously performed since o 1 requires the opening of v 3 while operation o 2 requires the closing of v 3 . However, some operations can run in parallel. For instance, o 1 and o 6 can be simultaneously executed since they are not in conflict. Therefore, there are both sequential and parallel relations between operations, and different sequences of executed operations may lead to different makespans. In addition, when scheduling a plant, unexpected events need to be considered. For example, an urgent order may suddenly arrive when the plant is running at a given schedule, the duration of an operation may change due to worn devices, or a filter or tank device may be suddenly damaged. Thus, it is essential to quickly modify the original schedule and to respond promptly to abrupt events. The key lies in quickly determining the scheduling strategies and controlling the commands to minimize the processing time.

5. Petri Net Model of a Batch Chemical System

In order to develop a model predictive control method, we need to model a given batch chemical system as a place-timed Petri net. To this end, several notations are introduced.
Definition 1. 
A logical operation ρ is a binary tuple ( γ , k ) that satisfies
o O ρ γ ( o ) = k ,
where O ρ is the set of productive operations, γ ( o ) represents the number of times to execute o, and k is a non-negative integer.
In a real-life plant, a logical operation means a specific working procedure on a part. As shown in Figure 1, a filling operation can be realized by o 1 or o 2 , and, consequently, it can be represented as the logical operation ρ 1 = ( γ 1 , 1 ) satisfying o O ρ γ 1 ( o ) = 1 , i.e.,  γ 1 ( o 1 ) + γ 1 ( o 2 ) = 1 .
Given a batch chemical system J, the batch size, i.e., the number of times to execute the system J, is denoted by Ω ( J ) .
Definition 2. 
An ordered pair of logical operations ( ρ i , ρ j ) is called a process relation, ρ i is a pre-operation of ρ j , and  ρ j is a post-operation of ρ i .
As shown in Figure 1, ρ 1 is the logical operation of the filling operation, ρ 2 is the logical operation of the filtering operation, and the processing flow is filling and then filtering, so ρ 1 is a pre-operation of ρ 2 and ρ 2 is a post-operation of ρ 1 .
Definition 3. 
Operations o and o are in conflict if o requires a valve to open and o requires a valve to be closed, or they require different states of the same device, such as a tank or filter, i.e.,  [ v V , v r ( o ) v ¯ r ( o ) ] [ x U , x r ( o ) x r ( o ) ] .
Definition 4. 
A set of operations is in conflict if each operation in it is in conflict with all others.
Definition 5. 
A set of operations is maximally in conflict, denoted by O m a x , if it is conflict and any superset of it is not in conflict, and the set of maximally conflicting sets is represented as O max .
Definition 6. 
A process graph is a binary tuple ( ζ , ψ ) , where ζ is the set of all logical operations and ψ is the set of all process relations.
Given a batch chemical system J, its place-timed Petri net model is G t s = ( P J P J ¯ P O P b P m , T , F , W , d , m 0 ) , where P J is the finite non-empty set of start places, P J ¯ is the finite non-empty set of end places, P O is the finite non-empty set of operation places, P b is the finite non-empty set of buffer operation places, and  P m is the finite non-empty set of monitor places. It can be obtained by manipulating data on the device resources, process recipes, and so on.
Furthermore, the Petri net modeling algorithm for batch chemical systems plays a crucial role in the model adjustment module of our MPC method, which can be used to reconstruct the Petri net model automatically when abrupt events occur.
For a batch chemical system, Algorithm 1 provides a modeling method to automatically generate the place-timed Petri net from a given group of data about resources such as valves, tanks and filters, batch sizes, operations, and recipes. Step 1 is to initialize the elements of the place-timed Petri net. Steps 2–14 make up a loop where the logical operation variable is the cyclic variable and, for the logical operation of process relations, they design the places, transitions, and arcs. Steps 20–26 make up the loop, where the maximally conflicting set of operations O m a x is the cyclic variable, and they design a monitor place for each O m a x O max . By means of the monitor places, the number of marked places, which represent the operations in a maximally conflicting set of operations, is, at most, one; consequently, two operations cannot be simultaneously executed if they are in conflict.
By Algorithm 1, we obtain the place-timed Petri net model of the beer canning plant, as shown in Figure 2. Here, we show the procedures to generate the Petri net. Through the production operations in Definition 1 and Table 1, we refine 15 logical operations and store them in ζ . According to Definition 2, we have 12 pairs of process relations and store them in ψ . According to Definition 6, we group ζ and ψ into the process graph ( ζ , ψ ) . According to Definitions 3–5 and Table 1, we obtain nine maximally conflicting sets. As a result, we obtain the inputs of Algorithm 1, which are the set of operations O, the operation time δ , the set of maximally conflicting sets O max , the process graph ( ζ , ψ ) , and batch size Ω ( J ) . According to Steps 1–14, the operation places, buffer places, transitions, arcs, arc weights, and initial markings of places are designed. Steps 14–17 aim to obtain the batch-head places of jobs and to design transitions connecting these batch starting places with the operation places. Similarly, Steps 17–20 aim to design the batch ending places of jobs. Finally, Steps 20–26 aim to design the monitor places for the maximally conflicting sets such that no operation competes for resources with any other operation.
Algorithm 1: Petri net modeling of a batch chemical system
Processes 12 00620 i001

6. Petri-Net-Based Predictive Control for Batch Chemical Systems

On the basis of the place-timed Petri net, a model predictive control method is presented to schedule and control a batch chemical plant in real time. It consists of three parts: the prediction model, rolling optimization, and feedback correction.
The model prediction is responsible for determining an appropriate event (transition) to be executed at each current time. This involves evaluating all candidate transitions by means of the evolving trajectories within the given prediction time domain. To do so, we need to construct a heuristic function to evaluate the execution time from any state to a goal one.
In a Petri net, an elementary path is an ordered sequence of nodes, i.e.,  π = x 1 x 2 . . . x K , where x k + 1 is an output node of x k for k = 1 , . . . , K 1 . The beginning and terminal nodes of π are denoted by   π and π , respectively. The delay cost of an elementary path π is τ ( π ) = p P π d ( p ) , where P π denotes the places occurring in π and d ( p ) is the delay of place p.
Definition 7. 
For an operation place p P o , an elementary path is called its downstream path if   π = p and π = p J ¯ , where p J ¯ is a place representing the complete logical operation of a system, and the set of its downstream paths is denoted by Π p .
Since the completion of jobs is described as the flow of tokens into certain places, we can define the time cost that tokens require by means of the downstream path. Consequently, we obtain a method to evaluate a Petri net’s states and search for them within or near the transition trajectories that require minimal time.
The path cost function is defined as follows:
h k ( m k ) = max p P o ( min π Π p τ ( π ) · m k ( p ) ) ,
where m k is the marking in a state X k .
According to Equation (6), the path cost can be used to estimate the time taken to complete all jobs and, consequently, to provide an approach to the optimization problem in the proposed Petri-net-based MPC.
A place-timed Petri net plays the role of the prediction model and is used to explore a sub-reachability graph, where a current state X k = ( m k , w k , g k ) is taken as the root node, within a given prediction time domain H, where H N + . By evaluating the leaf nodes of the sub-reachability graph with g k ( m k ) + h k ( m k ) , the leaf node with the minimal value is chosen since it is most possible in the optimal trajectory. By backtracking the sub-reachability graph from the leaf node, we can find the transition e k + 1 that can be fired at the current state X k and consequently take it as the control action at the current state.
Sensors that detect the aging of the equipment can lead to variations in operating process times, and devices occasionally break down in practice. The mismatch between an original Petri net model and a real plant is inevitable and leads to a decrease in the MPC’s reliability. To tackle this issue, we introduce a feedback correction mechanism in the proposed Petri-net-based MPC method.
Definition 8. 
Given the k-th firing transition e k , its workspace is the set of operations whose ending events are modeled by e k in the Petri net model, which is denoted by O ( e k ) .
Definition 9. 
Given the k-th firing transition e k , the feedback time α k is the function mapping from its workspace to the real number set, where o O ( e k ) , α k ( o ) is the difference in the actual ending and beginning times of o.
As a plant runs, events are executed one by one and are modeled by transitions in its Petri net model. Once a transition fires, we can calculate the real processing times of the operations that have been completed. According to Definitions 8 and 9, the real processing times are represented by α k and are fed back into the MPC such that the delays of the corresponding places can be corrected.
In a real plant, there are devices that are prone to breakdown. If a device is damaged suddenly, the operations relying on it cannot be performed. Hence, we need to re-model the plant.
Definition 10. 
At the k-th moment, the fault-event η k : D { 0 , 1 } is the function mapping from a resource set to T r u e ( 1 ) or F a l s e ( 0 ) , and  ϖ D , if ϖ breaks down, η k ( ϖ ) = 1 ; otherwise, η k ( ϖ ) = 0 .
According to Definition 10, we can identify the damaged devices by the fault event, determine the operations that cannot be performed, and correspondingly revise the process graph ( ζ , ψ ) . Then, we can correct the Petri net model via Algorithm 1.
For a state X k , its leaf nodes are obtained by firing k transitions from the initial state, and the leaf nodes are stored in the leaf node set Φ k .
In order to calculate the scheduling strategy and control instructions, we proposed the Petri-net-based MPC method for a batch chemical system, which is summarized in Algorithm 2.
Algorithm 2: Petri-net-based MPC for batch chemical plants
Processes 12 00620 i002
Algorithm 2 consists of four functions: rolling optimization, place delay model correction, fault event model correction, and rush order model correction. The first one is to calculate a control action in each time step, and the others are responsible for correcting the Petri net model according to the feedback data.
Step 1 is to initialize the elements. Steps 2–9 make up a loop, where the state X k variable is the cyclic variable. In every iteration, the rolling optimization function, place delay model correction, fault event model correction, and urgent order model correction are respectively called according to the state feedback. The loop stops, and the algorithm exits until the target state is reached. In Steps 9–16, the rolling optimization function seeks to generate the reachability graph with the limited depth defined by the prediction domain H, to evaluate each leaf node by the heuristic function, and to identify the most promising transition e k . After firing e k , the next marking m k + 1 is obtained and can be used to determine all marked operation places. We can in turn obtain all the operations being carried out in m k + 1 and the valve instructions according to the resource requirement function. In Steps 17–21, the place delay model correction function updates the delays of places if the operation time in the operation set α k is not equal to d. In Steps 22–25, the fault event model correction function computes the new process graph ( ζ , ψ ) and regenerates the place-timed Petri net model by using Algorithm 1. In Steps 26–29, the urgent order model correction updates the markings of the batch-head places when an urgent order suddenly arrives.
Algorithm 2 combines the model predictive control method and the heuristic searching algorithm. It is able to flexibly adjust the depth of the reachability graph via the prediction time domain and quickly correct the system model according to the feedback.

7. Experiments

In order to verify the Petri-net-based MPC method, a series of numerical experiments are carried out on the batch chemical plant, as shown in Figure 1. We develop the Petri-net-based MPC Visual Studio 2017 simulation program in C++, and it is run on a computer with an i7-11700K 3.6 GHZ CPU and 32.0 GB RAM.
To evaluate the performance of the rolling optimization function in the proposed MPC algorithm, we conduct six experiments without an abrupt event, and the results are summarized in Table 2.
As shown in Table 2, the Dijkstra algorithm is used to obtain the optimal solutions, and two Petri-net-based MPC algorithms are applied, where the prediction times are, respectively, 10 and 30. In the Petri-net-based MPC experiments, the mean search times per step are no more than 90 ms. Hence, we can conclude that the MPC method can schedule the plant in real time.
The average makespan in the six experiments using the MPC method is within 0.5% of the average makespan of the Dijkstra method. Hence, our MPC method can obtain a near-optimal solution to the scheduling issue of the plant.
Furthermore, the makespans of the MPC with the predication time of 30 are closer to the optimal ones than those with the predication time of 10. This means that we can approach the optimal solutions by increasing the prediction time domain if we obtain enough computational resources.
To evaluate the MPC methods with different prediction time domains, we draw Gantt graphs of Experiment 1, as shown in Figure 3. It is evident that there are major differences between the scheduling schemes. This implies that it may be worth paying greater computational costs.
To evaluate our MPC method with model correction, we conducted three experiments, which adopted the process adjustment event, urgent order event, and equipment damage event, respectively. The results are summarized in Table 3.
In Experiment 7, there are five abrupt events, in which the durations of o 8 , o 9 , o 10 , o 11 , and o 12 change to 90 s, 100 s, 110 s, and 130 s, respectively. Once such an abrupt event occurs, the place delay model correction function is called to correct the delays of the places, and the rolling optimization function computes control actions with the new Petri net model. The executive process of the plant is shown in the Gantt graph, as shown in Figure 4. The makespan without model correction is 20.23 min, while that with model correction is 19.17 min. This means that the model correction function is useful to improve the scheduling solution.
In Experiment 8, two urgent orders occur at 154 s and 172 s, respectively. The MPC algorithm is able to immediately adjust the schedule so that all orders are completed in 23.65 min.
In Experiment 9, the filters f 1 and f 2 are damaged at 465 s and 849 s, respectively. The MPC algorithm is able to regenerate the Petri net model immediately and recompute the scheduling strategy. As a result, the makespan is 25.43 min, which reflects the strong robustness of our MPC method.
From the above-mentioned results, our MPC method is able to compute the schedule scheme in real time and is robust enough to adapt to abrupt events. Further, its solution is very close to the optimal one.

8. Conclusions

The Petri-net-based MPC method is presented to schedule a batch chemical plant in real time. It consists of two algorithms. The first one aims to design the Petri net model automatically for a given batch chemical system. The second is made up of the rolling optimization function and three model correction functions. The proposed method allows the system to continuously optimize resource allocation while performing tasks, thereby achieving an efficient and intelligent production process.
The heuristic function and the predictive time domain are two important issues that affect the performance of the proposed method. However, the fixed prediction time domain limits the search area in the state space and this leads to a sacrifice in the quality of the scheduling strategy. In the future, we aim to improve the heuristic function via deep learning and to explore a method to dynamically adjust the prediction domain time such that the makespan can be shortened.

Author Contributions

Z.L. is responsible for preparing, creating, and presenting published works, and clearly writing the initial draft; J.Z. (Jiazhong Zhou) is responsible for conducting a research and investigation process; S.S. is responsible for programming, software development, designing computer programs, implementation of the computer code and supporting algorithms, testing of existing code components; J.L. is responsible for preparation, creation of the published work, specifically critical review, revision; J.Z. (Jiabing Zhang) is responsible for management and coordination responsibility for the research activity planning and execution. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the National Natural Science Foundation of China under Grant 61973130, the Fujian Provincial Science and Technology Development Project Led by the Central Government under Grant 2022L2012, and the Natural Science Foundation of Fujian Province under Grant 2021J0129.

Data Availability Statement

Data supporting the reported results can be found in the paper.

Conflicts of Interest

The authors declare that they have no conflicts of interest related to this work.

References

  1. Murata, T. Petri nets: Properties, analysis and applications. Proc. IEEE 1989, 77, 541–580. [Google Scholar] [CrossRef]
  2. Alessandro, G.; Manuel, S. Petri nets and Automatic Control: A historical perspective. Annu. Rev. Control 2018, 45, 223–239. [Google Scholar]
  3. Tianlong, G.; Bahri, P.A. A survey of Petri net applications in batch processes. Comput. Ind. 2002, 47, 99–111. [Google Scholar]
  4. Manuel, S. On the history of Discrete Event Systems. Annu. Rev. Control 2018, 45, 213–222. [Google Scholar]
  5. Tittus, M.; Lennartson, B. Hierarchical supervisory control for batch processes. IEEE Trans. Control. Syst. Technol. 1999, 7, 542–554. [Google Scholar] [CrossRef]
  6. Wang, Y.; Chou, H.; Chang, C. Generation of batch operating procedures for multiple material-transfer tasks with Petri nets. Comput. Chem. Eng. 2005, 29, 1822–1836. [Google Scholar] [CrossRef]
  7. Wang, Y.; Chang, C. A hierarchical approach to construct Petri nets for modeling the fault propagation mechanisms in sequential operations. Comput. Chem. Eng. 2003, 27, 259–280. [Google Scholar] [CrossRef]
  8. Susumu, H.; Tomoyuki, Y.; Takashi, I.; Katsuaki, O. Synthesis of Operating Procedures and Procedural Controllers for Batch Processes Based on Petri Nets. J. Chin. Inst. Chem. Eng. 2004, 35, 363–369. [Google Scholar]
  9. Petter, F.; Bengt, L.; Michael, T. Specification of a batch plant using process algebra and petri nets. Control. Eng. Pract. 2009, 17, 1004–1015. [Google Scholar]
  10. Mahsa, G.; Bahri, P.A.; Lee, P.; Gu, T. Petri-net based formulation and algorithm for short-term scheduling of batch plants. Comput. Chem. Eng. 2005, 29, 249–259. [Google Scholar]
  11. Lai, J.; Chou, H.; Chang, C. Petri-net based integer programs for synthesizing optimal material-transfer procedures in pipeline networks. J. Chin. Inst. Eng. 2006, 29, 337–346. [Google Scholar] [CrossRef]
  12. Samuel, W.W.; Anurag, R.; Sean, W. Model approximation for batch flow shop scheduling with fixed batch sizes. Discret. Event Dyn. Syst.-Theory Appl. 2015, 25, 487–529. [Google Scholar]
  13. Lin, W.; Luo, J.; Zhou, J.; Huang, Y.; Zhou, M. Scheduling and control of batch chemical processes with timed Petri nets. In Proceedings of the IEEE International Conference on Automation Science and Engineering, Fort Worth, TX, USA, 21–25 August 2016. [Google Scholar]
  14. Zhou, J.; Lefebvre, D.; Zhiwu, L. A Clustering Approach to Approximate the Timed Reachability Graph for a Class of Time Petri Nets. IEEE Trans. Autom. Control 2022, 67, 3693–3698. [Google Scholar] [CrossRef]
  15. Lefebvre, D.; Leclercq, E. Control Design for Trajectory Tracking With Untimed Petri Nets. IEEE Trans. Autom. Control 2015, 60, 1921–1926. [Google Scholar] [CrossRef]
  16. Lefebvre, D. Near-Optimal Scheduling for Petri Net Models With Forbidden Markings. IEEE Trans. Autom. Control 2018, 63, 2550–2557. [Google Scholar] [CrossRef]
  17. Lefebvre, D. Dynamical Scheduling and Robust Control in Uncertain Environments with Petri Nets for DESs. Processes 2017, 5, 54. [Google Scholar] [CrossRef]
  18. Cahyono, R.T.; Jacob, F.E.; Bayu, J. Discrete-Event Systems Modeling and the Model Predictive Allocation Algorithm for Integrated Berth and Quay Crane Allocation. IEEE Trans. Intell. Transp. Syst. 2020, 21, 1321–1331. [Google Scholar] [CrossRef]
  19. Camacho, E.F. Model Predictive Control and Hybrid Systems. In Model Predictive Control; Springer: London, UK, 2007; pp. 289–310. [Google Scholar]
  20. Yeh, M.L.; Chang, C.T. An automata based method for online synthesis of emergency response procedures in batch processes. Comput. Chem. Eng. 2012, 38, 151–170. [Google Scholar] [CrossRef]
Figure 1. A beer canning plant.
Figure 1. A beer canning plant.
Processes 12 00620 g001
Figure 2. The place-timed Petri net model of the beer canning plant.
Figure 2. The place-timed Petri net model of the beer canning plant.
Processes 12 00620 g002
Figure 3. Gantt graphs of the MPC results in Experiment 1.
Figure 3. Gantt graphs of the MPC results in Experiment 1.
Processes 12 00620 g003
Figure 4. Gantt graphs of the MPC results in Experiment 7.
Figure 4. Gantt graphs of the MPC results in Experiment 7.
Processes 12 00620 g004
Table 1. Operations of the beer canning plant.
Table 1. Operations of the beer canning plant.
OperationsOpen Valve StatesClosed Valve StatesTank or Filter StatesTime
o 1 v s 2 , v s 3 v ¯ s 1 , v ¯ s 8 , v ¯ s 9 , v ¯ s 12 u s 1 5 s
o 2 v s 12 , v s 13 v ¯ s 3 , v ¯ s 8 , v ¯ s 9 , v ¯ s 11 u s 1 6 s
o 3 v s 3 , v s 4 v ¯ s 1 , v ¯ s 2 , v ¯ s 8 , v ¯ s 9 , v ¯ s 7 , v ¯ s 10 u ¯ s 1 , u s 2 , f s 1 11 s
o 4 v s 13 , v s 14 v ¯ s 3 , v ¯ s 4 , v ¯ s 8 , v ¯ s 9 , v ¯ s 7 , v ¯ s 10 , v ¯ s 11 , v ¯ s 12 u ¯ s 1 , u s 2 , f s 2 12 s
o 5 v s 18 , v s 19 v ¯ s 3 , v ¯ s 4 , v ¯ s 8 , v ¯ s 9 , v ¯ s 7 , v ¯ s 10 , v ¯ s 13 , v ¯ s 14 , v ¯ s 17 u ¯ s 1 , u s 2 , f s 3 13 s
o 6 v s 4 , v s 5 v ¯ s 1 , v ¯ s 6 , v ¯ s 7 , v ¯ s 10 u ¯ s 2 7 s
o 7 v s 14 , v s 15 v ¯ s 5 , v ¯ s 4 , v ¯ s 7 , v ¯ s 10 , v ¯ s 11 , v ¯ s 16 u ¯ s 2 8 s
o 8 v s 8 , v s 9 v ¯ s 3 , v ¯ s 7 , v ¯ s 10 , v ¯ s 13 , v ¯ s 18 u s 1 2 min
o 9 v s 7 , v s 10 v ¯ s 4 , v ¯ s 14 , v ¯ s 19 u s 2 2 min
o 10 v s 1 , v s 6 v ¯ s 2 , v ¯ s 3 , v ¯ s 4 , v ¯ s 5 , v ¯ s 7 , v ¯ s 8 , v ¯ s 11 , v ¯ s 17 f ¯ s 1 2 min
o 11 v s 11 , v s 16 v ¯ s 7 , v ¯ s 8 , v ¯ s 12 , v ¯ s 13 , v ¯ s 14 , v ¯ s 15 , v ¯ s 17 f ¯ s 2 2 min
o 12 v s 17 , v s 20 v ¯ s 7 , v ¯ s 8 , v ¯ s 18 , v ¯ s 19 f ¯ s 3 2 min
Table 2. Experiments on the Petri-net-based MPC algorithm without an abrupt event.
Table 2. Experiments on the Petri-net-based MPC algorithm without an abrupt event.
ExperimentsDijkstraPetri-Net-Based MPC
Predication Domain H = 10Predication Domain H = 30
No.Batch sizeMakespan (min)Makespan (min)Search time (ms)Makespan (min)Search time (ms)
11019.9620.234.919.969.1
22044.3044.6018.644.3525.6
33069.6070.1024.169.7044.1
44096.6397.2153.296.8656.8
550121.75122.2581.8121.9084.6
660147.10147.4588.9147.1089.4
Table 3. Experiments on the Petri-net-based MPC with abrupt events.
Table 3. Experiments on the Petri-net-based MPC with abrupt events.
ExperimentsNo Model Correction Predication Domain H = 10Model Correction Predication Domain H = 10
No.Batch sizeMakespan (min)Makespan (min)
71020.2319.17
810N/A23.65
910N/A25.43
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lin, Z.; Zhou, J.; Sun, S.; Luo, J.; Zhang, J. Petri Net Model Predictive Control Method for Batch Chemical Systems. Processes 2024, 12, 620. https://doi.org/10.3390/pr12030620

AMA Style

Lin Z, Zhou J, Sun S, Luo J, Zhang J. Petri Net Model Predictive Control Method for Batch Chemical Systems. Processes. 2024; 12(3):620. https://doi.org/10.3390/pr12030620

Chicago/Turabian Style

Lin, Zexuan, Jiazhong Zhou, Shasha Sun, Jiliang Luo, and Jiabing Zhang. 2024. "Petri Net Model Predictive Control Method for Batch Chemical Systems" Processes 12, no. 3: 620. https://doi.org/10.3390/pr12030620

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop