1 Introduction

Nowadays metaheuristics are being used for optimization of fuzzy controllers, and these controllers need to be optimized because in many cases they do not achieve the optimal performance that is required for real-world applications. In most cases, these controllers are called type-1 fuzzy logic controllers (FLC) because they use the original definition of fuzzy sets [1]. Fuzzy logic was originally proposed by Lotfi Zadeh in [2], where the concepts of fuzzy sets and fuzzy logic were introduced. In this case, the elements of a set are given a numeric value as a measure of the uncertainty in the so-called membership functions. The membership functions are defined for a linguistic variable of a fuzzy set. In addition to the original fuzzy logic (type-1) that was proposed from the beginning, type-2 fuzzy logic was also later developed, and arises with the purpose of solving more complex problems, that is, with a higher level of uncertainty, when compared to the problems that can be solved with type-1 fuzzy logic [3].

Type-2 fuzzy sets were also introduced by Zadeh as an extension of ordinary fuzzy sets (type-1). In a type-2 fuzzy set the membership degrees are also fuzzy. In this sense, a type-1 fuzzy set is a special case of a type-2 fuzzy set because its secondary membership function is a subset with a single element [4].

Type-2 fuzzy logic systems can be viewed as a collection of type-1 fuzzy logic systems; therefore, their ability for uncertainty management is greater. The works in [5,6,7,8] describe the use of type-2 fuzzy systems that provide very good results in different control problems. In [9] the theoretical advances of type-2 fuzzy controllers are described, and also what remains to be done in this area was outlined. On the other hand, in [10] the difference between a type-1 and a type-2 fuzzy controller is explained in a very detailed fashion. In addition, this work described some limitations of type-1 fuzzy controllers to solve problems with higher levels of uncertainty, and the applications and benefits of type-2 fuzzy controllers are also outlined.

Both type-1 and type-2 fuzzy systems have been previously optimized with metaheuristics, for example, the optimization of type-1 fuzzy controllers is found in [11,12,13], which deal with the optimization of fuzzy controllers of autonomous mobile robots using the firefly algorithm. Also in [14], GSO was used for the optimization of a fuzzy controller of an autonomous robot following a trajectory, where the dynamic adjustment of the most important parameters for the operation of the GSO algorithm is presented. In addition, in [15] the GSO algorithm was used in the optimization of the water tank fuzzy controller.

There are many fuzzy controller optimization papers, using other metaheuristics. For example, in [16] the genetic algorithm (GA) is used to evolve the architecture of a type-2 fuzzy controller in robot navigation for real environments. Other authors have used fuzzy controllers of autonomous robots following a trajectory as described in [17], also there are more fuzzy controller applications thanks to their efficiency and performance, as illustrated in [18, 19], where a comparison is made between type-1 and type-2 fuzzy controllers, and in [20] two fuzzy controllers are used to control the liquid-level process in a tank.

The main motivation of this work is to introduce, through the use of a metaheuristic algorithm, an optimization method, where optimal performance can be obtained for achieving satisfactory results in the control of an autonomous mobile robot. It has been previously observed that the use of parameter adjustment in metaheuristic algorithms for the optimization of mathematical functions and control problems provides competitive results, so in this work we propose using fuzzy logic to perform the dynamic adjustment of the parameters of the algorithms and measure their performance applied in the optimization of the fuzzy controller of the autonomous mobile robot.

The main contribution is the proposed optimization methodology, as well as finding the optimal parameters for the optimization of a type-2 fuzzy controller. In this case, the control of the behavior of a robot following a trajectory is considered, which aims at following a given trajectory with a margin of error as low as possible, calculated by means of an established metric. In addition, a comparison of the optimization efficiency between two metaheuristic algorithms, the firefly algorithm (FA) and galactic swarm optimization (GSO) is considered. The reason for considering FA and GSO is that both algorithms have previously shown good performance when applied to fuzzy controller optimization problems.

