Abstract
This work presents a comparative analysis of Type-1 and Type-2 fuzzy controllers to drive an omnidirectional mobile robot in line-following tasks using line detection images. Image processing uses a Prewitt filter for edge detection and determines the error from the line location. The control systems are tested using four different paths from the Robotino® SIM simulator. Also, two different strategies in the design and implementation of the controllers are presented. In the first one, a PD controller scheme is extended by using a fuzzy system to have adaptive parameters P and D, additionally, Type-2 Fuzzy sets are used to give robustness to the controller. In the second case, a Fuzzy controller is designed to compute in a direct way the control variables and it is extended to Type-2 Fuzzy controller. Finally, experimental results and comparative analysis are presented for the five control schemes by comparing the running time and the standard deviation to measure the robustness of the control systems.
Introduction
Line following for an autonomous mobile robot is an alternative way to perform automatic motion of a robot by using a line as a predefined guide to drive a robot for going from an initial position to a final position [27]. This problem has many applications in industry, agricultural, and medical applications among others [14, 26]. Also, it is used for the study of different control schemes applied in robotic systems, using a diversity of options to interact with the environment [1, 28].
Currently, controllers that use traditional PID schemes can be found in many research works [15, 33]. However, the main problem with these simple implementations is that the effective automatic tuning of the PID parameters is based on linear systems. So, for no linear problems, such as line following robot applications, the tuning of PID schemes are performed by trial and error procedure. Additional to this, the functionality of each PID terms is not very clear for an analysis.
On the other hand, new hybrid approaches based on extended PID schemes have been developed for the design, implementation, and automatic tuning of controllers for complex systems with highly nonlinear and time-varying characteristics [13, 30].
One extension of the PID scheme is to add an adaptive capability to the PID parameters, allowing them to have different values according to error magnitude. When this is performed by a fuzzy system, the controller is called a fuzzy PID controller, and several control implementations are studied and shown their advantages [8, 10]. Other control methodologies based on fuzzy systems, called fuzzy controllers have been implemented in several applications [7, 32].
Type-2 fuzzy systems have as a main characteristic that, they are more adequate to handle uncertainties embedded in their inputs (data) and/or in model design [24, 25]. In [4] a type-2 fuzzy control shows to have better performance in the control of non-smooth systems.
Another important area of research has been the development of metaheuristic to optimize fuzzy controllers using type-1 or type-2 fuzzy sets in situations with noise, perturbation, and uncertainty [3, 12]. Applications of some of these methodologies in robotics can be found in [19, 21].
The motivation of this work is to quantify and compare different control schemes implemented to an omnidirectional robot in the line-following task. We will comment the advantages and disadvantages of each scheme. Additional, we propose two methodologies to design Type-2 fuzzy controllers.
In this work, we study and compare the performance of type-1 and type-2 fuzzy controllers to drive an omnidirectional mobile robot (Robotino) in line-following tasks using line detection images. We perform tests in four different circuits to analyze the behavior of the Robot in an uncertain and noisy environment.
The structure of the paper is as follows: Section 2 outlines the kinematic model of an omnidirectional mobile robot, and then the image processing for line detection is presented in Section 3. Section 4 describes the fundamentals of Type-1 and Type-2 Fuzzy Systems. In Section 5 five control schemes are introduced that will be tested in the autonomous driving of an omnidirectional Robot in Section 6. Finally, Section 7 draws some conclusions and future works.
Omnidirectional mobile robot kinematics
The principal characteristic of the omnidirectional mobile robots is they can move on three independent directions. That is, into a Cartesian plane, they can move in x and y directions, and additionally, they can perform a rotational motion. The combination of these three motions allows the Robot to perform more complicated motions. In Fig. 1a, it can see a Cartesian plane x - y, The front of the robot directed towards x-axis,

