Abstract
In this paper we present a modification based on generalized type-2 fuzzy logic to an algorithm that is inspired on the movement of large masses of stars and their attractive force in the universe, known as galactic swarm optimization (GSO). The modification consists on the dynamic adjustment of parameters in GSO using type-1 and type-2 fuzzy logic. The main idea of the proposed approach is the application of fuzzy systems to dynamically adapt the parameters of the GSO algorithm, which is then applied to parameter optimization of the membership functions of the bar and ball fuzzy controller. The experimentation was carried out using the original GSO algorithm, and the type-1 and type-2 fuzzy variants of GSO. In addition a disturbance was added to the bar and ball fuzzy controller plant to be able to validate the effectiveness of the proposed approach in optimizing fuzzy controllers. A formal comparison of results is performed with statistical tests showing that GSO with generalized type-2 fuzzy logic is the best method for optimizing the fuzzy controller.
Introduction
Control has become one of the most used and important applications for fuzzy logic given that it provides greater robustness in the design of the controllers, and better performance than traditional control strategies [1].
Fuzzy controllers are often used in complex plants to improve their operation by achieving smooth processes. The advantages offered by the use of fuzzy logic and fuzzy sets in addition to the emergence of type-2 fuzzy sets augment the possibilities of improving the design of fuzzy controllers [2, 3].
The dynamic adjustment of parameters with the use of fuzzy logic has proven recently to be an interesting alternative since several metaheuristic algorithms have been improved in this form. The adjustment is made through the use of fuzzy systems to control the main parameters for the operation of the metaheuristic algorithm and thus obtain an improvement. Since fuzzy systems are designed based on experts’ knowledge, they provide a better adaptation of the algorithm to the problem it is trying to solve [4]. Normally, parameter adaptation in metaheuristic algorithms, during execution, helps to obtain better results than when using fixed parameters [5–9].
The main advantages of using fuzzy logic in metaheuristics for the optimization of mathematical functions and control problems is their easy implementation and that they even have a good performance in non-linear processes. In addition, their operation is very similar to human reasoning, we do not need to be an expert in area of the problem to be solved, so it is not necessary to know the mathematical model of the problem to be solved, in addition to not depending on complex mathematical expressions.
Regarding fuzzy controllers, in recent decades they have been implemented in a large number of products and processes, such as vehicle systems, robotics, among others. Fuzzy controllers are very intuitive and offer the possibility of using imprecise expressions, it shows a tolerance to noise since its output depends on a set of rules, it will not be affected if a disturbance occurs, as well as being very stable.
In this paper, a method for dynamically adjusting the parameters of the galactic swarm optimization algorithm (GSO) is presented, where the most important parameters are adjusted by means of type-2 fuzzy systems, which are applied to the case of control of the ball and beam that consists in maintaining the balance of a ball on a beam. The main contribution is that in this paper the use of generalized type-2 fuzzy is proposed, unlike previous work that has only used interval type-2 and type-1 fuzzy logic. Generalized type-2 fuzzy logic is an extension of interval type-2 and it can handle higher levels of uncertainty, and this is why we proposed to improve the performance of GSO.
The main idea of the proposed approach is to optimize the fuzzy controller of the ball and beam, which consists of a controller of the Sugeno type [10, 11]. The optimization is carried out by obtaining the necessary parameter values to form the membership functions of the aforementioned controller [12, 13].
Galactic swarm optimization is a metaheuristic algorithm presented by Muthiah-Nakarajan and Noel in 2016 that takes as inspiration the movement of stars and galaxies in the universe. In the GSO algorithm the population is divided into subpopulations where all the individuals of each subpopulation are attracted to the best individual and in this way a balance is maintained between the exploration and exploitation in the algorithm therefore it has a good performance against complex problems [14].
In the current literature we can find different metaheuristic algorithms that have been applied to control problems to find the best design of fuzzy controllers, as in [15–17]. Also many other authors have worked on hybridizing metaheuristic algorithms, such as particle swarm optimization and gravitational search algorithm, among others [18–22].
This work is organized as follows: in Section 2 a brief introduction to type-1 and type-2 fuzzy logic is presented. In Section 3 a brief review of the GSO algorithm is given to familiarize the readers with its inspiration and how to perform its processing. In Section 4 the description of the control case of the ball and beam, as well as the fuzzy controller is presented. In Section 5 we show the proposed parameter adjustment approach in the GSO algorithm, as well as the fuzzy controller optimization used to test the proposed method. Section 6 shows the results obtained by the proposed approach applied to the optimization of the ball and beam controller in order to measure its performance and finally Section 7 describes the conclusions.
Basic concepts
In the area of artificial intelligence, fuzzy logic proposes allowing a system to deal with information from the real world with validity values between the true and false scale. Fuzzy logic manages to represent vague, incomplete or lack of information concepts to build heuristics capable of interpreting complex to define information [23].
Fuzzy logic is an extension of classical logic, therefore it can be adapted to everyday expressions that are used in the real world, and for example “it’s very high". This adaptation to natural language is due to the fact that each fuzzy set has a membership function related to each element [24, 25].
A type-1 fuzzy set represented by B is defined with a membership function in the universe X in a range of [0, 1], normally restricted to belonging to a family of contiguous membership functions μ
B
:⟶ [0,1]. The membership function of B is expressed by μ
B
(x) and is called the type-1 membership function [26]. In this case μ
B
(x) is the membership degree of element x ∈ X in set B. In Equation 1 we can find the mathematical representation of a type-1 fuzzy set [27].
Taking into account that the extension of classic sets to type-1 fuzzy sets comprises the membership of an element to a set, when this cannot be determined with a value of 0 or 1, then type-1 fuzzy sets are used. Similarly, when it is very difficult to determine the membership degree of an element in a type-1 fuzzy set, then type-2 fuzzy sets are used [28].
An interval type-2 fuzzy set that is expressed by
In the case of generalized type-2 fuzzy sets, the same logic is used as in type-1 fuzzy sets adding some complexity to its operations, in generalized type-2 fuzzy sets f
x
(u) is used through the vertical axis this due to the complexity shown in generalized type-2 fuzzy sets in comparison to the other fuzzy sets [29]. In this case we have the secondary membership
Galactic swarm optimization (GSO) is a metaheuristic algorithm presented by Muthiah-Nakarajan and Noel in 2016 that takes as inspiration the movement of stars and galaxies in the universe [14]. In the GSO algorithm the population is divided into subpopulations, where all the individuals of each subpopulation are attracted to the best individual, in this way a balance is maintained between the exploration and exploitation in the algorithm and therefore it has a good performance against complex problems [30].
This metaheuristic algorithm consists of two levels to perform its operation, at the first level in all subpopulations initially formed individuals are attracted to the best individual of each subpopulation, all this is done by calculating the velocity and position of individuals using particle swarm optimization (PSO).
Once the first level is completed, a super swarm is formed based on the best individuals of each of the subpopulations, then level 2 begins where the velocity and position of the individuals are calculated using the PSO algorithm until the best individual is found for the entire population [9].
The particle swarm optimization algorithm is a metaheuristic that uses bird behavior as inspiration, where each individual or particle has a velocity and position with which it moves along the established search space [31, 32]. Individuals in the real world have a small amount of inertia that keeps them where they moved, they also have an acceleration or change of velocity [33].
Level 1:
At this level, the main objective is to explore in all subpopulations or subswarms in parallel to obtain a better exploration of the solutions. Galactic swarm optimization begins its operation through iterations calculating the velocity and position of individuals with the expressions shown below [9]:
v(i) is the current velocity.
g(i) is the global best.
c1 and c2 are acceleration constants.
Wi is the inertia weight, r1 and r2 are obtained by the following expressions [14]:
K is the current iteration.
ri are random numbers obtained with a uniform distribution between – 1 and 1.
Level 2:
In the second level of the GSO algorithm the best individuals of each of the subpopulations form a super swarm, just as it was done in the first level the velocity and position of the individuals are calculated, but in this case the equations suffer some modifications as shown below:
p(i) is the personal best.
g is the global best.
c3 and c4 are the acceleration constants.
In galactic swarm optimization the movement of the sub-swarms in the first level is an exploratory phase and the second level is an exploitation phase. In this way the GSO algorithm alternates between an exploratory phase and an exploitation phase. Thus offering greater possibilities of finding optimal solutions.
Finding the appropriate parameter values of a metaheuristic algorithm can be a complex task. For this reason in recent years, fuzzy systems have been used to dynamically control the adjustment of the parameters and thus improve the performance of the metaheuristic algorithms. In this case we use galactic swarm optimization with dynamic adjustment of parameter, which is called as fuzzy galactic swarm optimization (FGSO).
The values recommended in the literature [25, 34] for the cognitive and social components used in the GSO algorithm are in the range of 0.5 to 2.5. In some previous papers, the use of the adaptation of parameters during the execution of the algorithms is recommended to improve their performance in the face of different complex optimization problems.
The main advantage of using parameter adjustment instead of fixed parameters is that the parameters are taking different values during the execution of the metaheuristic algorithm, so there is a greater variety and better solutions.
The design of optimal fuzzy controllers for complex plants is a difficult task since knowing all the components or characteristics of a plant is almost impossible to achieve. For this reason the use of fuzzy sets and the principles of fuzzy logic have been receiving increasing attention and their importance has been growing in recent years because they offer greater stability when simulating the processes to be controlled [35].
In the proposed approach we present the dynamic adjustment of parameters in galactic swarm optimization with the use of type-1, interval type-2 and generalized type-2 fuzzy systems with the aim of having a dynamic behavior in the parameters of the algorithm along the execution. In this particular case, it is proposed to use the parameter adjusting in the GSO algorithm and its application to optimize the ball and beam fuzzy controller, as shown in Fig. 1.