The organization of this paper is as follows: Sect. 2 details the inspiration and equations required by the GSO and FA algorithms to perform their search and optimization. In Sect. 3 the proposed approach for the optimization of the type-2 fuzzy controller of the autonomous mobile robot is presented. In Sect. 4 the case study of the autonomous mobile robot is presented. Section 5 shows the results obtained from the experiments developed with the proposed approach for the autonomous mobile robot plant. In Sect. 6, a discussion about the obtained results is presented. Finally, in Sect. 7 conclusions and future work are outlined.

2 Background

In a review of the state of the art, some articles focused on optimizing membership functions with FA and GSO were found, but none of these works use the same parameters of experimentation that are proposed here. Since the combination of these metaheuristics is rare in the literature, we will compare the performance results of these algorithms for this type of optimization problems.

In this section, we are presenting the relevant theory and concepts for this work.

2.1 Firefly Algorithm (FA)

This method was inspired by the flickering fireflies, where each firefly is attracted to another depending on the intensity of light or brightness it generates. It was developed in 2008 by Xin She Yang [21, 22]. The firefly algorithm has three main rules: Rule 1 stipulates that any firefly can be attracted to another firefly regardless of their sex, since in this method the fireflies are unisex. Rule 2 describes that the less glowing fireflies will be attracted to the brightest firefly. Finally, Rule 3 states that the search space is described by the objective function.

The FA has three equations that represent the movement of the fireflies. The first one is called the attraction equation:

$$\beta = \beta_{0} e^{{ - \gamma r^{2} }} ,$$
(1)

where \(\beta\) represents the attractiveness of a firefly; \(\beta_{0}\) is the initial attractiveness in \(r\) = 0 \(\in\) [0,1]; \(e\) ≈ 2.71828 is the basis of the natural logarithms; \(r\) is the distance between each of two fireflies, and \(\gamma\) determines the variation of attractiveness as the distance increases between the fireflies \(\in\) [0, 1].

The movement equation is as follows:

$$x_{i}^{t + 1} = x_{i}^{t} + \beta_{0} e^{{ - \gamma r_{ij}^{2} }} \left( {x_{j}^{t} - x_{i}^{t} } \right) + \alpha_{t} \in_{i}^{t} ,$$
(2)

where \(x_{i}^{t + 1}\) represents the next position; \(x_{i}^{t}\) is the actual position; \(\beta_{0} e^{{ - \gamma r_{ij}^{2} }} \left( {x_{j}^{t} - x_{i}^{t} } \right)\) represents the attraction; \(\alpha_{t}\) is the randomization with α being the parameter of randomness α \(\in\) [0, 1], and \(\in_{i}^{t}\) represents the vector of random numbers extracted from a Gaussian distribution.

The distance equation is expressed as:

$$r_{ij} = \sqrt {\mathop \sum \limits_{k = 1}^{d} \left( {x_{i,k} - x_{j,k} } \right)^{2} ,}$$
(3)

where \(r_{ij}\) represents the Euclidian distance between two fireflies i and j; \(x_{i,k}\) is the kth component of the spatial coordinate; \(x_{i}\) is the ith firefly, and \(d\) is the number of dimensions.

2.2 Galactic Swarm Optimization (GSO)

Galactic swarm optimization (GSO) is a recently created algorithm, which was proposed in 2016 by Muthiah-Nakarajan and Noel [23]. Galactic swarm optimization uses multiple exploration and exploitation cycles to carry out its search process, thus offering greater opportunities to find the global minimum.

In galactic swarm optimization, the concept of a swarm is used, which is represented by a set of elements called particles, as in the PSO algorithm, since it was taken as inspiration to demonstrate this technique. In the GSO algorithm the population is divided into M subpopulations called subswarms. This metaheuristic consists of two levels [20]. In the first level, the method starts to explore independently in each of the subswarms, thus improving the search for possible solutions. Since the GSO algorithm uses the PSO algorithm as a basis, the velocity and position of the particles are calculated according to the number of iterations determined for the first level [24].

In the second level, a super swarm is formed based on the best individuals of each of the subswarms, so that in the end the best possible solution is obtained. In the same way the calculation of the velocity and position of the particle is used as in the level 1. The equations needed to calculate the velocity and position of the GSO algorithm particles are represented below [25].

Level 1:

$$V_{j}^{(i)} \leftarrow W_{1} V^{(i)} + C_{1} r_{1} \left( {P_{j}^{(i)} - X_{j}^{(i)} } \right) + C_{2} r_{2} \left( {g^{(i)} - X_{j}^{(i)} } \right),$$
(4)
$$X_{j}^{(i)} \leftarrow X_{j}^{\left( i \right) } + V_{j}^{(i)} ,$$
(5)

where V (i)j is the velocity of the individual; W1 represents the inertia; C1 and C2 are the acceleration constants; r1 and r2 are random numbers; P (i)j is the best personal associated with the individual X (i)j ; g(i) represents the best global of the subswarm Xi, and X (i)j position of the individual.

$$w_{1} = 1 - \frac{k}{{I_{1} + 1}},$$
(6)

where is the current iteration number, an integer ranging from 0 to \(I_{1}\); and \(I_{1}\) is the number of iterations of the first level.

Level 2:

$$\begin{aligned} Y^{\left( i \right)} \in Y: \, i = 1, \, 2, \ldots ,M \hfill \\ Y^{\left( i \right)} = g^{\left( i \right)} , \hfill \\ \end{aligned}$$
(7)
$$V^{(i)} \leftarrow W_{2} V^{(i)} + C_{3} r_{3} \left( {P^{(i)} - Y^{(i)} } \right) + C_{4} r_{4} \left( {g - Y^{(i)} } \right),$$
(8)
$$Y^{(i)} \leftarrow Y^{\left( i \right) } + V^{(i)} ,$$
(9)

where V(i) is the velocity of the individual; W2 represents the inertia in level 2; C3 and C4 are the acceleration constants in level 2; r3 and r4 are random numbers; P(i) represents the personal best; g represents the global best, and Y(i) the position of the individual.

3 Proposal

The main contribution of this work is the proposed optimization methodology, as wells as its application for finding the optimal parameters in the design of a type-2 fuzzy controller, which must control the behavior of an autonomous mobile robot. The fuzzy controller aims at following a given trajectory with a margin of error as minimum as possible, calculated by means of an established metric of control performance.

The most important difference between using the dynamic adjustment of parameters in metaheuristic algorithms with respect to the use of fixed parameters is that the parameters selected for dynamic adjustment are modified as the iterations proceed, which leads us to obtain better solutions.

The methodology consists on using a metaheuristic algorithm to perform the optimization of the membership functions parameters of the type-2 fuzzy robot controller for path following. In this case, we measure the type-2 fuzzy controller’s performance and return a result according to the established performance metric and continue with the optimization until a stopping criterion or a previously established number of iterations are met. This methodology can be found in a summarized form in Fig. 1.

Fig. 1
figure 1

Proposed optimization method

The optimization of the fuzzy controller is performed with the original algorithms and their variants using dynamic parameter adjustment in the GSO and FA algorithms. In the first case, for the optimization variants we use type-1 fuzzy systems. The fuzzy system used for parameter adjustment of the GSO algorithm uses “Iteration” as input variable and as output variables the c3 and c4 parameters. Each of the variables is composed of three triangular membership functions labeled as “low”, “medium’ and “high”, as can be seen in Fig. 2. The fuzzy system FA_T1 that performs parameter adjustment of the FA uses the “Iteration” variable as input variable and as an output variable the \(\alpha\) parameter, and these variables are composed of three triangular membership functions labeled as “low”, “medium” and “high”, as illustrated in Fig. 3.

Fig. 2
figure 2

Type-1 fuzzy system for the GSO algorithm

Fig. 3
figure 3

Type-1 fuzzy system for the FA

In the second variant, interval type-2 fuzzy systems are used in FGSO IT2 and FA_T2, which are an extension of the previously used type-1 fuzzy systems. The type-2 fuzzy systems are formed with the same input and output variables, which are partitioned in the same way and sharing the same form for the set of fuzzy rules. This fuzzy system can be found in Figs. 4 and 5 as shown, respectively.

Fig. 4
figure 4

Interval type-2 fuzzy system for the GSO algorithm

Fig. 5
figure 5

Interval type-2 fuzzy system for the FA

