This document presents a fuzzy logic controller for navigating a mobile robot around moving objects. It consists of four main parts: (1) a rule base defining linguistic variables for distance, angle, and deviation, (2) fuzzification of numerical inputs into linguistic values, (3) fuzzy inference applying the rules, and (4) defuzzification of outputs into a numerical value. For example, an input distance of 1.04m and angle of 30 degrees would activate rules specifying a deviation of 19.58 degrees to the right to avoid collision. The fuzzy logic approach allows controlling the robot without an exact mathematical model.
3. INTRODUCTION
Concept of fuzzy theory can be applied in many application such as
fuzzy clustering, fuzzy reasoning, fuzzy programming.
Fuzzy reasoning is also known as fuzzy logic controller and it is a
very important application.
FLC employs a knowledge base expressed in terms of fuzzy
inference rules and fuzzy inference engine to solve a problem
We use FLC where exact mathematical formulation of the system
is not possible to formulate.
There difficulties are due to non linearity, time varying nature,
large unpredictable environment disturbances etc.
4. Fig 1: Block diagram of FLC
Fuzzy Controller consists of 4 modules:
Fuzzy rule base
Fuzzy inference engine
Fuzzification model
Defuzzification model
5. Consider the control of navigation of a mobile robot in the
presence of no. of moving objects.
Now, we consider 3 parameters:
D, distance from the robot to an object
θ, the angle of motion of an object with respect to the
robot.
δ, deviation from the reference
6. RULE BASE
Generating rule base by Mamdani approach :
Distance is being represented using 4 linguistic states:
VN : Very Near
NR: Near
VF: Very Far
FR: Far
The angular position and deviation can also be represented by
5 linguistic states:
LT: Left
AL: Ahead Left
AA: Ahead
AR: Ahead Right
RT : Right
7. Now, there will be 20 fuzzy rule base for the system taken :
Rule 1: If (distance is VN ) and angle is LT , the deviation is AA.
Rule 2: If (distance is VN ) and angle is AL , the deviation is AR.
Rule 3: If (distance is VN ) and angle is AA, the deviation is AL.
Rule 4: If (distance is VN ) and angle is AR , the deviation is AL.
Rule 5: If (distance is VN ) and angle is RT , the deviation is AA.
Rule 6: If (distance is NR ) and angle is LT , the deviation is AA.
Rule 7: If (distance is NR ) and angle is AL, the deviation is AA.
Rule 8: If (distance is NR ) and angle is AA , the deviation is RT.
Rule 9: If (distance is NR ) and angle is AR , the deviation is AA.
Rule 10: If (distance is NR ) and angle is RT , the deviation is AA.
Rule 11: If (distance is FR ) and angle is LT , the deviation is AA.
Rule 12: If (distance is FR ) and angle is AL , the deviation is AA.
Rule 13: If (distance is FR ) and angle is AA , the deviation is AR.
Rule 14: If (distance is FR) and angle is AR, the deviation is AA.
Rule 15: If (distance is FR ) and angle is RT , the deviation is AA.
Rule 16: If (distance is VF ) and angle is LT , the deviation is AA.
8. Rule 17: If (distance is VF ) and angle is AL , the deviation is AA.
Rule 18: If (distance is VF ) and angle is AA , the deviation is AA.
Rule 19: If (distance is VF ) and angle is AR , the deviation is AA.
Rule 20: If (distance is VF ) and angle is RT , the deviation is AA.
Fig 2: The rule base matrix
9. Linguistic states of the three variables taken are:
μ
μD : membership function of distance
μθ: membership function of angular position
μδ : membership function of deviation
10. FUZZIFICATION
For distance , as the input of distance = 1.04 cuts the y
axis both on NR and FR . So, we have to find the
membership function of distance for both the linguistic
state NR and FR.
Similarly, the input of angular position = 30o, Now cuts
the y axis at both AA and AR , hence we will be finding
the membership function of 30o in both the states AA and
AR.
Rule base is already done.
Now, the next step is the conversion of crisp input to
fuzzy value, that is known as fuzzification
11. Fuzzification of inputs:
Let us consider an input D = 1.04 m and θ = 30o
For this input we have to decide the deviation δ of the robot as
output.
By, using similarity transformation of triangles , we can find the
membership function of the distance, angular position.
12. From, the previous figure we can say that the,
x / y = δ/δ2
x /1 = 1.5 – 1.04/ 1.5 – 0.8
x = μNR(x) =0.6521 ( the membership function of distance
for NR)
Similarly for FR , μFR(x)= 0.3479
Now, from the linguistic state of the angular position,
applying same similarity transformation of triangle we will
be getting:
μAA(y)=0.333
μAR(y)=0.667
Hence, we have got our fuzzified input and the next block is
fuzzy inference engine.
13. FUZZY INFERENCE
After the fuzzification of the input, now it will pass through
fuzzy inference block.
In the fuzzy inference , it will take the fuzzified input and then
consult the fuzzy rule base. The main aim of fuzzy inference is
to eliminate the rules that are of not our use.
In this case we are actually only dealing with the angular
position two linguistic state AA,AR.
And of distance two linguistic states NR,FR.
Hence, we will be keeping the rules that are intersection to
there four states and remove the other rules for the input
x=1.04, θ = 30o.
14. From this, only 4 fuzzy rule are left,
Rule 1: If (distance is NR ) and angle is AA , the deviation is RT.
Rule 2: If (distance is NR ) and angle is AR , the deviation is AA.
Rule 3: If (distance is FR ) and angle is AA , the deviation is AR.
Rule 4: If (distance is FR) and angle is AR, the deviation is AA.
15. RULE STRENGTH COMPUTATION
Let, λ will be the strength of the rules to be calculated.
λ(R1)= min(μNR(x) , μAA(y) ) = min(0.6571,0.3333) = 0.3333
λ(R2)= min(μNR(x) , μAR(y) ) = min(0.65717,0.6667) = 0.6571
λ(R3)= min(μFR(x) , μAA(y) ) = min(0.3429,0.3333) = 0.3333
λ(R4)= min(μFR(x) , μAR(y) ) = min(0.3429,0.6667) = 0.3429
Lets, assume a threshold value of 0.3400.
That means only the value of R2 and R4 are above the threshold
value. So, now the rest two rules are cancelled.
After fuzzy inference stage we are only left with the two rule R2
and R4.
16. DEFUZZIFICATION
Again , the fuzzy input with the help of fuzzy rule has to be
converted to the crisp output.
The conversion from fuzzy value to the crisp value is known as
defuzzification.
NOTE:
We take min. of membership function values for each rule.
Output membership function is obtained by aggregating the
membership function of result of each rule.
Fuzzy output is nothing but fuzzy OR for all output of rule.
The methods used for defuzzification includes centroid
method, maximum method, weighted average method.
17. If, we are taking input = 1.04, that is cutting x axis in 1st triangle.
And input θ=30 cutting the second triangle
So, the output deviation triangle will have 0.333 as the output, as
it is the min area of both the input triangles.
Repeating the same step for rest of the rules, R2, R3 , R4 we
will be getting output area as 0.657, 0.3333,0.3333 respectively.
18. After combining all the areas of the 4 rules the combined output
will look like in the figure below.
The overall shaded region is the combined output graph for the
system input provided.
19. By, the method of centroid of sum (COS) we will be finding the
final output of the graph.
V = = = 19.59
20. CONCLUSION
Therefore, the robot should deviate by 19.58089o towards the
right with respect to the line joining to the move of direction to
avoid collision with the object.
We have seen how to make the rule base, fuzzification, fuzzy
inference and defuzzification for the mobile robot.