Proposed method.
The proposed approach for optimizing the ball and beam fuzzy controller is to generate the appropriate parameter values to build the membership functions of the fuzzy controller. All individuals in the GSO algorithm contain all the parameters to generate the controller membership functions expecting to obtain better control than the ones obtained with the original controller. Below we can find the flow chart to obtain the best RMSE and fuzzy controller after executing the GSO algorithm. In Fig. 3 we can observe the composition of the individuals in the algorithm [36].

Flowchart to obtain the best RMSE and fuzzy controller.

Individual composition.
The fuzzy system used in GSO to optimize the fuzzy controller consists of a fuzzy system with an input variable called “iteration” and two output variables c3 and c4 that represent the cognitive and social component respectively. Each of the used variables is partitioned into three triangular membership functions as shown below in Fig. 4.

FGSO Type-1 Fuzzy system.
For the design of the interval type-2 and generalized type-2 fuzzy systems, an extension of the type-1 fuzzy system shown in Fig. 4 was made using it as the basis for dynamic adaptation of parameters in the GSO algorithm. The resulting type-2 fuzzy logic systems are in Figs. 5 and 6 for interval type-2 and generalized type-2 fuzzy logic, respectively.

FGSO IT2 interval Type-2 Fuzzy system.

FGSO GT2 generalized Type-2 Fuzzy system.
As can be noted in the graphical description of the fuzzy systems, they are formed by triangular membership functions, then we show the equations that represent an interval type-2 triangular membership function and a generalized type-2 triangular membership function [37].
An interval type-2 triangular membership function is built with 6 parameters f1, s1, t1, f2, s2 and t2, where f1 < f2, s1 < s2 and t1 < t2 and is shown as follows:
In this case, f1, s1 and t1 are the parameters for the upper membership function and f2, s2 and t2 are the parameter for the lower membership function.
A generalized type-2 triangular membership function is built with 7 parameters f1, s1, t1, f2, s2, t2 and ρ where f1 < f2, s1 < s2 and t1 < t2 and is shown as follows [37, 38]:
In this case, f1, s1 and t1 are the parameters for the upper membership function and f2, s2 and t2 are the parameters for the lower membership function. Also ρ represents a fraction of the uncertainty in supporting the secondary membership function.
The expression used to define the “iteration” variable represents a percentage of the current iteration with respect to the total number of iterations established as shown below [39]:
The fuzzy rules of the fuzzy system used for dynamic adjustment of the parameters are the same ones used in the type-1 fuzzy system, which consist in achieving a balance between the exploration and exploitation of the algorithm while the iterations pass [40].
Fuzzy rules of the FGSO, FGSO IT2 and FGSO GT2 fuzzy systems: If (Iteration is Low) then (c3 is Low) and (c4 is High) If (Iteration is Medium) then (c3 is Medium) and (c4 is Medium) If (Iteration is High) then (c3 is High) and (c4 is Low)
Optimization and control problems usually require a very high computational cost, so given the shortage of time and resources, in recent years, different methods have emerged to deal with these types of problems, which have shown good performance at a relatively low cost.
The case study chosen to test the proposed approach of galactic swarm optimization with parameter adjustment using type-1 and type-2 fuzzy logic is the ball and beam fuzzy controller model, which consists in achieving the balance of a ball in a beam, where we are allowed to roll with a degree of freedom along the beam.
This model consists of an arm attached to the end of a beam and a servo gear attached to the other end. As the gear rotates at an angle of θ then the angle of the lever beam changes to α. Once the angle changes from horizontal position, the force of gravity causes the ball to roll along the beam. A fuzzy controller is used for this model where the ball can be manipulated. Below we can find in Fig. 7 the graphic description of this model [38].