Fuzzy system rules were designed with the idea that when the algorithms are in the initial iterations they can explore and when they are in the last iterations they can exploit.

Fuzzy rules for FGSO:

  1. 1.

    If (iteration is low) then (c3 is low) and (c4 is High),

  2. 2.

    If (iteration is medium) then (c3 is medium) and (c4 is medium),

  3. 3.

    If (iteration is high) then (c3 is high) and (c4 is low).

Fuzzy rules for FA:

  1. 1.

    If (iteration is low) then (alpha is low),

  2. 2.

    If (iteration is medium) then (alpha is medium),

  3. 3.

    If (iteration is high) then (alpha is high).

Each individual or possible solution that is used in our proposal is formed by the required parameters to automatically generate the type-2 fuzzy controller avoiding manually generating the fuzzy controller, in this way expecting to obtain better results than those obtained using the basis fuzzy controller. In Fig. 6, we can find the way in which individuals are composed in the metaheuristic algorithms [26,27,28].

Fig. 6
figure 6

Structure of individuals in the GSO algorithm and FA

Each individual contains the necessary parameters to form the fuzzy controller. In this case, the controller has two input variables, which are formed by two trapezoidal membership functions and this correspond to 8 parameters to form each and a triangular with six parameters giving a total of 22 parameters per input variable. The output variables consist of three triangular membership functions which are formed with six parameters each, giving a total of 18 parameters per output variable. Once all the parameters are obtained to form the input and output variables, the fuzzy controller is built.

The structure of the individuals in the GSO and FA algorithms help us to form the interval type-2 fuzzy controllers, which are formed by triangular and trapezoidal membership functions, and their equations and graphical representation using type-2 fuzzy logic are presented below.

The representation of the interval type-2 triangular membership functions (itritype2) of the fuzzy controller consists of 6 parameters an1, bn1, cn1, an2, bn2 and cn2, where the parameter values satisfy an1< an2, bn1< bn2 and cn1< cn2 and this is shown as follows:

$$\begin{aligned} \mu \left( x \right) & = {\text{itritype}}2\left( {x, \left[ {a_{n1} ,b_{n1} ,c_{n1} ,a_{n2} ,b_{n2} ,c_{n2} } \right]} \right), \hfill \\ {\text{where}}\quad a_{n1} < a_{n2} ,b_{n1} < b_{n2} ,c_{n1} < c_{n2} , \hfill \\ \mu_{1} \left( x \right) & = \hbox{max} \left( {\hbox{min} \left( {\frac{{x - a_{1} }}{{b_{1} - a_{1} }},\frac{{c_{1} - x}}{{c_{1} - b_{1} }}} \right),0} \right), \hfill \\ \mu_{2} \left( x \right) & = \hbox{max} \left( {\hbox{min} \left( {\frac{{x - a_{2} }}{{b_{2} - a_{2} }},\frac{{c_{2} - x}}{{c_{2} - b_{2} }}} \right),0} \right), \hfill \\ \bar{\mu }\left( x \right) & = \hbox{max} \left( {\mu_{1} \left( x \right),\mu_{2} \left( x \right)} \right) \forall_{x} \left( {b_{n1} ,b_{n2} } \right), \hfill \\ \bar{\mu }\left( x \right) & = 1 \forall_{x} \smallint \left( {b_{n1} ,b_{n2} } \right), \hfill \\ \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{\mu } \left( x \right) & = \hbox{min} \left( {\mu_{1} \left( x \right),\mu_{2} \left( x \right)} \right). \hfill \\ \end{aligned}$$
(10)

In Figs. 7 and 8, we can find the graphical description of the interval type-2 triangular and trapezoidal membership functions, respectively.

Fig. 7
figure 7

Interval type-2 triangular membership function

Fig. 8
figure 8

Interval type-2 trapezoidal membership function

The representation of the interval type-2 trapezoidal membership functions (itrapatype2) of the fuzzy controller consists of 8 parameters an1, bn1, cn1, dn1, an2, bn2, cn2 and dn2, where an1< an2, bn1< bn2, cn1< cn2a and dn1< dn2 and this is shown as follows:

$$\begin{aligned} \mu \left( x \right) & = {\text{itrapatype}}2\left( {x, \left[ {a_{n1} ,b_{n1} ,c_{n1} ,d_{n1} ,a_{n2} ,b_{n2} ,c_{n2} ,d_{n2} } \right]} \right), \hfill \\ {\text{where}}\quad a_{n1} < a_{n2} ,b_{n1} < b_{n2} ,c_{n1} < c_{n2} ,d_{n1} < d_{n2} , \hfill \\ \mu_{1} \left( x \right) & = { \hbox{max} }\left( {\hbox{min} \left( {\frac{{x - a_{n1} }}{{b_{n1} - a_{n1} }},1,\frac{{d_{n1} - x}}{{d_{n1} - c_{n1} }}} \right),0} \right), \hfill \\ \mu_{2} \left( x \right) & = { \hbox{max} }\left( {\hbox{min} \left( {\frac{{x - a_{n2} }}{{b_{n2} - a_{n2} }},1,\frac{{d_{n2} - x}}{{d_{n2} - c_{2} }}} \right),0} \right), \hfill \\ \bar{\mu }\left( x \right) & = \left\{ {\begin{array}{*{20}l} {\hbox{max} \left( {\mu_{1} \left( x \right),\mu_{2} \left( x \right)} \right)} & \quad {\forall x \notin \left( {b1,c2} \right)} \\ 1 & \quad {\forall x \in \left( {b1,c2} \right),} \\ \end{array} } \right. \hfill \\ \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{\mu } \left( x \right) & = \hbox{min} \left( {\alpha ,\hbox{min} \left( {\mu_{1} \left( x \right),\mu_{2} \left( x \right)} \right)} \right). \hfill \\ \end{aligned}$$
(11)

4 Problem Description (Autonomous Mobile Robot)

To test the proposed methodology, we consider the case of controlling an autonomous mobile robot. For this particular case, the main function of the fuzzy controller is to provide control of the motors to minimize the error in an established trajectory [29, 30].

The robot design for the case study can be found in Fig. 9, which consists of 2 wheels that move by means of motors and a passive wheel to give stability to the robot during the motion. The operation of the robot is determined by means of the following equations [31, 32]:

$$M\left( q \right) \dot{v} + C\left( {q,\dot{q}} \right)v + D_{v} = \tau + P\left( \tau \right),$$
(12)
$$\dot{q} = \left[ {\begin{array}{*{20}c} {\cos \theta } & 0 \\ {\sin \theta } & 0 \\ 0 & 1 \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} v \\ w \\ \end{array} } \right],$$
(13)

where [33] \(q\) = (x, y, θ)T describes the position of the robot; \(v\) = (\(v\), \(w\))T represents the linear and angular velocities; \(\tau\) = (\(\tau\)1, \(\tau\)2) represents the torque that is applied to the wheels;

Fig. 9
figure 9

Mobile robot model

\(P \in R^{2 }\) is the disturbance vector; \(M\left( q \right) \in R^{{2x_{2} }}\) represents a positive inertia matrix; \(C\left( {q,\dot{q}} \right)v\) describes the vector of centripetal and Coriolis forces, and \(D \in R^{{2x_{2 } }}\) is a diagonal positive defined damping matrix.

The fuzzy controller of the mobile robot is formed by two input variables labeled as the errors of the linear and angular velocities, granulated into three membership functions, two trapezoidal for the edges and one triangular for the center labeled as negative, zero and positive, respectively. The output variables are called torque1 and torque2, which are granulated into three triangular membership functions labeled: negative, zero and positive [34, 35]. Below we have a graphic description of the inputs and outputs that form the interval type-2 fuzzy controller of the mobile autonomous robot that, as mentioned above, which are granulated with triangular and trapezoidal membership functions. Figures 10, 11, 12 and 13 illustrate the corresponding type-2 membership functions.

Fig. 10
figure 10

Membership functions of the linear velocity error

Fig. 11
figure 11

Membership functions of the angular velocity error

Fig. 12
figure 12

Membership functions of Torque 1

Fig. 13
figure 13

Membership functions of Torque 2

