fuzzy logic and robot control mundhenk and itti, 2007

20
FUZZY LOGIC Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Upload: amira-burges

Post on 01-Apr-2015

237 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

FUZZY LOGICFuzzy Logic and Robot Control

Mundhenk and Itti, 2007

Page 2: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Problem:

We have a robot and we want it to move around obstacles based on how close we are to them. How do we do this?

Current Path

Page 3: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Current Path

Current Path

Ideal New Path

Ideal New Path

The closer you are to an obstacle, the harder you need to turn to avoid it.

Your course adjustments are minimally proportional to the distance to an obstacle and your current speed and heading.

Page 4: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Very Basic Control Theory Your speed towards a goal or away from

an object should be proportional to the distance from it. If you want to get to a goal in an optimal

amount of time you want to move quickly.However, you need to decelerate as you

grow near the target so you can have more control.

Speed µ distance-to-target

Page 5: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Very Basic Control Theory In systems with momentum (i.e. the real world) we have

to worry about more complex acceleration and deceleration. We can overshoot our target or stop short!

You increase your rate of deceleration based on how close you are to a goal or obstacle.

You can also integrate over the distance to a goal to create a steady state.

This is the basic idea behind a PID controller. Proportional Integral Derivative

The physical derivation of PID can be tricky, we will avoid it for now. However this part of an extremely interesting topic!

Page 6: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

IDEA!

Lets just hack a fuzzy controller together and avoid some math. The gods will curse us….But if it works, that may be all that matters!

Derive rule of thumb ideas for speed and directionIf I’m 6 meters from the obstacle, am I far

from it?

Page 7: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Near?

Far?

Ideal New Path

Ideal New Path

In addition to a change in speed, we may need to turn to avoid hitting an obstacle. If we are near, our course correction may need to be more abrupt.

Page 8: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Try some fuzzy rules…

Lets look at adjusting trajectory first then we will look at speed…If an obstacle is near and center, turn sharp

right or left.If an obstacle is far and center, turn soft left

or right.If an obstacle is near, turn slightly right or

left, just in case. Etc…

Page 9: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

IF AND THEN

20 M0 M

Distance Trajectory

0°90° -90°

Near

Near

Far

Center

Hard Right

Soft Right

Center

Turn

-25° 0°

A very simple example... Yes the robot only turns right.

Page 10: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

IF AND THEN

20 M0 M

Distance Trajectory

0°90° -90°

Near

Near

Far

CenterHard Right

Soft Right

Center

Turn

10 °

10 M

Happy Robot(幸せなロボット )

El mal de plantas

We have a robot and an obstacle we want to avoid. We create some fuzzy rules about how much to steer in any direction to avoid hitting the obstacle based on how far we are from it and to what degree it’s in our way.

Translations by Google. Are they any good?

Page 11: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

IF AND THEN

20 M0 M

Distance Trajectory

0°90° -90°

Near

Near

Far

CenterHard Right

Soft Right

Center

Turn

10 °

10 M

Happy Robot(幸せなロボット )

El mal de plantas

Implication of the rules:RULE 1. “Near” is less than “Center” we take the min since we are using “AND”RULE 2. We are getting near so we do a “Soft Right”RULE 3. We center to a certain degree since the obstacle is still kind of far away.

Page 12: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

IF AND THEN

20 M0 M

Distance Trajectory

0°90° -90°

Near

Near

Far

CenterHard Right

Soft Right

Turn

13 °

9 MDefuzzification:

Center of gravity – Turn -10 °

We can see that the second rule gives us a slight right turn much of the time. Thus, it’s not a very good rule!Lets get rid of it…

Aggregation

Page 13: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

20 M0 M

Distance Trajectory

0°90° -90°

Near

Far

CenterHard Right

Center

Turn

13 °

9 MCenter of gravity – Turn -10 °

The second rule turned out to not be very helpful anyways…

Page 14: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

20 M0 M

Distance Trajectory

0°90° -90°

Near

Far

CenterHard Right

Center

Turn

10 °

6 M

Center of gravity – Turn -17 °

Thus, as we get closer and the obstacle is more centered in our trajectory, we will tend to turn more to the right.

Page 15: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

The robot works in continuous time The fuzzy rules should change slightly at

each time step.We don’t want the robot to jerk to a new trajectory

too quickly. Smooth movements tend to be better. How often we need to update the controller is

dependant on how fast we are moving. For instance: If we update the controller 30 times

a second and we are moving < 1 kph then movement will be smooth.

Ideally, the commands issued from the fuzzy controller should create an equilibrium with the observations.

Page 16: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Our robot has momentum

We have somewhat implicitly integrated the notion of momentum.This is why we would slow down as we get

closer to an obstacle What about more refined control of

speed and direction?Use the derivative of speed and trajectory to

increase or decrease the rate of change.Thus, if it seems like we are not turning fast

enough, then turn faster and visa versa.

Page 17: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

IF AND THEN

20 M0 M

Distance Trajectory

0°90° -90°

Near

Far

Center

Hard Right

Soft Left

Center

Turn

-25° 10°

DTrajectory

Far-ish?

Prevent over steering with our robotChange in Trajectory

Page 18: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

IF AND THEN

20 M0 M

Distance Trajectory

0°90° -90°

Near

Far

Center

Slow

Very Slow

Fast

Speed

0 kph 10 kph

DDistance

Quick

0 mps 10 mps

Possible Rules to define speed

Page 19: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007

Demo

Page 20: Fuzzy Logic and Robot Control Mundhenk and Itti, 2007