Ball and Beam System.
The Lagrangian equation of motion for the ball is represented by the following expression:
The angle of the beam is α and can be expressed in terms of the θ angle which represents the angle of the gear as shown below:
The fuzzy system for the ball and beam controller consists of four inputs labeled r,

Ball and Beam Fuzzy System.
In Figs. 9, 10, 11 and 12 respectively we can find a graphical description of each of the input variables of the ball and beam fuzzy controller, which are granulated into two generalized bell membership functions.

r input.


Alfa input.

In a Takagi Sugeno system, the outputs are represented by linear functions, so for the case of the ball and beam controller, the output would be represented by 16 linear functions, which are shown below:
f1= 1.015r+ 2.234 r′–12.67α–4.046α′+ 0.02624
f2= 1.161r+ 1.969r′ –9.396α –6.165α′+ 0.474
f3= 1.506r+ 2.234r′– 12.99α – 1.865α′+ 1.426
f4= 0.7339r+ 1.969r′ – 9.381α – 4.688α′ – 0.8804
f5= 0.7343r+ 2.234 r′ – 12.85α – 6.11α′ – 1.034
f6= 1.413r+ 1.969 r′ – 9.485α – 6.592α′+ 1.159
f7= 1.225r+ 2.234 r′ – 12.8α – 3.929α′+ 0.3662
f8= 0.9853r+ 1.969r′ – 9.291α – 5.115α′ – 0.195
f9= 0.9853r+ 1.969 r′ – 9.292α – 5.115α′+ 0.195
f10= 1.225r+ 2.234 r′ – 12.8α – 3.929α′ – 0.3662
f11= 1.413r+ 1.969 r′ – 9.485α – 6.592α′ – 1.159
f12= 0.7343r+ 2.234 r′– 12.85α – 6.11α′+ 1.034
f13= 0.7339r+ 1.969r′– 9.381α– 4.688α′+ 0.8804
f14= 1.506r+ 2.234 r′ – 12.99α – 1.865α′ – 1.426
f15= 1.161r+ 1.969r′ – 9.396α – 6.165α′ – 0.474
f16= 1.015r+ 2.234 r′–12.67α–4.046α′ – 0.02624
The design of the rules of the fuzzy controller is devised with the objective of presenting a rule for each of the outputs and thus balancing the movement of the ball in the beam as shown below: If r is Small and If r is Small and If r is Small and If r is Small and If r is Small and If r is Small and If r is Small and If r is Small and If r is Large and If r is Large and If r is Large and If r is Large and If r is Large and If r is Large and If r is Large and If r is Large and
In Fig. 13 we can find the plant for the ball and beam fuzzy controller, where a fuzzy system is used to control the desired position of a ball in a beam.

