Fuzzy Logic Controller Design for Intelligent Robots

This paper presents a fuzzy logic controller by which a robot can imitate biological behaviors such as avoiding obstacles or following walls. The proposed structure is implemented by integrating multiple ultrasonic sensors into a robot to collect data from a realworld environment. The decisions that govern the robot’s behavior and autopilot navigation are driven by a field programmable gate array(FPGA-) based fuzzy logic controller.The validity of the proposed controller was demonstrated by simulating three realworld scenarios to test the bionic behavior of a custom-built robot.The results revealed satisfactorily intelligent performance of the proposed fuzzy logic controller. The controller enabled the robot to demonstrate intelligent behaviors in complex environments. Furthermore, the robot’s bionic functions satisfied its design objectives.


Introduction
Robot research is a popular scientific research [1][2][3][4] and is undoubtedly to enhance the quality of human life, but in the environment, the wheel structure is not suitable for use in the rugged terrain environment; in [5][6][7], it is very easy to study insects, whether they are moving on flat roads or walking on irregular roads.
With the increasingly widespread application of robots in today's fast-changing and diverse environment, it is essential for robots to possess autonomous movement capacity and intelligent decision-making processes, as well as behavioral control through sensory awareness of the surrounding environment to complete tasks in complex situations.In this regard, navigation and obstacle avoidance are the two crucial concerns that require attention.
Fuzzy logic [8][9][10][11] has been deemed appropriate for applications in automatic navigation of robots.This is mainly because of its capacity to process large quantities of incomplete and inaccurate input signals.Such signal processing can enable automatic navigation for robots in uncertain environments.Abundant research has been reported on the application of fuzzy theory in automatic navigation for robots.A typical application requires the robot to carry various sensors for sensing environmental information.The outputs of the sensors serve as inputs to the fuzzy controller.Expert experience is adopted to prebuild a fuzzy rule database, which is required for the robot's subsequent behaviors.Fuzzification, fuzzy inference, and defuzzification generate decisions that control the robot's behaviors [12,13], enabling the robot to navigate automatically.
A fuzzy logic controller can accept input from a diverse range of sensors.Ultrasonic sensors can detect the distance between a robot and obstacles [14][15][16].Global positioning systems can detect the robot's current position [17][18][19].With fuzzy inference, the final output enables a robot to differentiate between various environments and to perform the behaviors desired by the designer.For example, differences in wheel speeds can enable a wheeled robot to turn at an angle and roll in a new direction to avoid an obstacle.Regarding multilegged robots, the final input may be the rotational angle or forward velocity [17,20,21].
At present, the development of the living tools and the adaptability of the environment are far less than the evolution of the ability of organisms, regardless of how long these organisms are experiencing long-term evolution, and 2 Mathematical Problems in Engineering whether there is a high degree of adaptability to the habitat of living space, whether it is in sensory organs, exercise patterns, learning mechanisms, organ structures, monomers, or all life structures, which is more efficient, so the use of physical characteristics will be an important future development indicator.This study focuses on the behavior of the recurrence of biological patterns for the software direction, the use of its evolution and behavior patterns, and the software processing efficiency.

Behavior of Intelligent Robots
2.1.Behavior of Bionic Robots.The term "bionic robots" refers to robots that mimic the body structures, functions, problemsolving behavior, and motions of living creatures, with simple mechanical structures or electronic devices.Multilegged bionic robots belong to this category; their motion patterns and tread movements resemble those of insects and spiders.Such a robot uses each leg, with its embedded multiple rotational joints, to mimic the behavioral patterns of insects.Among such robots, the six-legged type is the most common type of bionic robot.

Applying Fuzzy Controller in Obstacle
Avoiding.The central nervous system contains the brain and spinal cord; the brain is responsible for the movement of the discriminant action and the spinal cord is responsible for the aggregation of sensory signals and finishing the brain cortex movement area issued by the action instructions and links the various parts of the neural network; it also contains the reflection of this part of the movement.
Robots in unknown environments need sensors to detect environmental conditions; after their sensors have measured environmental information, the robots' controllers can generate decisions to control the robots' behaviors.In this study, multiple ultrasonic sensors were adopted to measure distances between a robot and the environmental obstacles that surrounded it.
In this study, the neural pulse signal of the organism is used as the control structure of the imitation of the electronic circuit, and the information between the main control system and the subcontrol system is integrated.The main control system must transmit the analog signal.The auxiliary control system only needs to transmit the sensed analog signal to the main system and receives the motion instruction given by the main system, and the auxiliary functions of the main system and subsystems are complementary to each other.
Multiple sets of ultrasonic distance measurements were used as input to develop an intelligent navigation system.With this distance information, the fuzzy logic controller enabled the robot to safely complete tasks in an unknown environment.An individual ultrasonic sensor is shown in Figure 1(a).A photograph of the six-legged robot with an operative sensor array is shown in Figure 1(b).The positions of the distance sensing ultrasonic sensors are shown in Figure 1(c): right (S1), front (S2), left (S3), right front (S4), and left front (S5).
The control system of this study combines the main controller, subcontroller, organization, and computer software.
Six-foot robot body uses 18 servo motors, six MCU subcontrollers, UART message transmission, and the main controller of the news, and the design of wireless monitoring equipment, the use of RF module for two-way data transmission, and timely feedback related information and PC are used to analyze the action.You can adjust the six-foot robot in manual mode or automatic mode, which can be used flexibly.
The master/slave controller system can communicate with each other through the Bluetooth system and the monitoring system, and the monitoring system can manually operate the six-legged robot manually.
Figure 2 shows foot movement angle relative relationship [7]; M2 will be disturbed by the M2-M3 mechanism and the M2 motor mechanism; it must be specified within ±40 ∘ , to face the adjacent body operation collision damage.
M3 mechanism set contact with the ground for the vertical ground 90 ∘ , so the M2 and M3 must be the opposite of the servo motor angle; related mechanical joints are as follows: M2 − M3 = 57 mm.Using the above formula, the design of Figure 3 shows the movement angle and displacement of the map were from 0 ∘ , 10 ∘ , 20 ∘ , 30 ∘ , 40 ∘ , −10 ∘ , −20 ∘ , −30 ∘ , and −40 ∘ , for foot control design.
And then the corresponding H2 and H4 movement angle and displacement volume are as shown in Table 1.
Each foot institution is limited to positive and negative 60 degrees as a range of services, such as the six-foot body map shown in Figure 4, to avoid the impact of mutual action agencies and to prevent damage to the organization.