The design of the fuzzy rules of the autonomous mobile robot controller enables controlling the movement of the robot following the established trajectory, so that the movement is uniform and continuous. The fuzzy rules are listed below:

  1. 1.

    If (ErrorLV is negative) and (ErrorAV is negative) then (Torque1 is negative) and (Torque2 is negative),

  2. 2.

    If (ErrorLV is negative) and (ErrorAV is zero) then (Torque1 is negative) and (Torque2 is zero),

  3. 3.

    If (ErrorLV is negative) and (ErrorAV is positive) then (Torque1 is negative) and (Torque2 is positive),

  4. 4.

    If (ErrorLV is zero) and (ErrorAV is negative) then (Torque1 is zero) and (Torque2 is negative),

  5. 5.

    If (ErrorLV is zero) and (ErrorAV is zero) then (Torque1 is zero) and (Torque2 is zero),

  6. 6.

    If (ErrorLV is zero) and (ErrorAV is positive) then (Torque1 is zero) and (Torque2 is positive),

  7. 7.

    If (ErrorLV is positive) and (ErrorAV is negative) then (Torque1 is positive) and (Torque2 is negative),

  8. 8.

    If (ErrorLV is positive) and (ErrorAV is zero) then (Torque1 is positive) and (Torque2 is zero),

  9. 9.

    If (ErrorLV is positive) and (ErrorAV is positive) then (Torque1 is positive) and (Torque2 is positive).

These fuzzy rules are basically deciding the particular actions on the left and right wheels according to the position of the robot with respect to the desired trajectory.

5 Simulation Results

In this section, the results obtained from the fuzzy controller optimization of the autonomous mobile robot are presented. The methodology consists on using a metaheuristic algorithm to generate a vector of the necessary parameters to form the membership functions of the interval type-2 fuzzy controller that is optimized. For this specific case, the metaheuristics are the galactic swarm optimization and firefly algorithm and their variants with dynamic adaptation of parameters using type-1 and interval type-2 fuzzy systems. Table 1 shows the parameters used in galactic swarm optimization and firefly algorithm to perform the optimization of the fuzzy controller.

Table 1 Parameters of the GSO and FA algorithms

To measure the performance of the algorithms for the optimization of the fuzzy controller, the mean squared error (MSE) is used. Its equation is described below:

$${\text{MSE}} = \frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left( {X_{i} - Y_{i} } \right)^{2} ,$$
(14)

where \(X_{i}\) is the reference value at time I; the reference values are given in [32]; \(Y_{i}\) is the value produced by the system at time I, and \(n\) is the number of samples considered in the test.

Table 2 shows the performed experiments to obtain the best optimized fuzzy system with the FA, where it can be observed that the best error found is of \(9.64 \times 10^{ - 02}\) and an average of \(3.20 \times 10^{ + 00}\) was obtained.

Table 2 Results for the FA

Table 3 shows the performed experiments to obtain the best optimized fuzzy system with the fuzzy firefly algorithm, where it can be observed that the best error found is of \(9.93 \times 10^{ - 01}\) and an average of \(1.67 \times 10^{ + 00}\) was obtained.

Table 3 Results for the fuzzy FA

Table 4 shows the performed experiments to obtain the best optimized fuzzy system with the interval Type-2 fuzzy firefly algorithm, where it can be observed that the best error found is of \(9.64 \times 10^{ - 02}\) and an average of \(1.06 \times 10^{ + 00}\) is obtained.

Table 4 Results for the interval Type-2 fuzzy FA

Table 5 shows the performed experiments to obtain the best optimized fuzzy system with the GSO algorithm, where it can be observed that the best error found is of \(5.05 \times 10^{ - 03}\) and an average of \(1.17 \times 10^{ + 00}\) was obtained.

Table 5 Results for galactic swarm optimization (GSO)

Table 6 shows the performed experiments to obtain the best optimized fuzzy system with the FGSO algorithm, where it can be observed that the best error found is of \(5.78 \times 10^{ - 06}\) and an average of \(8.84 \times 10^{ - 01}\) was achieved.

Table 6 Results for fuzzy galactic swarm optimization (FGSO1)