Ball and beam plant.
As mentioned in the previous section, the case study used to test the proposed methodology in which type-1 and type-2 fuzzy logic is used to adjust the parameters of the GSO algorithm is the ball and beam system. The proposal is applied to the optimization of the fuzzy controller of the case study, which consists of generating the necessary parameter values to form a fuzzy controller as best as possible. In Table 1 we can find the parameters used to perform the optimization.
Parameters for GSO, FGSO, FGSO IT2 and FGSO GT2
Parameters for GSO, FGSO, FGSO IT2 and FGSO GT2
The nomenclature used in the Table is summarized as follows:
The results of the parameter optimization of the fuzzy controller are obtained by the fitness value of each individual, which is defined by the calculation of the root mean square error (RMSE) metric. The RMSE help us measure the behavior of the controller obtained by means of the GSO algorithm and the use of type-1 and type-2 fuzzy logic for the adjustment of parameters in the GSO algorithm. The expression of the mean square error is as shown below [35]:
In order to add more complexity to the plant used to test the optimized controllers, a percentage of noise (uniform random numbers) is added to the inputs of the plant system. The equation that expresses the noise that was applied is presented below:
Results of the optimization controller using the GSO algorithm
In Table 3 we can find the root mean square error (RMSE) values ordered from smallest to highest for 30 executions of the variant FGSO after controller optimization.
Results of the optimization controller using the FGSO variant
In Table 4 we can find the root mean square error (RMSE) values ordered from smallest to highest for 30 executions of the FGSO IT2 variant after controller optimization.
Results of the optimization controller using the FGSO IT2 variant
In Table 5 we can find the root mean square error (RMSE) values ordered from smallest to highest for 30 executions of the FGSO GT2 variant after controller optimization.
Results of the optimization controller using the FGSO GT2 variant
In Table 6 we can find the best, worst, average and standard deviation for 30 executions of the original GSO algorithm and variants FGSO, FGSO IT2 and FGSO GT2 after controller optimization.
Summary of results GSO, FGSO, FGSO IT2 and FGSO GT2
The averages of the results for each of the proposed methods are illustrated in Fig. 14.

