Industrial Automation course

Size: px
Start display at page:

Download "Industrial Automation course"

Transcription

1 Industrial Automation course Lesson 11 Petri Nets Modeling Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 1

2 Introduction An automated production system is necessary to obtain products, starting from blanks or raw materials, following defined production sequences (typically a sequence for a product type). It is made of different types of resources: Processing machines Handling devices Storage warehouses Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 2

3 Introduction The production process consists of the execution of processing activities which require the usage of at least one resource. The resources must be: Acquired at the beginning of an activity (if they aren t already allocated previously for this purpose) Released at the end (so that they can be used from other activities, if they are shared resources, or from the same one in the production of the subsequent product). Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 3

4 Introduction The activities: They are subject to conditions for their use (pre-conditions) Define a variation of the system state (post-conditions) They must be synchronized in a suitable way (sequence, concurrence, alternative) The «interesting» models are those related to flexible productions. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 4

5 Introduction The flexible productions are productions in which is possible to: Change the working type Change products Change machines Change the machine path Heavily exploit the available resources Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 5

6 Introduction All the implemented models must be without deadlock. What is the deadlock? Literally, the deadlock (stall), is a situation in which the system can t evolve anymore. Usually it is connected to the cyrcular waiting («I m waiting for you», «you are waiting for me»). In the Petri nets, the deadlock represents a died marking, i.e. a marking M, of a net N, in which R N, M =. It means that, in that marking, there aren t active transitions. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 6

7 Introduction The models that will be described are defined of functional type, i.e. models that describe the functions (or activities) executed by the plant. Systems with fixed working sequences will be considered. The modeling is executed following these steps: Activity model: a Petri Net model is defined for each activity Products model: all the nets associated to the activities are composed, in order to define the working sequences Resources model: The pre- and the post-conditions related to the resources availability Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 7

8 There are several ways to describe the activities: Two events model (activity = transition place - transition) One event model (activity = transition) FMS model (activity = place) The three models are equivalent (it is possible to move from one to another without information loss). The one event model and the FMS are reduction of the two events one. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 8

9 The differences between the different models are: Ease of the model analysis Representation of the resources use Ease of the translation of Petri Nets in a code useful for the real implementation Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 9

10 Two events activities model Activity waiting Starting activity Pre-conditions States Activity in progress Finishing activity Ended activity Events Post-conditions Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 10

11 Two events activities model - resources If there are limited resources, what is normally done is insert a place connected to the finishing activity transition and the starting activity one, with a number of tokens equal to the available resources. N available resources Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 11

12 Two events activities model - example Let s consider the parts transport using a robot. When the piece is available for the movement, if the robot is available, the handling is started. When the robots finishes the activity, the piece is available for the subsequent activities, while the robot returns available for a next handling. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 12

13 Two events activities model - example t1 p2 p1 p4 Meaning of the places: p1 part waiting p2 part handling p3 part moved p4 part waiting t2 Meaning of the transitions: t1 handling start t2 handling stop p3 Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 13

14 Detail of the operations representation The definition of the number of operations to execute is strictly correlated to the resource that are used during the operations. For example, is the execution of N subsequent operations, executed all with the same resource, to divide the operations or represent them in a single one does not change anything. The advantage obtained with the aggregation is the reduction of the number of places and transitions. In the case of the use of resources only in a part of the activity, the best practice is to divide the activity. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 14

15 Two events activities model - example R B1 B2 M Input buffer Machine Output buffer Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 15

16 Two events activities model - example Hypothesis: The parts arrive automatically to the buffer B1 The parts are taken automatically from the buffer B2 The buffers have capacity 2 The system activities are: B1 receives the part R load the part taken from B1 on M M works the piece R load the piece taken from M on B2 B2 is emptied Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 16

17 Two events activities model - example Activity waiting Activity in progress Activity ending - Piece arrival in B1 Piece to be loaded Piece to be loaded Piece loading in M Loaded piece Loaded piece Machining Machined piece Machined piece Piece unloading in B2 Unloaded piece Unloaded piece Emptying B2 - Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 17

