Fuzzy Logic Controller Parameter Optimization Using Metaheuristic Cuckoo Search Algorithm for a Magnetic Levitation System

: The main beneﬁts of fuzzy logic control (FLC) allow a qualitative knowledge of the desired system’s behavior to be included as IF-THEN linguistic rules for the control of dynamical systems where either an analytic model is not available or is too complex due, for instance, to the presence of nonlinear terms. The computational structure requires the deﬁnition of the FLC parameters namely, membership functions (MF) and a rule base (RB) deﬁning the desired control policy. However, the optimization of the FLC parameters is generally carried out by means of a trial and error procedure or, more recently by using metaheuristic nature-inspired algorithms, for instance, particle swarm optimization, genetic algorithms, ant colony optimization, cuckoo search, etc. In this regard, the cuckoo search (CS) algorithm as one of the most promising and relatively recent developed nature-inspired algorithms, has been used to optimize FLC parameters in a limited variety of applications to determine the optimum FLC parameters of only the MF but not to the RB, as an extensive search in the literature has shown. In this paper, an optimization procedure based on the CS algorithm is presented to optimize all the parameters of the FLC, including the RB, and it is applied to a nonlinear magnetic levitation system. Comparative simulation results are provided to validate the features improvement of such an approach which can be extended to other FLC based control systems.


