An improved spotted hyena optimizer for PID parameters in an AVR system

: In this paper, an improved spotted hyena optimizer (ISHO) with a nonlinear convergence factor is proposed for proportional integral derivative (PID) parameter optimization in an automatic voltage regulator (AVR). In the proposed ISHO, an opposition-based learning strategy is used to initialize the spotted hyena individual’s position in the search space, which strengthens the diversity of individuals in the global searching process. A novel nonlinear update equation for the convergence factor is used to enhance the SHO’s exploration and exploitation abilities. The experimental results show that the proposed ISHO algorithm performed better than other algorithms in terms of the solution precision and convergence rate.


Introduction
A metaheuristic optimization algorithm is a novel population-based global search algorithm, and is more suitable for solving complex problems [1,2]. Rao et al. proposed a teaching-learning-based optimization (TLBO) algorithm to solve large-scale optimization problems. The simulation results of the standard test function showed that the TLBO algorithm effectively solves complex optimization problems [3]. To solve a complex constrained optimization problem, Sayed E et al. proposed a decomposition evolutionary algorithm [4]. Mohapatra et al. proposed a competitive swarm optimizer algorithm [5]. To overcome the shortcoming of particle swarm optimization (PSO) falling easily into a local optimum, an improved quantum PSO algorithm with the cultural gene algorithm and memory mechanism was proposed to solve continuous nonlinear problems [6,7]. Ali et al. presented a multi-population differential evolution global optimization algorithm [1]. Ant colony optimization, proposed by Ismkhan, has been applied to solving complex problems [8]. Using the symbiotic organism search algorithm for fractional fuzzy controllers [9] and so on.
In an industrial control system, the proportional integral derivative (PID) controller has been widely applied. It accounts for more than 90% of the actual control system [10]. The PID parameter tuning problem proposed by Ziegler and Nichols has caused extensive concern. However, the traditional PID parameter tuning method has the following problems: The control performance index is not ideal and, typically, the method has a large overshoot and long adjustment time. The control effect of an intelligent optimization algorithm in PID parameter tuning is better than that of the traditional tuning method, and it can avoid some shortcomings of traditional methods [11]. Jiang et al. proposed a PID tuning premature with a genetic algorithm (GA) to enhance the search and convergence speed, but there were problems of premature convergence and parameter dependence [12]. Yu et al. proposed seeker search algorithm optimization PID controller parameters; improved the control precision of the system; accelerated the response speed and robustness of the system; and optimized the optimal parameters for the control system PID, but the optimization formula complex, need to set more parameters [13]. P. B. de Moura Oliveira, et al. designed Posicast PID control systems using a gravitational search algorithm (GSA) [14]. Guo-qiang Zeng et al. designed multivariable PID controllers using real-coded population-based extremal optimization [15]. A. Belkadi et al. proposed a PSO-based approach on the robust PID adaptive controller for exoskeletons [16]. M. Gheisarnejad proposed an effective hybrid harmony search (HS) and cuckoo optimization algorithm-based fuzzy PID controller for load frequency control [17]. Amal Moharam, et al. designed an optimal PID controller using hybrid differential evolution and PSO with an aging leader and challengers [18].
The spotted hyena optimizer (SHO) [19] is a novel intelligence algorithm proposed by Dhiman and Kumar in 2017. It was inspired by the social and collaborative behavior of spotted hyenas, which exist in nature. Spotted hyenas typically perform four processes: Search, encirclement, hunt, and attack prey. The SHO has the characteristics of simple, easy to implement programming and adjust the parameters set less features. Since the SHO was proposed, there have been various improved versions of the SHO algorithm. For example, N. Panda, et al. used an improved SHO (ISHO) with space transformational search to train a pi-sigma higher-order neural network [20]. H. Moayedi et al. proposed using the SHO and ant lion optimization to predict the shear strength of soil [21]. Q. Luo, et al. proposed using the SHO with lateral inhibition for image matching [22]. G. Dhiman et al. proposed a multi-objective optimization algorithm for engineering problems [23] and used the SHO to solve the nonlinear economic load power dispatch problem [24]. Xu Y, et al. proposed an enhanced moth-flame optimizer with a mutation strategy for global optimization [25].
In function optimization and engineering optimization, it has been proved that the performance of the SHO is superior to that of the grey wolf optimizer (GWO), binary GWO [26], PSO, moth-flame optimization (MFO), multi-verse optimizer, sine cosine algorithm (SCA), GSA, GA, HS, Harris hawks optimization [27], bacterial foraging optimization [28], and flower pollination algorithm [29] in terms of precision and the convergence speed [22]. In this paper, an ISHO algorithm is applied to solve PID parameter problems in an automatic voltage regulator (AVR).
The remainder of the paper is organized as follows: The basic SHO algorithm is presented in Section 2. In Section 3, the ISHO is introduced. In Section 4, the ISHO is proposed to optimize PID parameters and compared with well-known algorithms. Finally, conclusions are provided in Section 5.

