1. 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, an 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].
During the last decades, meta-heuristic nature-inspired algorithms have been given special attention due to their great capability in solving optimization problems in a wide range of applications such as operation and control of electric power systems [
8,
9,
10,
11,
12], chemical processes [
13,
14,
15], job scheduling [
16,
17,
18], vehicle routing [
19,
20], autonomous vehicles control [
21], mobile networking [
22,
23], multi-objective optimization [
24,
25,
26], image processing [
27], etc. Some of these algorithms found in the literature are cuckoo search, bat algorithm, particle swarm optimization, firefly algorithm, ant algorithms, genetic algorithm, differential evolution, etc. However, recent studies have shown that cuckoo search (CS) is potentially more efficient than other algorithms in solving optimization problems in terms of better-obtained solutions [
8], its well-balanced intensification/diversification search strategies [
3,
28,
29,
30], robustness and precision of obtained results [
7], and faster convergence speed [
31].
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.
2. 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:
where
r ϵ [0, 0.016] (
m) is the vertical position range of the object according to [
44],
v the velocity,
i the current, and
fi (
r) is the electromagnet’s inductance as function of the distance
r. The other parameters that define the mathematical model of the MLS are:
ki,
ci are constants that determine the static characteristic of the current
i versus the control signal
u,
FemP1 and
FemP2 are constants for the electromagnetic force
Fem calculation,
fiP1 and
fiP2 are constants to determine the inductance value
fi (
xi), 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
Figure 1 and
Figure 2, respectively.
3. 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.
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.
4. 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,
pa ∈ [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.
4.1. 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
XMFi 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,
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
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.
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.
4.2. 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
XMF(G + 1) is a candidate new solution for MF’s parameters obtained after the intensification process,
XMF(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,
XMF(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
XRB(G + 1) is a candidate new solution for RB parameters obtained after the intensification process,
XRB(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
XRB(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
XG/
XG+1 are candidate solutions comprising of
XMF(G)/
XMF(G+1) and
XRB(G)/
XRB(G+1), respectively.
4.3. 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
pa ≤ 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:
where
XG + 1 is a candidate new solution for MF and RB parameters obtained after the diversification process,
XG 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
Xp(G) and
Xq(G) are randomly selected solutions from de cuckoo population,
r ~
U (0, 1) is a random number drawn from a uniform distribution, and
pa = 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
pa = 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].
5. 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
%Mp,D is the desired percentage overshoot,
%Mp is the actual percentage overshoot,
ts,D is the desired settling time,
ts is the actual settling time,
rss,D is the desired final position,
ess 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.
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.
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.