Introduction
Most problems in the real world are often very challenging to solve, and many applications have to deal with non-deterministic polynomial-time hard (i.e., NP-hard) problems.To solve these problems, Appl.Sci.2019, 9, 2458; doi:10.3390/app9122458www.mdpi.com/journal/applscian optimization tool can be used even if there is no guarantee that the optimal solution can be obtained, techniques such as trial and error methods may help to find "acceptable solutions" [1,2].In this regard, researchers have focused their efforts on developing algorithms capable of solving these problems in a more efficient manner.Real-life applications found in engineering, business activities, industrial designs, statistics, decision making, optimal control, machine learning, etc., require optimization of (a set of) objective functions that can be anything, for example, minimization of energy consumption and costs, maximization of profit, output, performance, and efficiency, of a global optimization problem [3,4].Moreover, optimization can be defined as a field of science in which the values of parameters of the problem are explored under specified conditions (constraints) in order to find those particular values which enable an objective or set of objective functions to generate the minimum or maximum value [5,6].
In general, an optimization problem can be formulated in terms of a correctly defined cost/objective function in which all the objectives of optimization related to the problem are involved.Moreover, if any predefined constraints are to be used with respect of the parameters of the related problem, these should be considered during the design of the optimization problem and its corresponding cost/objective function [7].
Like almost all nature-inspired algorithms, the CS algorithm can be referred to as a meta-heuristic algorithm with two important features that make it so efficient at solving optimization problems, one is intensification or exploitation and the other is diversification or exploration.Intensification refers to focus on the search in a local region by exploiting information when a good solution has been found while diversification means the generation of diverse solutions far enough from good solutions to explore the search space on the global scale more efficiently [2,3,7,29,32,33].
On the other hand, in contrast to classical control theory that has been successful in controlling well defined deterministic systems, many engineering problems require more sophisticated control techniques due to the presence of strong non-linearities, embedded in a changing environment with uncertainty, or are difficult to model [34].Fuzzy logic control (FLC) technique provides a formal methodology to represent, manipulate, compute and incorporate human intelligence directly into automatic control systems [34,35] offering potential advantages over conventional control schemes in less dependency on quantitative models, natural decision making, learning capability, a greater degree of autonomy, ease of implementation, and a friendly user interface [34,[36][37][38][39].By using the linguistic approach provided by the fuzzy theory [40], human knowledge about the system to be controlled can be integrated into control theory [41].
An analysis of the literature about FLC parameter optimization using nature-inspired CS algorithm reveals some works which will be briefly described next.In [8] CS is used to adjust the shape of the controller's triangular and trapezoidal MF for the energy management of a hybrid power system.In [42] an image edge detection system based on a type-2 fuzzy is optimized by adjusting the shape of Gaussian MF.In [43], CS is used to adjust the shape of the fuzzy controller for liquid level control.In [11], a modified CS is used to tune MF's positions of an FLC for a stationary battery storage system.
In this regard, the objective of this paper is to propose a methodology to optimize FLC parameters which involve not only the MF's positions but also the RB, which is the novelty of the presented approach, using for this purpose the CS algorithm.This procedure can be applied to any problem which involves a system where this control technique is required.The CS is applied to a FLC to achieve a better performance in comparison to conventional design and according to some predefined objectives.Referring to the magnetic levitation system (MLS), these objectives are steady-state vertical position, maximum overshoot, and settling time.
Based on the aim discussed above, the major contribution of this research is the new methodology for FLC parameter optimization using CS, including the RB as another degree of freedom, in such a way that a better solution for the problem to optimize is more feasible to achieve.
This paper is organized as follows: The mathematical model of the MLS system is detailed in Section 2. In Section 3, The FLC design to control the MLS is presented.This FLC optimization procedure using the CS algorithm is given in Section 4, with a detailed description of the algorithm used.Finally, the simulation results and discussions are presented in Section 5.

Magnetic Levitation System Modeling
A magnetic levitator is a system formed by electromagnets that allow ferromagnetic objects to remain in the air by means of a strong magnetic field opposite and equal to gravity.According to [44], the model of the MLS systems using differential equations is described as follows: i = where r [0, 0.016] (m) is the vertical position range of the object according to [44], v the velocity, i the current, and f i (r) is the electromagnet's inductance as function of the distance r.The other parameters that define the mathematical model of the MLS are: k i , c i are constants that determine the static characteristic of the current i versus the control signal u, F emP1 and F emP2 are constants for the electromagnetic force F em calculation, f iP1 and f iP2 are constants to determine the inductance value f i (x i ), and, u represents the control signal.These equations include strong non-linearities and the control can be analytically designed either by a linearization approach, thus not dealing with large signal perturbations, or eventually by using complex nonlinear techniques.
For simulation purposes, a Simulink model representing-and the parameters defined in [44], has been implemented.Both, the control system structure and the Simulink representation of the MLS real model are illustrated in Figures 1 and 2, respectively.

Fuzzy Logic Controller Design
Due to the non-linear dynamics presented by the MLS [44], FLC is applied for maintaining a ferromagnetic sphere at a specific vertical position r, providing two advantages: A simple and robust non-linear control system and, an easy to implement controller since it is based on the linguistic description of the global system behavior [8].The FLC consists of three main modules: The fuzzification process module which takes the inputs to the controller and produces a degree of membership for each fuzzy set in the membership function, the inference engine which takes these fuzzy set memberships and determines which rules should be evaluated, and the defuzzification process which takes the output values from the inference mechanism and translates them into an output dispatch signal [8,35,38,39].Mamdani-based inference and defuzzification of the center of gravity are used in this paper.
A simple proportional-derivative (P-D) FLC type is chosen.The first input of the FLC is the position error, which represents the error between the desired sphere height and the actual sphere height.The second input of the FLC is the derivative of error, which indicates whether a positive/negative variation of the position is progressing or not.The controller will use this information to decide whether a high/low control action is needed to accomplish a predefined group of performance parameters or not.The output of the FLC is the control signal, which represents the control signal injected to the electromagnet of the MLS.The controller will use this information to decide a higher/lower control signal according to the value of its input.

Fuzzy Logic Controller Design
Due to the non-linear dynamics presented by the MLS [44], FLC is applied for maintaining a ferromagnetic sphere at a specific vertical position r, providing two advantages: A simple and robust non-linear control system and, an easy to implement controller since it is based on the linguistic description of the global system behavior [8].The FLC consists of three main modules: The fuzzification process module which takes the inputs to the controller and produces a degree of membership for each fuzzy set in the membership function, the inference engine which takes these fuzzy set memberships and determines which rules should be evaluated, and the defuzzification process which takes the output values from the inference mechanism and translates them into an output dispatch signal [8,35,38,39].Mamdani-based inference and defuzzification of the center of gravity are used in this paper.
A simple proportional-derivative (P-D) FLC type is chosen.The first input of the FLC is the position error, which represents the error between the desired sphere height and the actual sphere height.The second input of the FLC is the derivative of error, which indicates whether a positive/negative variation of the position is progressing or not.The controller will use this information to decide whether a high/low control action is needed to accomplish a predefined group of performance parameters or not.The output of the FLC is the control signal, which represents the control signal injected to the electromagnet of the MLS.The controller will use this information to decide a higher/lower control signal according to the value of its input.

Fuzzy Logic Controller Design
Due to the non-linear dynamics presented by the MLS [44], FLC is applied for maintaining a ferromagnetic sphere at a specific vertical position r, providing two advantages: A simple and robust non-linear control system and, an easy to implement controller since it is based on the linguistic description of the global system behavior [8].The FLC consists of three main modules: The fuzzification process module which takes the inputs to the controller and produces a degree of membership for each fuzzy set in the membership function, the inference engine which takes these fuzzy set memberships and determines which rules should be evaluated, and the defuzzification process which takes the output values from the inference mechanism and translates them into an output dispatch signal [8,35,38,39].Mamdani-based inference and defuzzification of the center of gravity are used in this paper.
A simple proportional-derivative (P-D) FLC type is chosen.The first input of the FLC is the position error, which represents the error between the desired sphere height and the actual sphere height.The second input of the FLC is the derivative of error, which indicates whether a positive/negative variation of the position is progressing or not.The controller will use this information to decide whether a high/low control action is needed to accomplish a predefined group of performance parameters or not.The output of the FLC is the control signal, which represents the control signal injected to the electromagnet of the MLS.The controller will use this information to decide a higher/lower control signal according to the value of its input.
The MF used for input and output data are shown in Figure 3 and the rules to be evaluated are given in Table 1, leading to a simple 25 rules FLC to reduce the controller computational complexity and facilitate a subsequent implementation.At the beginning, following a current preset practice of the FLC parameters, five triangular MF, uniformly distributed, are assigned to the FLC inputs and output, whereas the initial RB is defined according to the heuristic knowledge of the MLS performance and corresponds to a standard P-D based FLC.
Appl.Sci.2019, 9, x 5 of 15 The MF used for input and output data are shown in Figure 3 and the rules to be evaluated are given in Table 1, leading to a simple 25 rules FLC to reduce the controller computational complexity and facilitate a subsequent implementation.At the beginning, following a current preset practice of the FLC parameters, five triangular MF, uniformly distributed, are assigned to the FLC inputs and output, whereas the initial RB is defined according to the heuristic knowledge of the MLS performance and corresponds to a standard P-D based FLC.Table 1.Fuzzy logic initial rules for magnetic levitation system (MLS) control.

Derivative of error NB PB PB PS PS ZE NS PB PS PS ZE NS ZE PS PS ZE NS NS PS PS ZE NS NS NB PB ZE NS NS NB NB
For MF, "NB" represents the "Negative Big" fuzzy set, "NS" represents the "Negative Small" fuzzy set, "ZE" represents the "Zero" fuzzy set, "PS" represents the "Positive Small" fuzzy set and "PB" represents the "Positive Big" fuzzy set.
The CS algorithm used to optimize the MF for the input and output and the RB of the FLC are discussed next.For MF, "NB" represents the "Negative Big" fuzzy set, "NS" represents the "Negative Small" fuzzy set, "ZE" represents the "Zero" fuzzy set, "PS" represents the "Positive Small" fuzzy set and "PB" represents the "Positive Big" fuzzy set.

Degree of Membership
The CS algorithm used to optimize the MF for the input and output and the RB of the FLC are discussed next.

Fuzzy Logic Controller Parameter Optimization Using Cuckoo Search Algorithm
The CS algorithm is one of the newest developed nature-inspired metaheuristic algorithms and it is inspired in the obligate brood parasitism behavior of some cuckoo bird species which lay their own eggs in nests of other birds [3,29,45].If host birds realize that a cuckoo laid an egg in their nests, they will either remove the egg from the nest or just abandon it and build a new one.In this regard, some cuckoo species have developed skills to imitate patterns and colors of specific host bird's species increasing the probability of a cuckoo egg to survive [3,29,46].
The simplest approach of using new metaheuristic CS algorithm can be done through three ideal rules [3,29,47], which are: Each cuckoo lays one egg at a time and dumps it in a randomly chosen nest.Each egg represents a solution.The best nests with high quality of eggs (i.e., better solutions) will carry over to the next generations.Additionally, the number of available host nests (i.e., number of solutions per generation) is fixed and the egg laid by a cuckoo is discovered by the host bird with a probability, p a ∈ [0, 1].In general terms, CS is used to minimize/maximize an objective function, O (X), where X is a candidate solution of dimension, d, selected from a population of length, n.It is worth to remark that terms such as egg, nest, and solution represent the same in the context of the present study.
In short, CS algorithm involves two phases: At first, the initial random population is created and then, CS goes into an iterative process where two random walks, Lévy flights, and biased/selective random walk, are used to search for new solutions within the boundaries of the search space according to the problem restrictions.CS selects the best solution obtained in every iterative process according to the objective function value [3,29,48].A detailed description of the different phases of the algorithm and its application for the optimization of the FLC described in Section 3 is exposed next and is illustrated in Figure 4.

Initialization
In the initialization phase, the CS algorithm initializes a set of solutions which are randomly sampled from the search space.For this purpose, the dimension of the solution and the length of the population must be defined.
The dimension of the solution, d, is defined according to the total number of parameters to optimize.In accordance with the FLC designed in Section 3, these parameters are related to the MF's mapping and the RB.In this regard, both inputs (i.e., position error and derivative of error) and output (i.e., control signal) comprise five fuzzy sets and eleven parameters (since every fuzzy set is represented by a membership function of three variable positions except for both located at the maximum and minimum universe of discourse limits that have two fixed positions and one variable) whereas the RB includes twenty-five parameters.Considering all these values, each solution is represented with d = 58 parameters.The length of the population is fixed and a value of n = 25 is sufficient according to the literature [3].In this regard, the initial random population is formulated as a n x d matrix where every row is a candidate solution of dimension d.
In order to preserve some order and symmetry in comparison with the MF's mapping and RB distribution, every initial random solution conforming the initial random population, is generated according to the initial parameter distribution presented in Figure 3 and Table 1, as follows: where X MFi represents a candidate initial solution for the MF's mapping sampled randomly from the search space which is limited according to the problem restrictions (i.e., inputs and output range values of FLC designed in Section 3) and of dimension equal to the total number of MF parameters to optimize, X MF(I) represents initial membership function's parameters according to Figure 3, R is a set of displacements constituted of three different subsets that correspond to vectors of random numbers drawn from a uniform distribution where R Inp , R Inp, and R Out are the defined range for every input/output variable, respectively, and a design value of 5% has been defined with the aim that randomly generated solutions result rather similar to initial distributed ones (Figure 3), X RBi represents a candidate initial solution for the RB sampled randomly from the search space which is limited according to the problem restrictions (i.e., linguistic labels corresponding to fuzzy sets whose MF are depicted in Figure 3) and of dimension equal to the total number of RB parameters to optimize, X RB(I) represents initial RB parameters according to Table 1, U (−1, 1) is a set of integer rule-base displacements drawn from a uniform distribution, and X Gi is a candidate initial solution (nest) comprising of X MFi and X RBi at an initial generation G i .
Appl.Sci.2019, 9, x 7 of 15 values of FLC designed in Section 3) and of dimension equal to the total number of MF parameters to optimize, XMF(I) represents initial membership function's parameters according to Figure 3, R is a set of displacements constituted of three different subsets that correspond to vectors of random numbers drawn from a uniform distribution where RInp, RInp, and ROut are the defined range for every input/output variable, respectively, and a design value of 5% has been defined with the aim that randomly generated solutions result rather similar to initial distributed ones (Figure 3), XRBi represents a candidate initial solution for the RB sampled randomly from the search space which is limited according to the problem restrictions (i.e., linguistic labels corresponding to fuzzy sets whose MF are depicted in Figure 3) and of dimension equal to the total number of RB parameters to optimize, XRB(I) represents initial RB parameters according to Once the initial random population is created, the CS algorithm evaluates every candidate solution, so the best ones obtained a pass to the next generations.It is worth pointing out that, during a minimization/maximation process, the 'selection of best' step results crucial so the best solution according to problem's objectives of optimization can be obtained at the end of the algorithm.