Spotted hyena optimizer
The social relationships and habits of animals are the source of inspiration for our work. This social behavior is also present in the spotted hyena, whose scientific name is Crocuta. According to llany et al. [30], spotted hyenas typically live in groups, with as many as 100 group members, and they have mutual trust and interdependence. The communication between spotted hyenas is typically posed, and given a special signal, they track prey using sight, hearing, and smell. There are four main steps for a spotted hyena to attack prey: Search for prey, encircle prey, hunt prey, and attack prey. To generate a mathematical model for encircling, the equations are as follows [31]: where t is the current iteration, B  and E  are the coefficient vectors, p X  is the position vector of the prey, X  is the position vector, D  is the distance between the prey and spotted hyena, and || ||  represents the absolute value.

The coefficient vectors B
 and E  are calculated as follows: To define the spotted hyena behavior mathematically, the best search agent represents the location of the prey. The other search agents move toward the best search agent and save the best solutions obtained thus far to update their positions. The mathematical model can be formulated as follows: where h X  is the position of the best spotted hyena, k X  is the position of other spotted hyena, N is the number of spotted hyenas, M  is a random vector in [0.5,1], nos is the number of solutions, nos count is the count of all candidate solutions, and h C  is a cluster of N optimal solutions.
For spotted hyenas in the attack prey stage, to determine the optimal solution, it is necessary to continuously reduce the value of h  , where h  is the step size that the spotted hyena takes to attack prey, and it is clear that, when looking for prey, the spotted hyena continues to increase the number of steps gain steps. The formulation for attacking prey is is the position of the current solution and t is the number of iterations. The SHO allows its agents to update their positions in the direction of the prey. while ( t < max number of iterations) 7.
for each search agent do 8.
Update the position of the current search agent by Eq (2.10) 9.
end for 10.
Update h, B, E and N 11.
Check if any search agent goes beyond the search space and revamp it 12. Calculate ) the effect of prey in defining the distance in Eq (2.3). This helps the random behavior of the SHO to increase during the course of optimization, and favors exploration and local optima avoidance. The pseudocode of the SHO algorithm is as above.

Population initialization based on opposite learning
Haupt et al. found that the initial population affects the algorithm's accuracy and convergence speed [32]. The better than initial population can lay the foundation for the global search of the SHO algorithm [21]. However, without any prior knowledge of the global optimal solution of the problem, the SHO algorithm typically adopts a random method when generating the initial search agent, which thus affects the search efficiency. The opposition learning strategy is a new technology that has emerged in the field of intelligent computing. So far, the opposite learning strategy has been successfully applied to swarm intelligent algorithms, such as PSO, HS, and DE algorithms [33,34]. In this paper, the opposite learning strategy is embedded into the SHO for initialization.

Algorithm 2 Initialization method based on opposite learning
Set the population size to N 1.
for i=1 to N do 2.
for j=1 to d do 3.
for j=1 to d do 8.
end for 10. end for where N denotes the individuals with the best fitness selected as the initial population.
Definition: Opposition-based [35]. Suppose X exists in   u l, . The opposite point is  is completely defined by its components: According to the above definition, the specific steps for using the opposite learning strategy to generate the initial population are as above.