Table 7 shows the performed experiments to obtain the best optimized the interval type-2 fuzzy system with GSO algorithm, where it can be observed that the best error found is of \(1.39 \times 10^{ - 05}\) and an average of \(8.35 \times 10^{ - 01}\) was achieved.

Table 7 Results for interval Type-2 fuzzy galactic swarm optimization (FGSO IT2)

Table 8 shows the best, the worst, the average and standard deviations after 30 executions with the FA and its variants after having performed the fuzzy controller optimization.

Table 8 Best, worst and average for the FA and its variants

Table 9 shows the best, the worst, the average and standard deviations after 30 executions with the GSO algorithm and its variants after having performed the fuzzy controller optimization.

Table 9 Best, worst and average for the GSO algorithm and its variants

Finally, the results obtained with the methods are presented in Figs. 14, 15, 16 and 17, respectively, where one can note the differences between the desired trajectory and the real one generated by the autonomous mobile robot with the type-2 fuzzy logic controller.

Fig. 14
figure 14

The best result (\(9.64 \times 10^{ - 02}\)) obtained with firefly algorithm (FA) and its variants

Fig. 15
figure 15

The worst result (\(9.75 \times 10^{ + 00}\)) obtained with firefly algorithm (FA) and its variants

Fig. 16
figure 16

The best result (\(5.78 \times 10^{ - 06}\)) obtain with the GSO algorithm and its variants

Fig. 17
figure 17

The worst result (\(7.04 \times 10^{ + 00}\)) obtain with the GSO algorithm and its variants

5.1 Statistical Comparison

In order to validate the performance of the metaheuristic algorithms used to test the proposed optimization methodology of membership functions parameters of the mobile robot fuzzy controller, a statistical comparison is made to find evidence that the algorithms have performed well in the case study of the autonomous mobile robot plant. Table 10 shows the representation of the values used in the statistical test, to determine which method produced better results in the optimization of membership function parameters, generating a data vector, which helps to improve the performance of the fuzzy controller for the autonomous robot.

Table 10 Statistical test parameters [24, 35]

In Table 10, the null hypothesis (H0) states that the average MSE error for the GSO algorithm and its variants (μ1) is greater than or equal to the average MSE error for FA and its variants (μ2). The alternative hypothesis (Ha) states that the average MSE error for the GSO algorithm and its variants (μ1) is less than the average MSE error for FA and its variants (μ2).

Table 11 shows the averages, standard deviations and values of z for each of the comparisons made, where the GSO algorithm and its variants manage to obtain significant evidence against the FA and its variants. As a consequence H0 is rejected and Ha is accepted with a 95% of the level of significance and a rejection zone for values lower than − 1.645.

Table 11 Results of the Z-test for the GSO algorithm and the FA

As mentioned above, the metaheuristic algorithms generate satisfactory results in optimization problems, and in this paper we optimized a type-2 fuzzy controller which controls autonomous robot navigation, and then the results obtained in the experimentation are described. This experimentation is made with two optimization methods for the type-2 fuzzy controller to make a comparison of the methods and thus, discover which one is the best. As can be noted in Table 11, the method that produces the best results according to the hypothesis testing is the galactic swarm optimization, since the firefly algorithm gives a higher difference error between the desired trajectory and the actual trajectory generated by the robot. This algorithm has shown in other optimization problems to give good results as explained in [36, 37], although on the other hand, the galactic swarm optimization proved to be better in terms of the solution for this problem.

In addition, we also used the nonparametric Friedman test to be even more confident about the validity of the results. The Friedman test [38,39,40] is a nonparametric test to compare multiple algorithms to find the best algorithm. First, if we compare the original GSO and FA methods, we find that there is a significant advantage of GSO with a p value of 0.01 (see Table 12). Also, if we compare FGSO and FA_T1, we find significant advantage of FGSO with a p value of 0.00006 (see Table 13). Finally, we can compare FGSO IT2 versus FA_T2 and we find significant advantage of FGSO IT2 with a p value of 0.00006 (see Table 14).

Table 12 Friedman test in comparing GSO versus FA
Table 13 Friedman test in comparing FGSO versus FA_T1
Table 14 Friedman test in comparing FGSO IT2 versus FA_T2