Structure and Kinematics parameters of an omnidirectional mobile robot.
According to [2, 29], the kinematics of three-wheel omnidirectional robot which relates the robot motion with the wheels of the robot is given as in Equation (1)
Where:
x, y, ϕ determine the position and orientation into a global reference
υ1 is the linear velocity of the i-wheel
R is the distance between the i-wheel center and robot center
ρ i is the angular location of the i-arm attached to i-motor with respect to the head Robot [degrees].
Usually, in computer vision, line detection from an image is performed by a consecutive series of preprocessing stages. Fig. 2 shows the sequential process of line detection used in this work. Initially, Robotino captures color images, selects a region of interest of each image, which is converted in a gray, black-white image to have a compress and light version of it. Finally, we can obtain the line of the image by using an edge detection algorithm.

Image processing.
The Prewitt filter is a filter operator, also called kernel, which is frequently used for edge detection into images. The Prewitt operator is defined by a 3×3 matrix. Kernels defined in Equation (2) detect edges in horizontal and vertical directions respectively.
The edges detected in an image are obtained by the convolution of the black/white image with the Prewitt
y
operator.
In this application, only the Prewitt y operator was used due to the fact that the vertical lines are searched. Figure 3a shows an example of one picture captured by Robotino, and Fig. 3b shows the picture after preprocessing.

Example of an processed image.
Each image captured by Robotino has a size of 320×240 pixels. Then, we can locate a vertical line with a position in the range [1, 320]. If the position value equals 1, it indicates that the line completely is to the left, when it equals 160 indicates the line is at the center, and if it equals 320 indicates the lines are completely to the right.
A rule base of a Mamdani fuzzy system can contain Zadeh rules. Rule l, (l = 1, …, m), has the following structure for a model with two inputs and one output:
The difference between a Type-1 and Type-2 Fuzzy system is that the first one uses Type-1 Fuzzy sets and the second one uses at least one Type-2 Fuzzy set. Therefore, this simple difference entails an extension of mathematics and inference processing in Fuzzy systems [25].
The processing of a type-1 fuzzy system with fuzzy rules as in Equation (4) and centroid defuzzification can be executed through the following steps: Fuzzifier the inputs, generally by the use of a singleton membership functions Obtain the degree of compatibility, i.e., membership values of the antecedent of the rules according to the input values (the known facts) By the use of t-norm functions, get the firing strength of each rule Obtain an induced consequent membership function for each rule by the application of an implication operation y
l
Aggregate all induced membership functions, by the use of an aggregation operation, to generate the output type-1 fuzzy set B
Defuzzifier B by using the centroid method to get a crisp output value.
Note that there exist many alternatives to process a Mamdani fuzzy controller by the use of different methods or operations in any of the mentioned inference processing [18].
Type-2 fuzzy systems
A type-2 fuzzy set
1. where, X is the domain of the fuzzy variable, and u belongs to the interval called the primary membership, that is, u ∈ J
x
⊆ [0, 1],
If for all
IT2FSs are used in this work in the modeling of Type-2 Fuzzy Systems. From Equation (5), it can see that the third dimension is unnecessary and an IT2FS can be represented by a 2-dimension tuple.
Equally to T1FS, an IT2FS can be defined by different parametric membership functions, but in the last approach, there are different ways to define a shape or class of a fuzzy set, for example, a parametric triangular membership function has been defined with a different number of parameters in different works [6, 25]. In this work, and based on [6], it is used a set of six parameters to represent a type-2 triangular MF as in the following equation
Where, the first three parameters define the most left embedded T1-Triangular fuzzy set, and the other ones are used to define the most left embedded T1-Triangular fuzzy set. Figure 4 shows an example of a triangular IT2FS with following parameters: t2trimf (x ; .1, . 4, . 6, . 2, . 5, . 8).

