19
EE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: Petri nets were developed in the early 1960s by C.A. Petri in his Ph.D. dissertation. C.A. Petri. Kommunikation mit Automaten. PhD thesis, Institut für instrumentelle Mathematik, Bonn, 1962. [1] They are useful for modeling concurrent, distributed, asynchronous behaviors in a system. [1] Petri Net is a 5 tuple [2] * Token Place Transaction Flow Parts of a Petri Net system This Petri Net has: 2 places: p1, p2 p1 p2 t1 1 transition: t1 p1 has one token: M(p1) = 1 p2 has 0 tokens: M(p2) = 0 Petri Net [1] 1

EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

EE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten

Petri-Nets

Introduction:

• Petri nets were developed in the early 1960s by C.A. Petri in his Ph.D. dissertation. C.A. Petri. Kommunikation mit Automaten. PhD thesis, Institut für instrumentelle Mathematik, Bonn, 1962. [1]

• They are useful for modeling concurrent, distributed, asynchronous behaviors in a system. [1]

Petri Net is a 5 tuple [2]

*

Token Place Transaction Flow Parts of a Petri Net system

This Petri Net has:

2 places: p1, p2 p1 p2

t1

1 transition: t1 p1 has one token: M(p1) = 1 p2 has 0 tokens: M(p2) = 0

Petri Net [1]

1

Page 2: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

1. A Transition is enabled when all places inputting to the transition have a token. Once a transition is enabled, it may fire. Upon firing, the token is removed from the input places and a token is moved to the output place based on the weights. Only 1 token is removed or added to a place if the weight is 1.

p1

p2 t1

p3 p1

p2t1

p3

Petri Net after T1 fires [1] Petri Net before T1 fires [1]

2. A weighted Petri Net requires multiple tokens to enable a transition or moves

multiple tokens to the output place. The weight value is placed on the edge of the transition.

p1

p2

t1

p3 2

4 p1

p2

t1

p3 2

4

Weighted Petri Net before transition T1 fires [1] Weighted Petri Net after transition T1 fires [1] Transition Equations:

**

* *

**

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

The Petri Net is a five element vector. It is comprised of a Places Vector, Transitions Vector, Incident (input) Matrix, Output Matrix and Marking Vector. The Places vector is comprised of Places and Resources. Places are on the job path and resources are off the job path. Blocking occurs when there are not enough Tokens in the initial loop to enable a Transition.

2

Page 3: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

P = vector of Places = P1, P2, P3 ….Pn T

T = vector of Transitions = T1, T2, T3 ….Tm T

Incident Matrix Output Matrix(1 indicates Place tied to Transition) (1 indicates Place link to Transition)

P1 P2 P3 . . . . Pn T1 T2 . . . TnT1 P1

Job Flow

T2 P2. O = P3

Job Flow

Job Flow

I = . . Job. .Tn .

Job Resource ... ResourcePn

Job Flow

Job Flow

The Petri Net Transition Equation provides the location of the tokens after the transition fires. M is the Incident Matrix which is a fixed matrix based on the configuration of the Petri Net.

M=OT-I

I

1

0

0

0

0

1

0

0

0

0

1

0

0

0

0

1

0

0

0

0

1

0

0

0

0

0

1

0

0

1

0

0

O

0

1

0

0

0

0

0

0

0

0

1

0

0

1

0

0

0

0

0

1

0

0

0

1

0

0

0

0

1

0

1

0M OT I

M

1

0

0

0

1

1

0

0

0

1

1

0

0

0

1

1

0

0

0

1

1

1

0

0

0

0

1

1

0

1

1

0

=

3

Page 4: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

The Petri Net Marking Transition Equation can produce the next marking vector if the firing transition vector X is known. Marking Vector m = [m1, m2, m3, m4,… mm]T

mi+1=mi+MTXi+1

Where Xk=Xi+1 Where mk=mi+1

Fire T at time 1

Xk

1

0

0

0 mi

2

0

0

0

0

1

1

2

mk mi MT Xk.

mk

1

1

0

0

0

0

1

2

=

Petri Net flow example: Initial Condition (Pl = 2 tokens (Red and Blue), R1 = 1 token, R2 = 1 token, M1 = 2 token)

Fire T at time 1

Xk

1

0

0

0 mi

2

0

0

0

0

1

1

2

mk mi MT Xk.

mk

1