Lévy Flights Random Walk
After the initialization and with the information that possible good solutions were obtained in a previous generation, CS starts an intensification (local search) process so that better solutions can Once the initial random population is created, the CS algorithm evaluates every candidate solution, so the best ones obtained a pass to the next generations.It is worth pointing out that, during a minimization/maximation process, the 'selection of best' step results crucial so the best solution according to problem's objectives of optimization can be obtained at the end of the algorithm.

Lévy Flights Random Walk
After the initialization and with the information that possible good solutions were obtained in a previous generation, CS starts an intensification (local search) process so that better solutions can be obtained.CS intensification is carried out using a Lévy flights random walk with a step-size drawn from a Lévy distribution that is characterized by its infinite mean and variance, enabling CS to explore the search space more efficiently than other algorithms that use a standard Gaussian process.At a generation G > 0, a new solution is generated using a random walk according to the following expression [3,29]: where X MF(G + 1) is a candidate new solution for MF's parameters obtained after the intensification process, X MF(G) is a candidate solution at a previous generation G selected from the cuckoo population, α > 0 is a set of step-sizes that are related to the scale of the problem [3,29], Lévy(β) is a set of random numbers drawn from a Lévy distribution, X MF(best) is the best solution for MF's parameters obtained so far in the iterative process and together with RB parameters, better optimizes the objective function, and α 0 is a scaling factor that generally is fixed and set to 0.001 or 0.1 although a varying scaling factor has shown better performance for most optimization problems [48].In the present work, a varying scaling factor drawn from a uniform distribution is employed and formulated as follows: In the implementation, Lévy flights are calculated via the so-called Mantegna's algorithm for a symmetric Lévy stable distribution, as follows [3,29].
where β = 1.5 is the constant of the Lévy distribution [3], w and v are random numbers drawn from a normal distribution with zero mean and unit standard deviation, and Γ is the gamma function [3,29,49].
It is worth pointing out that the aforementioned procedure is applied only to generate new solutions for the MF's mapping.Therefore, new solutions for the RB are calculated as follows.
where X RB(G + 1) is a candidate new solution for RB parameters obtained after the intensification process, X RB(G) is a candidate solution at a previous generation G selected from the cuckoo population, S is set of integer numbers drawn from a normal standard distribution N (0, 1) to displace the RB values, and X RB(best) is the best solution for RB parameters obtained so far in the iterative process and together with membership function's parameters, better optimizes the objective function.
It is worth pointing out that intensification is applied to every solution of the population and a solution is replaced by another one or carried through the next generations, according to the following expression: where O (X) is the objective of optimization function, and X G /X G+1 are candidate solutions comprising of X MF(G) /X MF(G+1) and X RB(G) /X RB(G+1) , respectively.