Design of Obstacle Avoidance.
Figure 5 shows obstacle avoidance is a priority for a moving robot that must avoid obstacles and prevent collisions.We propose an efficient realtime avoidance system by which robots can avoid obstacles while moving as directed by automatic navigation.The distance information collected from sensors 1, 2, and 3 is used for the ultrasonic sensing system.Using the information about the robot's surroundings collected from these sensors as input, the proposed fuzzy logic controller generates instructions by which the robot can avoid obstacles.
Table 3 shows the complete obstacle avoidance procedure, in which the robot receives the ultrasonically sensed distances, from front, right, and left sensors, defined as   ,   ,   , respectively.These three distance variables are fed as input into the obstacle avoidance fuzzy controller.The motor control board calculates the velocity of the robot (  ) and directional angles to be modified (  ).On receiving   the output from the fuzzy logic controller, the robot can change its current velocity and navigational directions to avoid any obstacle.Each input to the fuzzy controller is assigned the same membership function (MF), as illustrated in Figure 6(a).The output is shown in Figures 6(b) and 6(c).
All the MFs are triangular.The linguistic terms of the input and output are shown in Tables 2 and 3.
For the real-world robot, the widely known max-min operation was used in the fuzzy inference, and the centerof-gravity method was adopted in fuzzification.Regarding the fuzzy rule database, the researchers' experience and knowledge of partially successful attempts were utilized to build relevant rules, as shown in Table 4.

