Fuzzy Logic Controller

Download Report

Transcript Fuzzy Logic Controller

A Framework for Multi-agent Discrete
Event Simulation: V-Lab®
Prasanna Sridhar
Shahab Sheikh-Bahaei
12/05/2003
Autonomous Control Engineering
University of New Mexico
This work was supported by NASA AMES under grant NAG 2-1547
V-Lab®
• V-Lab® Environment Layers
– Hardware Networking
• Networking foundation for
inter-machine communication
– Middleware
• Software environment for
inter-process communication
V-Lab
I-DEVS
– IDEVS
• Library of tools for soft
computing in DEVS
formalism
– V-Lab®
• Organizational structure for
DEVS objects.
• Management objects to
control time and message
flow in multi-agent systems
MIDDLEWARE
PHYSICAL NETWORK
Inside Layered Architecture
simman
Atomic
Model
Coupled
Model
middleware
V-lab®
• Hierarchical Tree
• Uses the IDEVS
structure for creating
objects
• Provides inbuilt agents
and physics to model
multi-agent multiphysics system
• SimMan is the
message router to
perform indirect
message passing.
SimEnv
Agents
Physics
Agents
Agents
SimMan
Physics
SimMan and SimEnv
• SimEnv
– Highest leveled coupled
model
– Instatiates all other models
– Houses all other models
– Couples all other models
together
• SimMan
– Message liaison providing
indirection between all
other models
– Controls flow of time and
messages between models
for the simulation
SimEnv
Agent
Agent
SimMan
Agent
Agent
Parsing
• A grammar defines rules for building syntactically correct
programs.
• One way of defining grammar is through BNF (BackusNaur Form)
• BNF of our simulation configurations is translated JavaCC
format and saved as file parseConfig.jj
• When parseConfig.jj is compiled by JavaCC, it generates a
Java file parseConfig.java. Parsing can be done by
instatiating an object of parseConfig.java
Sample Config file
robo2 = Robot.Robot;
robo3 = Robot.Robot;
robo4 = Robot.Robot;
robo5 = Robot.Robot;
robo6 = Robot.Robot;
robo7 = Robot.Robot;
terr = Robot.Terrain;
//agent
//agent
//agent
//agent
//agent
//agent
Need for Agent Manager
4 agents connected together
18 agents connected
manager
18 agents connected with manager
Message routing
R1
A1
A2
A4
R1
R1
A3
A5
R1
SimMan
R1:A2, A4, A5
R2:A1,A3
Legend:
A1,A2,A3,A4,A5: Agents
R1: Request Message
R1: A2 , A4,… : Database
for request/response
Re
A1
Re
A4
Re
Re
Re
A3
Re
SimMan
Legend:
A1,A2,A3,A4,A5: Agents
Re: Response Message
R1: A2 , A4,… : Database
for request/response
A2
R1:A2, A4, A5
R2:A1,A3
Potential repliers can be known by special messages
A5
I-DEVS
Efficient way
of handling
Time parameters
DEVSJAVA
Library
I-DEVS
Library
Extension
of DEVSJAVA
classes
Soft
Computing
Simulation Results
Fuzzy Logic Controller
Crisp
Values
Fuzzifier
Inference
Engine
Defuzzilier
Membership Functions
Fuzzy (IF THEN) Rules
Fuzzy Variables
Linguistic Variables
Crisp
Values
Devs-Fuzzy Logic
A typical Mamdani rule can be composed as follows
IF x1 is A1i AND x2 is A2i THEN y i is B i , for i  1, 2,..., l
DEVS primitives to compose a Mamdani rule:
Fuzzy
Value
X (real number)
Fuzzifier
Fuzzy
Values
AND/OR
DOF
Connectives
Membership
Functions
Fuzzy
Value
Y
Output
Block
(Fuzzy set)
Method of
Defuzzification
Y1
Y2
Yn
Defuzzifier
Defuzzified
output
(real number)
IF
theta
AND theta_dot
THEN force
is POS
is POS
is NEG
ZERO
NEG
POS
Change
Detectors
theta
theta_dot
Fuzzifier
(POS)
Fuzzifier
(NEG)
Output
Block
AND
Center of Gravity
force
(NEG)
Defuzzifier
Rule #2
force
Rule #3
force
Output
Robot Obstacle Avoidance
Angle of sensor i
w
Distance to obstacle
(measured by sensor i)
v
Fuzzy-Logic-Controller
1
2
Fuzzy-Logic Obstacle Avoidance
Membership Functions:
Close Near
Neg
Far
a) Distance measured by sensor (d)
Zero VSlow Slow
c) Forward velocity (V)
Fast Neg
Pos
Zero
b) Angle of sensor (th)
SNeg
Zero
SPos
d) Angular Velocity (W)
Pos
Fuzzy-Logic Obstacle Avoidance
Fuzzy rules for the ith sensor:
1."IF distancei is Close And anglei is Pos Then V
2."IF distancei is Close And anglei is Zero Then V
3."IF distancei is Close And anglei is Neg Then V
4."IF distancei is Near And anglei is Pos Then V
5."IF distancei is Near And anglei is Zero Then V
6."IF distancei is Near And anglei is Neg Then V
7."IF distancei is Far And anglei is Pos Then V
8."IF distancei is Far And anglei is Zero Then V
9."IF distancei is Far And anglei is Neg Then V
Is VSlow W is Neg "
Is Zero "
Is VSlow W Is Pos "
Is Slow W Is SNeg"
Is VSlow W Is SNeg"
Is Slow W Is Spos"
Is Fast W Is Zero"
Is Fast W Is Zero"
Is Fast W Is Zero"
Conventional Fuzzy vs. DEVS-Fuzzy
Conventional Fuzzy
Discrete Event Fuzzy
Simulation time
Simulation time
Cooperative Robotics
Cooperative pushing task:
Pushing task:
G
B
fl<0
rB
rA
A
wl
fl=0
fl>0
Pushing
region fr>0
fr=0
wr
fr<0
Cooperative pushing task:
G
wl
wr
Pushing
regions
B
rB
Cooperative Pushing Task
“in”
“in”?object_reached
“in”?command
“in”?object_lost
“out”!goal_reached
“out”?object_touched
“in”?outside_pushing_region
“out”?object_reached_the_goal
“in”?everybody_ready
“out”
Simulation Results
Simulation Results
Experiment Results
Experiment Results