Biased/selective Random Walk
In this step, new solutions far enough from the current best solutions are discovered by using far-field randomization [29].First, a random probability value of pa ∈ [0, 1] is assigned to every solution in the cuckoo population after the intensification process and then biased/selective random walk is implemented if the individual solution's assigned probability fits the condition p a ≤ 0.25.In this regard, a trial solution is built using a mutation of a candidate solution selected from the population and a differential step size from two stochastically selected solutions and then, a new solution is generated by a crossover operator from the candidate current solution and the trial solutions [48].This procedure is formulated as follows: p a > 0.25 (17) where X G + 1 is a candidate new solution for MF and RB parameters obtained after the diversification process, X G is a candidate solution at a previous generation G selected from the cuckoo population after the intensification process, p and q are random indexes so X p(G) and X q(G) are randomly selected solutions from de cuckoo population, r ~U (0, 1) is a random number drawn from a uniform distribution, and p a = 0.25 is the solution discovery rate used for most optimization problems according to the literature [3,48,50].It is worth pointing out that with a value of p a = 0.25, the global search is slightly intensive with about 1/4 of the search time, while local search takes about 3/4 of the total search time.However, this parameter can be modified depending on the application to increase the probability to find an optimum solution globally or locally [8].

Results and Discussion
Tuning procedure of fuzzy design variables using the CS algorithm presented in this paper permitted not only to eliminate the requirement of expertise needed for setting these variables but also to obtain an accurate FLC that enables MLS to perform according to a sort of pre-defined parameters.The CS algorithm used MLS modeling to simulate the real performance of the system with an 8 mm height set point and tuned the FLC according to MLS desired performance parameters.In this regard, the typical parameters of a second-order linear system are overshoot, settling time and steady-state output value.Overshoot represents the maximum response value (extremum), whereas settling time is the time elapsed until the system response remains bounded around the set point tolerance usually between ± 5%.The objective function and a minimum tolerance value as a finishing condition of the optimization process, were defined as: where %M p,D is the desired percentage overshoot, %M p is the actual percentage overshoot, t s,D is the desired settling time, t s is the actual settling time, r ss,D is the desired final position, e ss is the actual final position, and α x is the weight of each component.Note that α 1 = α 2 = α 3 = 1 are used in this paper to prioritize the minimization of every objective equally.In this regard, the aim is to minimize the deviation of every performance parameter from its respective goal.For purposes of comparison, both optimization procedures: For MF and RB, and with only MF have been implemented.On one hand, the optimization process of MF and RB took approximately 8 h on an Intel(R) Core(TM) i7-4510U CPU (2.00GHz) 12 GB of RAM computer using Matlab ® program (Matlab 2016b, MathWorks ® , Natick, MA, USA, 2016), whereas most of the computation time is spent on solving the 40 iterations required to reach the optimum solution that minimizes the objective function according to the problem restrictions.On the other hand, the optimization process of only MF took approximately 12 h on in the same simulation platform, whereas most of the computation time is spent for solving the 60 iterations required to reach the optimum solution that minimizes the objective function according to the problem restrictions.In this regard, Figure 5 illustrates the average objective function convergence for ten runs of each algorithm showing that optimizing MF and RB may lead to a faster convergence speed of the optimization process.
For purposes of comparison, both optimization procedures: For MF and RB, and with only MF have been implemented.On one hand, the optimization process of MF and RB took approximately 8 h on an Intel(R) Core(TM) i7-4510U CPU (2.00GHz) 12 GB of RAM computer using Matlab ® program (Matlab 2016b, MathWorks ® , Natick, MA, USA, 2016), whereas most of the computation time is spent on solving the 40 iterations required to reach the optimum solution that minimizes the objective function according to the problem restrictions.On the other hand, the optimization process of only MF took approximately 12 h on in the same simulation platform, whereas most of the computation time is spent for solving the 60 iterations required to reach the optimum solution that minimizes the objective function according to the problem restrictions.In this regard, Figure 5 illustrates the average objective function convergence for ten runs of each algorithm showing that optimizing MF and RB may lead to a faster convergence speed of the optimization process.In Figure 6, the optimal fuzzy MF encountered by the optimization algorithm are superimposed over non-optimized MF.The optimized MF maintain order and coherency with regards to the initial distribution illustrated in Figure 3, which was one of the primary objectives.Furthermore, as is shown in Table 2, the optimized RB distribution has been displaced in comparison to the initial RB shown in Table 1.In Figure 6, the optimal fuzzy MF encountered by the optimization algorithm are superimposed over non-optimized MF.The optimized MF maintain order and coherency with regards to the initial distribution illustrated in Figure 3, which was one of the primary objectives.Furthermore, as is shown in Table 2, the optimized RB distribution has been displaced in comparison to the initial RB shown in Table 1.
objective function according to the problem restrictions.On the other hand, the optimization process of only MF took approximately 12 h on in the same simulation platform, whereas most of the computation time is spent for solving the 60 iterations required to reach the optimum solution that minimizes the objective function according to the problem restrictions.In this regard, Figure 5 illustrates the average objective function convergence for ten runs of each algorithm showing that optimizing MF and RB may lead to a faster convergence speed of the optimization process.In Figure 6, the optimal fuzzy MF encountered by the optimization algorithm are superimposed over non-optimized MF.The optimized MF maintain order and coherency with regards to the initial distribution illustrated in Figure 3, which was one of the primary objectives.Furthermore, as is shown in Table 2, the optimized RB distribution has been displaced in comparison to the initial RB shown in Table 1.As aforementioned, FLC is tuned using CS to enable MLS to accomplish a specific settling time, overshoot, and steady-state vertical position.Moreover, MLS performance with optimized FLC can be compared with linear controllers designed from the system's linearized model around the desired steady-state.For this purpose, and in order to fulfill as close as possible the required performance parameters, full-state feedback controller referred to as "state-space (SS) controller" has also been designed.In this concern, it should be pointed out that, instead of the FLC which only needs to sense the position of the sphere, the SS controller should also require sensing both the velocity and the electrical current.
It is worth pointing out that the main reason to optimize both the RB and the MF's mapping is to reach the optimal minimum of the objective function given by the overall FLC processing in comparison to an only MF's parameter optimization procedure, as in [8,11,42,43].In this regard, both optimization procedures (i.e., MFs and RB optimization and only MFs optimization) have been applied to the FLC of the MLS (MLS-FLC).The obtained solutions of the aforementioned optimization procedures are compared with the MLS using a non-optimized FLC and the MLS with a full state feedback controller in terms of MLS' performance parameters.MLS real model representation described in Section 2 is used for simulations.As aforementioned, FLC is tuned using CS to enable MLS to accomplish a specific settling time, overshoot, and steady-state vertical position.Moreover, MLS performance with optimized FLC can be compared with linear controllers designed from the system's linearized model around the desired steady-state.For this purpose, and in order to fulfill as close as possible the required performance parameters, full-state feedback controller referred to as "state-space (SS) controller" has also been designed.In this concern, it should be pointed out that, instead of the FLC which only needs to sense the position of the sphere, the SS controller should also require sensing both the velocity and the electrical current.
It is worth pointing out that the main reason to optimize both the RB and the MF's mapping is to reach the optimal minimum of the objective function given by the overall FLC processing in comparison to an only MF's parameter optimization procedure, as in [8,11,42,43].In this regard, both optimization procedures (i.e., MFs and RB optimization and only MFs optimization) have been applied to the FLC of the MLS (MLS-FLC).The obtained solutions of the aforementioned optimization procedures are compared with the MLS using a non-optimized FLC and the MLS with a full state feedback controller in terms of MLS' performance parameters.MLS real model representation described in Section 2 is used for simulations.
The objective of optimization was to accomplish a specific set of performance parameters for MLS (i.e., %M p,D = 5%, t s,D = 0.5 s, r ss,D = 0.008 m) by minimizing the objective function defined by (18).MF and RB optimization optimum solution shows a smaller deviation value of every defined goal in comparison with an only MF optimization.Both optimization procedures' results are also compared with the performance of MLS with a SS controller.In this regard, according to resulting values listed in Table 3, MF and RB optimization proposed in this paper converges to a better solution which results in a set of slightly better performance parameters in comparison with only MF optimization and the results are close to the ones obtained using an analytic design approach (i.e., full state feedback controller).Furthermore, simulation results comparison is shown in Figure 7.
comparison to an only MF's parameter optimization procedure, as in [8,11,42,43].In this regard, both optimization procedures (i.e., MFs and RB optimization and only MFs optimization) have been applied to the FLC of the MLS (MLS-FLC).The obtained solutions of the aforementioned optimization procedures are compared with the MLS using a non-optimized FLC and the MLS with a full state feedback controller in terms of MLS' performance parameters.MLS real model representation described in Section 2 is used for simulations.The objective of optimization was to accomplish a specific set of performance parameters for MLS (i.e., %Mp,D = 5%, ts,D = 0.5 s, rss,D = 0.008 m) by minimizing the objective function defined by (18) .MF and RB optimization optimum solution shows a smaller deviation value of every defined goal in comparison with an only MF optimization.Both optimization procedures' results are also compared with the performance of MLS with a SS controller.In this regard, according to resulting values listed in Table 3, MF and RB optimization proposed in this paper converges to a better solution which results in a set of slightly better performance parameters in comparison with only MF optimization and the results are close to the ones obtained using an analytic design approach (i.e., full state feedback controller).Furthermore, simulation results comparison is shown in Figure 7.   Table 4 presents the objective function values in terms of MLS performance parameters for the MF and RB optimized FLC, the MF optimized FLC, and the SS controller.Notice that the objective global optimum value obtained with the MF and RB optimization is approximately half the obtained value with only MF optimization and closer to the SS controller approach, being a better solution the one with its objective function value closer to zero.It is worth pointing out that the analytic design of any classic or modern controller for a non-linear system (i.e., MLS) either by a linearization approach, thus not dealing with large signal perturbations, or eventually by using complex nonlinear techniques, requires a certain level of expertise for system parameter identification and the development of complex system modeling, resulting in a long implementation time.Consequently, by using the presented approach, these requirements are not completely necessary to obtain similar results than other complex control techniques.