Example of a triangular IT2FS.
The bounded region formed in the definition of an IT2FS (the shaded region in Fig. 4) is called footprint of uncertainty (FOU). It is the union of all primary memberships J
x
as follows
The
Therefore, an IT2FS can also be expressed in terms of Equation (9) as
The lower and upper membership functions of triangular MF from Eq. (7) are obtained by using min and max operation as follows
The steps for processing a Mamdani type-2 fuzzy system, according to Equation (4) and the extension principle [4, 25] and using the representation of Equation (10), when the input is a singleton fuzzy set (Type-1) with a core Obtain the degree of compatibility, which is an interval, on each rule according to the input Compute the firing interval of each l-rule Obtain an induced consequent IT2FS for each rule by the application of the composition operation as follows
Aggregate all induced IT2FSs B
l
, by computing an s-norm operation, to generate the overall interval IT2FS B
Obtain a type-1 fuzzy set from an interval type-2 fuzzy set by using the centroid type-reducer method. Equations to compute the most left and right centroids are as follows:
The switch points L and R can computed using the Enhanced Karnik-Mendel Algorithm [31]. The type-1 fuzzy set has membership μ B (y) = 1 when y∈ [c l (B) , c r (B)] and μ B (y) = 0 in otherwise.
Get a crisp output value y
c
(x′) from the type-1 fuzzy set B, doing defuzzication by centroid method, which is equivalent to find de mean of c
l
(B) and c
r
(B) as follows:
The control objective in this work is to maintain the Robot following the line printed on the floor. To perform this simple task, the Robot obtains images located in front of it, as in the example of Fig. 3, and through an image preprocessing, an integer variable belongs to the interval [1, 320] is generated to estimate the location of the Robot with respect to the line.
Then, the controller generates both the command velocity v x , and angular velocity v a of the Robot as a function of the error between the reference x d and actual position x. For this example, the reference always will be zero, because the objective is to maintain the robot at the center of the line.
Figure 5 shows the feedback control scheme and its principal components to illustrate the control task.

Feedback control Scheme for controlling Lineal velocities in Robotino.
The controller module is designed and implemented using different control strategies. The control strategies implemented in this work are: i) PD Control, ii) fuzzy PD control and iii) Fuzzy Control. As ii) and iii) are implemented using Type-1 and Type-2 fuzzy systems, then it will refer schemes iv) T2-Fuzzy PD control and v) T2-Fuzzy control, to distinguish when T2- Fuzzy system is used.
Figure 6 shows the traditional PD control scheme that will be tested in this work. This scheme is characterized by the sum of two terms, the first one scales the error signal and the second one scales the derivative of the error, which is used to anticipate the error. Equation (17) shows the mathematical definition of PD control:

PD Control Scheme.
The Fuzzy PD control (FPD) is a variant of the PD control scheme. In the FPD scheme, the parameters k p and k v are adaptive, that is, they can vary their values according to some variables, Fig. 7 shows Fuzzy PD.

Fuzzy PD Control Scheme.
In Fig. 8 the Fuzzy control scheme is presented. Note that the difference between Fuzzy PD and Fuzzy control is that in the first one, a FIS is used to change the values of the k p and k v parameters into a PD control scheme and in the second one, the FIS is the control scheme to compute in a direct form the values of the control variable.
Note from the control schemes, that variable u is a vector that contains the command velocities v x , v a , then it will be considered that an actual implementation contains two parallels schemes as are shown in Figs. 6, 7 and 8.

Fuzzy Control Scheme.
For the design and implementation of the Type-2 Fuzzy controllers, two methodologies are presented, which begin with a simple or based implementation and go to these more complicated models.
Design and implemented a PD control scheme, and tune the parameters PD. Design a Type-1 Fuzzy system to give adaptability to the parameters P and D. The range of values of the parameters is estimated according to the values obtained in steps 2. Design a Type-2 Fuzzy system based on the model obtained in step 2, by changing the type-1 to type-2 fuzzy sets.
Design a Type-1 Fuzzy system to compute in a direct way the command velocities. Design a Type-2 Fuzzy system based on the model obtained in step 2, by changing the type-1 to type-2 fuzzy sets.
In this work, the values of the parameters P, D, and all related to the fuzzy systems, such as number and types of fuzzy sets, and rule bases, etcetera, were determining by trial and error way.
Next, the way to compute v
x
for controllers for methodology 2 is described. The error variable was normalized to get a more adequate representation as in following Equation (18)
Where pos
x
is the position value obtained in the stage of image processing. Then, the input variables error and change of error, i.e. e and

