Automation & Robotics Research Institute The University of Texas at Arlington
F.L. LewisMoncrief-O’Donnell Endowed Chair
Head, Controls & Sensors Group
Talk available online athttp://ARRI.uta.edu/acs
Wireless Sensor Networks
II. ARRI Distributed Intelligence & Autonomy LabDIAL
UnattendedGroundSensors
SmallmobileSensor-Dan Popa
Testbed containing MICA2 network (circle), Cricket network (triangle), Sentry robots, Garcia Robots & ARRI-bots ( Dan Popa)
Distributed Intelligence and Autonomy Laboratory (DIAL)
Deadlock free dynamic resource assignment in multi-robot systems with multiple missions: a
matrix-based approach
Prasanna Ballal, Vincenzo Giordano, Frank LewisPrasanna Ballal, Vincenzo Giordano, Frank Lewis
by
Automation & Robotics Research Institute,University of Texas at Arlington
Discrete event controller
T asksco m p le ted v c
R u le-b ased rea l tim e con tro lle r
Cu curv uFuFrFvFx ⊗⊕⊗⊕⊗⊕⊗=
Job s ta rt lo g ic
R esource re lease lo g ic
W ireless Sensor
N etw o rk
. . .
u c
Se nsor ou tp ut u
R esourcere leased rc
S tart tasks v s
S tart reso urcere lease rs
O utp ut yM iss io n co m p le ted
P la nt co m m a nds P la nt s ta tus
D isp atch in g ru le s
C o ntro ller state m o nito ring lo g ic
xSv VS ⊗=
xSr rS ⊗=
xSy y ⊗= T ask co m p le te lo g ic
User interface:definition of
mission planning, resource allocation,
priority rules
U.S. Patent
Sensor readings
events
commands
Decision-making
Matrix Formulation: Definition
DDucrcv uFuFrFvFx +++=
multiply = AND & addition = ORoverbar = negation
Logical state equationCompare with xk+1=Axk+Buk
Job Start Equation:Resource Release Equation:Product Output Equation:
xSv vs =xSr rs =xSy y=
Compare with yk=CxkOutput equations
State vectorTask vector1= job complete
Resource vector1= resource available
Input vector1= event detected
Control inputpriority sequencingdeadlock avoidanceetc
Meaning of Matrices
Resources requiredPrerequisite jobs
Nextjob
NextjobFv
Fr
Conditions fulfilled
Nextjob Sv
Task Sequencing Matrix Resource Requirements Matrix
Releaseresource Sr
Conditions fulfilled
Resource Releasing MatrixTask Starting Matrix
Steward Kusiak
Construct Job Sequencing Matrix Fv
Part A job 1Part A job 2Part A job 3
Part B job 1Part B job 2Part B job 3
Par
t A jo
b 1
Par
t B jo
b 1
Par
t A jo
b 2
Par
t B jo
b 2
Par
t A jo
b 3
Par
t B jo
b 3
Nextjobs
Prerequisitejobs
Used by Steward in ManufacturingTask Sequencing
Contains same informationas the Bill of Materials(BOM)
Construct Resource Requirements Matrix Fr
Used by Kusiak in ManufacturingResource Assignment
Contains informationabout factory resources
Nextjobs
Prerequisiteresources
Part A job 1Part A job 2Part A job 3
Part B job 1Part B job 2Part B job 3
Con
veyo
r 1C
onve
yor 3
Fixt
ure
1
Rob
ot 1
-IBM
Rob
ot 2
-Pum
aR
obot
3-A
dept
crcv rFvFx +=
OR / AND Matrix Algebra
Example
)1()0()1(]101[ cbacba
x ∧∨∧∨∧=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡=
)0()1()0( cbax ∨∧∨∧∨=
cax ∧=
)1()0()1( cbax ∧∨∧∨∧=
)1()0()1( cbax ∧∧∧∧∧=
Easy to implement OR/ AND algebra in MATLAB
C= AB
for i= 1,Ifor j= 1,J
c(i,j)=0for k= 1,K
c(i,j)= c(i,j) .OR. ( a(i,k) .AND. b(k,j) )end
endend
Matrix multiply
Relation to Max-Plus Algebra
DDucrcv uFuFrFvFx +++=xSV vs =xSr rs =xSy y=
State equation
Output equations
Define diagonal timing matrices. Then max plus is
rFTSxFTSx rrrvvv +='
OPERATIONS IN OR-AND ALGEBRA
OPS. IN MAX-PLUS ALGEBRA
Can also include nonlinear terms- correspond to decisions
Relation to Petri NetsResources availableJobs complete
Trans. Trans.Fv Fr
Transition
Nextjobs Sv
Transition
Releaseresource Sr
UTA
ARRI
pinA p1t1 t2
p3t4 t5
p2 t3
p4 t6pinB
poutA
poutB
r1
r3
r2
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100001000000001000010000
vF
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
000010000100000000100001
TvS
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
000010000001
uF
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
000010100000010001
rF
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
010100000010001000
TrS
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100000010000
TyS
p1 p2 p3 p4 r1 r2 r3
p1 p2 p3 p4 r1 r2 r3
pinA pinB
poutA poutB
Activity Completion Matrix
Complete DE Dynamical Description
][ yrvu FFFFF =
][ Ty
Tr
Tv
Tu SSSSS =
],,,[ yT
yrT
rvT
vuT
uT FSFSFSFSFSM −−−−=−=
xFStmxMtmtm TTT ][)()()1( −+=+=+
DDucrcv uFuFrFvFx +++=
PN incidence matrix
Marking transition equation
Activity Start Matrix
DE state equation
[ ]TTTTT yrvup =
Include Process Times in Places
)()()( tmtmtm pa +=
)()()1( txStmtm Tpp +=+
)()()1( txFtmtm aa −=+
TTT OrtimesvtimesOT ],,,[=
TtxSdiagttTtmdiagtT Tsamplependppend })({])([})({)1( +−=+
Split up marking vector
Add tokens
Take away tokens
Wait for process durations
Allows easy MATLAB simulation of DE systems
DDucrcv uFuFrFvFx +++=
)()()1( txStmtm Tpp +=+
)()()1( txFtmtm aa −=+
)1()1()1( +++=+ tmtmtm pa
Duration time counting routine
1. Rules- fire transitions
2. Add tokens to places
3. Wait until jobs finish
4. Take tokens from places
5. Find updated vectors for DE state equation
Controller
System model
6. [ ] )( pmyrvu TTTTT =
!
DEC for WSN
Mission result:
False fire alarmRobot1 goes to
sensor 2Sensor 1
output:alarmRobot 1 picks
sensor 2Robot2 follows
robot1Sensor 3
measurementSensor 4
measurementRobot1 places
sensor 2Sensor2
measurement
Robot1 goes to sensor1
Robot2 smoke detection
Programmable Missions
Mission1-Task sequence
Mission 1 completedy1output
S2 takes measurementS2m1Task 11
R1 takes measurementR1m1Task 10
R1 deploys UGS2R1dS21Task 9
R2 takes measurementR2m1Task 8
R1 gores to UGS1R1gS11Task 7
R1 listens for interruptsR1lis1Task 6
R1 retrieves UGS2R1rS21Task 5
R2 goes to location AR2gA1Task 4
R1 goes to UGS2R1gS21Task 3
UGS5 takes measurementS5m1Task 2
UGS4 takes measurementS4m1Task 1
UGS1 launches chemical alertu1Input 1
Descriptionnotationmission1
Mission 2-Task sequence
Mission 2 completedy2output
R1 docks the chargerR1dC2Task 5
UGS3 takes measurementS3m2Task 4
R1 charges UGS3R1cS32Task 3
R1 goes to UGS3R1g S32Task 2
UGS1 takes measurementS1m2Task 1
UGS3 batteries are lowu2input
DescriptionnotationMission2
Fast Programming of Missions
⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜
⎝
⎛
=
100000000000100000000000100000000000110000000000010000000000010000000000011000000000001100000000000
19
18
17
16
15
14
13
12
11
1
xxxxxxxxx
Fv
⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜
⎝
⎛
=
000000000010000000000000000000000110000000000000000000111100000
19
18
17
16
15
14
13
12
11
1
xxxxxxxxx
Fr
⎟⎟⎟⎟⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜⎜⎜⎜⎜
⎝
⎛
=
100000100000100000100000100000
26
25
24
23
22
21
2
xxxxxx
Fv
⎟⎟⎟⎟⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜⎜⎜⎜⎜
⎝
⎛
=
000000000000010010000000000000000010000100
26
25
24
23
22
21
2
xxxxxx
Fr
Mission 1 matrices
Mission 2 matrices
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140
10
20
30
40
50
60
70 1S4m1S5m1R1gS21R2gA1R1rS21R1lis1R2m1R1gS11R1dS21R1m1S2m
2S1m2R1gS32R1cS32S3m2R1dC
R1R2UGS1UGS2UGS3UGS4UGS5
Time [s]
mobile wireless sensor network DE simulation priority 2-->1
Reso
urce
s
M
issi
on2
M
issi
on 1
u2
u1
0 20 40 60 80 100 120 140 0 20 40 60 80 100 120
10
20
30
40
50
60
70 1S4m1S5m1R1gS21R2gA1R1rS21R1lis1R2m1R1gS11R1dS21R1m1S2m
2S1m2R1gS32R1cS32S3m2R1dC
R1R2UGS1UGS2UGS3UGS4UGS5
Time [s]
mobile wireless sensor network DE simulation priority1-->2
Reso
urce
s
Mis
sion
2
M
issi
on1
u1
u2
Simulation 2 –change mission priority
Simulation Results
Event traces
• Up means task in progress
• Down means resource in use
Mission 1 jobs
Mission 2 jobs
Resources
High Level Controller
Dispatching rules
To Generate uc
RS232 RS232 RS232
Wireless Network with Internet connection
- - Rule Based Real Time Controller
ucStart tasks/jobs
Mission result
Resource release
Sensor output u
Task completed v
Resource released r
Medium Level Tasks ControllersRobot 1
Task 1 Task 1
Robot 2
Task 1
Wireless sensors
Task 1
Robot 3
RS232
Pioneer arm
Cybermotion robot
Cybermotion robot
Xbow sensors
Environment
Task1
PC
urv uFrFvFx ⊗⊕⊗⊕⊗=xSv VS ⊗=
xSy y ⊗=xSr rS ⊗=
Finite state machine for each agent
UC-TDMA MAC protocol
Supervisor control level A
gent control levelN
etwork control level
Agents events
DEC Implementation
DDucrcv uFuFrFvFx +++=
DE controller on PC
Replaced by actual WSN
)()()1( txStmtm Tpp +=+
)()()1( txFtmtm aa −=+)1()1()1( +++=+ tmtmtm pa
System model
Duration times
LabVIEW diagram of Controller
LabVIEW Controller's interface:
FrFv
Resources
R1u1
R1u2
R1u3
R1u4
R2u1
R2u2
R2u3
R3u1
R3u2
Discrete events
Results of LabVIEW Implementation on Actual Workcell
Compare with MATLAB simulation!
We can now simulate a DE controller and then implement it,Exactly as for continuous state controllers!!
Schematic Event Sequence for Mission Performance
Shared resources circular waits
S4m2
S1m1
X21 X2
2 X23 X2
4 X25 X2
6
R1cS11 R1dC1
S3
R1
u1
u2
S3m2 R1gA2 R2mS22 S2m2 R2gC2
y2 Mission2 result
y1 Mission1 result
S2
X14 X1
3X12X1
1
S4
X27 X2
8
R2
R1gD2
S1
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180
1R1gS11S1m1R1dC
2R1gA2S3m2R2mS22S2m2R2gC2S4m2R1gA
S1R1S2R2S3S4
Time [s]
Mobile wireless sensor network DE simulationRe
sour
ces
Mis
sion
2
Mis
sion
1
Event time trace
Simulation results
Deadlock!
One Step Look Ahead Deadlock Avoidance Policy
Some Definitions:
• Circular Waits-Circular waits (CW) among resources are a set of resources ra, rb,… rwwhose wait relationship among them are ra rb … rw and rw ra.
• Simple CW-Simple CWs (sCW) are primitive CWs which do not contain other CWs.
• Critical siphons, Sc- The critical siphon of a CW is the smallest siphon containing the CW. Note that if the critical siphon ever becomes empty, the CW can never again receive any tokens. This is, the CW has become a circular blocking.
•Siphon job set Js-Siphon-job set, Js, is the set of jobs which, when added tothe set of resources contained in CW C, yields the criticalsiphon.
•Critical Subsystems Jo-The critical subsystems of the CW C, are the job sets J(C) from that C not contained in the siphon-job set Js of C. That is Jo = J(C)\ Js.
One Step Look Ahead Deadlock Avoidance Policy ctd…
Deadlock AnalysisThe Circular Waits are key to deadlock analysis (Wysk).CW are difficult to find from the Petri Net.
The CW are given directly from our matrices by the Wait Relation Matrix
rrW FSG = (in AND/OR algebra)
i.e. if gij=1 then resource j waits for resource i
Use string algebra to find a matrix C, wherein each column represents a circular wait.
When a CW becomes blocked, one has Deadlock. To avoid this, examine the Critical Siphons. CS are difficult to find using Petri Nets.
The CS are given directly from our matrices by the columns of matrix
⎥⎥⎦
⎤
⎢⎢⎣
⎡ ∧C
FFCFSC vT
rT
vrTsSc =
Where vector Cs is the projection of C into the shared resources in the CW
and denotes the element-by-element matrix ‘and’ operation. ∧
)()()()( vdTvdvdvdo FCSCFCCFJ ∧=∧=
Matrix formulation for Jo
)())(( ioio CmCJm <
Deadlock Avoidance Strategy- MAXWIP Policy
One Step Look Ahead Deadlock Avoidance Policy ctd…
Critical Subsystems Jo
Deadlock analysisResources
Circular Waits Ci Co
Circular waits Matrix
Tasks
Critical subsystems Jo
Critical subsystems Matrix
Resources
ResourcesW
Digraph Matrix
Gurel’s algorithm
Matrix operations
Maxwip policy )())(( ioio CmCJm <
Initial number of tokens in circular wait Ci should always be greater than the number of tokens in the corresponding critical subsystem
Deadlock avoidance
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
111111111110111101111100100010010001
oC
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
011111101101111110000110011011011001100000011000000000000011
oJ
R1cS1 R1dC S3m S2m S4mS1m R1gA R2mS2 R2gC R1gD
S1 S2 S3 S4 R1 R2
Circular wait matrix Critical subsystem matrix
Deadlock avoidance
Motion with Deadlock Avoidance
Motion with no Deadlock Avoidance
Charger
UGS
Sentry robot
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180
1R1gS11S1m1R1dC
2R1gA2S3m2R2mS22S2m2R2gC2S4m2R1gA
S1R1S2R2S3S4
Time [s]
Mobile wireless sensor network DE simulation
Reso
urce
s
M
issi
on2
M
issi
on1
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180
1R1gS11S1m1R1dC
2R1gA2S3m2R2mS22S2m2R2gC2S4m2R1gA
S1R1S2R2S3S4
Time [s]
Mobile wireless sensor network DE simulation
Reso
urce
s
Mis
sion
2
Mis
sion
1
Event time trace without deadlock avoidance
Event time trace with deadlock avoidance
Simulation results
New Work—Modify resource assignments on-line as sensor nodes fail or are added
DDucrcv uFuFrFvFx +++=
Add or modify columns of Fr
Deadlock avoidance still works if there are no Key resources-1-step look ahead.
New Work --Deadlock Avoidance for Free-Choice Routing Systems
R2 R4 R5
t3 R2A t5 t7 R4A t9
Pi1 t1 B1 t2 R1A t4 B2 t6 R3A t8 B3 t10 R5A t11 Po1
B1 R1 B2 R3 B3
Choices in routing- select resource for next job
Problems with the old formulae-need to make critical subsystems include alternate routing resources
DDucrcv uFuFrFvFx +++=
New Work-A new matrix algebra to implement Dempster-Shafer decisions
∑=∩
=ACB
jiji
CmBmAm )()()( 212,1
).()( 21 jiCB
CmBm∑≠∩ φ
Implement the DS Rule of Combination
Make the state equation
∑≠∩
=0
)()(AB
BmaPl
Plausibility
∑⊂
=AB
BmABel )()(Belief
xSv vs = xSr rs =Make the output equations
Implement