F uzzy L ogic I nference for P ong ( FLIP )

Post on 07-Feb-2016

42 views 0 download

Tags:

description

F uzzy L ogic I nference for P ong ( FLIP ). Brandon Cook & Sophia Mitchell Undergraduate Students, Department of Aerospace Engineering, Student Members AIAA Dr. Kelly Cohen Associate Professor, Department of Aerospace Engineering, Associate Fellow AIAA - PowerPoint PPT Presentation

Transcript of F uzzy L ogic I nference for P ong ( FLIP )

1

Fuzzy Logic Inference for Pong (FLIP)

Brandon Cook & Sophia MitchellUndergraduate Students, Department of Aerospace Engineering,

Student Members AIAA

Dr. Kelly CohenAssociate Professor, Department of Aerospace Engineering, Associate Fellow AIAA

Sponsored by: NSF Type 1 STEP Grant, Grant ID No.: DUE-0756921

2

Outline

• Project Goal & Objectives• Project Research Tasks• Introduction to Fuzzy Logic• Results• Future Work

3

Project Goals• Test the effectiveness of a fuzzy logic based robot at

emulating human like reasoning in a competitive environment

• Grasp understanding of intelligent robotics while enhancing capabilities for real world applications.

[5]

4

Overall Objectives

• Create PONG simulation in MATLAB– Singles• Familiarize with gaming strategies• Cascading Fuzzy Logic

– Doubles• Collaborative robotics

[6]

5

Project Research Tasks

• Conduct literature survey • Develop rules for the

Fuzzy Inference System (FIS)• Create an “Intelligent Team” of two autonomous agents• Successfully implement rotation DOF (Degree of

Freedom) & enhanced bounce characteristics• Test the effectiveness of the FIS• Test the effectiveness of the “Intelligent Team”

[7]

6

Fuzzy Logic

• Allows classification of variables for more human-like reasoning

• Utilizes linguistic reasoning• Common terms• Inputs• Rules• Outputs• Membership Function• Fuzzy Inference System (FIS)

7

Fuzzy Inference System

[3]

8

Fuzzy Decision Making

9

10

Assumptions & Constraints

• Confined paddle movement and rotation speed

• Varying difficulty not available (e.g. easy, medium, hard)

• No physical system used– In real world scenario robotics would be equipped with

sensors to quantify ball speed, trajectory pattern, etc.– Must imitate how a human perceives the game with

eyesight• Supply qualitative data to Fuzzy paddle in real-time

11

Singles Configuration

12

Fuzzy Paddle

13

Cascading Fuzzy Logic• Output from one FIS becomes input for subsequent FIS

Score Difference

Ball Speed

Opponent Position

Opponent Inertia

Where to hit the ball:Top, Middle, Bottom

Game Type:Offensive, Defensive

My Position:Top, Middle, Bottom

Desired Paddle Angle to Score on Opponent

14

Open FISInertia

Position

Open

BE – Very Bottom, B – Bottom, M – Middle, T – Top, TE – Very TopGD – Going Down, S – Stationary, GU – Going UpVB – Very Bottom, B – Bottom, M – Middle, T – Top, VT – Very Top

15 Rules

15

Open: Rule Set1. If (Position is VB) and (Inertia is GD) then (Open is M)2. If (Position is VB) and (Inertia is S) then (Open is T)3. If (Position is VB) and (Inertia is GU) then (Open is TE)4. If (Position is B) and (Inertia is GD) then (Open is T)5. If (Position is B) and (Inertia is GS) then (Open is T)6. If (Position is B) and (Inertia is GU) then (Open is TE)7. If (Position is M) and (Inertia is GD) then (Open is TE)8. If (Position is M) and (Inertia is S) then (Open is TE)9. If (Position is M) and (Inertia is GU) then (Open is BE)10. If (Position is T) and (Inertia is GD) then (Open is BE)11. If (Position is T) and (Inertia is S) then (Open is BE)12. If (Position is T) and (Inertia is GU) then (Open is B)13. If (Position is VT) and (Inertia is GD) then (Open is BE)14. If (Position is VT) and (Inertia is S) then (Open is B)15. If (Position is VT) and (Inertia is GU) then (Open is M)

16

Game Type FISScore

Ball Speed

Game Type

6 Rules

17

Strategy FIS

Game

Strategy

Open

My Position

VB: Very Bottom, B: Bottom, C: Center, T: Top, VT: Very TopBE Very :Bottom, B: Bottom, M: Middle, T: Top, TE: Very Top

25 Rules

18

Movement FIS

Movement

Angle Rotate

Distance

Fbelow: Far Below, Cbelow: Close Below, OnT: On Target, Cabove: Close Above, Fabove: Far Above , FCW: Far Clockwise, NCW: Near Clockwise, OnT: On Target, NCCW: Near Counter Clockwise, FCCW: Far Counter Clockwise, Dfast: Down Fast, Dslow: Down Slow, None: No Movement, Uslow: Up Slow, Ufast: Up Fast, CWFast: Clockwise Fast, CWSlow: Clockwise Slow, None: No Rotation, CCWSlow: CounterClockwise Slow, CCW Fast: CounterClockwise Fast

25 Rules

19

Results

20

Simulation: Human vs. Robot

21

Results: Human vs. Robot

Conclusions:• Highly difficult to defeat the Fuzzy

controller• Rules are sufficient for defeating a human

player• Can use similar logic and methodology to

produce doubles game

22

Results: Robot vs. Robot

Conclusions:• Each “volley” lasted nearly 5 minutes• Fuzzy controllers are equally matched• Highly effective at calculating the ball

trajectory to find intersection point

23

Doubles Configuration

NOTE: FLIP 1 = Back Paddle, FLIP 2 = Front Paddle

24

Human Collaboration