Fuzzy Sets for variables error and change error for a) and b) T1FS and c) and d) for T2FS cases.
The output variable v x is fuzzified as is shown in Fig. 10.

Fuzzy Sets for output variable v x for a) T1FS and b) T2FS cases.
Table 1 shows the rule-base of the fuzzy control system using the structure defined in Eq. (4). The first column lists the fuzzy values of the error variable, and the first row indicates the fuzzy values of the change of error. The other cells contain the fuzzy values of the output variable.
Rule base for computing v x in FC and T2FC
A similar process was used to compute the angular velocity. Note that for schemes of the Methodology 1, the input variables are the same and the only change is that the range of the outputs should determine the P and D parameters.
Robotino® sim application
Robotino® SIM is a simulation tool for experimenting with a virtual Robotino® platform in a predefined virtual environment. It allows experimenting with different control system schemes for a wide range of applications by the simulation of sensors such as bumper system, distance sensors, cameras, optoelectronic sensors, and inductive sensors amount others.
Robotino® SIM, in its freely available version, provides two predefined paths to test applications such as line followers among others. It does not give any information about the size and shape of the paths, additionally, it contains sources of noise in sensors (that also are unknown for the users). These characteristics make this tool very useful for testing control designs for simulating a real environment with uncertainty.
Figure 11a and b show the default paths that Robotino® SIM has integrated into its free version. A user can have an idea or perform an estimation of the size of each path to consider that each square printed on the floor is equals 0.5 m.

Default circuits defined in Robotino Sim Tool.
In this work, five different control schemes are compared: 1) PD Control; 2) Fuzzy PD Control using T1 fuzzy sets; 3) Fuzzy control using T1 fuzzy sets; 4) Fuzzy PD Control using T2 fuzzy sets; 5) Fuzzy control using T2 fuzzy sets. Table 2 shows the assigned nomenclature as a reference.
Nomenclature assigned to the control Schemes
Each controller was tested as a line follower in different paths. Fig. 11 shows two perspectives of the default circuits defined in Robotino Sim Tool, and here these will be called as interior and exterior circuit.
To generate four independent tests the Robotino traveled each circuit in opposite directions, namely in clockwise and counterclockwise. Tests
It should be mentioned that, Robotino Sim contains sources of noise in sensors and uncertainty conditions at the environment, and then it is expected that on different tours in a particular circuit, the robot will perform with different times.
Table 3 shows the average times (in seconds), and the standard deviation taken from 30 tours in each circuit. These values are used as metrics to determine which model is faster and whereas the standard deviation says us to determine which model is more robust under uncertainty conditions.
The average times and standard deviation of the tests
From the results, it can noted that in general, the FPD controller can drive the Robot faster and from its standard deviation, it is more robust than its counterpart PD scheme. With respect to Type-1 and Type-2 controller in both methodologies, it can be noted that Type-1 controllers performed tours faster than their Type-2 counterparts system, but from the standard deviations, it can be concluded that Type-2 fuzzy implementations are more robust under conditions of uncertainty due to the sensors and the environment.
Finally, by comparing the response of the models for methodology 1 with respect to the model of methodology 2, we can note that methodology 1 generates faster and more robust controllers than methodology 2. However, this previous statement was made under the consideration that the parameters were tuned by trial and error, additionally; the authors think the designs of methodology 2 are a more transparent definition of the rule base to compute the command velocities.
Figure 12 shows an example of the behavior of the command velocities taken from a tour in the circuit

Command velocities taken from a tour in the circuit
In this paper we introduced five different control schemes to drive the Robotino Robot in a line following task. These schemes use image processing to acquire the actual location of the robot with respect to the line and compute the error signal to determine the commands for linear and angular velocities.
According to the results, we can conclude that Fuzzy PD schemes are more efficient than classical PD schemes, and Type-2 schemes give more robustness than classical Type-1 schemes to a control system.