Nonlinear variation convergence factor
Similar to other group intelligent optimization algorithms based on population iteration, it is crucial for the SHO to coordinate its exploration and exploitation capabilities. During exploration, groups need to detect a wider search area and avoid the SHO algorithm becoming stuck in a local optimum. The exploitation capacity mainly uses the group's existing information to search some local solution's areas of the solution. The convergence rate of the SHO algorithm has a decisive influence. Clearly, robustness and fast convergence are achieved only when the SHO algorithm improves the coordination of the exploration and exploitation capabilities.
According to [21], the SHO algorithm's exploration and exploitation abilities depend on the change of the convergence factor h  . The larger the convergence factor h  , the better the global search ability and the more likely the SHO algorithm avoids falling into a local optimum. The smaller the convergence factor h  , the stronger the local search ability, which speeds up the convergence of the SHO algorithm. However, in the basic SHO algorithm, the convergence factor h  decreases linearly from 5 to 0 as the number of iterations increases. The linear decreasing strategy of the convergence factor h  has a good global search ability in the early stages of the algorithm, but the convergence speed is slow. In the latter part of the algorithm to speed up the convergence rate, but easy to fall into a local optimum, particularly in multimode functions problems. Therefore, in the evolutionary search process, the convergence factor h  with the number of iterations linearly decreasing strategy cannot fully reflect the actual optimization of the search process in the SHO algorithm [36]. In fact, the SHO is expected to have a strong global search ability in the pre-search period while maintaining a fast convergence rate. Additionally, Enns, et al. and Zeng, et al. found that performance improved if the control parameter was chosen as a nonlinearly decreasing quantity rather than using a linearly decreasing strategy [30,32]. Thus, the control parameter h  is modified as follows: where t is the current iteration,   On average, the results are better than those of existing algorithms: The larger the value of u (u > 2.0), the greater the failed convergence rate.

Diversity mutation operation
Similar to other population-based intelligent optimization algorithms, in the late iteration of the SHO, all the spotted hyenas move closer to the optimal individual region, which results in a reduction of population diversity. In this case, if the current optimal individual is the local optimal, then the SHO algorithm falls into a local optimum. This is also an inherent characteristic of other group intelligent optimization algorithms. To reduce the probability of premature convergence for the SHO algorithm, in this paper, a diversity mutation operation is performed on the current optimal spotted hyena individuals. The steps are as follows:

Description and modeling of an AVR system
Providing constancy and stability at rated voltage levels in electricity, the network is also one of the main problems in power system control. If the rated voltage level deviates from this value, then the performance degrades and the life expectancy reduces. Another important reason for this control is true line loss, which depends on the real and reactive power flow. The reactive power flow is largely dependent on the terminal voltage of the power system. However, it is necessary to reduce the loss caused by the solid line by controlling the rated voltage level. To solve these control problems, an AVR system is applied to power generation units [36]. The role of the AVR is to maintain the terminal voltage of the synchronous alternator at the rated voltage value.

PID controller
Using the PID controller to improve the dynamic response while reducing or eliminating the steady-state error, the derivative controller adds a finite zero to the open-loop plant, which enables the improvement of the transient response. The PID controller transfer function is (4.1) A simple AVR system has four parts: Amplifier, exciter, generator, and sensor. The mathematical transfer function of the above four components is considered as linear and time constant. To analyze the dynamic performance of an AVR, the transfer functions of these components are in [37,38] where the range of A K is [10,400] and the amplifier time constant ranges from 0.02-0.1 s.

Exciter model
The transfer function of an exciter is modeled by a gain E K and time constant E  , and given by where E K is typically in the range [10,400] and the time constant E  is in the range 0.5-1.0 s.

Generator model
The generator model is represented by a gain G K and time constant G  . The transfer function is given by where R K is in the range [0.7,1.0] and R  is in the range 1.0-2.0 s. The generator gain R K and time constant R  are load dependent.

