Professional Documents
Culture Documents
For Lab: Submitted By: Warda Tu Zahra BSEE 17-21 Dated: 15 March 2021
For Lab: Submitted By: Warda Tu Zahra BSEE 17-21 Dated: 15 March 2021
BSEE 17-21
Membership functions are used in the fuzzification and defuzzification steps of a FLS (fuzzy logic
system), to map the non-fuzzy input values to fuzzy linguistic terms and vice versa.
There are different forms of membership functions such as:
o Triangular.
o Trapezoidal.
o Piecewise linear.
Implementation:
We have defined 5 triangular membership functions for the distance from obstacle as
Near(N) (s<=0.25)
Near medium(NM) (0<=s<=0.5)
Medium(M) (0.25<=s<=0.75)
Medium Far(MF) (0.5<=s<=1)
Far(F) (s>=0.75)
membership functions are defined for dS (change in distance) which are given as:
ds0 (ds<=-0.2)
ds1 (-0.2<=ds<=0)
ds2 (-0.1=ds<=0.1)
ds3 (0<=ds<=0.2)
ds4 (ds>=0.2)
(1) The “rule-base” holds the knowledge, in the form of a set of rules, of how best to control the
system.
(2) The inference mechanism evaluates which control rules are relevant at the current time and
then decides what the input to the plant should be
(3) The fuzzification interface simply modifies the inputs so that they can be interpreted and
compared to the rules in the rule-base.
(4) the defuzzification interface converts the conclusions reached by the inference mechanism into
the inputs to the plant.
Implementation:
We specify a set of rules (a rule-base) that captures the expert’s knowledge about how to control the
plant.
Other rules are also defined which are listed in following table
Robot needs to be maintained at a distance of 0.5m from the left wall. Based on the fuzzy logic,
these requirements are met in simulations by defining the rulebases and incorporating them in
Mobotsim in the form of membership functions. These membership functions include the data
obtained from the sensors that are used in our design i.e. SL, ΔSL.
s=minvalue(s7,s8,s9,s10)
ds=s-z
Code
“membership functions” “rule base” “main”
Discussion:
Left wall follower robot is designed using fuzzy control logic. Rule base is defined and then membership
functions are used to fuzzify and defuzzify the output. The whole code is then simulated in mobotsim.
Ideally, the robot should move in a straight line but it gets tilted as velocities of wheels are decided
manually.