Sei sulla pagina 1di 43

FUZZY - LOGIC BASED OBSTACLE

AVOIDANCE AND TARGET REACHING


ALGORITHM ON NIS EMBEDDED FPGA
ROBOT
Prepared by:
By:
Irish Asmi. I - 411711106033
Mrs.Sudhalakshmi. S
Nivedita.DEPARTMENT
K - 411711106061
OF ELECTRONICS AND COMMUNICATION ENGG.

Guided

Objectives of the project


To design two fuzzy logic based algorithms and

implement them in LabVIEW as given below


First algorithm has an aim of obstacle avoidance in

an unknown environment.
Second algorithm has a combined objective of both

avoiding of obstacles and also reaching a


predefined target point in an environment

To implement the above algorithms using NIs

embedded FPGA robotic platform


DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Literature Survey
Paper referred

Year

Author

Comparison with
proposed system

Design and Implementation


of Fuzzy-Logic based
Obstacle-Avoidance and
Target-Reaching Algorithms
on NIs embedded robot.

2013

Muhammad
Mysorewala

New algorithm for


obstacle avoidance
using fuzzy logic
implemented with
the help of
ultrasonic sensors

Obstacle avoidance with


ultrasonic sensors

1998

Borenstein. J

Algorithm
implemented using
ultrasonic sensors

Koren. Y

All the previously


designed algorithms
and there drawbacks
were featured in this
paper

The vector field histogram Fast obstacle avoidance for


mobile robots

1991

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Existing system and its Limitations


The popular existing systems are edge-detection, potential

fields, certainty-grids, Vector-Field Histogram (VFH)


Limitations of the existing systems
Current systems are computationally heavy.
In presence of complex tasks, it becomes practically
impossible to implement on hardware platforms and
perform all these operations in parallel.
Robot can avoid the obstacle but time constrain will be
high.
Robot positioning will be inaccurate

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Proposed System
Proposed system uses fuzzy logic based navigation

approaches.
Fuzzy logic
Fuzzy logic is a form of many-valued logic which
deals with reasoning that is approximate rather than
fixed and exact.
IR Sensors are used in this system instead of ultrasonic
sensors.
Apart from IR Sensor, a temperature sensor is also used in
this system to measure the ambient temperature of the
surroundings.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Proposed System
Decision about the movement of the robot is

taken in an adaptive manner.


The hardware used in this project is NIs
embedded robotic platform which has SBRIO with
a controller and a FPGA.
The software is implemented using high-level
LabVIEW modules for real-time programming.
This system uses a combined objective of
obstacle avoidance and target reaching in a single
algorithm.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Processes in fuzzy logic controller


Input stage

FUZZIFICATION

Processing
stage

APPLICATION OF
FUZZY LOGIC
RULES

Output stage

DEFUZZIFICATI
ON

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Fuzzification
Fuzzification which can be defined as

Fuzzification is the process of decomposing a


system input and/or output into one or more fuzzy
sets.
Inputs are decomposed into membership
functions.
The membership functions can be modified by
"hedges". Some examples include,
About
Close to
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Application of fuzzy logic rules


Matches all the inputs with a fuzzy set of rules

and generates a result based on those rules.


A set of fuzzy logic rules which are used in a
particular controller is known as fuzzy set.
A common example of fuzzy set
IF temperature IS very cold THEN stop fan
IF temperature IS cold THEN turn down fan
IF temperature IS normal THEN maintain level
IF temperature IS hot THEN speed up fan

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Defuzzification
Defuzzification can be defined as

Defuzzification is the process of converting


one or more fuzzy sets into a system input and/or
output.
Outputs are obtained by using membership
functions.
Result is defined by min - max method

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Algorithm 1 : Obstacle avoidance


Fuzzification
Range

Membership functions

0 0.2 m

Close

0.2- 0.5 m

Medium

Above 0.5 m

Far

Application of fuzzy logic rules


IF 'Left' IS 'Far' AND 'Middle' IS 'Medium' AND 'Right' IS 'Medium'
THEN 'Right' IS 'Forward' ALSO 'Left' IS 'Zero'
IF 'Left' IS 'Far' AND 'Middle' IS 'Medium' AND 'Right' IS 'Close'
THEN 'Right' IS 'Forward' ALSO 'Left' IS 'Backward'
IF 'Left' IS 'Far' AND 'Middle' IS 'Close' AND 'Right' IS 'Far' THEN
'Right' IS 'Backward' ALSO 'Left' IS 'Backward'
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Algorithm 1 : Obstacle avoidance


Defuzzification
Range

Membership

-0.8 m/sec to 0

functions
Backwards

-0.16 m/sec to +0.16

Zero

m/sec
0 to +0.8 m/sec

Forwards

O
B
S
T
A
C
L
E

SENSORS

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Algorithm 2 : Obstacle avoidance and


Target reaching
Fuzzification
Range

Membership functions

0 0.2 m

Close

