Smart Robot Wall-Following Control Using a Sonar Behavior-based Fuzzy Controller in Unknown Environments

Abstract This paper addresses a sonar behavior-based fuzzy controller (BFC) for mobile robot wall-following control. The wall-following task is usually used to explore an unknown environment. The proposed BFC consists of three sub-fuzzy controllers, including Straight-based Fuzzy Controller, Left-based Fuzzy Controller, and Right-based Fuzzy Controller. The proposed wall-following controller has three characteristics: the mobile robot keeps a distance from the wall, the mobile robot has a high moving velocity, and the mobile robot has a good robustness ability of disturbance. The proposed BFC will be used to control the real mobile robot. The Pioneer 3-DX mobile robot has sonar sensors in front and sides, and it is used in this study. The inputs of BFC are sonar sensors data and the outputs of BFC are robot’s left/right wheel speed. Experimental results show that the proposed BFC successfully performs the mobile robot wall-following task in a real unknown environment.


Introduction
The autonomous mobile robot is, ideally, to move or work without human operator in the real world, but the unknown, uncertain, and dynamic environments make this task difficult to accomplish. The wall-following task is usually used when the mobile robot is exploring an unknown environment. Related study has shown the reasons for autonomous mobile robots following walls or contours of an object [1]. These depend on the type of mobile robot and its applications. The perspective information is very important in unstructured environments. When facing unfamiliar or unstructured environment (especially outdoors), autonomous mobile robots rely on the perspective information to re-plan the walking paths.
Recently, several researchers [2][3][4] used various methods for implementing wall-following control. Chung et al. [2] proposed wall-following controllers based on Lyapunov function candidate for a two-wheeled mobile robot (MR) to follow an unknown wall. The mobile robot is considered in terms of kinematic model in Cartesian coordinate system. Two wall-following feedback controllers are designed: full state feedback controller and observer-based controller. Huang [3] proposed a wall-following control approach for a wheeled mobile robot equipped with a group of infrared sensors. The linear and angular positions of the robot with respect to the wall are derived by processing the readings of the sensors. A method to detect the discontinuity of the wall is also presented. The BFC succeeds in wall-following and is disturbance-free. Finally, the proposed BFC was implemented to control a real mobile robot. Experimental results also show that the proposed BFC successfully performs mobile robot wall-following task in a real unknown environment.

Robot Description
In this study, Pioneer3 DX [10] is adopted to perform wall-following control. The size of the mobile robot Pioneer3 DX is 45 × 38 × 25 cm and shown in Figure 1(a). The robot has a control motor, two drive wheels, and a caster wheel. And there are eight ultrasonic sensors to detect the front and sides. The arrangement of ultrasonic sensors is shown in Figure 1(b). The range of sensors is between 0.2 meter and 4.8 meter. These sensors take turns to measure distance once every 40 ms. The maximum forward/backward speed of the wheels is 120 cm/s. The Advanced Robotics Interface for Applications (ARIA) platform is used for programming. The ARIA platform includes many libraries and packages of C++ function. Wireless TCP/IP Ethernet in the platform connects the mobile robot and personal computer (PC).