• Inspired by 2010 Australian Open tennis matches: Federer and Mirka

• Player’s positioning showed their role in the game– Front: Offensive– Back: Defensive

• Cover as much of the court as possible by staggering• Front player used hand signals to notify partner play or

movement– To mimic this, the front paddle makes final decision

to who goes for the ball

25

Collaborative Reasoning

26

Collaborative Reasoning: Part 1

• FLIP 2 calculates POI (Point Of Intersection)• FLIP 2 recognizes its own court position• FLIP 1 sends FLIP 2 its court position and POI• FLIP 2 decides who

goes for the ball– Closest to POI

• FLIP 2 determinesgame type

27

Collaborative Reasoning: Part 2.1

• Option 1: FLIP 1 goes for the ball• FLIP 2 must avoid so doesn’t block the ball after

hit by FLIP 1• Recognizes FLIP 1

Angle & Position

28

Collaborative Reasoning: Part 2.2

• Option 2: FLIP 2 goes for the ball• Calculates both opponents Position and Inertia• Finds open section of the court• Finds own position,

rotation, open portion of court, and game type

• Moves and rotates to intercept ball

29

Collaborative Reasoning: Part 3

• FLIP 1:• Calculates its POI• Recognizes own position• Calculates how far it needs to translate to

intercept the ball

30

Collaborative Reasoning: Part 4.1

• Option 1: FLIP 1 goes for the ball– FLIP 1 uses same logic as previously described to

find optimal location and strategy to hit the ball

31

Collaborative Reasoning: Part 4.2

• Option 2: FLIP 2 goes for the ball– FLIP 2 tells FLIP 1 it needs to be backed up

(extremely defensive)• Move to normal POI

– FLIP 2 tells FLIP 1 it doesn’tneed backed up• Move to opposite side

of the court

32Open FIS

Inertia 2

Open

Inertia 1

Position 1

Position 1

GD: Going Down, S: Stationary, GU: Going UpVB: Very Bottom, B: Bottom, C: Center, T: Top, VT: Very TopBE Very :Bottom, B: Bottom, M: Middle, T: Top, TE: Very Top

225 Rules

33

Avoidance FISBack Paddle Angle

Back Paddle POI

Target Position

RD: Rotated Down (CW), OnT: On Target, RU: Rotated Up (CCW)FB: Very Bottom, B: Bottom, OnT: Center, A: Top, FA: Very TopBE Very :Bottom, B: Bottom, M: Middle, T: Top, TE: Very Top

20 Rules

34

Results

35

Simulation: Humans vs. Robots

36

Results: Humans vs. Robots

Methods:• Two veteran “gamers” selected to test the effectiveness of the

Fuzzy LogicConclusions:• Fuzzy team is superb at collaborating effectively to defeat the

opposing team• Highly effective at communicating in a time-critical manner• Excellent at making adjustments to the infinite gameplay

scenarios to defeat opponent

37

Simulation: Robots vs. Robots

38

Results: Robots vs. Robots

Methods:• Ran simulation for 30 servesConclusions:• Each “volley” lasted nearly 3 minutes• Intelligent teams are equally matched• Highly effective at calculating the ball trajectory to find

intersection point• Very challenging to score a point on the fuzzy team

39

Accomplishments• Rotational DOF added to human and Fuzzy paddles• Enhanced bounce characteristic– No longer a “convex paddle”– Angle of Incidence: allows for more intuitive ball control

• Ability to rotate and translate simultaneously– Less delay between commands and response– Allows Fuzzy paddle to rotate fully to desired output

• New Fuzzy Rules

Conclusions

• Fuzzy logic is an effective tool for collaboration between autonomous agents in a time-critical spatio-temporal environment

• A completely autonomous, robotic, intelligent team (or swarm) would be very useful in applications including:– Space robotics– Celestial body exploration and colonization– Unmanned Aerial Vehicles (UAVs)– Homeland security– Disaster relief programs

40

[8]

41

Future Work• Include game difficulty– Easy, Medium, Hard

• Modify FLIP’s FIS for extreme offensive moves capability– Passing from back to front paddle– Speeding up ball between paddles– Both go for ball with different paddle angles

• Use knowledge gained from research to create a real-life intelligent swarm of robotics

• Incorporate Type II Fuzzy Logic for learning capabilities

43

Acknowledgements

UC Academic Year – Research Experience for Undergraduates (AY-REU) Program

Sophia Mitchell (Base Pong Script)

Dr. Kelly Cohen

References1. Kosko, Bart. Fuzzy Thinking: The New Science of Fuzzy Logic. New York: Hyperion, 1993. Print.2. Mendel, Jerry M., and Dongrui Wu. "Interval Type-2 Fuzzy Sets." Perceptual Computing: Aiding People in Making Subjective Judgments. Piscataway, NJ: IEEE, 2010. 35-64. Print.3. Sabo, C., Kingston, D., Cohen, K., “SMART Heuristic for Pickup and Delivery Problem (PDP) with Cooperative UAVs”, AIAA Infotech@Aerospace Conference, St. Louis, MO, March 29-31, 2011, AIAA Paper 2011-14644. http://gamerfront.net/2012/02/atari-announces-the-100000-pong-indie-developer-challenge/172355. http://en.wikipedia.org/wiki/File:NASA_Curiosity_Rover.jpg6. http://gamerfront.net/2012/02/atari-announces-the-100000-pong-indie-developer-challenge/172357. http://gamerfront.net/2012/02/atari-announces-the-100000-pong-indie-developer-challenge/172358. http://www.lynnehartke.com/2012/10/what-to-say-to-someone-with-chronic.html#!/2012/10/what-to-say-to-someone-with- chronic.html9. http://orbitertutorials.zxq.net/astronaut_qualifications.htm

45

Questions?