0.2 - 0.4 m

Medium

0.4 - 0.6m

Far

For :
Range

Membership functions

-30 to 30

Zero

-60 to 0

Negative

0 to 60

Positive

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Algorithm 2 : Obstacle avoidance and


Target reaching
Application of fuzzy logic rules
LEFT

INPUT
DISTANCE
MIDDLE
RIGHT

TARGET

OUTPUT
ROBOT

DIRECTION

TURNING
ANGLE

M
M
M
.
.
.

M
M
C
.
.
.

M
C
F
.
.
.

Z
Z
Z
.
.
.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

PM
PL
NL
.
.
.

Algorithm 2 : Obstacle avoidance and


target reaching
Defuzzification
Range

Membership functions

-40 to -60

Negative large

-20 to -60

Negative medium

-40 to 0

Negative small

-20 to 20

Zero

0 to 40

Positive small

20 to 60

Positive medium

40 to 60

Positive large

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

TARGET

ROBOT

Direction of
robotic
movement

Proposed system
Algorithm 1 : Obstacle avoidance
The input contains three

membership functions namely


Close
Medium

OBSTACLE

Far

The output has three

membership functions such as


Backwards
Zero

SENSORS

Forwards
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Algorithm 2 : Obstacle avoidance and


Target Reaching
There are four inputs in this

algorithm

TARGE
T

Left
Middle
Right
Deviation from desired output()

OBSTACLE

The output is the Robot Turning

Angle() which has the following


membership functions
NS, NM, NL
Z

ROBOT

PS, PM, PL
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Direction of
robotic
movement

Block diagram
Obstacle
Sensor

Obstacle
Sensor

Obstacle
Sensor

FPGA
Board

Signal
Conditioning

Input
buffers

Config
Memory

FPGA

H bridge
Motor Drive

Motors

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

RF
Transceiver

Receiver - Diagram

RF
Transceiver

PC with LabVIEW
software installed

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Sensors
Two types of sensors are used in this system
Temperature sensor
IC

used - LM35
Operating voltage - 4V.
This is a 3 pin IC.
IR sensors
IC

used - GP2Y0A21YK
Coverage distance - 10 to 95 cm.
Operating voltage - 3.3V.
It is a 3 pin IC.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

FPGA
IC used : EP2C8T144C8
It is a 144 pin IC package.
89 pins are used as general input/output pins.
Working voltage - 1.2V.
Has three speed grades
Speed grade we use - 8

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Motor drives
IC used - L293
Known as H bridge motor drive.
Uses NPN transistors to form H bridge.
Equal to two H bridge drives.
Mainly used to control the speed of motors.
Used as bidirectional switch.
Used to run two motors.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

RF Transceivers
IC used - RF 434.
Properties

Transmitter

Receiver

No of pins

Frequency used

433.92 MHz

433.92 MHz

Operating voltage

2-12 V

4.5 - 5.5 V

Data rate

4800 bps

2400 bps

Distance

500 ft

500 ft

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Operations inside FPGA

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Advantages and applications of


proposed system
Advantages of the proposed system
Accurate, Simple and Quick reaction to sudden

changes.
Using Fuzzy Logic Robot can able to avoid
obstacle in time efficient manner.
Using RF transceiver, Robot activity can be
monitored easily.

Applications of the proposed system


Military applications.
Vacuum cleaners.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Hardware Details
Altera FPGA
Obstacle Sensor
RF Transceiver
H Bridge Motor Drive
Motors

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Software Tools
Quartus II for FPGA programming
Nios EDS for processor programming
Orcad for circuit design
Eagle for PCB design
LabVIEW for path control

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Working Principle
of IR Sensors

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Controlling motor speed


PWM signals are used to control the speed with

which the motors operate