Conclusions
A procedure for optimizing the parameters of an FLC by means of cuckoo search algorithm has been presented in this paper.The main advantage of this approach is that little or no expertise for tuning FLC parameters is needed since by using CS as an optimization algorithm, a global convergence to the optimum FLC according to the objective function is assured.An initial symmetrically defined set of MF and RB has been required to obtain an optimum FLC with order and coherency of parameters.By tuning the FLC MF's mapping and RB distribution, the proposed approach has successfully reached the optimization objectives such as settling time, overshoot and steady-state vertical position for an FLC-MLS.The obtained results have highlighted that the proposed algorithm can be applied to any system where the FLC technique is used, to optimize an objective function involving several system parameters.
Current work is focused on applying the presented algorithm to improve the performance of a fuzzy-based energy management strategy for a residential grid-connected microgrid considering energy state forecasting, peak shaving, and demand management.

Figure 1 .
Figure 1.Control system structure for magnetic levitation system (MLS) using fuzzy logic control (FLC).

Figure 1 .
Figure 1.Control system structure for magnetic levitation system (MLS) using fuzzy logic control (FLC).

Figure 1 .
Figure 1.Control system structure for magnetic levitation system (MLS) using fuzzy logic control (FLC).

Figure 4 .
Figure 4. Flowchart of the optimization process.