18 Two events activities model - example Piece to be loaded Loaded piece Machine piece Unloaded piece Begin arrival Begin loading Begin machining Begin unloading Begin exiting Arrive in B1 Loading in M Machining Unloading in B2 Exiting from B2 Arrival end Loading end Machining end Unloading end Exiting end Piece to be loaded Loaded piece Machined piece Unloaded piece Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 18

19 Two events activities model - example It is now necessary to define pre and post conditions of the activities Activity Pre-conditions Post-conditions Arrive in B1 B1 available Loading in M R available, M available R available, B1 available Machining Unloading in B2 R available, B2 available R available, M available Emptying B2 B2 available Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 19

20 Two events activities model - example p10 p12 p13 t1 p1 t2 p2 t3 p3 t4 p4 t5 p5 t6 p6 t7 p7 t8 p8 t9 p9 t10 p11 Places meaning: Transitions meaning p1: arrival in B1 p8: unloaded piece t1: arrival start t8: unloading end p2: piece to be loaded p9: exiting from B2 t2: arrival end t9: exiting start p3: loading in M p10: B1 available t3: loading start t10: exiting end p4: loaded piece p11: R available t4: loading end p5: machining p12: M available t5: machining start p6: machined piece p13: B2 available t6: machining end p7: unloading t7: unloading start Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 20

21 One event activities model In this case the activity is modeled using a single transition. Compared to the 2 events model, this corresponds to combine, in one single transition, the subnet transition place transition that represents the activity, associating the two events (begin and end) in the same transition. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 21

22 One event activities model With this model the activity is described using a single transition. The elements of the scheme are: A transition that represents the event of activity execution A place for the waiting of the activity (or end of the previous) A place with the pre-conditions A place for the activity ending (or the waiting of the next) A place with the post-conditions Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 22

23 One event activities model Two events model One event model Activity waiting Pre-conditions Activity begin Activity executing Activity end Activity waiting Activity ended Activity Pre-conditions Post-conditions Activity ended Post-conditions Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 23

24 One event activities model - remarks Model abstraction The activity has infinitesimal duration the state «executing activity» is not present The resources used in single activities are modeled with self-loops there isn t a true model of busy resource Representation compactness Thanks to this representation the dimension of the graph is highly reduced Control implementation The beginning and the end of the activity are part pf the same transition pay attention to the control implementation Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 24

25 One event activities model - example Let s implement, with this logic, the example related to the transport of the part with the robot Activity waiting Activity beginning Activity waiting Activity executing Activity ending Activity ended Robot availability Activity Activity ended Robot availability Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 25

26 One event activities model - example Let s consider, rather, the machining cell example Piece to be loaded Loaded piece Machined piece Unloaded piece Arrival in B1 Loading in M Machining Unloading Exiting from B2 Piece to be loaded Loaded piece Machined piece Unloaded piece Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 26

27 One event activities model - example p5 p7 p8 t1 p1 t2 p2 t3 p3 t4 p4 t5 p6 Places meaning: p1: piece to be loaded p2: loaded piece p3: machined piece p4: unloaded piece p5: B1 available p6: R available p7: M available p8: B2 available Transitions meaning t1: input t2: loading t3: machining t4: unloading t5: exiting Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 27

28 FMS model (Flexible Manufacturing Systems) The basic idea is the following: A resource is acquired in order to execute an operation; this resource is kept (allocated) until the resource needed for the execution of the next activity is released When the resource is allocated, the activity executing state is indistinguishable from the state of wait for the next activity The resources exchange is «instantaneous» (the deallocation of a resource used in an operation and the allocation of another resource for the next action are contemporary) Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 28

29 FMS model (Flexible Manufacturing Systems) Two events model FMS model Prev. Activity executing Activity ending Activity ended Activity waiting Post-conditions prev. activity Prev. Activity executing End prev. Act. Start next act. Pre-conditions next activity Activity starting Pre-conditions next activity Next activity executing Post-conditions prev. activity Next activity executing Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 29