Sensor model
The sensor is modeled by a gain R K and time constant R  . The transfer function is given by where R K is in the range [10, 400] and R  is in the range 0.001-0.06 s. The complete transfer function model of the AVR system is given in Figure 2. In the work of Gozde and Taplanmacioglu [37], the parameters of the AVR system were 0 The transformer function of the AVR system with the above parameters is (4.6) To improve the dynamic response of the AVR system and maintain the terminal voltage at 1.0 pu, a PID controller is included, as shown in Figure 2.
With the PID controller, the transfer function of the AVR system of Figure 2 becomes

PID controller based on the ISHO
An AVR system with a PID controller tuned by the ISHO algorithm is shown in Figure 2. The gains of the PID controller are regulated by the ISHO algorithm. If the proportional gain is too high, then the system becomes unstable and the proportional gain becomes too low, which results in a larger error and lower sensitivity. For an AVR system, the ranges commonly used in the literature are [0.0,1.5] and [0.2,2.0] in [38,39]. To increase the search space for better optimization gains, the resulting lower and upper bounds are chosen to be 0.01 and 2, respectively. PSOGSA [41], FPA [42], and SCA [43]. The results showed that the ISHO performed better than the other algorithms. All the parameters set in the algorithms are given in Table 2.
Setting the six algorithms' parameters, we obtained the best parameter values for each algorithm to optimize the PID parameters using the population size of 50, 20 iterations, and 20 runs independently. "Best" is the optimal fitness value, "Worst" is the worst fitness value, "Mean" is the mean fitness value, and "Std." is the standard deviation. Table 3 shows that the best fitness value of ISHO was significantly better than those of the other algorithms, and the standard error of the ISHO was the smallest. It is thus proved that the ISHO is better than the standard SHO and other algorithms (SCA, FPA, PSOGSA, and GWO) in terms of obtaining the optimal PID parameters.   In Table 2, we label the optimal PID parameters with the optimal fitness values, and the minimum standard error is indicated by the black bold line. The table shows that, although the PSOGSA algorithm is also a hybrid of the PSO and GSA algorithms, the effect of optimally searching for PID parameters was still not as good as that of the ISHO algorithm.    The transient and steady-state behavior of the system can be analyzed from the transient analysis of the ISHO optimized PID controller in the AVR system, as shown in Figure 4. For comparison, responses for the SCA, FPA, PSOGSA, GWO, and SHO algorithms are shown in Table 8. The figure shows that the maximum overshoot for the ISHO algorithm is 5% less than that of the SCA algorithm, 3.5% less than that of the FPA algorithm, 4.82% less than that of the GWO algorithm, and 6.8% less than that of the SHO algorithm. The peak time for the ISHO algorithm is more than that of the SHO, GWO, PSOGSA, FPA, and SCA algorithms. The maximum overshoot and settling time for the ISHO algorithm are better than those of the SHO, GWO, PSOGSA, FPA, and SCA algorithms, and are major factors for comparing the stability analysis of systems.  The convergence characteristics are shown in Figure 4. The figure shows that the ISHO algorithm's fitness value decreases the fastest compared with those of the other algorithms. This shows that the ISHO algorithm has a strong global search capability and higher precision. The ISHO algorithm is considered as an optimization of the PID controller parameters in the AVR system, which has promising potential applications.

Conclusions
The SHO was inspired by the social behavior of a spotted hyena swarm. Its mathematical model is relatively simple, but the control parameter directly affects the balance between the global search ability and local search ability in the SHO algorithm. Based on the analysis of the above characteristics of the SHO, in this paper, a nonlinear adjustment strategy was adopted for the control parameters and the mutation strategy was used to deal with the update of the intelligent individual position. The performance of the improved algorithm was verified by a simulation. The ISHO quickly approached the theoretical value and significantly improved the convergence speed and optimization efficiency. The ISHO algorithm was used to determine the parameters of the PID controller for an AVR system. It is clear from the results that the proposed ISHO algorithm avoided the shortcoming of the premature convergence of the SHO, GWO, PSOGSA, FPA, and SCA algorithms and obtained global solutions with better computation efficiency.