Figure 6 .
Figure 6.Optimized and non-optimized MF used for inputs and output data: (a) Position error (input), (b) derivative of error (input), (c) control signal (output).

Table 2 .
Fuzzy Logic optimized rule base (RB) for MLS control.Control Signal Position Error NB NS ZE PS PB Derivative of error NB PB PB PB PS PS NS PB ZE PS NS NB ZE ZE NS NS NS NB PS NB NS NB NB NB PB NB NS NB NB NB

Figure 6 .
Figure 6.Optimized and non-optimized MF used for inputs and output data: (a) Position error (input), (b) derivative of error (input), (c) control signal (output).

Figure 7 .
Figure 7. Fuzzy logic control of the MLS (MLS-FLC) with only MF's positions optimized, with membership function (MF) and rule base (RB) optimized, non-optimized and MLS with state-space (SS) controller step response: (a) Steady-state response, (b) dynamic response.

Figure 7 .
Figure 7. Fuzzy logic control of the MLS (MLS-FLC) with only MF's positions optimized, with membership function (MF) and rule base (RB) optimized, non-optimized and MLS with state-space (SS) controller step response: (a) Steady-state response, (b) dynamic response.

Table 1 .
Fuzzy logic initial rules for magnetic levitation system (MLS) control.

Table 1 ,
U (−1, 1) is a set of integer rule-base displacements drawn from a uniform distribution, and XGi is a candidate initial solution (nest) comprising of XMFi and XRBi at an initial generation Gi.
YesEndFigure 4. Flowchart of the optimization process.

Table 2 .
Fuzzy Logic optimized rule base (RB) for MLS control.

Table 3 .
Comparison results for the non-optimized fuzzy logic control (FLC), the optimized FLC, and the state-space (SS) controller.

Table 4 .
Objective function values comparison.

Table 3 .
Comparison results for the non-optimized fuzzy logic control (FLC), the optimized FLC, and the state-space (SS) controller.

Table 4 .
Objective function values comparison.