Fuzzy Logic Controller - Home | School of Electrical …oren/SCS_MSNet/pr… · PPT file · Web...
Transcript of Fuzzy Logic Controller - Home | School of Electrical …oren/SCS_MSNet/pr… · PPT file · Web...
A Framework for Multi-agent A Framework for Multi-agent Discrete Event Simulation: V-Lab®Discrete Event Simulation: V-Lab®
Prasanna SridharShahab Sheikh-Bahaei
12/05/2003Autonomous 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
– 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
PHYSICAL NETWORK
MIDDLEWARE
I-DEVS
V-Lab
Inside Layered Architecture
middleware
AtomicModel
CoupledModel
simman
V-lab® • Uses the IDEVS
structure for creating objects
• Provides inbuilt agents and physics to model multi-agent multi-physics system
• SimMan is the message router to perform indirect message passing.
• Hierarchical TreeSimEnv
Agents
Agents
Physics
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
SimMan
Agent
Agent
Agent
Agent
Parsing
• A grammar defines rules for building syntactically correct programs.
• One way of defining grammar is through BNF (Backus-Naur 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; //agentrobo3 = Robot.Robot; //agentrobo4 = Robot.Robot; //agentrobo5 = Robot.Robot; //agentrobo6 = Robot.Robot; //agentrobo7 = Robot.Robot; //agentterr = Robot.Terrain;
Need for Agent Manager
4 agents connected together 18 agents connected
18 agents connected with manager
manager
Message routing
A1
SimMan
R1
A2
A3A4
A5
R1:A2, A4, A5R2:A1,A3
R1
R1
R1
Legend:A1,A2,A3,A4,A5: AgentsR1: Request MessageR1: A2 , A4,… : Database for request/response
A1
SimMan
Re
A2
A3A4
A5
R1:A2, A4, A5R2:A1,A3
Re
Re
Re
Legend:A1,A2,A3,A4,A5: AgentsRe: Response MessageR1: A2 , A4,… : Database for request/response
Re R
e
Potential repliers can be known by special messages
I-DEVS
DEVSJAVALibrary
Soft Computing
I-DEVSLibrary Extension
of DEVSJAVAclasses
Efficient wayof handlingTime parameters
Simulation Results
Fuzzy Logic ControllerFuzzy Logic Controller
DefuzzilierFuzzifier Inference Engine
Membership Functions
Fuzzy (IF THEN) RulesFuzzy VariablesLinguistic Variables
CrispValues
CrispValues
Devs-Fuzzy LogicDevs-Fuzzy Logic
DEVS primitives to compose a Mamdani rule:
Membership Functions
A typical Mamdani rule can be composed as follows i
1 1 2 2IF is AND is THEN is , for 1,2,...,i i ix A x A y B i l
X (real number)
Fuzzy Value
Fuzzifier
Output Block
Fuzzy Value
Y (Fuzzy set)
…
AND/ORFuzzyValues
DOF
DefuzzifierY1Y2
Yn…
Method of Defuzzification
Defuzzified output (real number)
Connectives
IF theta is POS AND theta_dot is POS THEN force is NEG
NEGZERO
POS
Fuzzifier(POS)
ANDDefuzzifier
theta
theta_dot Fuzzifier(NEG)
forceOutput Block
(NEG)
Center of Gravity
Rule #2
Rule #3
force
force
Output
Change Detectors
Robot ObstacleRobot Obstacle AvoidanceAvoidance
Distance to obstacle (measured by sensor i)
Angle of sensor i w
v
Fuzzy-Logic-Controller
2
1
Fuzzy-Logic Obstacle AvoidanceFuzzy-Logic Obstacle Avoidance
a) Distance measured by sensor (d) b) Angle of sensor (th)
c) Forward velocity (V) d) Angular Velocity (W)
Close Near Far Neg Zero Pos
Zero VSlow Slow Fast Neg SNeg Zero SPos Pos
Membership Functions:
Fuzzy-Logic Obstacle AvoidanceFuzzy-Logic Obstacle Avoidance
1."IF distancei is Close And anglei is Pos Then V Is VSlow W is Neg "2."IF distancei is Close And anglei is Zero Then V Is Zero " 3."IF distancei is Close And anglei is Neg Then V Is VSlow W Is Pos "4."IF distancei is Near And anglei is Pos Then V Is Slow W Is SNeg"5."IF distancei is Near And anglei is Zero Then V Is VSlow W Is SNeg"6."IF distancei is Near And anglei is Neg Then V Is Slow W Is Spos"7."IF distancei is Far And anglei is Pos Then V Is Fast W Is Zero"8."IF distancei is Far And anglei is Zero Then V Is Fast W Is Zero"9."IF distancei is Far And anglei is Neg Then V Is Fast W Is Zero"
Fuzzy rules for the ith sensor:
Simulation timeSimulation time
Act
iviti
es
Discrete Event FuzzyConventional Fuzzy
Conventional Fuzzy vs. DEVS-FuzzyConventional Fuzzy vs. DEVS-Fuzzy
Cooperative RoboticsCooperative Robotics
Cooperative pushing task:
Pushing task:Pushing task:
Pushing region
rArB
G
B
rwlw
fr=0
fr<0fr>0
fl<0
fl=0fl>0
A
Cooperative pushing task:Cooperative pushing task:
rB
G
B
rwlw
Pushing regions
Cooperative Pushing TaskCooperative Pushing Task
“in”?command
“out”!goal_reached
“in”?object_reached
“in”?object_lost
“out”?object_touched
“in”?everybody_ready
“in”?outside_pushing_region
“out”?object_reached_the_goal
“in” “out”
Simulation ResultsSimulation Results
Simulation ResultsSimulation Results
Experiment ResultsExperiment Results
Experiment ResultsExperiment Results