1

0

0

0

0

1

2

=

Post Fire t=1 Post Fire t=2

**

**

* *

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

Fire T at time 2

Xk

0

1

0

0 mi

1

1

0

0

0

0

1

2

=

mk mi MT Xk.

mk

1

0

1

0

0

1

1

1

=* *

**

*

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

Fire T at time 3

Xk

1

0

1

0 mi

1

0

1

0

0

1

1

1

=

mk mi MT Xk.

mk

0

1

0

1

0

0

0

2

=*

*

*

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

*

*

4

Page 5: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Post Fire t=3

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

*

Fire T at time 4

Xk

0

1

0

1 mi

0

1

0

1

0

0

0

2

=

mk mi MT Xk.

mk

0

0

1

0

1

1

1

1

=

**

*

Post Fire t=4

Fire T at time 5

Xk

0

0

1

0 mi

0

0

1

0

1

1

1

1

=

mk mi MT Xk.

mk

0

0

0

1

1

1

0

2

=

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

*

*

*

*

*

Post Fire t=5

Fire T at time 6

Xk

0

0

0

1 mi

0

0

0

1

1

1

0

2

=

mk mi MT Xk.

mk

0

0

0

0

2

1

1

2

=

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

**

*

* *

Post Fire t=6

P1 P2 P3 P4 P5

R1 (P6) R2 (P7)

M1 (P8)

T4T3T2T1

**

*

**

*

5

Page 6: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

In this example the Transition firing vector input was manual operation. The Marking Transition equation accounts for the dynamics of the Petri Net. In order to successfully simulate the Petri Net as a discrete event system, the firing vector must be calculated. The firing vector address the possibility of single or multiple transition firings at any given time. This is further discussed later in the lecture.

Firing Vector (Xi) equation [2]

Robot Example: A Petri Net can be used to model the control commands using IF / THEN logic as depicted below.

Robot Control Command Nodes [3]

Robot Sensor Configuration [3]

Using the two command structures and the sensor inputs, the Petri Nets below represents the flow for Wall Tracking and Robot Tracking through the command control network. In Wall Tracking the command structure is; if the robot approaches walls, execute a left turning motion. If the robot moves away from the walls, execute a right turning motion. If walls are located on the left side of the robot, stop quickly and execute a slow right turning motion. If sensors do not detect the wall, go forward. [3]

6

Page 7: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Wall Tracking Petri Net [3]

Simulation Results for Wall Tracking [3]

7

Page 8: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

In Robot Tracking, one robot travels in parallel with the other. The Robot does not exactly know its current position or the position, velocity and moving direction of the other robot. Therefore it must infer the state of the other robot through local sensor information. [3]

Place Table Robot Tracking Task [3]

Petri Net Robot Tracking Task [3]

8

Page 9: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Neural Network and Fuzzy Logic Control: Using a weighted Petri Net a Neural Network can be simulated. The Neural Network conversion to Petri Net uses a weighted transition as the hardlim function with standard inputs places and transitions.

McCullock-Pits NN model (top) and Adaptive Neural Processor (bottom) [4]

A Fuzzy Logic controller can be designed using Petri Nets. The hardware implementation of the controller is based on the Petri Net design. In the following example the Fuzzy Logic Controller for a Concrete Production Device is designed using Petri Nets. The hardware to implement the Fuzzy Logic Controller is designed from the Petri Net. Concrete Production Example [5]

1) The action sequence arrangements. The concrete production device includes conveyor belts T1 and T2 which transport cement and aggregate to the scales, water container and cement mixer (left). The action sequence essential for the concrete production is as follows.. • aggregate weighing; • emptying the scales; • cement weighing; • emptying the scales; • water batching; • ingredients mixing in the cement mixer; • emptying the cement mixer. The concrete production device should work

with maximum efficiency, i.e., as many actions as possible should be performed simultaneously. For example, while mixing the ingredients together, a new portion of aggregate should be weighed. 2) Description of the control algorithm using Petri Net. The Petri net which describes the control algorithm of the concrete production device is shown below. The transitions described by “1” are unconditioned ones.

9

Page 10: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

3) Transformation of the Petri Net to the Logic Circuit. Application of the proposed method leads to the logic circuit of this net, based on JK flip-flops of the type SA or SB, as shown in Fig. 11. Analogously, one can transform the Petri Net to the logic scheme containing the fuzzy JK flip-flops of the type AA or AB.

