Parameter Tuning of PI Control for Speed Regulation of a PMSM Using Bio-Inspired Algorithms

This article focuses on the optimal gain selection for Proportional Integral (PI) controllers comprising a speed control scheme for the Permanent Magnet Synchronous Motor (PMSM). The gains calculation is performed by means of different algorithms inspired by nature, which allows improvement of the system performance in speed regulation tasks. For the tuning of the control parameters, five optimization algorithms are chosen: Bat Algorithm (BA), Biogeography-Based Optimization (BBO), Cuckoo Search Algorithm (CSA), Flower Pollination Algorithm (FPA) and Sine-Cosine Algorithm (SCA). Finally, for purposes of efficiency assessment, two reference speed profiles are introduced, where an acceptable PMSM performance is attained by using the proposed PI controllers tuned by nature inspired algorithms.


Introduction
Recently, the permanent magnet synchronous motor (PMSM) has achieved notoriety in industrial applications (e.g., electric vehicles [1], computer numerical control machines [2], industrial robots [3]).Among its most relevant features are a fast dynamic response, compact size, high power density, high torque capacity and low losses due to heat dissipation, which make it highly efficient.The performance of the PMSM can be affected during operation by the non-linearity of the dynamic system, some parametric variations and bounded perturbations of the load torque, which the controller must be able to overcome in real-time operation by always considering the physical constraints of the machine [4][5][6].
In the literature, several speed-control schemes have been proposed for PMSM, where a proper performance in tasks of regulating the speed of the rotor is achieved [7][8][9][10][11][12].Some controllers use adaptive schemes [8,[13][14][15], artificial neural networks (ANNs) [5,11,12,16], sliding mode control (SMC) based techniques [17][18][19][20], and fuzzy logic [5,10], to name a few methods.Sliding-modes based control provides a high disturbance rejection and a low sensitivity to parametric variations.However, the well-known phenomenon of chattering is also presented, which leads to low precision, warm-up in electrical power devices and wear in motor's mechanical parts.With the use of fuzzy logic a good performance is presented but it has the problem that the fuzzification rules, the inference mechanism, and the defuzzification operations are not clear and, in addition, they demand high computational processing capacity.Where using ANNs, a large amount of data and various operating scenarios of the plant are required for offline training.Also, it's necessary to have a device with a high processing capacity to manipulate all of the data, resulting in greater cost and system complexity.
The conventional integral proportional controller (PI) is the dominant choice in most industrial applications due to its easy implementation.However, PI controllers are unable to offer effective solutions against different external disturbances and parametric variations.In this paper, we propose the use of stochastic optimization algorithms based on evolutionary and particle intelligence techniques, as well as mathematical functions for calculation of the controller gains, in order to improve and optimize the closed-loop system performance under different operating conditions.
Nature inspired algorithms, stochastic algorithms, and algorithms based on population behavior are inspired by two principles: (1) nature; (2) the environment.The first aspect is Darwin's evolutionary theory, where only the strongest individuals or those who adapt to the environment around them survive [21].This feature is the basis for the development or inspiration of evolutionary algorithms, where the best solutions generated by mutation and crossover operators are used to transfer the best genes to the next generation in an evolutionary simulation process, an example of which is the biogeography-based optimization (BBO) algorithm developed by Dan Simon [22], which takes up the work "The Theory of Island Biogeography" by Marc Arthur and Wilson (1960), this algorithm is based on the behavior of the species within a habitat, taking into account the phenomena of emigration, immigration and mutation.Another clear example is the flower pollination algorithm (FPA) proposed by Yang (2012) [23], in which flower reproduction is imitated by taking into account all the factors and processes necessary for pollination, and where the reproduction of the most suitable floral species predominates.
The second aspect of inspiration are the algorithms developed or created from observing different kinds of particle swarms [24].In 1995 Russell Eberhart and James Kennedy developed a particle swarm optimization algorithm based on groups of social relationships between individuals.Thanks to this research, the behaviors of some biological species have been emulated, such as birds, fish, ants, fireflies, whales, bats, gray wolves, termites, among others.These search algorithms are based on a randomly generated population that moves continuously around a search space using variation operators.In [25] the cuckoo search algorithm (CSA) is modeled on the aggressive way of reproduction of the cuckoo bird and the characteristic flight patterns of other types of birds.In reference [26] the so-called bat algorithm (BA) is proposed that mimics the phenomenon of echolocation of small bats to reach their prey.Beneoluchi et al [27] proposed an algorithm based on the behavior of the African buffalo that has the ability to organize itself through two basic sounds for finding solutions.Another algorithm based on swarm intelligence is the Artificial Bee Colony (ABC), in which the honeybee's food search is imitated to solve problems of numerical optimization, both the ABC and the improved algorithms that derive from it have been applied in the training of neural networks [28,29].
There are also meta-heuristics that do not necessarily have a real inspiration, where simple mathematical functions can also be used to design optimization algorithms in this field.One of these is the sine cosine algorithm (SCA), which uses the sine and cosine functions to explore and exploit the space between two solutions in the search space in order to find better solutions.
Several bioinspired algorithms have been used for the calculation of conventional controller gains are detailed in different works.In reference [30], the BA is used to optimize a PID robust controller that takes care of maintaining a constant voltage level at the load of a DC-DC converter.Similarly, in reference [31] a BA searches for the gains of a PI controller to calculate the maximum power point of a photovoltaic system that supplies the current and voltage for a switchable reluctance motor.
In the same way, in reference [32] the performance of the frequency control strategy of a hybrid power system based on the CSA is investigated.The system's generator units are used in hybrid vehicles.Here CSA-optimized PI/PID controllers are used for control of wind turbine generators, a diesel engine generator, and a battery power storage system to adjust total active power generation according to load demand.Also, in reference [33] we have found the use of the CSA for finding optimal tuning parameters for the I-PD and PI-PD controllers, which are applied for speed control of DC motors in the presence of load disturbances.
In reference [34], FPA is used for the calculation of the gains of a PI controller of two degrees of freedom, to control of the heat flow experiment.Also, in reference [35], it is used for the optimization of a PI-PD controller in cascade within a multi-area power system.The BBO algorithm is also found in reference [36] where the comparison is made between the use of BBO for the optimization of PI and PID controllers, for handling of a thermal hybrid system composed of a Dish-Stirling solar thermal and a wind turbine.This type of strategy is also present in the control of electrical devices as in reference [37], where a PI controller is optimized for the control of the voltage of a three-phase rectifier.
In reference [38] SCA is used along with a PI controller for the optimal control of a capacitive energy storage system, just as in reference [39] a hybrid system is used that consists of the calculation of optimal gains of a PID controller through the use of SCA and fuzzy logic for frequency control in an autonomous power system.
The purpose of this paper is to compare five different nature inspired algorithms to adjust the parameters of the PI controllers in order to determine which provides better performance when applied to the speed control of a PMSM.Algorithms inspired by the nature of BA, BBO, CSA, FPA and SCA are tested and the result is compared to show which one is more useful for speed regulation tasks.In summary, nature inspired algorithms search six gains for the speed tracking of a PMSM.The control system is based on three PI controllers where the gains are tuned using nature-inspired algorithms.The external PI control loop regulates the rotor speed to the desired reference value and sets the reference values for the internal control loop which regulates the currents on the d-axis and q-axis of the PMSM (Figure 1).The internal control loop consists of two PI controllers whose tasks are to regulate the i q current to the value set by the external control loop and keep the i d current equal to zero.In reference [34], FPA is used for the calculation of the gains of a PI controller of two degrees of freedom, to control of the heat flow experiment.Also, in reference [35], it is used for the optimization of a PI-PD controller in cascade within a multi-area power system.The BBO algorithm is also found in reference [36] where the comparison is made between the use of BBO for the optimization of PI and PID controllers, for handling of a thermal hybrid system composed of a Dish-Stirling solar thermal and a wind turbine.This type of strategy is also present in the control of electrical devices as in reference [37], where a PI controller is optimized for the control of the voltage of a three-phase rectifier.In reference [38] SCA is used along with a PI controller for the optimal control of a capacitive energy storage system, just as in reference [39] a hybrid system is used that consists of the calculation of optimal gains of a PID controller through the use of SCA and fuzzy logic for frequency control in an autonomous power system.
The purpose of this paper is to compare five different nature inspired algorithms to adjust the parameters of the PI controllers in order to determine which provides better performance when applied to the speed control of a PMSM.Algorithms inspired by the nature of BA, BBO, CSA, FPA and SCA are tested and the result is compared to show which one is more useful for speed regulation tasks.In summary, nature inspired algorithms search six gains for the speed tracking of a PMSM.The control system is based on three PI controllers where the gains are tuned using nature-inspired algorithms.The external PI control loop regulates the rotor speed to the desired reference value and sets the reference values for the internal control loop which regulates the currents on the d-axis and q-axis of the PMSM (Figure 1).The internal control loop consists of two PI controllers whose tasks are to regulate the q i current to the value set by the external control loop and keep the d i current equal to zero.
It is important to note that these optimization algorithms are increasingly popular in engineering applications because: (I) they are based on fairly simple concepts and are easy to implement; (II) they do not require gradient information; (III) they can overlook local optimals; (IV) they can be used in a wide range of problems spanning different disciplines.

Mathematical Model of PMSM
The PMSM is a nonlinear system, strong coupling between its mechanical and electrical variables.The differential equations that define the dynamics of the motor in a frame of reference dq can be defined as: It is important to note that these optimization algorithms are increasingly popular in engineering applications because: (I) they are based on fairly simple concepts and are easy to implement; (II) they do not require gradient information; (III) they can overlook local optimals; (IV) they can be used in a wide range of problems spanning different disciplines.

Mathematical Model of PMSM
The PMSM is a nonlinear system, strong coupling between its mechanical and electrical variables.The differential equations that define the dynamics of the motor in a frame of reference dq can be defined as: where i d , i q , u d and u q , are dq components of the current and the voltage in the stator respectively, R s is the stator resistance, P is the number of pole pairs, λ m is the flux generated by the permanent magnet of the rotor, L d and L q are the dq components of the stator winding inductance, b is a viscous damping coefficient, J is the inertia moment and T l is the load torque.In case the PMSM is surface mounted permanent magnet type, L q is equal L d , consequently, the electromagnetic torque T e can be defined as follows: where n p is the number of poles.The dynamic equations of the mechanical variables of the PMSM are expressed as where ω r is the mechanical speed of the rotor and, θ r is the position of the rotor.

Control Scheme for PMSM
The control objective is to design an asymptotically stable speed controller for PMSM to make the rotor speed track the reference trajectory correctly under different parameter perturbations and load torque disturbances.Therefore, the main signal error can be defined as, where ω* is the desired rotor speed.If that the constant flow links have a linear relationship with the current in the stator; thereby its values can be estimate in an easy way.We can define the tracking error of the d-axis current as, where i * d is the d-axis current reference value.In theory, the proposed controller forces the current i d to have a value of zero in a finite time, so that the electric torque is proportional to current i q .Therefore, the current error in q-axis is defined as follows e q = i * q − i q (9) where i * q is the q-axis current reference value.The proposed control system is based on a sinusoidal pulse width modulation (SPWM) scheme; m q and m d are the modulating signals in dq reference frame.The modulation signals are transformed to abc system using the Park transformation and rotor position θ r , for comparison with high-frequency carrier signal.Figure 1 details the control scheme.

Definition of the Tuning Problem Based on Optimization Algorithms
The problem to be solved in this work is a search for more optimal values for three PI controllers that regulate the rotor speed of the PMSM.To solve the optimization problem, it is necessary to use a target function to generate an adequate search space and find the best parameters of PI regulators.The objective function can be defined using different error criteria of the dynamic response of the system, such as: (a) Integrated absolute error (IAE), (b) Integrated Squared Error (ISE), (c) Integrated Time Squared Error (ITSE), (d) Integrated Time Absolute Error (ITAE).Although these definitions work properly, in this work we propose to use the following objective function [40], which allows us to obtain better results: minJ where M p is the maximum overshoot; e ss is the error in steady state; t s is the time of establishment; t r is the rise time; and β is the weighting factor that can be modified depending on the dynamic characteristics that are required to be reached.In relation to the objective function, Equation ( 10) the optimization problem can be defined as follows: minimize J subject to: for j = [i q , i d , w].It should be mentioned that β in (10) determines the magnitude of the characteristic values of the transient response of the system.If β > 0.7 is reduced M P and e ss ; if β < 0.7 is minimized t r and t s .The search space of the parameters is defined as: The control scheme for PMSM is exposed in section three, however, a proper operation requires robust strategies or adaptive control that ensure safe and reliable performance also must respond quickly and appropriately to various scenarios that it may face.

Nature-Inspired Algorithms
The optimization process refers to finding the optimal values of the parameters of a given system from all possible values, in order to maximize or minimize its performance.Optimization problems can be found in all fields of study, which makes the development of optimization algorithms essential.
Optimization algorithms can be classified based on their nature as deterministic or stochastic algorithms.Deterministic algorithms follow a rigorous procedure, and its path and values of both design variables and functions are repeatable.Most conventional classical algorithms are deterministic, an example is the Newton Raphson algorithm.
Stochastic algorithms always have some randomness, the strings or solutions in the population will be different each time a program is executed because the algorithms use some pseudo-random numbers, the final results may not be very different, but the paths of each individual are not exactly equal.These algorithms are divided into two main groups: heuristic and metaheuristic.
The term heuristics means "to find or discover by trial and error", using these algorithms quality solutions are found for a difficult optimization problem in a reasonable time, but there is no guarantee that optimal solutions will be reached.Metaheuristic algorithms generally work better than a simple heuristic, because these use some randomization trading and local search.It is worth noting that there are no agreed definitions of heuristics and metaheuristics in literature; some use "heuristics" and "metaheuristics" interchangeably [41].
Metaheuristics can be classified by their source of inspiration, most new algorithms today have been developed inspired by nature, most nature-inspired algorithms are based on some successful features of the biological system (biologically inspired, or bioinspired for short).Not all algorithms were based on biological systems, as many algorithms have been developed using the inspiration of physical, chemical and mathematical systems [42].

Bat Algorithm
The BA was developed by Yang [43] and mimics the behavior of small bats that use echolocation to orient themselves in the dark to avoid obstacles, detect prey and locate cracks.Echolocation is a navigation system based on the hearing of bats and some other animals to detect objects in their environment by emitting a sound signal to the environment.
Within the BA each virtual bat in the initial population employs a similar echolocation phenomenon to update its position.Bat echolocation is a perceptual system in which a series of strong ultrasonic waves are released to create echoes.These waves return with delays and at different audio levels, those bats evaluate to detect a specific prey.BA is based on the following rules that can summarize the behavior of bats using the echolocation process: (a) Each bat uses the characteristics of the echolocation process to make a classification among its prey and obstacles.
(b) Bats fly randomly at an initial speed v i to reach the initial position x i ; with a frequency that can vary from a minimum frequency f min to a maximum frequency f max ; or varying the wavelength λ and its intensity or volume L to search for their prey.Bats can automatically adjust the wavelength or frequency of the signal they emit, and the number of pulses emitted r depends on how close your prey or target is.
(c) The intensity or volume changes from a high value L 0 to a constant minimum value L min .
During the optimization process, the x i position and v i speed of each bat must be specified and updated in each BA iteration.The rules for obtaining new bat solutions and velocities are given by the following equations where rand ∈ [0, 1] is a random vector that follows a normal distribution, f i is the frequency of the ith virtual bat, f min and f max is the minimum and maximum frequency that the bats will emit, respectively, v t i and v t+1 i is the flight speed of the ith current bat and the next flight speed respectively, x t i and x t+1 i is the position of the ith bat currently and at a later instant; y x* is the best solution currently generated, which is calculated by comparing all bat solutions.For the local search, a solution of all the best current solutions is chosen, a new solution for each bat is generated by means of a random path defined by the following expression where x n is the new solution, x a is the best old solution ε ∈ [−1, 1], is a random number, L t is the average volume of all bats in iteration t.As the intensity is reduced if the bats are closer to their prey, while the number of emitted pulses is increased, the volume can be adjusted to a convenient value as follows where α is a random constant between 0 and 1, γ is a constant value greater than zero.The basic steps in the BA algorithm process are presented in the flowchart shown in Figure 2. where  is a random constant between 0 and 1,  is a constant value greater than zero.The basic steps in the BA algorithm process are presented in the flowchart shown in Figure 2.

Cuckoo Search Algorithm
CSA is an algorithm based on the application of metaheuristics from nature.The CSA is an algorithm based on the aggressive breeding strategy of cuckoo birds and the Lévy flight characteristics of some bird species [44].The CSA begins when the mother cuckoo lays her eggs in other people's nests, of the same or another species of bird.The mother nest owner may discover that the eggs do not belong to her, so she may destroy the eggs or leave the nest with all the eggs inside.
Some species of cuckoo birds have evolved in such a way that the females throwing the eggs can imitate the color and pattern of the eggs of the selected nest.This action reduces the chance of the egg being abandoned and increases the ability to reproduce.
The cuckoo search algorithm can be described by the following three actions: Using the above three rules, the CSA starts with an initial population randomly distributed to perform the search for a nest to lay the egg.The random position of the nest where the egg is laid is decided by making Levy flights, defined as:

Cuckoo Search Algorithm
CSA is an algorithm based on the application of metaheuristics from nature.The CSA is an algorithm based on the aggressive breeding strategy of cuckoo birds and the Lévy flight characteristics of some bird species [44].The CSA begins when the mother cuckoo lays her eggs in other people's nests, of the same or another species of bird.The mother nest owner may discover that the eggs do not belong to her, so she may destroy the eggs or leave the nest with all the eggs inside.Some species of cuckoo birds have evolved in such a way that the females throwing the eggs can imitate the color and pattern of the eggs of the selected nest.This action reduces the chance of the egg being abandoned and increases the ability to reproduce.
The cuckoo search algorithm can be described by the following three actions: (a) Each cuckoo lays one egg at a time, which represents a set of coordinates of the solution and deposits it in a nest chosen at random.
(b) The part of the nests that contain the best eggs or candidate solutions is moved to form the next generation.
(c) The number of nests is fixed and sometimes the nest owner may discover a strange egg with a probability P a ∈ [0, 1].If this happens, the host may destroy the egg or leave the nest.This results in the construction of a new nest at a different location.
Using the above three rules, the CSA starts with an initial population randomly distributed to perform the search for a nest to lay the egg.The random position of the nest where the egg is laid is decided by making Levy flights, defined as: where t is the current generation number and α > 0 is the step size.The product OR PEER REVIEW 8 of 21 rrent generation number and 0   is the step size.The product  means input sically, Lévy flights provide a random walk, while their random steps are drawn bution, which for large steps has an infinite variance with an infinite mean, with rld, if the egg of a cuckoo bird is very similar to the egg of the nest-owning bird, ss chance of being discovered so the suitability must be related to the difference in ng the rules defined above, the optimization algorithm can be summarized in the rt (Figure 3).
location of current solution in i-th dimension at t-th iteration 1 r , 2 r , 3 r are d i P is the location of targeted optimal solution.The parameter 1 r is a control decreased linearly from a constant value a to 0 by each iteration to achieve the e exploration and exploitation phases of the algorithm Equations ( 21) and ( 22) are ed for exploration and exploitation processes as follows: means input multiplications.Basically, Lévy flights provide a random walk, while their random steps are drawn from a Lévy distribution, which for large steps has an infinite variance with an infinite mean, with the form In the real world, if the egg of a cuckoo bird is very similar to the egg of the nest-owning bird, then the egg has less chance of being discovered so the suitability must be related to the difference in solutions.Following the rules defined above, the optimization algorithm can be summarized in the following flowchart (Figure 3).
where t is the current generation number and 0   is the step size.The product  means input multiplications.Basically, Lévy flights provide a random walk, while their random steps are drawn from a Lévy distribution, which for large steps has an infinite variance with an infinite mean, with the form In the real world, if the egg of a cuckoo bird is very similar to the egg of the nest-owning bird, then the egg has less chance of being discovered so the suitability must be related to the difference in solutions.Following the rules defined above, the optimization algorithm can be summarized in the following flowchart (Figure 3).

Sine-Cosine Algorithm
The sine cosine algorithm (SCA) is a new metaheuristic algorithm SCA is population based optimization technique that founds the optimization process with a set of random solutions [45].These solutions are iteratively calculated over the course of iterations by an objective function.The probability of finding global optima is increased with the sufficient number of random solutions.The SCA is simply based on the Sine-Cosine function used for exploration and exploitation phases in optimization problems, which can be formulated as: where X is the location of current solution in i-th dimension at t-th iteration 1 r , 2 r , 3 r are random values, and i P is the location of targeted optimal solution.The parameter 1 r is a control parameter that is decreased linearly from a constant value a to 0 by each iteration to achieve the balance between the exploration and exploitation phases of the algorithm Equations ( 21) and ( 22) are combined to be used for exploration and exploitation processes as follows:

Sine-Cosine Algorithm
The sine cosine algorithm (SCA) is a new metaheuristic algorithm SCA is population based optimization technique that founds the optimization process with a set of random solutions [45].These solutions are iteratively calculated over the course of iterations by an objective function.The probability of finding global optima is increased with the sufficient number of random solutions.The SCA is simply based on the Sine-Cosine function used for exploration and exploitation phases in optimization problems, which can be formulated as: where X t i is the location of current solution in i-th dimension at t-th iteration r 1 , r 2 , r 3 are random values, and P i is the location of targeted optimal solution.The parameter r 1 is a control parameter that is decreased linearly from a constant value a to 0 by each iteration to achieve the balance between the exploration and exploitation phases of the algorithm Equations ( 21) and ( 22) are combined to be used for exploration and exploitation processes as follows: The designed parameter r 1 is employed to guide the next position's region, which may be between the solution and destination or outside it.To achieve balance between exploration and exploitation phase, the dynamical fine-tune of r 1 during search process is carried out using Equation (24) as: where a is a constant, T is the maximum number of iterations and t is the current iteration.The r 2 is random variable which used to find the direction of the movement of the next solution (i.e., if it towards or outwards P i ).Also, the r 2 is random variable which gives random weights for P i in order to stochastically emphasize (r 3 > 1) or deemphasize (r 3 < 1) the effect of desalination in defining the distance.The r 4 is a random number in [0, 1] is used to switch between the sine and cosine functions as in Equation ( 23).The steps of the SCA algorithm are given in Figure 4.
where t i x is the pollen or solution vector in iteration t ;  g is the best solution of all the generation of current solutions;  is a scale factor to control the step isize and L is the pollination force, which is a step size related to the Lévy distribution.Levy flight is a group of random processes in which the length of each jump follows Levy's probability distribution function and has infinite variation.Following, L for a Levy distribution is given by: where     is a standard range function.
For pollination, the second and third rule is given by Most flower pollination activities can occur on both a local and global scale.In practice, adjacent flower patches or flowers in the not-so-distant neighborhood are more likely to be pollinated by local flower pollen than those that are far away.For this, we use a change probability (Rule 4) or a proximity probability p to switch between global pollination common to intensive local pollination.
Figure 5 represents the flowchart of the FPA algorithm that provides information on the execution steps of the optimization technique.

Flower Pollination Algorithm
Pollination is a natural mechanism for the reproduction of flowering plants and is defined as the transfer of pollen from one flower to the stigma of the pistil of the same flower or another flower of the same plant species.There are two types of pollination according to pollen transfer methods: (1) biotic pollination (90% of plants have this pollination) this is done by pollinators such as insects or animals.and (2) abiotic pollination (10% of plants have this pollination) does not require the transfer of pollen by living organisms, it is done by water, wind or gravity as pollinators.When pollen goes from one plant to another of the same type, such pollination is called cross-pollination and self-pollination occurs when pollen is delivered to the same flower or flowers of the same plant.
Generally, the size of the flowers is consistent with the bodies of the insects so that the insects can enter the flowers and their bodies are in contact with the pollen and pistil.Pollinating insects are often associated with a specific type of flower, which is defined as the constancy of the flower.That is, pollinators tend to sit on certain species of flowers.Therefore, flower constancy helps to quantify the cost of searching for each of the pollinators.For biotic pollination, pollinators such as flies, birds, and bats can fly long distances.Therefore, they can be considered as global pollination.Similarly, the passage jump or flight of birds or bees can be described as a collection flight.The strategies of biotic pollination, cross-pollination, abiotic pollination and self-pollination are defined in the domain optimization and incorporated in the flower pollination algorithm.The pollination process includes a series of complex mechanisms in plant production strategies.A flower and its pollen gametes form a solution to the optimization problem.The constancy of the flower as an adjusted solution is perceptible.In global pollination, pollinators transfer pollen over long distances to high adaptation.On the other hand, local pollination within a limited area of a single flower takes place under the shade of wind or water.Global pollination occurs with a probability called change probability.If this step is removed, then local pollination replaces it [23].
Four rules are followed in the FPA algorithm: 1. Biotic pollination and cross-pollination are considered global pollination and pollen transporters or pollinators move in a way that follows Lévy flights.

3.
Pollinators, including insects, can develop a floral constancy.Flower constancy is a production probability that is proportional to the similarity of two flowers involved.

4.
The interaction of global and local pollination can be controlled by the probability of change.
The first and third rules can be expressed as: where x t i is the pollen or solution vector in iteration t; g * is the best solution of all the generation of current solutions; γ is a scale factor to control the step isize and L is the pollination force, which is a step size related to the Lévy distribution.
Levy flight is a group of random processes in which the length of each jump follows Levy's probability distribution function and has infinite variation.Following, L for a Levy distribution is given by: where Γ(λ) is a standard range function.
For pollination, the second and third rule is given by where x t j y x t k are pollens from different flowers of the same plant species.This essentially imitates the constancy of the flower in a limited neighborhood.Mathematically, if x t j y x t k come from the same species or are selected from the same population, this becomes a local random walk if we extract ∈ from a uniform distribution in [0, 1].
Most flower pollination activities can occur on both a local and global scale.In practice, adjacent flower patches or flowers in the not-so-distant neighborhood are more likely to be pollinated by local flower pollen than those that are far away.For this, we use a change probability (Rule 4) or a proximity probability p to switch between global pollination common to intensive local pollination.
Figure 5 represents the flowchart of the FPA algorithm that provides information on the execution steps of the optimization technique.

Biogeography-Based Optimization Algorithm
Inspired by biogeography, Simon developed a new approach called Biogeography-Based Optimization (BBO) in 2008.This algorithm is an example of how a natural process can be modeled to solve optimization [14].In BBO, each possible solution is an island and their features that describe habitability are included in a Habitat Suitability Index (HSI).The goodness of each solution are named Suitability Index Variables (SIV).For example, of the natural process, why some islands may lean towards accumulating many more species than others.Because of possess certain environmental features that are more suitable to sustaining that kind than other islands with fewer species.It is axiomatic the habitats with high HSI have large populations and a high immigration rate and feature of a large number of species that migrate to other habitats.The rate of immigration will be lower if these habitats are already saturated with species.On the other hand, habitats with low HSI have high immigration and low immigration rate, because of the sparse population.
The fitness function FF is associated with each solution of Biogeography-Based Optimization BBO, which is analogous to HSI of a habitat.A good solution is analogous to a habitat having high HSI and a poor solution represents a habitat having a low HSI.The best solutions share their geographies of the lowest solutions throw migration (emigration and immigration).The best solutions have more resistance to change than the lowest solutions.However, the lowest solutions have more change from time to time and accept many new features from the best solutions.The immigration rate and emigration rate of the j-th island may be formulated as follows in Equations 28 and 29 [22].

Biogeography-Based Optimization Algorithm
Inspired by biogeography, Simon developed a new approach called Biogeography-Based Optimization (BBO) in 2008.This algorithm is an example of how a natural process can be modeled to solve optimization [14].In BBO, each possible solution is an island and their features that describe habitability are included in a Habitat Suitability Index (HSI).The goodness of each solution are named Suitability Index Variables (SIV).For example, of the natural process, why some islands may lean towards accumulating many more species than others.Because of possess certain environmental features that are more suitable to sustaining that kind than other islands with fewer species.It is axiomatic the habitats with high HSI have large populations and a high immigration rate and feature of a large number of species that migrate to other habitats.The rate of immigration will be lower if these habitats are already saturated with species.On the other hand, habitats with low HSI have high immigration and low immigration rate, because of the sparse population.
The fitness function FF is associated with each solution of Biogeography-Based Optimization BBO, which is analogous to HSI of a habitat.A good solution is analogous to a habitat having high HSI and a poor solution represents a habitat having a low HSI.The best solutions share their geographies of the lowest solutions throw migration (emigration and immigration).The best solutions have more resistance to change than the lowest solutions.However, the lowest solutions have more change from time to time and accept many new features from the best solutions.The immigration rate and emigration rate of the j-th island may be formulated as follows in Equations ( 28) and ( 29) [22].
where: µ i , λ i are the immigration rate and the emigration rate of j individual; I is the maximum possible immigration rate; E is the maximum possible emigration rate; j is the number of species of j-th individual; and is the maximum number of species.j-th in BBO, the mutation is used to increase the diversity of the population to get the best solutions.Mutation operator modifies a habitat's SIV randomly based on mutation rate.The mutation rate m j is expressed in Equation (30).
where m j is the mutation rate for the j-th habitat having a j number of species; m max is the maximum mutation rate; p max is the maximum species count probability; p j the species count probability for the j-th habitat and is given by Equation ( 31): where µ j+1 , λ j+1 are the immigration and emigration rate for the j-th habitat contains j + 1 species; µ j−1 , λ j−1 , are the immigration and emigration rate for the j-th habitat contains j − 1 species.Figure 6 represents the flowchart of the BBO.

Results and Discussion
The adjustment parameters of the algorithms, which were used for the BBO are number of habitats equal to 40, a permanence range of 1 and a mutation factor of 0.04 [46].For SCA was set maximum of iterations equal to 40 and 40 search agents, r 1 = 2 − (0.2t), r 2 , r 3 and r 4 with a randomized value [45].While CSA occupied the parameters 40 nests and a probability of finding foreign eggs P a = 0.25 [25], the adjustment of the FPA are as size of population equal to 40, a maximum number of iterations equal to 40 and initial value of p equal to 0.8 [47], and BA with r 0 = 0.1, L 0 = 0.9, γ = 0.9, α = 0.9, F min = 0 and F max = 0 [43].The initial population and the number of iterations for all the algorithms was fixed at 40, the same value was chosen so that the results could be object of comparison, the parameters of each algorithm are taken from the referenced articles.
Obtaining the gains of the three PI controllers that make up the speed control scheme occurs based on simulations developed in the Matlab environment, where the different heuristics and the dynamic model of the PMSM described by the differential Equations ( 1)-( 3) are integrated.
The motor parameters used in the simulation are contained in Table 1.While the graphs in Figure 7 show the behavior of the system using the different algorithms, feeding with a step (1000 rad/s), and under constant load torque (1 Nm).iterations for all the algorithms was fixed at 40, the same value was chosen so that the results could be object of comparison, the parameters of each algorithm are taken from the referenced articles.
Obtaining the gains of the three PI controllers that make up the speed control scheme occurs based on simulations developed in the Matlab environment, where the different heuristics and the dynamic model of the PMSM described by the differential Equations ( 1)-( 3) are integrated.
The motor parameters used in the simulation are contained in Table 1.While the graphs in Figure 7 show the behavior of the system using the different algorithms, feeding with a step (1000 rad/s), and under constant load torque (1 Nm).The results of single run might be unreliable due to the stochastic nature of meta-heuristics.All of the algorithms are run 25 times and statistical results from the evaluation of the gains of the three PI controllers, calculated by the different optimization algorithms in the control the PMSM (minimum, maximum, mean and standard deviation) are collected and reported in Table 2.These results show that the FPA managed to obtain the smallest value of the minimum function, with the BBO being the second best, followed by SCA and CSA, with BA presenting the worst result.The results of single run might be unreliable due to the stochastic nature of meta-heuristics.All of the algorithms are run 25 times and statistical results from the evaluation of the gains of the three PI controllers, calculated by the different optimization algorithms in the control the PMSM (minimum, maximum, mean and standard deviation) are collected and reported in Table 2.These results show that the FPA managed to obtain the smallest value of the minimum function, with the BBO being the second best, followed by SCA and CSA, with BA presenting the worst result.The gains of PI controllers found through BA, FPA, SCA, CSA and BBO are listed in Table 3.The tests were performed on PC with Intel (R) Core (TM) i7-7500U 2.9 GHz with 8.00 GB in RAM and with 2016b version of Matlab.The execution time of the different algorithms for the calculation of the profits of the PI controllers is shown in Table 4.In order to know the performance of controllers in operating conditions where an unknown variable load torque is presented, the load torque is modeled using a Lorenz system described by the following first-order differential equations.
T l = 0.04z (35) where a = 5, b = 12y, c = 25; with initial conditions: x(0) = 0.1, y(0) = 0.1 and z(0) = 0.5 [48].Below are two cases in which the reference trajectory has different natures.In the first case the transition between the desired speed values is smooth.In the second case the changes in the reference speed are values with a constant rate of change defined by slopes.

Case 1 PMSM Response to a Speed Reference Characterized by Bezier Polynomials with Variable Load Torque
The reference speed is given by a Bézier polynomial ψ for providing a sufficiently smooth transfer between the actual and desired speed reference values, within a specific time interval.Then, the reference trajectory is as follows [49] where ω 1 = 1000 rad/s, ω 2 = 600 rad/s, ω 3 = 300 rad/s, T 1 = 0 s, T 2 = 1 s, T 3 = 3 s, T 4 = 5 s, T 5 = 6.5 s y T 6 = 7.50 s, and ψ is a polynomial function with the form The performance of the controllers is verified using performance indices such as ISE, IAE, ITSE and ITAE.The ISE penalizes the controller for steady state errors, while IAE penalizes the controller for transient errors, ITSE penalizes the controller for steady state errors over a prolonged time and ITAE penalizes the controller for transient state errors over a prolonged time.Table 5 shows these indicators for case 1.The smallest indicators are the result of the BBO algorithm, presenting the best performance in speed tracking, followed by the FPA, BA, SCA algorithms and with the largest amount of error for the CSA. Figure 8 show the speed tracking of all algorithms for case 1, where there is an error in steady state less than 0.001% of the nominal reference value, it can be observed that the different algorithms achieve the appropriate tracking of the desired speed profile.The absolute error is shown in Figure 9, being the maximum error of just 0.9 rad/s, being the BBO the algorithm that gives the least error and CSA the one that gives the greatest error.
Figure 10 shows the speed tracking of all algorithms for case 2, the speed behavior is shown when the path changes from a slope-dependent value to a constant value.The absolute error is shown in Figure 11, where unlike case 1, the initial error is greater because this path is not as smooth.As in case 1 the best result is obtained using the BBO and the algorithm with the largest error is CSA.Table 6 shows performance indicators ISE, IAE, ITSE and ITAE for case 2, sorting these algorithms in ascending order according to the smallest error we first have the BBO, followed by FPA, BA, SCA and lastly CSA.  Figure 10 shows the speed tracking of all algorithms for case 2, the speed behavior is shown when the path changes from a slope-dependent value to a constant value.The absolute error is shown in Figure 11, where unlike case 1, the initial error is greater because this path is not as smooth.As in case 1 the best result is obtained using the BBO and the algorithm with the largest error is CSA.Table 6 shows performance indicators ISE, IAE, ITSE and ITAE for case 2, sorting these algorithms in ascending order according to the smallest error we first have the BBO, followed by FPA, BA, SCA and lastly CSA.The results shown prove the usefulness and good performance of nature inspired algorithms.The tests carried out with the gains of the PI controllers calculated for the speed control show that  Figure 10 shows the speed tracking of all algorithms for case 2, the speed behavior is shown when the path changes from a slope-dependent value to a constant value.The absolute error is shown in Figure 11, where unlike case 1, the initial error is greater because this path is not as smooth.As in case 1 the best result is obtained using the BBO and the algorithm with the largest error is CSA.Table 6 shows performance indicators ISE, IAE, ITSE and ITAE for case 2, sorting these algorithms in ascending order according to the smallest error we first have the BBO, followed by FPA, BA, SCA and lastly CSA.The results shown prove the usefulness and good performance of nature inspired algorithms.The tests carried out with the gains of the PI controllers calculated for the speed control show that  The results shown prove the usefulness and good performance of nature inspired algorithms.The tests carried out with the gains of the PI controllers calculated for the speed control show that the algorithms have a similar behavior since everyone complies with the tracking of the reference speed trajectory, only highlighting the BBO algorithm as the one that has a minor error.

Conclusions
In this work we compare optimization algorithms based on nature to tune three PI controllers that regulate the rotor speed of a PMSM.Four algorithms inspired by nature: BA, BBO, CSA and FPA and one algorithm inspired by the mathematical function SCA were taken into account to make the most optimal search for gains.
The results of the simulations show that the five algorithms used to tune the parameters of the PI controllers work well to follow different trajectories with variable or constant load torque.By comparing the response of each of the algorithms in the two proposed cases, and based on the different error indicators (Table 5; Table 6) it can be concluded that the BBO works best under different operating conditions.It is worth mentioning that the gains were calculated in conditions of constant load torque and constant speed.Under these conditions, the algorithm that showed the best performance was the FPA, having the smallest minimum function and the smallest average among all the algorithms as can be seen in Table 3, situation that changed when having a variable load torque.Future research should focus on improving the response of these algorithms to disturbances, uncertainties and parametric variations.
Future works consist of the application of different algorithms inspired by nature to calculate and optimize PID controller gains for others electric machines.Experimental results on optimized PID controller combined with adaptive control in electromechanical energy conversion systems will also be introduced in subsequent studies.Another research line will involve testing the response of more complex industrial plants when using other bio-inspired and intelligent techniques.In the same way, a statistical analysis will be included to determine the significance of the results.The final research goal will include the experimental validation of this paper.

Figure 1 .
Figure 1.Speed control scheme of a PMSM.

Figure 1 .
Figure 1.Speed control scheme of a PMSM.

.
(a) Each cuckoo lays one egg at a time, which represents a set of coordinates of the solution and deposits it in a nest chosen at random.(b) The part of the nests that contain the best eggs or candidate solutions is moved to form the next generation.(c)The number of nests is fixed and sometimes the nest owner may discover a strange egg with a probability If this happens, the host may destroy the egg or leave the nest.This results in the construction of a new nest at a different location.

x
are pollens from different flowers of the same plant species.This essentially imitates the constancy of the flower in a limited neighborhood.Mathematically, if species or are selected from the same population, this becomes a local random walk if we extract  from a uniform distribution in [0,1].

Figure 7 .
Figure 7. Motor response to step and constant torque (a) Response using BA; (b) Response using BBO; (c) Response using CSA; (d) Response using FPA; (e) Response using SCA.

Figure 7 .
Figure 7. Motor response to step and constant torque (a) Response using BA; (b) Response using BBO; (c) Response using CSA; (d) Response using FPA; (e) Response using SCA.

Figure 8 .
Figure 8. Simulated waveforms of the rotor speed responses, Case 1.

Figure 9 .
Figure 9. Waveforms of the rotor speed error performance, Case 1.

Figure 9 .
Figure 9. Waveforms of the rotor speed error performance, Case 1.

Figure 9 .
Figure 9. Waveforms of the rotor speed error performance, Case 1.

Figure 11 .
Figure 11.Waveform of the rotor speed error performance, Case 2.

Figure 11 .
Figure 11.Waveform of the rotor speed error performance, Case 2.

Figure 11 .
Figure 11.Waveform of the rotor speed error performance, Case 2.

Table 2 .
Minimum function statistical data using different optimization algorithms.

Table 3 .
Optimal gains for PI controllers.

Table 4 .
Execution time of optimization algorithms.

Table 5 .
Performance indices of PI controllers tuned using BA, BBO, CSA, FPA and SCA in case 1.

Table 6 .
Performance indices of PI controllers tuned using BA, BBO, CSA, FPA and SCA in case 2.

Table 6 .
Performance indices of PI controllers tuned using BA, BBO, CSA, FPA and SCA in case 2.

Table 6 .
Performance indices of PI controllers tuned using BA, BBO, CSA, FPA and SCA in case 2.