The Proposed Sonar BFC
In this session, an efficient sonar BFC is proposed for wall-following control, and the diagram is shown in Figure 2. The proposed BFC consists of three sub-fuzzy controllers, called Straight-based Fuzzy Controller (SFC), Leftbased Fuzzy Controller (LFC), and Right-based Fuzzy Controller (RFC), respectively. Each sub-fuzzy controller represents a behavior of the mobile robot, and the switch is used to change the mobile robot's behavior. The SFC represents a behavior along the wall. When the mobile robot moves in a straight line, the SFC sub-controller will maintain the fixed distance between the robot and wall in controller is designed with Lyapunov method. Carelli and Freire [4] developed a control algorithm to guide a mobile robot along a corridor or to allow the robot to follow a wall. The proposed algorithm is based on distance measurements supplied by sonar sensors and it is designed to be asymptotically stable and to avoid saturation of robot actuators. The robot states are obtained by estimation with an extended information filter (EIF), with adaptive covariance based on empirical rules. In general, because external noise interference and sensitivity of sensing module exist, traditional control methods are difficult to control the stable behavior of robot. In order to solve the design problem of the controller, fuzzy logic control has been successfully applied on the robot control problem [5].
Fuzzy theory [6] is based on fuzzy set. The basic spirit accepts the existential fact of the fuzziness phenomenon. The goal is to handle the things concept of fuzzy and uncertain. Fuzzy theory expresses knowledge in the form of linguistic rules to possibly implement expert human knowledge and experience. Therefore, fuzzy theory has widely been applied in various fields, such as automatic train operation system [7], image recognition [8], and weather forecast [9].
In this study, an efficient sonar behavior-based fuzzy controller (BFC) is proposed to implement mobile robot wall-following control. The inputs and outputs of the proposed BFC are sonar sensors and left/right wheels' speed of the mobile robot. The BFC consists of three sub-fuzzy controllers, called straight behavior fuzzy controller (SFC), left behavior of fuzzy controller (LFC), and right behavior fuzzy controller (RFC), respectively. Each sub-fuzzy controller represents a different behavior. The BFC has the mode decision-making to switch behavior in different situations. Our experiments are divided into two parts. The first part is to test the detour ability of the mobile robot in three different environments, whereas the other part is to test the robustness ability of the mobile robot when it encounters disturbance. Simulation results show that the order to avoid collision or departure from the wall. The LFC and RFC represent the behaviors of left turn and right turn. When the mobile robot moves left or right, the LFC or RFC sub-controller will also keep the fixed distance between the robot and wall. The SFC and LFC sub-controllers are two inputs and two outputs, whereas the RFC sub-controller is single input and two outputs. Input and output of each sub-controller are the values of sonar sensors and the vector speed of wheels. For the proposed fuzzy controller, the distances S1, S2, S3, and S4 are measured by the referred sonar sensors 3, 2, 1, and 0, respectively. Because the arrangement of eight sonar sensors is symmetric, only four sonar sensors of right side on the robot need to be considered as inputs of the fuzzy controller, and vice versa for the other four sonar sensors of left side, referred to sonar sensors 4, 5, 6, and 7 on the robot. In general, a fuzzy controller consists of four parts: fuzzification, rule base, fuzzy inference engine, and defuzzification.

Fuzzification
Fuzzification is defined as the mapping from a crisp value to a fuzzy set. This step converts real value into degree of linguistic variable. Most fuzzy logic controllers usually use triangular membership functions and trapezoid membership functions. Both the triangular and trapezoid membership functions are shown in Figure 3. The membership function of a fuzzy set A is denoted as μ A , and μ A (x) represents the membership degree of input variable x mapping to fuzzy set A.

Fuzzy Inference Engine and Rule Base
In this step, the rule base (i.e. IF~Then~) is used to infer input linguistic variables to output membership functions. The rule base is composed of expert experience and engineering knowledge. A fuzzy rule is defined as follows.
(1)  value of S3 increases gradually, the mobile robot needs to be moved toward the wall. In this study, the fixed distance of the wall-following control is set as 30 cm. The three membership functions (i.e. Near, Normal, and Far) of S3 and S4 are defined in Figure 5. That is, when the mobile robot keeps a fixed distance between the mobile robot and the wall, the center of normal membership function in S4 and S3 is set as 30 and 40 cm, respectively.

Left-based Fuzzy Controller
The left turn behavior of LFC depends on the angle of corner formed by two walls. If the value of S1 is smaller than the value of S3, the angle of corner is less than 90°. On the contrary, if the value of S1 is larger than the value of S3, the angle of corner is more than 90°. When the angle is less than 90°, the mobile robot needs left turn early in order to avoid falling into a dead zone. Oppositely, when the angle of corner is more than 90°, the mobile robot maintains the fixed distance moving along the walls and needs left turn lately. Figure 6 shows the angle of corner based on the values of S1 and S3. The three different linguistic variables are used in LFC, such as Close, Normal, and Far. The membership functions of inputs S1 and S3 are shown in Figure 7. In order to avoid colliding with the front wall, the center of normal membership function in S1 and S3 is set as 35 cm.
where x 1 , x 2 ,…, x n represent the input variables and n denotes the number of inputs. In this study, the minimum operator is adopted to perform AND operator.

Defuzzification
The final output of a fuzzy controller converts fuzzy conclusion into a crisp value. In this study, we adopt Center of Area (COA) method to perform defuzzification. The COA method is defined as follows: where y represents the output of a controller, μ A (y i ) is membership function of fuzzy set A calculated for the input variables, and y i is the output value of consequent part of ith fuzzy rule.