Hardware implementation of the fuzzy Petri Net using JK flip-flops type SA or SB [5]

Figure 1 - Petri Net for a Fuzzy Logic Controller [5]

10

Page 11: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Matrix Discrete Event Model: Fv is Steward’s Task Sequencing Matrix (Jobs Complete) Fr is Kusiak’s Resource Requirements Matrix Bill of Materials (Resources Available) Sv is Next Job Conditions fulfilled (Transition) Sr is Released Resource Conditions fulfilled (Transition)

Basic Concept Matrix Formulation of Discrete Event Systems [2]

The Petri-net can easily be derived from the from the discrete event matrix of a flexible manufacturing system. The discrete event matrix is formed by using engineering data. The Bill of Materials which is an integral part of a manufacturing process can be described as a matrix in which the (i,j) entry is equal to the number of parts type j needed to fabricate one assembled part of type i. [6] In the Job Sequencing Matrix, jobs are indicated by the columns & rows. A “1” in the matrix shows that job j is a prerequisite for job i. The Job Sequencing Matrix can represent an array of parts needed in a manufacturing process sequence.[6] The available resources required for a process is used to generate the Resources Requirements Matrix. The rows relate to jobs, and the columns correspond to resources (i.e.. tooling, machines…etc). A “1” in the Resources Requirements Matrix indicates that resource j is required for job i. The Resources Requirements Matrix is easily modified as resources change.[6] To allow assembly, job sequencing, addition of resources, deadlock analysis & avoidance, and facilities dispatching design, a rule-based discrete event matrix model is needed. The model yields a framework for a rigorous analysis of a flexible manufacturing system. The model can be simulated on a computer. Job sequencing, resource assignment, and resource release are represented in the model.[6]

11

Page 12: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Matrix Model of Petri Net [2]

12

Page 13: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

“Logical” Equations for Discrete Event Model: Matrix DE Model Equation: DDucrcv uFuFrFvFx +++= Start Equation: xSV vs = Resource Release Equation: xSr rs = Product Output Equation: xSy y=

Addition = logical “or” Multiplication = logical “and” Overbar = “negation”

Firing Vector equation [2]

Controller based on a Matrix Formulation: X is the State vector Fv is the Job Sequencing Matrix, Fv (i,j)=1 if job j is required as a precursor to job i. Fr is the Resource Requirements Matrix, Fr(i,j)=1 if resource j is required for job i. Sv is the Start Matrix, Sv(i,j)=1 if job i must be stated when all requirements of Xj are satisfied, so that Xj has been set high. This matrix has multiple 1’s in the same column, which correspond to job routing decisions. Sr is the Resource Release Matrix, Sr(i,j)=1 if resource i should be released when Xj is set high. Work Cell Inputs (Plant Commands):

Pin is the parts entering the cell. y is the tasks complete. Vs is the jobs to be started, part of the work cell dynamics. Rs is the resources to be released, part of the work cell dynamics.

Work Cell Outputs (Plant Status):

u is parts present at the cell. Pout is products leaving the cell. Vc is the completed jobs, part of the work cell state outputs. Rc is the resources currently available, part of the work cell state outputs.

13

Page 14: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

The Discrete Event model monitors state outputs, and checks the conditions required for performing the next function in a manufacturing process. State vector X stores the conditions, Sv computes which jobs may start, Sr computes which resources should be released due to completed jobs Vc. The Discrete event model commands the workcell dynamics. [6]

Taskscompleted v c

Rule - Based Real-Time Controller

Cucurv uFuFrFvFx ⊗⊕⊗⊕⊗⊕⊗=

Job start logic

Resource release logic

Work Cell

. . .

uc

Partspresent u

Resourcereleased rc

Parts in p in Start tasks v s Start resource r elease r s Output y Products pout

Plant commands Plant status

Dispatching rules

Controller state monitoring logic

xSv VS ⊗=

xSr rS ⊗=

xSy y ⊗=Task complete logic

Controller based on Matrix Formulation [7]

14

Page 15: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Application Example[7]:

Application- Intelligent Material Handling

12 Sensors!!

Machine 2

Machine 1

Layout of the IMH Cell

X5

X2 X8

X4

X6

X7

R1

R3 R2

M2 M1

B3

B2

B1

X3

X9 X1

A B A B

IBM robot

