**1. Introduction**

Production scheduling is a fundamental function in production control. It has an immediate and considerable impact on the efficiency of related manufacturing processes and significantly influences the overall production performance.

The primary characteristic of batch production is that the output of the process appears in quantities of materials or lots called batches. All components are completed at a workstation before they move to the next one. These kinds of production environments appear in chemical, pharmaceutical, food and similar industries.

The control of batch processes poses difficult issues as these processes are neither continuous nor discrete, but have the characteristics of both. ISA society introduced a multi-part S88 standard where the first part [1] defines the models and terminology for batch plants and control systems. S88 provides a framework for the development of technologies that not only support control activities of batch processes but also management activities, such as scheduling. This is illustrated in [14] where a generic framework is defined for interpreting a multi-purpose/product batch plant in terms of S88 constructs for scheduling purposes.

In order to cope with the behaviour of a batch production process an appropriate mathematical model is needed. When the behaviour is described by such a model, formal methods can be used, which usually improve the understanding of systems, allow their analysis and help in implementation. MILP based formulations of batch process features are typically used as shown in [12]. Nevertheless, Petri nets have also been applied in different aspects of modelling, qualitative and quantitative analysis, control, planning and scheduling of batch processes [4]. Independently of the chosen framework, the modelled behaviour is often extremely complex. Within the changing production environment the effectiveness of batch production modelling is, therefore, a prerequisite for the effective design and operation of batch systems.

To determine a model, data from different existing information systems could be used. From production management systems, such as Manufacturing Resource Planning (MRP II) and Enterprise Resource Planning (ERP), data about the needs, product structure and process

©2012 Gradišar and Mušiˇc, licensee InTech. This is an open access chapter distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0),which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. ©2012 Gradišar and Mušič, licensee InTech. This is a paper distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### 2 Will-be-set-by-IN-TECH 4 Petri Nets – Manufacturing and Computer Science Automated Petri-Net Modelling for Batch Production Scheduling <sup>3</sup>

structure could be gained [21]. On the other hand, data from the production process could be used to determine the actual resource availability. MRP II and ERP systems are commonly used in discrete manufacturing for upper level production control, such as production planning. Standard production management tools, such as MRP, are also used in batch production environment [20]. As defined with standard S88.01 the required raw materials and their quantities are determined from a dedicated data structure named *Formula*. This way the formula can be linked to standard Bill of Materials (BOM) used within MRP II concept [7].

time stamps is defined as a multiset, and written as a sum (union) of sets of timestamped tokens. E.g., two tokens with time stamp 10 and three tokens with timestamp 12 are written as 2@10 + 3@12. The timestamp of a token defines the time from which the token is available. Time stamps are elements of a time set *TS*, which is defined as a set of numeric values. In many software implementations the time values are integer, i.e., *TS* = **N**, but will be here admitted

as collections of time stamps and are multisets over *TS* : *TSMS*. By using HD principle the formal representation of a P/T timed Petri net is defined as follows. *TPN* = (N , *M*0) is a timed Petri net system, where: N = (*P*, *T*, *Pre*, *Post*, *f*) is a Timed Petri net structure, *P* = {*p*1, *p*2, ..., *pk*}, *k* > 0 is a finite set of places, *T* = {*t*1, *t*2, ...,*tl*}, *l* > 0 is a finite set of transitions. *Pre* : (*P* × *T*) → **N** is the input arc function. If there exists an arc with weight *k* connecting *p* to *t*, then *Pre*(*p*, *t*) = *k*, otherwise *Pre*(*p*, *t*) = 0. *Post* : (*P* × *T*) → **N** is the output arc function. If there exists an arc with weight *k* connecting *t* to *p*, then *Post*(*p*, *t*) = *k*, otherwise *Post*(*p*, *t*) = 0. *f* : *T* → *TS* is the function that assigns a non-negative deterministic time delay to every *t* ∈ *T*. *M* : *P* → *TSMS* is the timed marking, *M*<sup>0</sup> is the initial marking of a timed Petri

To determine the availability and unavailability of tokens, two functions on the set of markings are defined. The set of markings is denoted by **M**. Given a marking and model time, *m* : *P* × **M** × *TS* → **N** defines the number of available tokens, and *n* : *P* × **M** × *TS* → **N** the number of unavailable tokens for each place of a TPN at a given time *τk*. Note that model

Using the above definitions, addition and subtraction of timed markings, and the TPN firing rule can be defined. Given a marked *TPN* = (N , *M*), a transition *t* is time enabled at time *τk*, denoted *M*[*t*�*τ<sup>k</sup>* iff *m*(*p*, *M*, *τk*) ≥ *Pre*(*p*, *t*), ∀*p* ∈ •*t*. An enabled transition can fire, and as a result removes tokens from input places and creates tokens in output places. The newly created tokens are accompanied by timestamps depending on the model time and the delay of transition that created the tokens. If marking *M*<sup>2</sup> is reached from *M*<sup>1</sup> by firing *t* at time *τk*, this is denoted by *M*1[*t*�*τkM*2. The set of markings of TPN N reachable from *M* is denoted by

Petri nets are a family of tools that provide a framework, which can be used for various problems that appear during the life-cycle of a production system [18]. In this section we present the modelling of production system using timed Petri nets for the purpose of performance control. When timed Petri nets are used, it is possible to derive performance measures such as makespan, throughput, production rates, and other temporal quantities. The Petri net model is built based on the data stored in production management information

With the method presented here several scheduling problems that appear in various production systems can be solved. In a discrete manufacturing different jobs are needed to produce a final product that is composed of several components. Similarly in batch production different activities have to be performed in order to produce a final product. However, here the resultant product is produced with some irreversible change, e.g. products

<sup>0</sup> . Timed markings are represented

Automated Petri-Net Modelling for Batch Production Scheduling 5

to take any positive real value including 0, i.e., *TS* = **R**<sup>+</sup>

time also belongs to time set *TS*, *τ<sup>k</sup>* ∈ *TS*.

net.

*R*(N , *M*).

**3. Modelling procedure**

systems, i.e., ERP system.

**3.1. The class of production systems**

are mixed from quantities of ingredients.

While in a discrete manufacturing processes BOM are used to determine process materials and their quantities needed for production of finished products, in batch production processes these data are given with Formula. The same is with information that defines a sequence of operations required to produce an item. In discrete manufacturing processes these are defined with Routing, and Manufacturing recipes are used in batch production.

These two groups of data items, together with the given resource units, form the basic elements of the production process. These data can be effectively used to build up a model of the batch production system with timed Petri nets. An algorithm will be introduced, which builds a Petri-net model from the existing data. The model is built directly in a top-down manner, starting from the Formula (BOM) and the Manufacturing recipes (routings) [21].

First a class of Petri nets used is presented in a formal manner with detailed discussion on time representation. Next a method to describe a Formula with Petri net structure is given. Root item, representing the product, is composed of sub-items (sub-processes). Later a method of describing the basic production activities with timed Petri net is presented. The obtained model is applied in optimisation of batch scheduling problem.