Done by using the width of the PWM signal sent
to the motor drive from FPGA..

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Controlling direction of rotation of motor

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Simulation Program
clear
clc;
Goal position of vehicle
xgoal=[25; 25];
Initial vehicle position
x=[5; 5];
xmin=[0; 0];
xmax=[30;30];
Nsteps=500;

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Simulation program
Next set the parameters of the vehicle:
lambda=0.1;
Ns=16;
r=1;
xs=0*ones(2,Ns);
Jo(:,1)=0*ones(Ns,1);
Jg(:,1)=0*ones(Ns,1);
J(:,1)=0*ones(Ns,1);
theta(:,1)=0*ones(Ns,1);
for m=2:Ns
theta(m,1)=theta(m-1,1)+(pi/180)*(360/Ns);
end
Weighting parameters for planning (sets priority for being aggresive
in the direction of the goal vs. avoiding obstacles
w1=1;
w2=1.0000e-04;
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Simulation program
Allocate memory
x(:,2:Nsteps)=0*ones(2,Nsteps-1);
The obstacles:
figure(1)
clf
plot(5,5, 's',25,25,'x')
axis([0 30 0 30])
hold on
xlabel('x');
ylabel('y');
title('Obstacles (o), initial vehicle (square) and goal (x) positions');
hold on
Plot obstacle positions (sets obstaclefunction)
plot(20,15,'o',8,10,'o',10,10,'o',12,10,'o',24,20,'o',18,20,'o')
hold off
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Simulation program
Plot the functions:
xx=0:31/100:30;
yy=xx;
Compute the obstacle and goal functions
for jj=1:length(xx)
for ii=1:length(yy)
zz(ii,jj)=obstaclefunction([xx(jj);yy(ii)],w1);
end
end
for jj=1:length(xx)
for ii=1:length(yy)
zzz(ii,jj)=goalfunction([xx(jj);yy(ii)],xgoal,w2);
end
end
[x] = fuzzyfis(Nsteps, Ns, x, xs, xmin, xmax, r, theta, xgoal,lambda);
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Simulation program
figure(8)
clf
contour(xx,yy,zz,25)
colormap(jet)
xlabel('x');
ylabel('y');
title('Vehicle path to avoid obstacles and reach goal');
hold on
plot(x(1,:),x(2,:),'r-')
plot(5,5,'s',25,25,'x')
hold off

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Initial environment

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Final output

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Simulation results
The simulation of two fuzzy logic algorithms is shown.

Hardware results
The hardware results will show the actual movements of

the robotic platform in a path when the obstacles are


placed at different locations in that path.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Final demo to be displayed


Collects information from all the sensors in the

robotic platform.
Sends those information to pc via RF transceiver
for further processing.
Two fuzzy logic algorithms will be implemented
on that data.
The outputs got by this implementation is being
sent to FPGA board via RF transceiver.
These outputs will be given to motor drives which
will control the movement of robot.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Questions asked in previous review


How do motor drive control the speed of the

motor?
What is the difference between the two
algorithms?
How do you set the target position?
How are you saying that distance is measured
through IR sensor?

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

References
Muhammad Mysorewala, Khaled Alshehri, Eyad Alkhayat, Adnan Al-Ghusain, Omar

Al-Yagoub Design and Implementation of Fuzzy-Logic based Obstacle-Avoidance and


Target-Reaching Algorithms on NIs Embedded-FPGA Robotic Platform
,IEEE/CICA,2013.(BASE PAPER)
Borenstein, J.; Koren, Y.;, "Obstacle avoidance with ultrasonic sensors", IEEE Journal of
Robotics and Automation, Apr 1988.
Borenstein, J.; Koren, Y.; , "The vector field histogram-fast obstacle avoidance for
mobile robots", IEEE Transactions on Robotics and Automation, Jun 1991.
Menon, A.; Akmeliawati, R.; Demidenko, S.; , "Towards a Simple Mobile Robot with
Obstacle Avoidance and Target Seeking Capabilities using Fuzzy Logic", IMTC 2008.
IEEE.,May 2008
Ganapathy, V.; Soh Chin Yun; Ng, J.; , "Fuzzy and Neural controllers for acute obstacle
avoidance in mobile robot navigation", IEEE/ASME, 2009.
J. J. Rodriguez-Andina, M. J. Moure, and M. D. Valdes, Features, design tools, and
application domains of FPGAs, IEEE Transactions on Industrial Electronics, 2007
Ling K.V., Yue S.P. and Maciejowski J.M., "A FPGA Implementation of Model
Predictive Control", IEEE American Control Conference,2006.
NI-FPGA details: http://www.ni.com/fpga/
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

References
NI-SBRIO details: www.ni.com/singleboard
A project on Creating a Smart Grid Monitoring and Control System Using LabVIEW

and NI-SBRIO http://sine.ni.com/cs/app/doc/p/id/cs-13487.


LabVIEW VI for Simple Vector Field Histogram (VFH), http://zone.ni.com/reference/enXX/help/372983A-01/lvrobovi/simple_vfh.
PID and Fuzzy Logic Toolkit User Manual, National Instruments. 2009.
Lefteri H. Tsoukalas, and Robert E. Uhrig, Fuzzy and Neural Approaches in
Engineering, Wiley-Interscience. 1997.
Tahboub, Khaldoun K., and Munaf SN Al-Din. "A Neuro-Fuzzy reasoning system for
mobile robot navigation." JJMIE 3.1 (2009).
Pi-Ying Cheng, Pin-Jyun Chen, Navigation of mobile robot by using D++ algorithm,
Intelligent Service Robotics Journal, November 2012,
K. Schmidt and Y. Boutalis, "Fuzzy Discrete Event Systems for Multiobjective Control:
Framework and Application to Mobile Robot Navigation", IEEE Trans. on Fuzzy
Systems, October 2012.
Y. S. Boutalis, K. Schmidt, "Multi-objective decision making using fuzzy discrete event
systems: A mobile robot example", 18th Mediterranean Conference on Control and
Automation, June 23-25, 2010.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Thank You

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

Potrebbero piacerti anche