9
Design, Low Cost Implementation and Comparison of MIMO Mamdani Fuzzy Logic Controllers for Wall Tracking Behavior of Mobile Robot Umar Farooq 1 , K.M. Hasan 2 , Ghulam Abbas 3 , Muhammad Usman Asad 4 , Syed Omer Saleh 5 1,4,5 Department of Electrical Engineering University of The Punjab Lahore-54590 Pakistan 2 Department of Electrical Engineering UET Lahore-54580 Pakistan 3 University of Lyon, Lyon Institute of Nanotechnology, CPE Lyon France 1 [email protected], 2 [email protected], 3 [email protected], 4 [email protected], 5 [email protected] Abstract—This paper describes the design, implementation and comparison of two Mamdani Fuzzy Logic Controllers for wall tracking behavior of mobile robot. Both the controllers take inputs from two ultrasonic sensors and generate motion commands for left and right motors. The controllers are designed using MATLAB and implemented in real time using an inexpensive and readily available microcontroller, AT89C52. The controllers differ in membership functions and the rule base which provides a mean for their comparison. Experimental results have validated both the controllers; however they exhibit different settling time and percentage overshoot due to the difference in the membership functions and the design of rule base. Keywords-wall tracking;mobile robot navigation;fuzzy logic controller;mamdani fuzzy inference engine;MATALAB;AT89C52 micocontroller I. INTRODUCTION In an indoor navigation, mobile robot is also required to have a wall following capability. This behavior enables the robot to follow the contour of objects such as walls and obstacles in the environment and can also be combined with more intelligent behavior to accomplish a high level task [1]. The controller for this behavior can be designed either using conventional control techniques or intelligent algorithms. The conventional controller requires the complete knowledge of environment for its design and will not work well in noisy and uncertain environments. This difficulty of modeling the complete environment can be overcome by employing soft computing techniques. Amongst these techniques, fuzzy logic offers a promising solution to handle real world uncertainty by mimicking human experience in the form of rules. Many researchers have utilized fuzzy logic in developing controllers for wall following behavior of a mobile robot. In [2], a wall following controller is designed using fuzzy logic and is tuned with the help of genetic algorithm to find optimum membership functions so that the robot moves at constant distance to the wall, at high speed and as smoothly as possible. The designed controller is tested on a highly maneuverable mobile robot ‘IKERLAN’ that is equipped with 12 ultrasonic sensors and has a maximum speed of 0.25m/s. In [3], an embedded fuzzy logic controller for wall following task of mobile robot is realized using the Motorola MC68HC11 microprocessor chip. The rule base of controller is designed using a software product called FIDE which provides the capability of converting fuzzy inference engine into assembler code compatible with MC68HC11 chip. The machine code is downloaded to microprocessor for embedded execution on commercially available mobile robot called Whiskers that is equipped with four optical range sensors on a side of robot. The maximum speed of robot is found to be 0.33m/s. In [4], fuzzy logic controller is designed for wall following task and is implemented using Altera’s Excalibur kit which consists of the Nios processor, the GNUPro compiler and Altera Quartus tool used to configure the development board containing APEX20K200E FPGA. The designed controller has used approximately 32% of FPGA and 12% of Nios processor chip and is tested on a car like robotic vehicle equipped with five infrared sensors. Experimental results show the advantages of fuzzy logic to control wall following of car and simultaneously the gap detection. In [5], the design of a fuzzy logic controller is presented for an autonomous robot equipped with three ultrasonic sensors that is designed to take part in an IEEE competition, held at Cleveland State University in 2004. Since the main theme of competition was to cover as much of playing area as possible within shortest time, a fuzzy wall following controller is designed. The robot is first modeled in MATLAB Simulink and fuzzy rules are optimized for best results possible. The controller is then implemented with two PIC16F877 microcontrollers using a look up table approach. One microcontroller calculates the present error in distance and angle and sends the necessary control signals to the second microcontroller which generates PWM signals to run the two servo motors. In [6], a comparative analysis is performed between fuzzy controller and neuro-fuzzy controller for wall following behavior of mobile robot. Both of these controllers are implemented on FPGA platform. Experimental results have shown that neuro-fuzzy controller is better choice than fuzzy controller because it significantly reduces the trajectory tracking error but at the expense of using more DSP resources causing a slower throughput time. In [7], a neural integrated

[IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

Embed Size (px)

Citation preview

Page 1: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

Design, Low Cost Implementation and Comparison of MIMO Mamdani Fuzzy Logic Controllers for Wall

Tracking Behavior of Mobile Robot

Umar Farooq1, K.M. Hasan2, Ghulam Abbas3, Muhammad Usman Asad4, Syed Omer Saleh5 1,4,5Department of Electrical Engineering University of The Punjab Lahore-54590 Pakistan

2Department of Electrical Engineering UET Lahore-54580 Pakistan 3University of Lyon, Lyon Institute of Nanotechnology, CPE Lyon France

[email protected], [email protected], [email protected], [email protected], [email protected]

Abstract—This paper describes the design, implementation and comparison of two Mamdani Fuzzy Logic Controllers for wall tracking behavior of mobile robot. Both the controllers take inputs from two ultrasonic sensors and generate motion commands for left and right motors. The controllers are designed using MATLAB and implemented in real time using an inexpensive and readily available microcontroller, AT89C52. The controllers differ in membership functions and the rule base which provides a mean for their comparison. Experimental results have validated both the controllers; however they exhibit different settling time and percentage overshoot due to the difference in the membership functions and the design of rule base.

Keywords-wall tracking;mobile robot navigation;fuzzy logic controller;mamdani fuzzy inference engine;MATALAB;AT89C52 micocontroller

I. INTRODUCTION In an indoor navigation, mobile robot is also required to

have a wall following capability. This behavior enables the robot to follow the contour of objects such as walls and obstacles in the environment and can also be combined with more intelligent behavior to accomplish a high level task [1]. The controller for this behavior can be designed either using conventional control techniques or intelligent algorithms. The conventional controller requires the complete knowledge of environment for its design and will not work well in noisy and uncertain environments. This difficulty of modeling the complete environment can be overcome by employing soft computing techniques. Amongst these techniques, fuzzy logic offers a promising solution to handle real world uncertainty by mimicking human experience in the form of rules. Many researchers have utilized fuzzy logic in developing controllers for wall following behavior of a mobile robot. In [2], a wall following controller is designed using fuzzy logic and is tuned with the help of genetic algorithm to find optimum membership functions so that the robot moves at constant distance to the wall, at high speed and as smoothly as possible. The designed controller is tested on a highly maneuverable mobile robot ‘IKERLAN’ that is equipped with 12 ultrasonic

sensors and has a maximum speed of 0.25m/s. In [3], an embedded fuzzy logic controller for wall following task of mobile robot is realized using the Motorola MC68HC11 microprocessor chip. The rule base of controller is designed using a software product called FIDE which provides the capability of converting fuzzy inference engine into assembler code compatible with MC68HC11 chip. The machine code is downloaded to microprocessor for embedded execution on commercially available mobile robot called Whiskers that is equipped with four optical range sensors on a side of robot. The maximum speed of robot is found to be 0.33m/s. In [4], fuzzy logic controller is designed for wall following task and is implemented using Altera’s Excalibur kit which consists of the Nios processor, the GNUPro compiler and Altera Quartus tool used to configure the development board containing APEX20K200E FPGA. The designed controller has used approximately 32% of FPGA and 12% of Nios processor chip and is tested on a car like robotic vehicle equipped with five infrared sensors. Experimental results show the advantages of fuzzy logic to control wall following of car and simultaneously the gap detection. In [5], the design of a fuzzy logic controller is presented for an autonomous robot equipped with three ultrasonic sensors that is designed to take part in an IEEE competition, held at Cleveland State University in 2004. Since the main theme of competition was to cover as much of playing area as possible within shortest time, a fuzzy wall following controller is designed. The robot is first modeled in MATLAB Simulink and fuzzy rules are optimized for best results possible. The controller is then implemented with two PIC16F877 microcontrollers using a look up table approach. One microcontroller calculates the present error in distance and angle and sends the necessary control signals to the second microcontroller which generates PWM signals to run the two servo motors. In [6], a comparative analysis is performed between fuzzy controller and neuro-fuzzy controller for wall following behavior of mobile robot. Both of these controllers are implemented on FPGA platform. Experimental results have shown that neuro-fuzzy controller is better choice than fuzzy controller because it significantly reduces the trajectory tracking error but at the expense of using more DSP resources causing a slower throughput time. In [7], a neural integrated

Page 2: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

fuzzy controller (NiF-T) comprising of three distinct parts including fuzzy logic membership function, a rule neural network and output-refinement neural network is developed for non-linear dynamic control problems and is applied to control three behaviors in mobile robot navigation including wall following, hall centering and convoying. The beauty of proposed controller is that it requires a small number of rules for training the network. In [8], a reinforcement ant optimized fuzzy controller (RAOFC) is described. The antecedent part in each fuzzy rule uses interval type-2 fuzzy set in order to increase fuzzy controller robustness while consequent part is designed using Q-value aided ant colony optimization. Rules are automatically generated by using online aligned interval type-2 fuzzy clustering method (AIT2FC). The designed controller is applied to wall following behavior of mobile robot namely PIONEER3-DX mobile robot with four range finding sonar sensors. The output from the controller is steering angle for robot. Although these approaches to wall following mobile robot control produce efficient results, the computational resources need to be reduced for achieving a low cost solution to the problem without much deteriorating the performance.

In this paper, detail design of two fuzzy logic controllers are presented that enable the mobile robot to track wall on its left side at a set distance. Both the controllers measure distance from the wall and orientation with respect to the wall with the help of two ultrasonic sensors. One of the controllers is made sensitive to variation in both the sensors to align with the wall while the other controller is made sensitive to variation in one sensor only. This variation in sensitivity leads to the design of two controllers with different membership functions and the fuzzy rule base. Both the controllers are checked for validity by implementing them in real time using an inexpensive 8-bit microcontroller and experimental results are recorded. It is seen that the controllers offer different settling time and percentage overshoot owing to the difference in their design.

In the sections that follow; mobile robot architecture, fuzzy controller development, fuzzy controller implementation and finally the results are presented.

II. MOBILE ROBOT ARCHITECTURE The experimental prototype is a rectangular shaped

differentially steered mobile robot. Two dc motors independently control two wheels on a common axis. A third wheel (caster) is provided for support. Two SRF04 ultrasonic sensors named as front sensor (FS) and back sensor (BS) comprise the sensory system of the robot. These sensors are mounted on the left side of the robot to track wall at the desired distance. The sensors arrangement is shown in Fig. 1. To drive the dc motors from microcontroller, a motor interface board is designed using 4N25 and L298N integrated circuit chips. IC L298N contains two H-bridges each capable of handling currents up to 2A. These bridges are connected in parallel to enhance the current rating. The microcontroller is also interfaced to MAX232 chip to transfer the distance information from sensors and speed profile of motors in a serial fashion to computer for analysis. The assembled robot is shown in Fig. 1.

Figure 1. Sensors placement on robot

Figure 2. Assembled Robot

III. FUZZY CONTROLLER DEVELOPMENT To follow the left wall at a set distance, two fuzzy

controllers are designed. These controllers differ in the membership functions and the rule base. In both the controllers, inputs i.e., distance information from front and back sensors are represented by the linguistic variables ‘FS’ and ‘BS’ respectively and are scaled in range [10,60]. Similarly, the outputs from the controllers i.e., speed of left and right motors are represented by the linguistic variables ‘LM’ and ‘RM’ and are scaled in range [0,50]. Further, the fuzzy sets for all the linguistic variables in both the controllers are represented by triangular membership functions to reduce the computational complexity and the degree of belongingness to each fuzzy set is scaled in range [0,100] to prevent floating point storage and calculations. This section describes the detail design of the two controllers.

Page 3: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

A. Fuzzy Logic Controller Sensitive to Variation in Both the Sensors In this controller, the linguistic variables representing the

inputs ‘FS’ and ‘BS’ are described with the help of three fuzzy sets: Near, Med and Far. The fuzzy set ‘Near’ covers the region very close to the wall, the fuzzy set ‘Med’ serves the purpose of set point for wall tracking and the fuzzy set ‘Far’ encapsulates the region very far away from the wall to be tracked. The width of ‘Med’ fuzzy set is kept small as compared to the fuzzy sets ‘Near’ and ‘Far’. This ensures the fast variation in the speed of motors when the disturbance tries to deviate the robot once it is following the wall at set point. The fuzzy sets for ‘FS’ (same as that for ‘BS’) are shown in Fig. 3 and are described by the following set of equations:

,4 100, 10 30

0, 35s s

FS NEARs

F F

− + ≤ ≤=

⎧⎨⎩

(1)

,20 600, 30 35

20 800, 35 40s s

FS MEDs s

F F

F Fμ

− ≤ ≤=

− + ≤ ≤

⎧⎨⎩

(2)

,0, 35

4 140, 35 40s

FS FARs s

F

F Fμ

≤=

− ≤ ≤

⎧⎨⎩

(3)

In these expressions, Fs is the distance measurement recorded by front sensor while ,FS xxxμ represents the degree of belongingness of ‘FS’ to a particular fuzzy set ‘xxx’.

The linguistic variables representing the outputs ‘LM’ and ‘RM’ are described by two fuzzy sets, ‘Slow’ and ‘Fast’. In contrast to fuzzy sets for inputs, these sets do not overlap. This condition is adjusted through experimentation. The fuzzy set ‘Slow’ is responsible for generating the duty cycle below 50% while fuzzy set ‘Fast’ generates the duty cycle variation above 50%. The fuzzy sets for ‘LM’ (same as that for ‘RM’) are shown in Fig. 4 and are described by the expressions:

,4 100, 0 25

0, 25m m

LM SLOWm

L L

− + ≤ ≤=

⎧⎨⎩

(4)

Figure 3. Fuzzy sets for linguistic variable ‘FS’

Figure 4. Fuzzy sets for linguistic variable ‘LM’

,0, 25

4 100, 25 50m

LM FASTm m

L

L Lμ

≤=

− ≤ ≤

⎧⎨⎩

(5)

In these expressions, Lm represents the speed of left motor while ,LM xxxxμ represents the degree of belongingness of ‘LM’ to a particular fuzzy set ‘xxxx’.

To design a rule base for fuzzy logic controller, various possible cases which the mobile robot can encounter in real time are shown in Fig. 5, 6 and 7. Fig. 5 describes the three situations in which the robot is already parallel to the wall but at three different distances. In the first case, both the sensors measure in the ‘Near’ region. Thus the robot should take turn towards right by reducing the speed of right motor and increasing the speed of left motor to follow wall at distance where the degree of belongingness to ‘Med’ region is maximum. The change in speed of the motors is represented by the arrows inside the robot with the speed being proportional to the length of the arrow. The red arrow shows the speed of the left motor while the green arrow shows the speed of the right motor. The turning direction of the robot is shown above the robot with an arrow pointing in either clockwise or counter-clockwise direction. Thus we have the first rule for fuzzy controller which can be described as:

[R1]: If FS is Near and BS is Near Then LM is Fast and RM is Slow

In the second case, the robot is already placed at the set point where both the sensors measure in the ‘Med’ region. Thus the robot should go fast without turning as indicated by the arrows and we have the second rule which can be stated as:

[R2]: If FS is Med and BS is Med Then LM is Fast and RM is Fast

In the third case, the robot is placed above the set point i.e., at a large distance from the wall where both the sensors measure in the ‘Far’ region. This situation should drive the robot towards set point by reducing the speed of left motor and increasing the speed of the right motor as indicated by arrows. Thus the robot will go forward while taking turn towards left and we have found the third rule for the fuzzy controller which can be described as:

[R3]: If FS is Far and BS is Far Then LM is Slow and RM is Fast

Page 4: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

Figure 5. Three different situations faced by mobile robot when it is parallel to the left wall. The dotted line represents the set point

Fig. 6 describes the three possible situations when the angle made by the robot with the wall is positive. In the first case, FS measures in ‘Near’ region while BS measures in ‘Med’ region. Thus the robot should take sharp turn towards right to align with the wall at ‘Med’ distance. When this happens, both sensors will measure in ‘Med’ region and rule R2 will be activated which will drive the robot at set point. The rule can be described as:

[R4]: If FS is Near and BS is Med Then LM is Fast and RM is Slow

In the second case, FS measures in ‘Near’ region and BS measures in ‘Far’ region. Thus the robot should take sharp turn towards right to reduce the angle with the wall. In due course, when BS will measure in ‘Med’ region, rule R4 will be activated which eventually ensures the motion of robot in straight line at set distance along the wall. This rule can be stated as:

[R5]: If FS is Near and BS is Far Then LM is Fast and RM is Slow

In the third case of positive angle made by the robot with the wall, FS measures in the ‘Med’ region and BS measures in the ‘Far’ region. Now, the robot should take sharp turn towards right so that BS also measures in the ‘Med’ region. At this point, rule R2 will be activated and robot will follow the wall at set point. The rule can be described as:

[R6]: If FS is Med and BS is Far Then LM is Fast and RM is Slow

Figure 6. Three different situations faced by mobile robot when it is tilted towards the wall (The angle made by the robot with the wall is taken as

positive in this case). The dotted line represents the set point.

Similar to the above situations, there are three more possible situations in which the angle made by the robot with the wall is negative as shown in Fig. 7. In the first case, FS measures in ‘Med’ region while BS measures in ‘Near’ region. This is the compliment of the situation described by rule R4. Thus the robot will take sharp turn towards left so that BS also measures in ‘Med’ region. At this point, rule R2 will be activated and the robot will track the wall. The rule can be stated as:

[R7]: If FS is Med and BS is Near Then LM is Slow and RM is Fast

In the second case, FS measures in ‘Far’ region and BS measures in ‘Near’ region i.e., the angle is large negative. This is compliment to the situation described in rule R6. Thus the robot should take sharp turn towards left. In due course, FS will measure in ‘Med’ region and rule R7 will be activated which will ensure the wall tracking at set point. The rule can be described as:

[R8]: If FS is Far and BS is Near Then LM is Slow and RM is Fast

In the third case, FS measures in ‘Far’ region while BS measures in ‘Med’ region. In this situation, the robot should take sharp turn towards left so that both the sensors measure in ‘Med’ region. At this point, rule R2 will be activated and the robot will follow the wall at set distance. The rule can be written as:

Page 5: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

Figure 7. Three different situations faced by mobile robot when it is tilted away from the wall (The angle made by the robot with the wall is taken as

negative in this case). The dotted line represents the set point.

[R9]: If FS is Far and BS is Med Then LM is Slow and RM is Fast

After the rule base is designed, the rules in the rule base are evaluated in sequence. The outputs from the rules that have been fired are aggregated using OR operator. This aggregated output is also fuzzy in nature and we require a crisp output in the form of duty cycle of pulse width modulated signal (PWM) for controlling the speed of left and right motors. The conversion of fuzzy output to a crisp output is known as Defuzzification. Amongst the various methods available for defuzzification, center of area (COA) method has been used which can be mathematically described as:

1

1

( )

( )

n

i out ii

o n

out ii

Z ZZ

Z

μ

μ=

=

∑=

∑ (6)

where ( )out iZμ are the i=1,2,…,n sampled values of the

aggregated output membership function and oZ is the crisp value which describes the duty cycle of PWM signal for controlling the speed of motors.

B. Fuzzy Logic Controller Sensitive to Variation in One Sensor In this controller, similar to the first controller, linguistic

variables for inputs ‘FS’ and ‘BS’ are described by three fuzzy sets, ‘Near’, ‘Med’ and ‘Far’. Since we want to make this controller sensitive to variation in one sensor only, the effective width of fuzzy set ‘Med’ is kept small for front sensor. The fuzzy sets for ‘FS’ are shown in Fig. 8 and are described by the expressions:

,100, 10 30

20 700, 30 35s

FS NEARs s

F

F Fμ

≤ ≤=

− + ≤ ≤

⎧⎨⎩

(7)

, 4 -40, 10 35

4 240, 35 60s s

FS MEDs s

F F

F Fμ

≤ ≤=

− + ≤ ≤

⎧⎨⎩

(8)

, 20 700, 35 40

100, 40 60s s

FS FARs

F F

− ≤ ≤=

≤ ≤

⎧⎨⎩

(9)

The fuzzy sets for ‘BS’ are shown in Fig. 9 and are described by the following set of equations:

,4 140, 10 35

0, 35s s

BS NEARs

B B

− + ≤ ≤=

⎧⎨⎩

(10)

, 4 40, 10 35

4 240, 35 60s s

BS MEDs s

B B

B Bμ

− ≤ ≤=

− + ≤ ≤

⎧⎨⎩

(11)

,4 140, 35 60

0, 35s s

BS FARs

B B

− ≤ ≤=

⎧⎨⎩

(12)

In contrast to the first controller, the output linguistic variables ‘LM’ for this controller is described by three fuzzy sets, ‘Slow’, ‘Med’ and ‘Fast’. The fuzzy set ‘Med’ is introduced in order to have smooth variation in the speed of left motor from ‘Slow’ to ‘Fast’. However, the linguistic variable ‘RM’ is described by two fuzzy sets similar to the first controller i.e., ‘Slow’ and ‘Fast’. Thus whenever the front sensor will see a sudden change (e.g., wall is bending), the controller will quickly vary the speed of right motor from ‘Fast’ to ‘Slow’ as compared to left motor to prevent sudden collision and robot operation will be resumed. The fuzzy sets for ‘LM’ are shown in Fig. 10.

This controller also operates with nine rules which are described as:

[R1]: If FS is Near and BS is Near Then LM is Fast and RM is Slow

[R2]: If FS is Near and BS is Med Then LM is Fast and RM is Slow

Page 6: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

Figure 8. Fuzzy sets for linguistic variable‘FS’

Figure 9. Fuzzy sets for linguistic variable‘BS’

Figure 10. Fuzzy sets for linguistic variable‘LM’

[R3]: If FS is Near and BS is Far Then LM is Fast and RM is Slow

[R4]: If FS is Med and BS is Near Then LM is Fast and RM is Fast

[R5]:If FS is Med and BS is Med Then LM is Fast and RM is Fast

[R6]: If FS is Med and BS is Far Then LM is Med and RM is Fast

[R7]: If FS is Far and BS is Near Then LM is Fast and RM is Fast

[R8]: If FS is Far and BS is Med Then LM is Slow and RM is Fast

[R9]: If FS is Far and BS is Far Then LM is Med and RM is Fast

These rules are evaluated in sequence using Mamdani Implication method, similar to the first controller and final aggregated fuzzy outputs corresponding to ‘LM’ and ‘RM’ are converted into numeric values using equation (6) which are actually the speed commands for the motors.

IV. FUZZY CONTROLLER IMPLEMENTATION Both the fuzzy controllers are implemented as C programs

running inside AT89C52 microcontroller. The main microcontroller reads range information from sensors, performs fuzzy logic algorithm and calculates motors speeds. These speed values are passed onto second microcontroller which generates PWM signals corresponding to speed values. At the same time; main microcontroller transfers sensor readings, motor commands and the time elapsed in the form of an 8-byte packet to the computer serially for analysis (one byte from the packet is transmitted at a time). The packet starts with a fixed byte; the next four bytes include left sensor value, right sensor value, left motor speed and right motor speed; and the last three bytes is the count value that represent the time taken by fuzzy algorithm for its execution. The transmitted packet is decoded in MATLAB environment to analyze the speed profiles of the motors. The block diagram for the system is shown in Fig. 11 while flowchart for program is shown in Fig. 12.

Figure 11. Block digaram for FLC implementation

V. RESULTS AND DISCUSSIONS To test the validity of the designed controllers and to

compare their performance for wall tracking behavior, an experimental setup consisting of straight and slightly curved walls is built. A marker is fixed undercarriage the robot to

Main Microcontroller

Implementing FLC

Front Sensor

Back Sensor

PC

Microcontroller for

PWM Signal Generation

2 Channel Motor

Drivers

Left Motor

Right Motor

Page 7: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

trace the path while tracking the wall. Both the fuzzy controllers are tested and path traced by the robot for case of negative, positive and zero angles are recorded, as shown in Fig. 13. The continuous line in this figure is the path traced by the robot with fuzzy logic controller being sensitive to variation in both the sensors while dashed line shows the path traced by fuzzy logic controller that is made sensitive to variation in one sensor only. It can be observed from the paths that the settling time and percentage overshoot offered by the former fuzzy controller is less than the later. This result is also evident from the plots of speed profile of motors in time, as sown in Fig. 14, 15 and 16 for the case of negative, positive and zero angles respectvely. The comparison of the controllers is presented in Table 1.

TABLE I. COMPARISON OF CONTROLLERS

Controller Type Average Settling Time

Average Percent Overshoot

Fuzzy Logic Controller Sensitive to Variation in Both

Sensors 0.3 sec 5%

Fuzzy Logic Controller Sensitive to Variation in One

Sensor Only 2.0 sec 10%

Figure 12. Flow charts for main(left) and sub(right) microcontrollers

(a)

(b)

(c)

Figure 13. Ptath traced by the robot with two fuzzy controllers (a) robot is placed at small negative angle (b) robot is placed at large positive angle (c)

robot is placed at zero angle

Start

Read Sensor Values

Fuzzify the Sensor Values

Evaluate Fuzzy Rules

Defuzzify the Crisp Output

Find PWM Duty Cycle

Send LM PWM to Port 1

Send RM PWM to Port 2

Start

Timer 0 Interrupt?

Read Port 1 to Set LM PWM

Read Port 2 to Set RM PWM

Transmit Data Serially to PC

Page 8: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

(a)

(b)

Figure 14. Speed profile of left and right motors when the ange is small

negative (a) First FLC (b) Second FLC

(a)

(b)

Figure 15. Speed profile of left and right motors when the ange is large positive (a) First FLC (b) Second FLC

(a)

(b)

Figure 16. Speed profile of left and right motors when the ange is zero medium (a) First FLC (b) Second FLC

Page 9: [IEEE 2011 International Conference on Information and Communication Technologies (ICICT Pakistan) - Karachi, Pakistan (2011.07.23-2011.07.24)] 2011 International Conference on Information

VI. CONCLUSIONS In this paper, the design of two fuzzy logic controllers for

wall following behavior of mobile robot is presented. The controllers are tested in real time using an inexpensive microcontroller and compared for settling time and percentage overshoot. Experimental results have validated both the controllers for wall following behavior of mobile robot, however they offer different settling time and percentage overshoot owing to the difference in the criterion employed for their design. It is concluded that the design criterion in which both the sensors are made equally sensitive to variations is better due to reduction in settling time, peak time and percentage overshoot.

REFERENCES

[1] Martin B. Holder, Mohan M. Trivedi, and Suresh B. Marapane, “Mobile robot navigation by wall following using a rotating ultrasonic scanner,” Proc. ICPR, 1996, pp. 296-302.

[2] Reinhard Braunstingl, Jokin Mujika, and Juan Pedro Uribe, “A wall following robot with a fuzzy logic controller optimized by a genetic

algorithm,” Proc. International Joint Conference of Fuzzy Systems, vol. 5, 1995, pp. 77-82.

[3] Eddie Tunstel and Mo Jamshidi, “Embedded fuzzy logic based wall following behavior for mobile robot navigation,” First International Joint Conference of North American Fuzzy Information Processing Society, 1994, pp. 329-330.

[4] Med Slim Masmoudi, Insop Song, Fakeddine Karray, Mohamed Masmoudi, and Nabil Derbel, “FPGA implementation of fuzzy wall following control,” Proc. 16th International Conference on Microelectronics, 2004, pp. 133-139.

[5] Vasmi Mohan Peri and Dan Simon, “Fuzzy logic control for an autonomous robot,” Proc. Annual Meeting of North American Fuzzy Information Society, 2005, pp. 337-342.

[6] Jamil Abou Saleh, Fakhreddine Karray, Mohamed Slim Masmoudi, and Mohamed Masmoudi, “Soft computing techniques in intelligent wall following control for a car-like mobile robot,” International Conference on Signals, Circuits and Systems, 2009, pp. 1-6.

[7] Kim C. Ng and Mohan M. Trivedi, “A neuro-fuzzy controller for mobile robot navigation and multirobot convoying,” IEEE Transactions on Systems, Man and Cybernatics, vol. 28, no. 6, Dec 1998, pp. 829-840.

[8] Chia-Feng Juang and Chia-Hung Hsu, “Reinforcement ant optimized fuzzy controller for mobile robot wall following control,” IEEE Transactions on Industrial Electronics, vol. 56, no. 10, October 2009, pp. 3931-3940.