In summary, we can state that there is sufficient statistical evidence to say that the galactic swarm optimization (and its variants) outperforms the firefly algorithm.

6 Discussion

In the state of the art, we can find works related to the optimization of membership functions, such as in [41] where a comparative study of type-2 fuzzy particle swarm, bee colony and bat algorithms in optimization of fuzzy controllers is presented. This study makes a comparison between three very promising methods in optimization of fuzzy controllers, where their results for each of the algorithms show the best, worst, average, standard deviation. So having these results we can compare them with the results obtained in this proposal, where we can discuss which method has achieved better performance in the optimization of fuzzy controllers. In Table 15, the results of bee colony optimization are illustrated versus results of Table 8 that represents firefly algorithm (FA), and it is observed that the best value found by the original bee colony optimization (BCO) algorithm, the best with type-1 fuzzy logic (BCO_T1), type-2 fuzzy logic (BCO_T2), but on average and standard deviation the FA showed that its performance is better in optimizing membership functions.

Table 15 Results of performance the BCO

Regarding Table 16 which represents particle swarm optimization (PSO particle swarm optimization with type-1 fuzzy logic (PSO_TI), particle swarm optimization with type-2 fuzzy logic (PSO_T2), it is observed that the results were better for PSO than for the FA in Table 8, but it must be taken into account that the PSO with inertia weight parameters, position update that helps improve the movement of the particles to find the best overall, and the traditional FA only uses a next position and a Gaussian distribution.

Table 16 MSE results of PSO

In Table 17, the bat algorithm shows results that are inferior in its optimization performance as shown in Table 17 versus the FA of Table 8.

Table 17 Results of the bat algorithm

Table 9 shows the results obtained with GSO, which are better when compared to Tables 15 and 17. As it is observed, in general the proposed algorithms turn out to have better performance than those found in the literature. We have to mention that there are other related articles, but they use the RMSE metric and not the MSE that is used in this proposal.

Finally, we show in Table 18 a summary of all the above-mentioned methods, and we can note that the best fuzzy controller (highlighted in bold) is found by FGSO IT2 with an error of 1.39 × 10−05. We can also notice that PSO_T2 achieves the second best fuzzy controller with an error of 1.90 × 10−04. From the optimal fuzzy control design point of view this is very important because the goal is finding the best possible controller. However, statistically speaking on average there is no significant difference between the type-2 fuzzy GSO variant and the type-2 fuzzy PSO algorithm.

Table 18 Summary of results among the proposed methods and other algorithms in the literature

7 Conclusions

Fuzzy controllers are being widely used today, as they can solve problems that were previously almost impossible to deal with. As a conclusion of this paper it is explained that the results that originated by the parameter optimization of the type-2 fuzzy robot controller membership functions were very satisfactory. In addition, the obtained controller values proved to be very close to the robot’s desired trajectory, observing with this, that the performance of a fuzzy controller can be improved if a metaheuristic optimization is applied. In this case, we used two metaheuristics that proved to be good in parameter optimization of the membership functions.

The experimentation was carried out with the original GSA and FA metaheuristics and their variants using type-1 and interval type-2 fuzzy systems for dynamic parameter adjustment. In order to compare the variants, a statistical test was performed between the original GSO algorithm and the FA and their variants using type-1 and interval type-2 fuzzy systems, where the GSO algorithm achieved significant improvements when compared to the FA based on the results shown in Table 11.

We can conclude that the parameter adjustment using fuzzy logic in the GSO and FA algorithms applied to fuzzy control is a good choice since competitive results were obtained with these methods. In this regard, we plan to continue investigating in this line of research and depending on the behavior of the algorithms and the use of type-1 and type-2 fuzzy logic, we will consider other types of problems.

As future work, different variations of the fuzzy systems for the dynamic adjustment of the parameters in the metaheuristic algorithms will be considered and applied to different control problems.

It is also planned to perform the dynamic tuning of the parameters with generalized type-2 fuzzy systems and in the same way to extend the controller to a generalized type-2 fuzzy controller [42, 43]. In addition, a study of the controllers by adding different levels of disturbances to the plants could be done to measure the performance of the proposed method under different situations.