PUMA roboADEPT robot

Conveyor bidirectional Conveyo

t

r unidirectional

conveyor

machine machine

15

Page 16: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

PART B OUT PART A OUT

PART A PART B

CRS

ROBOT 1

ROBOT 2

ROBOT 3

Machine 1

Machine 2

A(1)R1

A(2)R1 B(1)R1

B(2)R1

A(1)R2

A(2)R2

B(1)R2

B(1)R3

B(2)R3 A(1)R3

PUMA

ADEPT

Petri-net Flow Chart:

R1U1

B1AA

B1AS R2U1

M1A

M1P

B2AA B3AA

R2U3 B2AS R3U1 B3AS R1U3 PAO

B1BA B2BA M2A B3BA

PBI R1U2 B1BS R2U2 B2BS R3U2 M2P R3U3 B3BS R1U4 PBO

R1A

R2AR3A

X1 X2 X3 X4 X5 X6 X7 X8 X9

X12 X13 X14 X15 X16 X17 X18 X19 X11 X20

PAI X10

16

Page 17: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Error!c.f. Saridis

Start tasks/jobs

PC with High Level Controller

Dispatching rules

To Generate uc

Tasks: v SA

controller

controller

controller

CRS Puma 560 ADEPT One

Low level PD & PID controllers

Robots

Medium Level Tasks Controllers

RS232 - 1 RS232 - 2 RS232-3

Robot 1 Task 4

Task 3 Task 2

Task 1

Robot 2 Task 3

Task 2 Task 1

Robot 3

Task 3 Task 2

Task 1

SAv~ Workcell data gathering

u

v

r

p

SensorsMachines

SB S in v r p ~ , ~ ,~

Jobs vSB

rSB

rSA, pin

Parts out

vSB

DAQ -cardAnalog & digital I/0

Rule - Based Real -Time ControllerController state monitoring logic

CuDDur v uFuFuFrF v F x C⊗⊕⊗⊕⊗⊕⊗ ⊕ ⊗ =

Job start logic

Sv =Sv x⊗

Task complete logicy =Sy x⊗

Resource release logic

xSr rs ⊗=

uc

Jim Albus

17

Page 18: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

LabVIEW diagram of Controller

LabVIEW Controller's interface:

FrFv

18

Page 19: EE 5322: Intelligent Control SystemsEE 5322: Intelligent Control Systems Prepared by: Aaron Halverson, Rich Otten Petri-Nets Introduction: • Petri nets were developed in the early

Simulation sites: a tool for synthesis of Petri Nets and asynchronous circuits Petri-Nets Demo- http://www.utdallas.edu/~kcooper/teaching/2305/PN_Demo.docPetrify (Tool for Petri-Net synthesis) - http://www.lsi.upc.es/~jordic/petrify/petrify.htmlPetri-Nets Simulation for Windows - http://www.fi.ru/os/petri.php3Petri-Nets Deign Simulation - http://www.elyros.com/PNSim/ Reference: 1. UTDallas SE 2370 course notes by Kendra Cooper Fall 2004. Petri Nets. 2. UTA EE4315/5325 Lecture by Jose Mireles Jr, Fall 2002. Petri Nets for

simulation/control of Discrete Event Systems: introduction & matrix representation. 3. Kyung No Lee, Doo Yong Lee. 1998. An Approach to Control Design for Cooperative

Multiple Mobile Robots. Department of Mechanical Engineering, Korea Advanced Institute of Science and Technology.

4. Syed I. Ahson. 1995. Petri Net Models of Fuzzy Neural Networks. IEEE Transactions on systems, man, and cybernetics. Vol. 25, No. 6 pp 926 – 927

5. Leslaw Gniewek, Jack Kluska. 2004, Hardware Implementation of Fuzzy Petri Net as a Controller. IEEE Transactions on systems, man, and cybernetics – part B: Cybernetics. Vol. 34, No. 3 pp 1315 – 1324

6. Diego A Tacconi, F.L Lewis. 1997. A new Matrix Model for Discrete Event Systems: Application to Simulation. IEEE Control Systems. pp 62-71

7. F.L. Lewis, Wireless Sensor Networks for Monitoring Machinery, Human Biofunctions, and BCW Agents

Other Sources: 1. Class Notes from UTA EE5322 (Fall 2004) 2. Class Notes from UTA EE5325 (Fall 2002)

19