Results for the ball and beam plant without noise.
In Table 7 we can find the mean square error (RMSE) values ordered from smallest to highest for 30 executions of the original GSO algorithm after optimization of the controller by applying 5% noise to the plant of the ball and beam system.
Results of the optimization controller using the GSO algorithm applying noise
In Table 8 we can find the mean square error (RMSE) values ordered from smallest to highest for 30 executions of the FGSO variant after optimization of the controller by applying 5% noise to the plant of the ball and beam system.
Results of the optimization controller using the FGSO variant applying noise
In Table 9 we can find the RMSE values ordered from smallest to highest for 30 executions of the FGSO IT2 variant after optimization of the controller by applying 5% noise to the plant of the ball and beam system. In Table 10 we can find the RMSE values ordered from smallest to highest for 30 executions of the FGSO GT2 variant after optimization of the controller by applying 5% noise to the plant.
Results of the optimization controller using the FGSO IT2 variant applying noise
Results of the optimization controller using the FGSO GT2 variant applying noise
In Table 11 we can find the best, worst, average and standard deviation for 30 executions of the original GSO algorithm and the FGSO, FGSO IT2 and FGSO GT2 variants after controller optimization by applying 5% noise to the plant of the ball and beam system. The averages of the results for each of the proposed methods are illustrated in Fig. 15.
Summary of results GSO, FGSO, FGSO IT2 and FGSO GT2 applying noise

Results for the ball and beam plant by applying 5% noise.
In order to provide a deeper analysis of the results obtained after the optimization of the parameters of fuzzy controller with the different variants of the proposed approach a statistical test was performed. The test is the statistical Z test and the parameters used in this case are those shown in Table 12:
Statistical Z test parameters
Statistical Z test parameters
The null hypothesis (H0) states that the average of the GSO algorithm and the FGSO, FGSO IT2 and FGSO GT2 variants (μ1) with 5% noise is greater than or equal to the average of the GSO algorithm and the FGSO, FGSO IT2 and FGSO GT2 variants (μ2) without applying noise to the plant. The alternative hypothesis (Ha) states that the average of the GSO algorithm and the FGSO, FGSO IT2 and FGSO GT2 variants (μ1) with 5% noise is less than the average of the FGSO, FGSO IT2 and FGSO GT2 variants (μ2) without applying noise to the plant of the ball and beam system.
Table 13 shows the averages, standard deviations and values of z for each of the comparisons made, where the GSO algorithm and the FGSO, FGSO IT2 and FGSO GT2 variants (μ1) with 5% noise obtains significant evidence against the FGSO, FGSO IT2 and FGSO GT2 variants (μ2) without applying noise to the plant. 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.
Results of Z-test for the ball and beam fuzzy controller
After performing the statistical tests among the variants of the proposed approach and observing that there is a good performance, a statistical test is carried out between our variants and the variants presented in [38] that also deal with the ball and beam fuzzy controller. The parameters shown in Table 12 are the same used to perform the statistical test.
Table 14 shows the average, standard deviation and values of z for the statistical test performed between our proposed approach (μ1) and the Harmony search (HS) algorithm variants (μ2), where in five of the six cases it is possible to obtain significant evidence, with a 95% level of significance and a rejection zone for values less than – 1,645, thus showing that our methods are better.
Results of Z-test for our proposal and the FHS method
In this paper, we proposed an approach for the dynamic adjustment of parameters in galactic swarm optimization, where type-1, interval type-2 and generalized type-2 fuzzy systems are used, and this approach was tested with the optimization of the ball and beam fuzzy controller.
To validate the proposed method, a statistical test was carried out among the variants presented in Section 5, where they were tested by simulating the original plant of the controller and adding a level of disturbance. A statistical test was also carried out with respect to the Harmony Search Algorithm with the objective of observing the performance of our proposal against other metaheuristics that have been applied to the same case study of the ball and beam fuzzy controller.
After analyzing the results, we can conclude that the proposed method for augmenting the GSO algorithm with parameter adjustment using type-1 and type-2 fuzzy logic shows good performance in control problems, specifically when applied to the optimization of the ball and beam fuzzy controller.
We can conclude that the proposed approach was good because in the comparison made among the variants, the approach obtains good results either when a noise level was applied or without applying noise to the plant. In addition, in the comparison made against the harmony search algorithm, significant improvements are achieved in 5 of six cases that were compared. This is based on the results presented in Tables 13 and 14.
Galactic swarm optimization has proven to be a metaheuristic that can offer good performance in the face of control problems. As future work we envision testing the approach with different control problems expecting to also have encouraging results.
