The Effectiveness of LEGO Mindstorms NXT in Following Complicated Path Using Improved Fuzzy-PID Controller
The Effectiveness of LEGO Mindstorms NXT in Following Complicated Path Using Improved Fuzzy-PID Controller
Abstract Line follower robots are monotype mobile robot recovery process which takes longer. So will cause the
having the ability to follow a line very accurately. Though many movement of robots are increasingly chaotic and unstable. On
researchers are studying regarding line follower robot but most other hand, Hagras [3] found that to design a robust controller
of the concepts are concentrated on theoretical design. The which can provide copacetic performance in the face of
performance of the conventional type of controller in controlling
line follower robot is still being a popular topic to be discussed.
skeptical and imprecision, fuzzy logic controller is credited
The traditional controller cannot deal with uncertainty data such with being an adequate methodology.
as the amount of light whether it is too high or too low light that
received by the light sensor which leads to the inaccurate II. BACKGROUND STUDIES
movement of the line follower robot. This research presents an
application of improving fuzzy-PID controller method in A. Comparison of Improved Fuzzy-PID and Non-Improved
controlling LEGO Mindstorms NXT while following the Fuzzy-PID
complicated path with more accurate and high velocity. LEGO
Mindstorms NXT with single light sensor is used as a line In the before technology, they were many methods used to
follower robot to tracking the complicated black line drawn on design and implement, and also different algorithms were used
the white surface. The investigation of existing method for line for line follower robot. The most common and popular line
following application will help in identifying the best controller tracing methods are simple Boolean logic, PID controller, and
method of inspecting the pattern of line follower robot fuzzy logic controller. Each line following controller
movement. At the end of the research, the movement of LEGO technique has its own advantages and disadvantages. In this
Mindstorms NXT robot is more accurate with high complexity of section, the proposed fuzzy-PID controller that is improved
line by using improved fuzzy-PID controller. The improved
fuzzy-PID is compared with non-improved fuzzy-PID. In
fuzzy-PID controller also increases the velocity of the robot when
tracking the complicated path. previous studies [2, 4, 5], the authors does not proven the
fuzzy-PID controller that their introduced will improve the
Keywords Improved Fuzzy-PID, Complicated Path, LEGO performance of the robot from aspect accuracy and velocity
Mindstorms NXT, Accurate, Velocity. while following the complicated line following. Table I show
the differences between the proposed fuzzy-PID which is
called as an improved fuzzy-PID controller and the non-
I. INTRODUCTION improved fuzzy-PID controller.
Line following is one of the most practical application as it
allow the robot to moving from one point to another to Table I. Differences of Proposed or Improved Fuzzy-PID Controller and Non-
perform tasks as previous study [1]. The situations become Improved Fuzzy-PID Controller
worst when robots need to follow the complicated and small Type of Differences
thickness of line such as thin sharp curve line. The existing Fuzzy-PID
methods to control line following robot is still being issue on Non-Improved Fuzzy logic serves to help determine
how to improve the performance of line follower robot. The Fuzzy-PID the value parameter error and the
traditional algorithm for line follower robot movement is, it previous error value changes (Derror)
will turn left when there is no line detected by the sensor and it [2].
will turn right when the line is detected by the sensor. This
algorithm is very slow and not accurate, wasting valuable time Non-Improved PID controller serves for steering
and battery power. Line follower robot algorithm using Fuzzy-PID purpose and fuzzy controller serves
conventional PID is much better than the earlier algorithm but for efficient velocity of robot [4].
the robot still will be unsteady about the line. Mas Pratama et
al. [2] stated that the disadvantages of PID control system is, if Improved PID controller serves to calculate the
given light sensor value are increasingly sensitive the response Fuzzy-PID error which then will be used to
will overshoot and undershoot. However, if the light sensor evaluate the fuzzy rule.
value is made less sensitive to the response, there will be a
III. IMPLEMENTATION OF IMPROVED FUZZY- PID controller for next steps. The result of error will use for a
PID fuzzy controller rule evaluation. The result of motor power for
each control will be summed together which is used to control
In accordance with the research title, the performance of
the movement of the LEGO Mindstorms NXT robot.
line follower control system will be discussed in this research
based hybrid between PID controller methods with fuzzy logic
controller method. There will be two control methods that A. Fuzzy Logic Controller
work together in the system. As on the basis of the theory of In this section, the implementation of the fuzzy logic
control systems, there is something which is the goal, the controller which is including the fuzzification process, rule
system needs to be controlled. The purpose of the form of the base evaluation and defuzzification process is elaborated. The
set point on line follower robot is a situation where the intensity of the reflected light is sensed to provide the function
movement of the robot needs to remain accurate and faster. for tracing a path following. For simplified the system, one
light sensor is utilized. In this research, MATLAB Fuzzy
The block diagram of the proposed or improved fuzzy-PID Logic Toolbox is used to avail in fuzzy logic controller design.
controller is shown in Fig 1. Fig 1 show the block diagram of The input and output membership functions are defined and
the proposed fuzzy-PID controller. The first part of a program are related with sets of rules. The outputs of fuzzy controllers
is a fuzzy logic controller while the second part of a program control the power of two motors of the LEGO Mindstorms
is a PID controller. After reading the light sensor value, NXT robot. Fig 2 show the fuzzy logic inference system
ARM7 microcontroller executes the fuzzy logic controller and where there will be one input and to output in this research
PID controller steps in sequence. After evaluation of sensor which the input is light intensity, and the output is left motor
value in the fuzzy controller, this information will be sent to power and right motor power.
(1)
(2)
Fig 4. Right Motor Membership Function
2) Rule Base
There are only two rules for determining desired power to
follow the pre-defined path whether the right or left motor is
Fig 3. Input Intensity of Light Reflected Membership Function fast or slow depends on the value of light readings. In this
research, the value of light reading is between our minimum
The membership function for the aimed output of the right and maximum light readings which are in the range between 0
motor and left motor is shown in Fig 4 and Fig 5. The to 100. The value of light is an error (e) that have been
membership function is a triangular type which right motor calculated in PID controller part where error value is
(RM) and left motor (LM) speeds are described by two fuzzy calculated using the variable from the intensity light value.
sets that are Slow and Fast. The definition of these sets is The light error is considered black if the range of the value is
shown in Table III. between zero to 30. While the light error is considered white if
the range of the value is between 40 to 100. The value of the
Table III. Fuzzy Sets Defined for Output error will be used when the correction is set to the robot
Fuzzy Set Description motors. The description of the fuzzy rules is as Table IV.
Slow Speed of left or right motor is low
Fast Speed of left or right motor is high Table IV. Fuzzy Rules of Desired Power
/ Right Motor Left Motor
The membership functions for Right Motor and Left Black Slow Fast
Motor, as shown in Fig 4 and Fig 5, are described by the White Fast Slow
expressions:
(3) Because we can absorb and simplify rules into two
rules, a curve line appears on the surface viewer with the
(4) graph of desired power and the light reflected intensity which
is shown in Fig 6 and Fig 7.
(5)
= (7)
e: error = PV SP (8)
Fig 6. Graph of Light versus Right Motor
Where SP is Setpoint, PV is the Process Variable. If converted
into the syntax of the program will be becomes:
Setpoint = 45
= 1.5
error = 69.3 45 = 24.3
P= error
P = 1.5 24.3 = 36.45
2) Integral
3) Derivatives
The basic formula of the controller derivatives are:
= (10)
D1 = error last_error
D1 = 69.5 69.3
D = D1
D = 0.2 15 = 3
PD = P + D
PD = 36.45 + 3 = 39.45
So if all three controllers are combined, then the syntax of the
program will be:
Setpoint = 45
error = PV SP
P= error
P = 1.5 24.3 = 36.45
I1 = error
I = I1
Fig 9. LEGO Mindstorms NXT
I = 24.3 0.001 = 2.403
D1 = error last_error
D1 = 69.5 69.3 B. Pre-Defined Path Following
D = D1 To validate the proposed control algorithm, a pre-defined
D = 0.2 15 = 3 path is constructed as represented in Fig 10. The pre-defined
last_error = error path track was constructed by pasting a 3.5 cm black tape on a
PD = P + D white chart. The length of the track is set at 914.4 cm which
PD = 36.45 + 3 = 39.45 consisting a curve line, sharp curve line, zigzag curve line and
PID = PD + I straight line make the track is complicated to follow. The path
PID = 39.45 + 2.403 = 41.583 following is developed with nine critical point lines that were
The proportional, integral and derivative outputs are used the circle with red as shown in Fig 10. There is two type of
to calculate the value of turning point which if converted into pre-defined path following that is large thickness of pre-
syntax of the program will be: defined path following and small thickness of pre-defined path
Right Motor = Turning point PID following track. Critical point line here means the line that
Right Motor = 15 41.583 = 26.583 hard to be followed by the LEGO Mindstorms NXT robot and
Left Motor = Turning Point + PID also described as a type of line that has a curve on it.
Left Motor = 15 + 41.583 = 56.583
researcher while the improved fuzzy-PID controller is the Table VI. Summarization of Experimental Result Validation
proposed fuzzy-PID controller method that will improve the for Small Thickness of Pre-Defined Path
accuracy and velocity of the robot movement. Small Thickness (1.75 cm
Table V shows the summary of the evaluation and width of black tape)
Method
validation result from the experimental approach for the large Accuracy Time Velocity
thickness of pre-defined path. The column of accuracy and
(%) (s) (cm/s)
velocity validate the implementation of the improved fuzzy-
PID controller is successful in which for all controller methods Boolean Logic 13
evaluated, improved fuzzy-PID controller method achieve the
best result compared to other methods. The result validates PID Controller 23
that velocity of the LEGO Mindstorm NXT robot is faster
when follow the large thickness of pre-defined path. Fuzzy Logic 30
Controller
Table V. Summarization of Experimental Result Validation Non-Improved 80 35 26.13
for Large Thickness of Pre-Defined Path Fuzzy-PID
Large Thickness (3.5 cm Controller
width of black tape)
Method Improved Fuzzy- 93 25 36.58
PID Controller
Accuracy Time Velocity
(%) (s) (cm/s)
From the experimental results, only fuzzy-PID controller
Boolean Logic 20 60 15.24 method can follow all the type of line whether in large
thickness line or small thickness line. By using Boolean logic
PID Controller 47 59 15.50 method, the robot movement is very inaccurate and slow. It is
very traditional method for line follower robot and suitable for
beginner to learn about line follower robot. PID controller and
Fuzzy Logic 57 44 20.78 fuzzy logic controller method make the pattern of robot
Controller movement also inaccurate but better than Boolean logic
method from aspects of accuracy and velocity. However, by
using improved fuzzy-PID controller method, the pattern of
Non-Improved 70 37 24.71 robot movement is more accurate and faster. The significant
Fuzzy-PID improvement of the fuzzy-PID will increase the performance
of the pattern of robot movement in line following application
Controller which is being use in wide area such as transportation,
planetary exploration, surveillance, security and military
targets tracking. In this research, the advantages or the
Improved Fuzzy- 77 33 27.70 effectiveness of improved fuzzy-PID controller method has
been identified, which is the improved fuzzy-PID controller
PID Controller cover a more extensive scope of working conditions, and they
are all the more effectively adjustable in normal dialect terms.
In addition, a self-sorting out fuzzy controller can
consequently channel an underlying surmised set of fuzzy rule
Table VI shows the summary of the evaluation and and uses of improved fuzzy-PID controller enhance the quality
validation result from the experimental approach for small variable.
thickness of pre-defined path. The column of accuracy and
velocity validate the implementation of the improved Fuzzy- VI. CONCLUSION
PID controller is successful in which for all controller methods Usually, line follower robot might be able to follow the
evaluated, improved fuzzy-PID controller method achieve the narrow and simple curve line, but with sharp curve line and
best result of velocity. As shown in Table VI, only non- zigzag line, the pattern of LEGO Mindstorms NXT robot
improved fuzzy-PID controller and improved fuzzy-PID movement will be not accurate and slow. The high complexity
controller method successful finish follow the pre-defined path of line that is sharp curve line and zigzag line indeed give
where the time taken to finish tracking the small thickness of influence in robot movement. Only fuzzy-PID controller
pre-defined path for each method is 35 second and 25 second. method can tracking all type of the line whether in large or
Although non-improved fuzzy-PID controller successful finish small thicknesses of the line. At the end of the experiment,
tracking the small thickness of pre-defined path, however, zigzag line and sharp curve line is identify as the type of line
improved fuzzy-PID controller method achieve the best result that will make robot movement is not accurate, chaotic and
compared to other methods. The result also validates that slow. Although the only single light sensor is installed in
velocity of the LEGO Mindstorm NXT robot is faster when LEGO Mindstorms NXT, however, when the robot is
following the small thickness of pre-defined path compared controlled by the improved fuzzy-PID controller method, the
the large thickness of pre-defined path.
REFERENCES
[1] Pakdaman, M.Sanaatiyan, M.M., Design and
Implementation of Line Follower Robot, Second
International Conference on Computer and Electrical
Engineering TCCEE, pp. 585 - 590, 2009.
[2] I Putu Adinata Mas Pratama, I Nengah Suweden, I.B.
Alit Swamardika, Sistem Kontrol Pergerakan Pada
Robot Line Follower Berbasis Hybrid PID-Fuzzy
Logic, Proceeding Conference on Smart-Green
Technology in Electrical and Information Systems, pp.
159 - 164, 2013.
[3] Hami Hagras, Type-2 FLCs: A New Generation of
Fuzzy Controllers, IEEE Computational Intelligence
Magazine, vol. 2, no 1, pp. 30 - 43, 2007.
[4] Pham Xuan Thuy, NguyenTang Cuong, Vision Based
Autonomous Path/Line Following of a Mobile Robot
Using a Hybrid Fuzzy PID Controller, Proceeding
Publishing House of Science and Technology, 2016.
[5] Nurul Nadirah Mohd Khairi and S. Sakinah, S. Ahmad,
A Comparison of Type-1 and Type-2 Fuzzy Logic
Controllers in Robotics: a Review, International Journal
on Numerical and Analytical Methods in Engineering
(IRENA), vol. 2, no. 5, 2014.
[6] S. Sakinah, S. Ahmad, and W. Pedrycz, Fuzzy Rule-
Based System Through Granular Computing, IEEE
International Conference on Systems, Man, and
Cybernetics, pp. 800 - 805, 2013.
[7] Sabrina Ahmad, Intan Ermahani A Jalil, S. Sakinah S.
Ahmad, An Enhancement of Software Requirements
Negotiation with Rule-based Reasoning: A Conceptual
Model, Journal of Telecommunication, Electronic and
Computer Engineering (JTEC), vol. 8, no. 10, pp. 193 -
198, 2016.
[8] S. Sakinah, S. Ahmad, Fuzzy Modeling through
Granular Computing, PhD thesis, University of Alberta,
2012.