30 FMS model (Flexible Manufacturing Systems) - example The FMS born with the idea of associate an activity to the used resource. As described previously, the example of the machining cell has activities that use more than one resources (for example the moving from B1 to M). In these cases, for the FMS models, the sub-operations in which the multiple resources are used are «hidden» inside the transitions. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 30

31 FMS model (Flexible Manufacturing Systems) - example The activities will be: Use of B1 Moving B1 M Machining Moving M B2 Use of B2 Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 31

32 FMS model (Flexible Manufacturing Systems) - example p6 p8 p9 t1 p1 t2 p2 t3 p3 t4 p4 t5 p5 t6 p7 Places meaning: Transitions meaning p1: use of B1 p6: B1 available t1: start input t6: exiting end p2: moving B1 - M p7: R available t2: start loading p3: machining p8: M available t3: start machining p4: moving M- B2 p9: B2 available t4: start unloading p5: use of B2 t5: start exiting Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 32

33 Modeling methods There are different methods for the modeling of FMS. The basic idea is always to divide the problem in smaller and easier sub-problems. The methods are: Top-down Bottom-up Hybrid These methods are often defined direct, because starting from the model of the system behavior it is possible to develop the plant controller. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 33

34 Modeling methods Top-down methods The top-down methods are based on subsequent refines of the Petri Net: It starts from a simple net (defined of first level), that describes (in an aggregate way) all the functionalities of the system The first level net is expanded, adding places and transitions with more detail. The refining rules preserve the properties of the net (as the boundedness and the liveness) Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 34

35 Modeling methods Top-down methods Valette method Lets consider a net, defined of first level (N1), in which exist transitions 1-enabled (i.e. so that the number of input token to that transitions allow only one fire, in a defined marking). These transitions can be substituted with well-formed block (Petri Nets with defined characteristics, that will be detailed in the next slides). The refinement of the transition is made deleting it and connecting the input / output arcs to the initial / final transition of the well-formed block. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 35

36 Modeling methods Top-down methods Valette method First level net Well-formed block t11 t1 t11 p2 p1 t12 p1 t2 t12 p2 t2 Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 36

37 Modeling methods Top-down methods Valette method It is possible to operate also refining the places. This process is executed substituting a place with a sequence place-transition-place and then refining the the intermediate transition. The upstream / downstream place in respect to the intermediate transition is connected to the input / output arcs of the place that must be refined. The token, that were originally inside the place, are moved in the place upstream to the intermediate transition. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 37

38 Modeling methods Top-down methods Valette method Transition refining Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 38

39 Modeling methods Top-down methods Valette method - Properties The resulting net after the refining of a transition (or place) of a first level network (N 1 ) takes the name of second level net (N 2 ). N 2 keeps the main properties of N 1 : N 1 bounded N 2 bounded N 1 live N 2 live N 1 reversible N 2 reversible N.B.: Obviously this is valid also for the next refining! Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 39

40 Modeling methods Top-down methods Valette method Well-formed block A well-formed block has the following characteristics: Exist only one input transition (t in ) and only one in output (t out ) The net obtained adding to the block a place (p a ) marked with a token, that has in its post-set / pre-set only the transitions t in / t out is live The initial marking of the added net is the only one reachable marking in which p a is marked (it has a token) The only one transition of the added block, that is enabled in the initial marking is t in Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 40

41 Modeling methods Top-down methods Conclusions Advantages Guarantee that the final Petri Net has important structural properties Ease easy implementation Disadvantages It is not possible to ensure the interpretation consistency of the model Impossible to insert block that are not independent Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 41

42 Modeling methods Bottom-up methods In the bottom-up methods sub-models are developed (modules) that are independent, and than, they are connected, sharing (merging) some net elements. It is possible to merge places, transitions, particular paths (sequences, alternatives, fork-join, etc ) Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 42

43 Modeling methods Bottom-up methods - Conclusions Advantages They are intrinsically suitable for the reuse of models In the module are «well-formed» it is easy to understand the reason of the non-compliance of some properties Disadvantages They don t guarantee the preservation of the fundamental properties The method that guarantee the preservation of the properties require strong simplification of the model Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 43