Wall Following.
The robot can follow walls, thus enabling it to walk along the boundaries of the testing environment.The operational definition is "motion in a direction parallel to the nearest wall at a consistent distance from that wall."The procedure for wall following is illustrated in Figure 7.
The right and left ultrasonic sensors (S1 and S2 in Figure 1) are used to detect the side distances of the robot, defined as   and   , respectively.The sensing system first judges which side is closer to the robot and chooses the distance to the nearest side as the baseline, enabling the robot to move along the nearest wall.The robot evaluates its current location against that in the previous cycle (farther from or nearer to the side wall).If the distance in the current cycle is longer than that in the previous cycle, it signifies that the robot has moved farther away from the wall.Therefore, the robot must turn toward the wall.Conversely, a shorter distance in this cycle than that in the previous cycle means that the robot has moved closer to the wall.In such a case, the robot must turn away from the wall.The difference between the wall distances in the two cycles (  ) is then taken as one of the inputs to the fuzzy logic controller.The other input is the velocity of the robot (  ).A relatively fast velocity means that the robot has gained considerable speed by moving away from or closer to the wall, thus requiring more angular modifications, and vice versa.Figure 8 illustrates the wall following behavior.In Case A, the robot first detects a shorter distance from the left wall and moves along it.Because the robot's motion is parallel to the wall, the robot-wall distance differences in the two cycles should be zero, thus requiring no angular modification.In Case B, the robot begins to deviate from the left wall; thus, the robot-wall distance difference between the two cycles should increase.Using the distance difference and the current velocity as inputs to the fuzzy logic controller, a turning angle   toward the wall can be obtained, enabling the robot to turn toward the wall and return to correct the wall following behavior.
The MFs of the wall following input are illustrated in Figures 9(a 5.The widely known max-min operation is used in fuzzy inference and the center-of-gravity method is adopted for fuzzification.The wall following fuzzy controller rules are shown in Table 6.

Experiments and Results
In this study, we designed a total of 18 servo motors of six feet as the induction unit of the neural current, combined with the fuzzy ultrasonic controller, six angles of the design, through  the three-foot system for the neural current sensing control.The judgment of the stability and the identification of the obstacle in front of the ultrasonic wave are described below.
The following describes the control system.The walking state of the six-legged robot is the ratio of the height to the time of the six-legged robot shown in Figure 10, and the center of the body is highly displaced.Figure 11 shows the six-legged robotic gait diagram showing the footsteps of the left and right sides of the sixlegged robot, and the footsteps of the six-foot robots are located on the ground.

The Experiment.
After the robot's bionic behavior controlling chip was designed and implemented, the chip was installed in a real robot for function verification and performance analysis.The hardware comprised a field programmable gate array board, motor control board, and a sixlegged robot, as shown in Figure 1(b).

Experiment of the Robot's Bionic Controlling Behavior
Scenario 1: Obstacle Avoidance.The purpose of this experiment was to examine whether the proposed navigation system could successfully lead the robot to avoid obstacles.The path was 1 m wide, and the width of the obstacle (a rectangular solid) was 20 cm.As shown in Figure 12, the robot first moved upward following instructions from the developed fuzzy database.While moving, the robot detected objects on both its sides at Point A but continued to move forward because the distance ahead was still considerable.The robot detected an object close ahead and a wall blocking its right side when it reached Point B. Immediately, the fuzzy logic controller responded with a left turn.At Point C, obstacles were present at the front and on the left side.
The obstacle on the right side was farther away; therefore,  the fuzzy logic controller responded with a right turn.With no further obstacles lying ahead, the robot continued moving forward.The real experiment is illustrated in Figure 13.
Scenario 2: Dead End with Three Surrounding Walls.The purpose of this experiment was to examine whether the robot could make its way out of a dead end.The dead end was 50 cm wide, as shown in Figure 14.The robot moved forward, following instructions from the developed fuzzy database.
As it moved, it detected objects on both sides at Point A. However, it continued moving forward because there was a considerable expanse of empty space before it.At Point B, the robot then detected an object that obstructed its forward path and a wall blocking its right side.Immediately, the fuzzy logic controller responded with a left turn.At Point C, the obstacles appeared at the front and on the left side.The obstacle to the left side was more distant; thus the fuzzy controller ordered a left turn.At Point D, the robot turned left because no obstacles were found on the left.After the robot had turned, it found no further obstacles lying ahead and continued to move forward.The real experiment is shown in Figure 15.
Scenario 3: Wall Following and Obstacle Avoidance.This experiment tested whether the proposed navigation system correctly integrated wall following, obstacle avoidance, and target tracing.As shown in Figure 16, the wall was 60 cm long, and the obstacle (a rectangular solid) was 20 cm wide.At Point A, the robot calculated that its conditions called for a wall following behavior.At Point B, the robot deviated gradually from the wall, and the fuzzy controller modified the robot's direction away from the wall.At Point C, the robot detected obstacles at its front and on its left side.In the  proposed integrated system, obstacle avoidance has higher priority than wall following does; the fuzzy controller ordered a right turn, and the robot turned right and performed obstacle avoidance.The real experiment is shown in Figure 17.

Discussion.
In the current study, a real robot was tested; the accuracy levels of its intelligent behavioral functions were verified.Thus, three scenarios were designed to examine the robot's bionic behaviors.The results reveal that the proposed fuzzy logic controller enabled the robot to perform in complex environments and to demonstrate intelligent behaviors.The robot was designed for bionic functions; its performance demonstrated those bionic functions.

Conclusions
The current study, with fuzzy control as its core, proposes control methods for intelligent behaviors such as obstacle avoidance, wall following, and attack.The system integrates three control methods within an inclusive structure that can be used for further development of bionic behavior controllers for intelligent robots.In this study, the controller platform is established to determine whether the surrounding environment is suitable for walking through the most basic bio-current signal and discrete event control through the most primitive and consistent simulation of the organism.In the robot's reflex movement which is directly used for environmental interaction, this method can let the six-legged robot know the front path of obstacles and quickly take action to avoid unnecessary collision; the future can use GPS, gyroscope, pressure sensors, temperature and humidity sensors, and infrared sensors, increasing fusion sensing in the system, so that, overall, it is more perfect.
In the system of signal transmission, we use the simplest 8-bit transmission to significantly reduce the chip computing, reduce system load, as far as possible in a short time to resolve and control the system, so that the signal from the main system to the subcontroller can be immediately transferred.This method allows the system time to deal with not only other major messages to judge, but also the least information for the most effective signal processing, and to be closer to the simulation of biological movement structure.
In the study of the structure of the robot, the behavior can be smoother, real-time to achieve effective steering behavior, dodge behavior; these have a high degree of evolution, functional verification, and system analysis; we have established three situations, dodge obstacles, to avoid the dead end and walking in a wall of space; the results show that the proposed fuzzy logic controller is able to successfully guide the robot behavior with the autonomous model.
) and 9(b).The MF of the output is shown in Figure 9(c).All the MFs are obtained as triangles.The linguistic terms of the input and the output are shown in Table

Table 1 :
Foot movement data.

Table 2 :
Linguistic terms of the input.

Table 3 :
Linguistic terms of the output.

Table 5 :
Linguistic terms of the input and output.

Table 6 :
Wall following fuzzy controller rules.