Straight-based Fuzzy Controller
When the mobile robot is in the wall-following process, the important thing is to maintain the fixed distance between the mobile robot and the wall. The behavior of the proposed SFC depends on the measurement values of sensors 1 and 0 (i.e. S3 and S4). And this behavior of the mobile robot is shown in Figure 4. When the value of S3 decreases gradually, this means that the mobile robot moves toward the side of the wall. In this case, the mobile robot needs to be moved far from the wall. On the contrary, when the Robot S3 S1 Robot S3 S1 Robot S3 t Figure 6. the angle of corner based on the values of S1 and S3.

Mobile Robot Control without Disturbance
Figure 10(a) shows the path of the mobile robot wall-following control in environment 1 successfully. In this figure, we can find that the BFC switches to LFC mode when the mobile robot locates in positions A, B, and C. In addition, the BFC switches to RFC mode when the mobile robot locates in position D. The trajectory of a mobile robot wall-following control in environment 2 is shown in Figure 10(b). In environment 2, a mobile robot finds it difficult to implement the wall-following control at the positions of A, B, C, and D. The simulation results show that the mobile robot using the proposed controller still successfully avoids obstacles and performs the wall-following control. When the sonar sensor 0 cannot detect the wall momently, the mobile robot needs to turn right over 90°. Environment 3 (i.e. Figure 10(c)) is more difficult to control than environments 1 and 2.

Mobile Robot Control with Disturbance
Sometimes, the mobile robot suffers disturbance in the wall-following control; the disturbance rejection capability of the proposed controller is important. The adopted environments in this example are the same with example 1. In this experiment, the disturbance is added into the controller output of the mobile robot. In order to observe the behavior of the mobile robot, the 'disturbance' label is

Right-based Fuzzy Controller
The right turn behavior of RFC depends on the distance (S4) between the mobile robot and the wall. If the value of the distance (S4) is far, the mobile robot needs left turn early to avoid being far from the wall in right turn process. Oppositely, if the value of the distance (S4) is near, the mobile robot keeps a fixed distance from the wall after right turn. This phenomenon is shown in Figure 8. The two membership functions (i.e. Near and Far) in RFC are shown in Figure 9.

Results
The simulation experiment is divided into two parts. First, in example 1, we analyze the movement path of the mobile robot when various obstacles encounter in three different environments. Second, in order to evaluate the robustness of the BFC, we add a disturbance into the output of the mobile robot in example 2. In this study, the time step of the mobile robot is set to 500 ms.  environments. In [11], nine fuzzy rules are used for mobile robot wall-following control. In Figure 12(a) and (c), the mobile robot performs wall-following control successfully in environments 1 and 3, but the mobile robot cannot keep a stable fixed distance from the wall. And Figure  12(b) shows that the mobile robot collides with the wall in environment 2.
In order to evaluate the performance of the proposed controller, a root mean square error (RMSE) is adopted in this study. The RMSE is defined as follows: T Total marked between two time steps. In this example, the noise with zero mean and a standard deviation (STD) of 0.4 m is regarded as output of the mobile robot. Figure 11 shows the moving trajectory of a mobile robot. In these figures, the proposed controller quickly makes the mobile robot to keep a fixed distance from the wall when the mobile robot encounters a disturbance. Simulation results show that the proposed controller has the disturbance rejection capabilities when the mobile robot encounters a disturbance.

Discussion
The performance of the proposed sonar BFC is compared with Farooq's method [11]. Figure 12 shows the trajectory of a mobile robot using Farooq's method in various   Experimental results show that only five, five, and two fuzzy rules in SFC, LFC, and RFC sub-fuzzy controllers are successfully used to perform the wall-following control in two unknown environments. In addition, the disturbance rejection capability of the proposed controller is also presented in our experiments. The proposed controller quickly makes the mobile robot maintain a fixed distance from the wall when the mobile robot encounters a disturbance.

Disclosure Statement
No potential conflict of interest was reported by the authors.

Conclusions
In this study, an efficient sonar BFC is addressed for the wall-following control of mobile robots. The wallfollowing task is usually used when the mobile robot is exploring an unknown environment. The proposed BFC is composed of three sub-fuzzy controllers (i.e. SFC, LFC, and RFC). The inputs and outputs of the proposed BFC are sonar sensors and vector speeds of left/right wheels.