Design, Implementation, and Optimization of Sliding Mode Controller for Automatic Voltage Regulator System

Academic studies on the Automatic Voltage Regulator (AVR) have focused on a linear mathematical model which lacks protective features. More accurate model of the AVR system includes protective features as described in IEEE standards. The AVR models without protective features, namely limiters, result in less accurate control performance since the outputs of real controllers are always bounded. In the present study, the controller outputs are limited between -0.9pu and 1.0pu, and the upper bound of exciter output is limited by 3.1pu with the direction of IEEE standards. The effect of limiters on the controller performance is investigated. Two controllers with a novel sliding surface function are proposed based on a mathematical model of the AVR (SMC3) and its approximate reduced-order model (SMC2). The proposed controllers having only two parameters are optimized with improved particle swarm optimization (PSO) algorithm. After optimization, the robustness of the controllers is compared with the results of various operating conditions identical to the previous studies. Nominal time constants of the AVR constituents are perturbed from -50% to 50%, and ±10% output disturbance is applied to the output. Although controller outputs and exciter output are limited, the overshoot is measured less than 0.1% at no-load conditions. The robustness of the controllers against parameter uncertainties is measured with an average overshoot at the output. Another superiority among the reported results in the literature is obtained from the proposed controllers, where the minimum average overshoots are measured. In addition, when ±10% load is applied to the output of the AVR, the proposed controllers generate accurate control inputs that reject the load disturbance successfully. Furthermore, the proposed controllers keep the output within the ±5% band if there is a monotonic change at the output. All the results show that the proposed controllers with the improved PSO have drawn the best performance from the perspective of time-domain specifications in comparison with the recently reported controllers.


I. INTRODUCTION
Electric power distribution networks continue to enlarge at a rapid rate due to the demand for different types of loads. The energy demand is provided continuously by a variety of power plants connected to the distribution network. In this network, the electrical energy flowing from the power plants to the loads should be regulated despite the load change on the distribution network. There are two important properties to be always regulated: operating frequency and operating voltage levels. The first one is directly related to the speed of the generator rotor while the operating voltage level changes with respect to the load on the power system or excitation of the synchronous generator. The frequency and voltage regulations are performed at the power plants. Both frequency and voltage levels are measured at the terminals of the generators, and proper controllers are used to ensuring their stability. Operation frequency is regulated with Load Frequency Controller (LFC), and an Automatic Voltage Regulator (AVR) is used to regulate the terminal voltage or reactive power of the synchronous generator.
The present study deals with the voltage regulation of the synchronous generators mounted in hydroelectric, thermoelectric, and wind power plants. On account of the controller (EDLPC) for the AVR has been proposed which contained an emotional deep neural network (EDNN) structure and an artificial emotional Q-learning algorithm.
The number of the parameters to be tuned increases when the complexity of the controllers increases. As the advances in computational systems have increased in the last few decades, metaheuristic optimization algorithms have become more prevalent in optimization problems. The general principle of these algorithms was to minimize or maximize the selected objective function so that the terminal voltage level was kept more accurate. The optimum magnitude of each controller parameter was investigated among a specified value of candidates, which are generally chosen randomly in a bounded search space. Then, the optimum value was iteratively searched using the optimization algorithm's principle without complex mathematical derivations. In order to obtain a fast response with good transient-state, ABC [20], AOA [7], CS [15], ECSA [25], EOA [16], FSA [17], IKA [1], IWO [23], PSO [8], [33], SCA [24], and hybrid algorithms [9], [22] can be found in the literature. Each optimization algorithm has own superiority to the others to find the optimal solution [34].
Generally, the search spaces for conventional PID controller parameters have been defined between 0.2 and 2.0 [13]. Different types of objective functions have been formulated in order to find the optimal controller parameters. Error-based performance indices, time domain specifications, and frequency domain parameters have been used frequently. Commonly preferred performance indices are ISE, IAE, ITSE, and ITAE, time-domain specifications are maximum peak (Mo), overshoot (OS%), steady-state error (ess), settling time (ts), and rising time (tr) obtained from the step response data and frequency domain parameters are phase margin (PM) and gain margin (GM). In the literature, the objective functions have been formulated not only with one of the performance indices [22], [29], [32], but also the combined functions are defined with appropriate weighting constants [6]- [8], [11], [15], [21], [35]. A single function may not be efficient for the optimization of all controller parameters, while it is a difficult task to determine the weighting constants of combined objective functions [11]. A comparative study on the combined performance indices was evaluated with PID controller tuning by a tree-seed algorithm [14].
The performance of the controllers and the success of the selected optimization algorithms were evaluated against parameter uncertainties and voltage regulation of generator terminals [2]. The fluctuations in the terminal voltage, even small in magnitude, may cause severe damage to the connected electrical devices on the distribution network [35]. Therefore, the performance of the proposed controllers for the AVR has also been evaluated with respect to the transient and steady-state step responses and load disturbance rejection capability [25].

A. DISCUSSION ON THE PREVIOUS STUDIES
The studies in the literature on the control of the AVR can be investigated with the following highlights:  Proposed controllers  Proposed parameter optimization algorithms  Superiority comparison (other controllers or optimization algorithms) Among the controllers recommended for the AVR, there are a significant number of conventional PID and PID-based controllers. In Table I, selected studies on the AVR are summarized concerning the highlights above.
As seen in Table I, the studies on the control of the AVR can be classified into two groups. In the first group, the aim of the studies with conventional PID is to present how superior the proposed optimization algorithm is to the other algorithms. The only difference in these studies is the optimization algorithm, as stated in [2]. A good comparison can be found in [25]. In the remaining studies, new controllers are proposed with different optimization algorithms. Further critical comments on the optimization algorithms used for PID tuning with transient-state response specifications were given in [16].
Remark 1: In the light of the interest in metaheuristic optimization algorithms, the rising question is to understand how an optimization algorithm is suitable for the control of the AVR. It is evident that no algorithm fits all the optimization problems [3]. Each optimization algorithm has superiority over each other in different aspects, as stated in "no free lunch theorems" [36], [37]. New optimization algorithms are being developed to overcome the constraints of existing ones.
The metaheuristic optimization algorithms in Table I give satisfactory results if the following parameters are appropriately selected:  Sufficiently large and correct search space for each controller parameter  Sufficient number of population individuals  Sufficient number of iterations  Correct algorithm gains  Adequate number of free runs  The proper objective function(s) to be minimized or maximized Furthermore, the optimization algorithms can be improved according to the controller [25]. Besides, the whole performance of the proposed controllers depends on the robustness of the controller against parameter uncertainties and disturbances [2].
Remark 2: The efforts on the control of the AVR have been performed with a linear model of the AVR which includes an amplifier, an exciter, a sensor, and a synchronous generator [29]. The control input of the proposed controllers was applied directly to the AVR without any limiters. However, the control input must be limited against overexcitation and underexcitation of the synchronous generator. Overexcitation causes the excessive current in the field circuit of the generator which results in heating and underexcitation causes the generator to operate it outside of the underexcited region. The excitation limiters, which are overexcitation limiters (OEL) and underexcitation limiters (UEL) prevent the generator from operating out of the This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. allowable operating region [38], [39]. In addition to these limiters, overvoltage limiters (OVL), stator current limiters (SCL), and volts-per-hertz limiters are used in modern excitation systems [40], [41]. These limiters make the linear model of the AVR system non-linear [39], [42].
Since the practical application of the controllers proposed for the AVR is difficult, an effective way is to use suitable mathematical models which represent the actual performance of the excitation system of a synchronous generator. In this context, the models presented in IEEE standards can be used as the most appropriate mathematical models for academic studies [40], [41]. The protection accessories of the models presented in IEEE Std 421. 5 [41] are the excitation limiters which are generally neglected in the literature [43]. The simulation results, obtained from the linear model of the AVR without including OEL and UEL in the excitation systems, may not be valid for real applications [40], [41]. In practice, the range of excitation current is between 1.6-3.0pu. According to [43], the excitation current out of the limits is difficult to realize because of the magnetic saturation. Therefore, in the present study, the limits were defined in the direction of IEEE [44], which reflects the real exciter features in the simulation results.
Remark 3: An important barrier to the configuration of an optimization algorithm is the number of controller parameters to be tuned. As the number of controller parameters is increased, defining sufficiently large and correct search space for each parameter will be difficult. There are three parameters to be tuned for the conventional PID controller. However, up to 7 parameters were reported for different structures of PID controllers proposed for the single input single output the AVR [24]. It is usually preferable to have a single controller with the fewest adjustable parameters to accomplish superior terminal voltage regulation [45]. TSA IKA, LUS, ABC, PSO, DEA, PSA, BBO [15] CS PSO, GA, CAS [16] EOA PSO, ACO-NM,GA-BF [17] FSA ABC, TLBO, MOEO, NSGA [18] Canceling zeros by poles --- [25] ECSA Results of 21 different PID-based AVR studies [19] WCA GA, SA, DA, KHA, ABC, LUS, MOL, TLBO [20] Comparative analysis of PSO, DEA and ABC [46] PID with Filtered Derivative Action  

B. CONTRIBUTION OF THE PRESENT STUDY
In the previous section, common drawbacks of the recent studies were discussed. Generally, the evaluations were performed for the robustness of the proposed controllers against load disturbance rejection performance and parameter uncertainties. Adaptive control, self-tuning control, variable structure control, and direct feedback linearization (DFL) techniques were used to give dynamic stability to power systems over a wide range of operating points [47]. Therefore, conventional sliding mode control (SMC) is well fitted for the AVR control problem. Contrary to the previous studies, a novel SMC strategy is followed in this study. Tuning of the controller parameters is performed by using improved particle swarm optimization (PSO) algorithm.
The contributions of the present study can be outlined as follows:  Model-based sliding mode controllers are designed for the AVR systems with a novel sliding surface rule.  A straightforward design procedure of the controllers is provided step by step.  The limiters are introduced at the output of the controller and the exciter in accordance with the direction of IEEE standards.  The stability of the proposed controller is guaranteed in the sense of Lyapunov stability theorem subjected to the lumped uncertainty and output disturbances.  Traditional PSO is improved for the proposed controllers so that a customized objective function is defined for each controller parameter.  Only two controller parameters are optimized in the AVR system.  Overshoot at the output is restricted in the objective functions of the improved PSO.  Various operating conditions identical to previous studies are evaluated for comparison.  The effect of the limiters on the performance of the controllers is compared with the linear AVR.
 Enhancement of the improved PSO is compared with traditional PSO. The remaining of the study is organized as follows. In the following section, the AVR model with the limiters is introduced. In section 3, detailed design procedures of the proposed sliding mode controllers are derived. Different design requirements are explained for SMC in this section. The mathematical basis of the improved PSO for the proposed controllers is given in section 4. In section 5, detailed comparisons are performed between conventional AVR and AVR with limiters, traditional and improved PSO, SMC2 and SMC3. All the results are compared graphically and statistically with the related studies in the literature. Finally, all the results are summarized in the last section.

II. DESCRIPTION OF LINEAR AVR MODEL WITH THE LIMITERS
In previous studies, the authors preferred the state-variable methodology for the model of the AVR [48]. A conventional AVR mainly consists of four constituents: an amplifier, an exciter, a sensor, and a synchronous generator [2], [29], [49], as seen in Fig. 1. The mathematical model of each AVR constituent is simplified with the first-order transfer function, ignoring saturation or any nonlinear state [13]. In order to make the comparison in a fair and informative manner, the same mathematical model of the AVR is considered in the present study. Typical transfer functions of each AVR constituent are constructed by a time constant and a gain. The transfer functions and parameter ranges are given in Table II [24], [35], [49], [50].  It is possible to come across many studies in the literature that do not limit the control inputs. Nevertheless limiting the control input significantly affects the closed-loop performance of the controllers in real systems [51]. Unlike the cited studies, the limiters are introduced for the controller input and the exciter to prevent the generator from overexcitation and underexcitation. These limiters result in nonlinear characteristics [39], [42]. Because of this reason, the transient performance of the AVR system is crucially affected. The detailed structures of limiters of the AVR This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. system were presented in [40]. A saturation function is used to simplify the limiters that limit the control input and exciter output between their maximum and minimum values. The tracking of the control input was only given in [7], [11], [31], [32]. Different types of excitation system models were introduced in IEEE standards [40]. Among the excitation system models, the maximum and minimum control input defined for the DC1C excitation system model is considered for the present study. The output of the proposed sliding mode controller is limited between -0.9pu and 1.0pu and the saturation factor of the exciter is defined as 3.1pu. The schematic diagram of the AVR with the proposed SMC and connected to a distribution network is depicted in Fig. 2. In the present study, the load frequency controller is assumed to work stable.

III. PROPOSED SMC DESIGN PROCEDURE
One of the effective control schemes to obtain an accurate control input in the presence of model uncertainties and output disturbances is SMC. The SMC schemes can be classified as first-order SMC schemes which are also known as conventional SMC and high-order SMC schemes. In the conventional SMC schemes, the control input is obtained using a straightforward solution with the approximate model of the system [52]. This solution was also successfully applied with second-order SMC [53]. Another types of SMC schemes are second-order algorithms, namely, drift, twisting, super-twisting and sub-optimal [54].
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Among these algorithms, super-twisting control is more prevalent in the literature [55]- [58]. The SMC schemes can be either model-based or nonmodel-based. The non-model-based schemes have been widely used in practical applications at a price of limited performance. On the other hand, an approximate mathematical model is adequate to design the model-based SMC. Besides, the model-based SMC schemes provide robust control input that rejects matched uncertainties and output disturbances. In particular, their systematic design procedure with an approximate system model has made the SMC attractive since it was first introduced in the literature [53], [59]. Furthermore, fast dynamic response, high accuracy, stability, and simplicity of implementation are the other SMC features in industrial applications [60]. In addition, a sliding-mode based variable structure control was proposed for a nuclear reactor power system with LSA for obtaining an efficient controller against output disturbances and parameter uncertainties [61].
Because of the reasons mentioned above, the model-based SMC is preferred to control the AVR. The design procedure of the proposed controllers is as follows: Step 1: Exact mathematical model or approximate model of the system is obtained.
Step 2: A sliding surface function is defined with the system states. It is generally a function of tracking error and its derivatives.
Step 3: The equivalent control law is investigated in the derivatives of the sliding surface function.
Step 4: Ideal sliding mode is obtained.
Step 5: The switching control law is decided in the sense of stability.
Step 6: The control input is obtained by summing the equivalent and the switching control laws.

A. GENERALIZED SYSTEM DESCRIPTION
Consider an n th -order, uncertain, SISO, linear system with parameter uncertainties and output disturbances of the form:

Remark 4:
In practice, bounded uncertainties and disturbances are allowed to impact a system within the operating region. If the total impact of the uncertainties and disturbances pushes the system out of the operating region, the protective devices activate to protect the system. Therefore, we need to assume an uncertain bounded term in the model of the AVR system that impacts when the controllers are active in the operating region. In the literature, this approach was used in the mathematical model of electromechanical systems [52], [53], multirotor UAV controlled with SMC [62], and higher-order models of synchronous generators under external disturbances [63]. In addition, bounded external disturbance and system uncertainties were considered in the design of a robust statefeedback controller recently [30].

B. PROPOSED SLIDING SURFACE DESIGN RULE
In the conventional SMC, it is well-known that the construction of the sliding surface is the most critical step of the design procedure. In the present study, a new rule is proposed for the sliding surface. The proposed rule is suitable to design SMC with a relative degree of 1 for n thorder uncertain linear systems, as follows: where i k is the sliding surface parameter, 0 i k  . The tracking error is described as: where () Rs is the set point and () Ys is the output in Laplace form.
The control input is derived from the sum of the two control laws: where eqn u and swn u are equivalent and switching control laws for an n th -order system, respectively. The switching control law enforces the tracking error towards the origin of the sliding surface. The control law is designed as relay-like control to ensure a fast dynamic response against output disturbances. Therefore, it is also known as the discontinuous control law. The switching control law is directly related to the transient-state performance and disturbance rejection ability of the controller. When the tracking error reaches to the origin of the sliding surface, the equivalent control law keeps the system at the origin where both error and its derivative is zero. Hence, it is also known as the continuous control law, This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. which provides the performance of the controller at the steady-state. It is obvious that the modern systems are too complex to predict the actual behavior of the system with the uncertainties in the parameters caused by aging of mechanical equipment, thermal stress and other unpredictable reasons in the operating process. Therefore, in the academic studies, simplified mathematical models of AVR constituents have been used. When considering the all the system with uncertain parameters, we may need to represent the system with an approximate model obtained by open-loop response. Since, the proposed SMC schemes are capable of designing with the approximate model, we designed two types of SMC based on the degree of the system model.
In the present study, the open-loop unit step response of the AVR is used in the design procedure of the proposed sliding mode controller. Two different controllers are designed for 2 n  and 3 n  . The stability of both controllers is guaranteed in the sense of Lyapunov stability theorem. The third-order model is obtained directly from the open-loop model of the AVR, while the second-order model is approximated from the unit step response of the open-loop AVR model.

C. DESIGN OF SMC WITH SECOND-ORDER APPROXIMATED MODEL OF AVR (SMC2)
A second-order, uncertain, linear system with respect to (1) is as follows: Then, the transfer function of the system with nominal parameters, ( , ) 0 D s a  , in time domain is as follows: The sliding surface for 2 n  obtained from the proposed rule given in (5): Taking inverse Laplace transform of (11) results in: where In order to obtain continuous control law eq u , the derivative of () t  is taken until the control input appears. In the proposed rule in (6), it appears in the first-order derivative of (12):

k e t k r t y t t k e t k r t a y t a y t bu t
2 eq u can be found by 2 ( The equivalent control law with lumped uncertainty is as follows: Then, the control input becomes: The ideal sliding mode can be derived by substituting (17) into (14) as follows: Lyapunov stability theorem is generally preferred in the literature to guarantee the asymptotic stability of the conventional SMC schemes [52], [53], [61], [64].
( ) 0 t   must be satisfied for SMC of relative degree 1. Therefore, a positive definite Lyapunov function is selected as follows: Substituting (18) into the first time derivative of (19) gives: At this step, the switching control law is selected as:  If the switching gain is selected as , then the proposed controller is stable.

D. CHATTERING REDUCTION
Conventional SMC schemes suffer from chattering, which is a high-frequency oscillation of switching control law. As stated in [52], if the gain of switching control is set large, faster convergence is obtained with chattering in the steadystate. On the other hand, the convergence will be slow if the magnitude of the switching gain is small. In the literature, smooth switching is preferred [65].
A control input having chattering may lead to infeasibility for the real AVR applications. In the literature, fractional approximation [66], saturation [67], [68] or hyperbolic tangent (tanh) [64], [69], [70] functions were preferred for smoothing of control inputs of conventional SMC schemes whose relative degrees are generally one or two. Besides, drift, twisting, super-twisting, and sub-optimal sliding mode controllers were developed to overcome chattering without using a model of the controlled system [54]. For more smooth control input, tanh-based super-twisting controller was also proposed recently [56]. As a result, tanh is frequently the preferred function for smoothing control input of SMC.
In the present study, to get smooth transitions in the switching control, tanh function with a smoothing constant is preferred instead of sign function as follows [53]: where 2 sw k is the switching gain, Finally, the control input in (17) is found as: (24) Although the switching control is smoothed with (23), when a sudden disturbance has occurred at the output, the switching rule behaves as a sign function until the error converges to zero. At that time, the limiter, introduced at the output of the controller, limits the calculated control input. Then, the actual control input of SMC2 applied to the exciter becomes as in the following rule: The final control input, between the minimum and the maximum limits, changes smoothly.

E. DESIGN OF SMC WITH THIRD-ORDER OPEN-LOOP MODEL OF AVR (SMC3)
A third-order model of the AVR can be expressed with model uncertainties and output disturbances by using (1) as follows: Following the descriptions in (2)-(4), one has bounded lumped uncertainties, Then, the third-order model with the nominal parameters, in time-domain is as follows: In this step, the sliding function can be constructed for the third-order system using the proposed rule in (5): Time-domain representation of (27) is obtained by inverse Laplace transforming as follows: The first-order derivative of the sliding surface in (28) is taken to get 3 eq u : (27) into (30), one has: From (30), 3 eq u can be found by 3 ( The equivalent control law with the lumped uncertainty becomes 1 33 ( , ) . In order to derive the ideal sliding mode, the procedure in section 3.3 is followed. After simplifications, the ideal sliding mode is found as: Because of the systematic design procedure and the proposed rule for sliding surfaces, it is easy to guarantee asymptotic stability by using Lyapunov theorem. Choosing (19) and following the solutions, one can have the same switching control law given in (21). Then, in order to This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. overcome the chattering issue, the smooth control law in (23) can be used. At the end of the derivation of control input for the third-order model, the following expression with the smooth switching control law is obtained: As described in (25), the actual control input of SMC3 is limited as follows: The overall block diagram of the proposed SMC scheme is depicted in Fig. 3

F. ANALYSIS OF CONTROLLER PARAMETERS
In the present study, two controllers are proposed for the AVR based on the sliding surface function in (5) In addition, the smoothing factor in the switching control, sf k , can be selected as constant to reduce the chattering. By using the simplifications above, there are two controller parameters to be optimized, namely 0 k and sw k . In the real system optimization, trial-and-error method generally has been preferred by the expert staff for achieving the desired controller performance. In addition, Ziegler-Nichols and root locus tuning methods were also suggested for optimal controller parameters. As stated in [5], [6], [61], these methods are far from reducing the effects of parameter uncertainties and load disturbance. Therefore, metaheuristic search algorithms have been frequently preferred to find optimal controller parameters in the literature. In the present study, the PSO algorithm was improved for the proposed SMC schemes.

IV. IMPROVED PSO FOR THE PROPOSED SMC SCHEMES
The popular metaheuristic algorithms, generally called bioinspired algorithms, are based on the behaviors of animals in nature. In addition to animal behaviors, laws of chemical and physical reactions are also used to develop new optimization algorithms. Systematic classification of these algorithms can be found in [71]. The most popular algorithms used in optimization problems do not need complex mathematical derivations to characterize the swarming behavior of animals in nature. This is one of the reasons for these algorithms being popular in order to find optimum solutions for complex problems. The optimal solution is searched in the pre-defined search space subjected to the constraints of the problem. Among these algorithms, PSO is one of the most active optimization algorithms which is capable of finding the optimum solution. It was first proposed in [72] based on the behavior of fish or birds in nature. Because of its satisfying performance and its simple structure with an affinity toward manufacturing, PSO has been used in different applications.
PSO algorithm, by nature, optimizes the particles with respect to the positions of local and global best particles. Among the particles, the worst particle of the population is also moving in the direction of previous local and global best particles. Although current technology provides high-speed computations for simulations, it does not fit real systems. An applicable optimization algorithm to the real systems needs to be designed so that the algorithm is able to find optimum parameters with a minimum number of experiments. For this purpose, a novel strategy is improved in the proposed PSO algorithm.
In the present study, traditional PSO is improved for the optimization of proposed SMC parameters. The principle of the improved PSO is based on shrinking the initial search space concerning the worst particle position. At the end of each iteration, the worst particle is exchanged for a new particle randomly selected from the updated search space. This property of the proposed PSO increases the probability of finding a global optimum in that space. Another property of the improved algorithm is using a customized objective function for each controller parameter. Instead of using a single or combined objective function, customized objective functions concerning the effect of controller parameters are introduced to get better optimization. Overshoot at the output of the generator terminal is not desired. Therefore, the particles that result in overshoot are labeled as the worst particles with a decay coefficient. In the literature, the worst particles were rarely used in PSO [73]- [75].

A. MATHEMATICAL DESCRIPTION OF THE IMPROVED PSO
where n is the number of variables uniformly distributed in each search space. The probability density of finding optimum parameters in the search spaces are in the following: Consider a swarm-based optimization of a controller having m parameters. In order to measure the performance of the controller by using the variables in (37) as the parameters of the controller, a set of customized objective functions are described as follows: In the present study, at each iteration of the optimization, m parameters are simultaneously assigned to the controller for n times. At the end of each iteration, the best and the worst objective function is determined as: Generally, large magnitudes of the controller parameters cause instability at the output. On the other hand, small magnitudes of the controller parameters do not provide satisfactory performance. The parameters that give best output are, in fact, the parameters that make up the best combination. In order to achieve good convergence to the global optimum parameters, the initial search spaces are shrunk at the end of each iteration with respect to the parameters that result in the worst objective magnitude. Then new parameters are selected within the new bounds and replaced by the worst ones: Exchanging the worst parameter of the iteration for the randomly selected new parameter in the corresponding search space increases the probability density of finding optimum parameters as follows:

B. IMPLEMENTATION OF THE IMPROVED PSO
Implementations of the traditional and the improved PSO algorithms are as follows: Step 1. Define the bounds of the search spaces for each parameter of the controller and select same number of particles randomly to generate initial positions of particles.
Step 2. Select the initial coefficients of the PSO algorithm: 12 , cc : Acceleration constants, 12 , Step 3. Set the particles sequentially to the corresponding parameters of the controller and run the system.

Step 4. Perform customized objective measurements of the particles of each parameter.
Step 5. Determine the local best, global best and local worst particles of the current iteration.
Step 6. Calculate the velocities of each particle and update the positions of the particles The velocities of each particle are calculated as follows: where iter is the iteration number of the optimization, The particles are updated as follows: Step 7. Update the bounds of each search space concerning the position of the worst particle of the current iteration.
Step 8. Exchange the worst particle of the iteration for the randomly selected new particle in the corresponding search space.
Step 9. Continue from Step 3 to Step 8 until the iteration number reaches its maximum.
The flowchart of the traditional PSO algorithm shown with solid lines and the improved PSO algorithm shown with the dashed line are depicted in Fig. 4.

C. OBJECTIVE FUNCTION SELECTION
The objective functions for the controller parameters are customized concerning the properties of the controller parameters on the control input and the output of the AVR. Since two parameters are to be optimized, two different objective functions are defined.
In conventional SMC, a large magnitude of switching gain increases the transient response performance of the system while it produces chattering in the control input. Therefore, there is also a dilemma of selecting the appropriate switching In order to compare the improved PSO with the traditional PSO, the following objective function, including all performance terms of (48) and (49) is constituted for the traditional PSO:

V. RESULTS AND DISCUSSION
In this section, the optimization results of the proposed sliding mode controllers with both traditional and improved PSO are presented. A second-order approximate model of the AVR can be obtained by using different mathematical methods [76], [77]. Besides, a graphical analysis of the step response of the AVR can be more beneficial for practical applications. First-order and second-order modeling methods based on the step response of a real system were presented in [78]. Since an approximate model of the AVR is adequate for the proposed SMC, the first-order plus dead-time modeling is used to obtain the second-order model of the AVR. In the literature, different orders of AVR models were also studied [31]. The forward path of the AVR is taken into account for the open-loop unit step response, which includes the amplifier, the exciter, and the generator. The sensor is omitted since the gain of the sensor is close to unity [2]. The forward path transfer function is obtained as follows [  The second-order approximate transfer function is obtained from the graphical analysis of the unit step response of (51) as follows: 2 19.4567 () 3.0295 1.9457 AVR Gs ss   (52) The unit step responses of the AVR and the approximate second-order model are depicted in Fig. 5 and the corresponding modeling error is given in Fig. 6. Modeling error according to the transient-state output of the transfer functions is between -2.048% and 2.45%.

FIGURE 5. Unit step responses of the AVR and its second-order approximate model FIGURE 6. Modeling error of the AVR and its second-order approximate model
Remark 5: The number of iteration and population size is directly related to how much an optimization algorithm is realizable. The increase in the number of simulations in the optimization causes it to move away from realization. In other words, it can be recommended to perform optimization that can be done with a small number of simulations. In Table III, simulation numbers are given for comparison. According to [73], the exchange of the worst parameter with a new randomly selected parameter increases the probability of finding the global optimum parameters of the controllers by using fewer simulations. Therefore, a small population size with a fewer number of iteration is selected.

A. TRANSIENT RESPONSE ANALYSIS AT NO-LOAD
In the present study, two different structures of controllers are proposed for the AVR by using the second-order approximate model parameters (SMC2) and third-order openloop transfer function parameters (SMC3). In order to present the effect of the limiters, simulations are performed with both conventional AVR (Fig. 1) and the AVR system with limiters (Fig. 3). Furthermore, the effectiveness of improved PSO over traditional PSO is also investigated. All simulations for the transient response analysis are summarized in Fig. 7. literature, different values of the constants have been used. In order to get a balance in the optimization 1 c and 2 c are selected as the same magnitude. The other parameter, w , indicates the inertia weight that enhances the ability of the algorithm. Not only the constant magnitude of w but also linearly changing rules were used in the PSO. Greater magnitude of w may lead to an explosion of the velocity that causes the particles to push out of the search space, while smaller value may cause a slower convergence to the optimal value [79].
In this study, these parameters are chosen so that all particle velocities to local and global positions are balanced. The specifications of the controllers and PSO are listed in Table IV. The optimum controller parameters are shown in Table V. In the optimizations, traditional and improved PSO are run with the same initial positions of the particles. The proposed SMC2 is used in both AVR systems and optimized with traditional and improved PSO. The corresponding transient responses of the AVR systems are depicted in Fig. 8. Similarly, the response of the SMC3 for each AVR system and optimization algorithms are shown in Fig. 9.
It is noteworthy that the AVR outputs in the transient-state are disturbed by the limiters introduced for the controller and the exciter as seen in Fig. 8 and Fig. 9. This is because the evaluated control input is cropped at the controller and the exciter outputs. Although the proposed controllers generate the necessary control input, the limiters became barriers to the desired fast response. Despite these obstacles, a good controller performance has been achieved. The corresponding control inputs generated by the proposed controllers are shown in Fig. 10 and Fig. 11. The calculated control inputs of the proposed controllers cropped at 1pu because of the controller limiters. It is clearly seen that the calculated control inputs are cropped by the limiter at 1pu. Another limiter, introduced at the output of the exciter, is also affected the excitation of the generator. In Fig. 12 and Fig. 13, the excitation signals of the generator in the transient-state are depicted for SMC2 and SMC3, respectively. A slight delay can be seen at the exciter outputs since the control input is cropped at 1pu. In addition, the exciter limiter at 3.1pu also reduces the excitation. Therefore, as seen in Fig.  8 and Fig. 9, the step response of the AVR with limiters is slower as compared with the response of the conventional AVR. In Table VI, time domain specifications are given. In general, better results were obtained when using the improved PSO for each controller and the AVR system. In the optimization of the traditional PSO, a single objective function is defined, traditional P , in (50). However, individual objective functions are defined for each parameter of the proposed controller in the improved PSO, sw P in (48) and eq P in (49). The tracking performance of traditional P , sw P , and eq P are given in Fig. 14, Fig. 15, and Fig. 16, respectively. As seen in Fig. 15 and Fig. 16, the magnitude of objective functions decreases rapidly in the first quarter of the total iteration, and fine-tuning is observed in the remaining iterations. The initial control input to the amplifier is at maximum allowable magnitude. Therefore, the exciter runs at the maximum. The sum of switching and equivalent control laws exceeds the upper bound of the limiters. Both control laws produced by SMC2 and SMC3 are shown in Fig. 17 and Fig.  18, respectively. As seen in the following figures, the chattering phenomenon of SMC is eliminated in the proposed controller schemes.
It is clearly seen that the controller is activated by the switching control laws in the transient-state by the nature of SMC theory. As the system states converge to the desired values, the magnitudes of switching controls converge to zero until the system is affected by any disturbance or uncertainties.
The proposed controllers generated the switching controls without chattering, as seen in Fig. 17 and Fig. 18. Besides, larger control inputs are generated using the controller parameters obtained from the improved PSO compared with the result of traditional PSO. At the end of the transient-state, all the switching controls converged to zero as expected. In the steady-state, the equivalent controls drove the system as seen in Fig. 19 and Fig. 20. In the steady-state, the system was driven by the equivalent control laws, while the switching control was dominant in the transient-state. The relative degree of the proposed controllers is 1, and the stability of the controllers is guaranteed in the sense of the Lyapunov stability theorem. Fig. 21 and Fig. 22 clearly show that the sliding surface functions converge to zero in a finite time. In this section, a comprehensive analysis of the proposed SMC2 and SMC3 controllers was evaluated on the conventional AVR and the AVR with limiters. The negative effect of the limiters is seen in the figures reflected in the outputs of the system, the control inputs, and the tracking performance of the sliding surface functions. Despite the obstacle of the limiters, both the proposed controllers and the improved PSO have successfully brought the output of the system to the desired value.
In the remaining sections, the results of SMC2 and SMC3 optimized with the improved PSO for the AVR system with limiters are used.

B. PERFORMANCE COMPARISON AT NO-LOAD
In the literature, the performance of the proposed controllers is commonly compared with the time-domain specifications as maximum peak value (Mp), overshoot (OS%), rise time (tr, from 10% to 90%), settling time (±2% or ±5% band). Besides, the error-based performance indices (ISE, ITSE, IAE, ITAE) were also evaluated to indicate the superiority of the proposed controllers and corresponding optimization algorithms [16].
It is clear that the performance of the controllers with limiters is different than the proposed controllers without having any limiters. The biggest challenge in claiming a good performance is to provide all the performance indices in balance. As stated in [16], minimum rise time results in a larger overshoot. However, when there is no overshoot at the output, a long rise time is observed. It is noteworthy that the overshoot at the output is not desired feed-back control systems but may be acceptable if it is less than 5% of the desired terminal voltage [35].
In the present study, the overshoot is limited at 0.1% of the desired terminal voltage in the definitions of objective functions since a larger overshoot deviates the terminal voltage causing a large variation in reactive power flow. In order to figure out the whole performance of the proposed controllers in a fair manner, not only the effect of limiters must be included in the evaluation, but also the performance  of the optimization must be considered. In Table VII, the reported time-domain specifications from cited studies are given to compare with the proposed SMC performance. It can be concluded from Table VII that the proposed controller having two parameters exhibits good performance at the no-load condition. Another remark to note is that the overshoot is under 0.1% without sacrificing the rise time and settling time.

C. ROBUSTNESS EVALUATION AGAINST UNCERTAIN PARAMETERS
The properties of AVR constituents vary due to the load variations and aging in their lifetime [2]. Therefore, robustness against parameter uncertainties and load at the generator terminal was evaluated in the literature. The time constants of the AVR constituents were changed and the corresponding step responses were reported as either graphically or giving time-domain specifications [1], [3], [10], [11], [13], [14], [17], [19], [35], [46]. Generally, the time constants were changed with 25% steps from -50% to 50%.
Similar to the literature, the performance of the proposed controllers is evaluated. In Table VIII, the robustness analysis of SMC2 against parameters uncertainties is given and corresponding outputs are depicted in Figs. 23-26.   Similarly, the robustness analysis of SMC3 against parameter uncertainties are given in Table IX, and corresponding outputs are depicted in Figs. 27-30. All the measurements are performed with the optimized parameters of the proposed controllers given in Table IV.  As seen in the figures related to the robustness of the proposed controllers, the stability is kept in the event of uncertain parameters. The output of the AVR changes slightly. At the end of transient-state, no steady-state error was observed.  A comprehensive comparison can present how the proposed controllers recover the output subjected to parameter uncertainties. Since the overshoot changes the direction of power flow, a new comparison criterion is considered. Concerning the uncertainty interval of the AVR constituents from -50% to +50% changes in the time constants, the average overshoot rate shows how much the controllers generate an accurate control input in that interval.
In the present study, the average overshoot rates of the controllers in Table X are also calculated. It is clearly seen from the results that the proposed SMC schemes are most robust to parametric uncertainties. The proposed controllers generate the most negligible overshoot at the generator terminal. The results proved the superiority of SMC2 and SMC3 over the compared controllers in the sense of robustness against the parameter uncertainties.

D. ROBUSTNESS EVALUATION AGAINST LOAD DISTURBANCE
Another robustness criterion for the AVR control is the load disturbance rejection capability of the controllers. Less than 5% of rated terminal voltage deviation may be allowable [35] but the controller should suppress the disturbance even if more than 5%. In the literature, the disturbance rate is generally selected as ±10% of rated terminal voltage [14], [16], [24]. In Fig. 31, the injected disturbance and the corresponding the AVR outputs are depicted for SMC2 and SMC3. +0.1pu disturbance is applied at 2s and removed at 4s, then -0.1pu disturbance is applied at 6s and removed at 8s. Since 0.1pu step disturbance is injected, the initial measurement starts with the magnitude of the step, and then the output enters and remains in the ±5% error band in less than 0.4s. OS% in [35] OS% in [10] OS% in [11] OS% in [14] OS% in [19] OS% in [20] OS% in [ OS% in [35] OS% in [10] OS% in [11] OS% in [14] OS% in [19] OS% in [20] OS% in [

E. ROBUSTNESS EVALUATION AGAINST ABRUPT AND FOLLOWED BY MONOTONICALLY CHANGING DISTURBANCE
In the event of a sudden failure, a large increase or decrease in the magnitude of the voltage may occur. Furthermore, this failure may continue monotonously. In such fault situations, the accurate control input is particularly critical to keep the output voltage at the reference value. In order to evaluate the robustness of the proposed controllers, the following scenarios are applied to the AVR system.

Scenario 1: An abrupt change then monotonically increasing output
Assume that there is a fault that increases the voltage of the distribution network abruptly and then it increases continuously. In this case, the AVR system should be able to stabilize the output at the reference value. For this scenario, the output of the AVR is increased more than 25% of the reference at 3 rd second and then monotonically increased up the 60% during the remaining 17s. The response of the AVR system with both controllers is depicted in Fig. 32. It is clearly seen from the figure that the controller recovers the abrupt change in 1s. In addition, the maximum errors measured at 20 th second are 0.019pu for SMC2 and 0.027pu for SMC3.
There are two obstacles to recovering the output voltage in the present study, namely, the limiters. The outputs of SMC2 and SMC3 controllers and exciter outputs corresponding to the fault in this scenario are depicted in Fig. 33 and Fig. 34, respectively. The monotonic increase is well covered by the controllers.

Scenario 2: An abrupt change then monotonically decreasing output
This scenario is the reverse of the first one. In this scenario, a decrement at 3 rd second is seen, and the voltage is reduced monotonically to down to 60% of the reference. The proposed controllers generate the accurate control inputs to recover the abrupt change in 1s as in the previous fault. Although the fault is continuous, the proposed controllers generate the accurate control inputs so that the maximum errors at 20 th second are 0.019pu for SMC2 and 0.027pu for SMC3. The corresponding output of the AVR system with both controllers is depicted in Fig. 35. In this fault scenario, only the outputs of the controllers are affected by the limiters. The necessary excitation outputs are within limits. The generated outputs by SMC2 and SMC3 are shown in Fig. 36 and Fig. 37, respectively. These two scenarios show that the proposed controllers subject to the limiters are robust against whether the sharp change or monotonic change occurs is seen at the distribution line. The absolute error measured at the end of the two scenarios is less than 5% even if the perturbation at the output reaches nearly ±60% of its nominal value.
Obviously, the performance of a controller optimized for a nominal operating point does not guarantee robustness during its lifetime [2]. Therefore, designed SMC2 and SMC3 optimized for a nominal operating point are evaluated without changing controller parameters. From the results above, the proposed controllers exhibit reliable performance against parameter uncertainties and load disturbances. The controllers generate fast and accurate control inputs to maintain the output at the rated value.
The AVR efficiency, which decreases with the effect of aging, is also investigated in this study. The forward-path gain of the AVR is reduced by 10%, 20%, and 30% of its nominal value. Then, the proposed controllers optimized for the nominal operating point are still able to generate accurate control inputs that result in no steady-state error at the generator terminal.

VI. CONCLUSIONS
In the present study, two sliding mode controllers were designed and implemented to control AVR in the presence of parametric uncertainties and load disturbances. Unlike the studies in the literature, limiters were used to limit the control input. A saturation factor was introduced at the output of the controller and the exciter in accordance with the direction of IEEE standards.
A systematic design procedure of control inputs was described in detail. A novel rule for sliding surfaces was proposed that varied with respect to the degree of the controlled system. The stability of the proposed controllers was guaranteed by Lyapunov stability theorem concerning the lumped uncertainties. Only two controller parameters were optimized with the improved PSO. Due to its simplicity, minimum population size and iteration were used in the optimization. Therefore, the computational cost was also minimized.
Although the limiters caused a delay in the output of the controllers and exciters, the performance of AVR was considerably kept well as compared to the conventional AVR. Besides, the new features of the improved PSO enhanced the optimization of controllers.
The well-known drawback of the SMC schemes, chattering, was reduced by using a frequently preferred smooth function, hyperbolic tangent, in the switching control law.
The performance of the proposed controllers was also compared with the recently published studies. The results of the identical operating conditions showed that the proposed controllers generated more accurate control input. The overshoot at the output was minimized without sacrificing the transient performance. Although the forward gain of the AVR was reduced concerning the effect of the aging factor, there was no steady-state error observed at the output. Further analysis on the robustness was performed for the abrupt and monotonic changes at the output of the AVR. The proposed controllers generated accurate control inputs so that the error at the output is less than 5% of its nominal value. Finally, two new sliding mode controllers were designed for the AVR in agreement with IEEE excitation limiters. Owing to the excellent outcomes given in graphically and statistically verified that the proposed controllers are stable and robust against parametric uncertainties, load disturbances and decreasing efficiency. Since most AVR studies focused on the PID controller, SMC can be a good alternative to PID as a new controller.
The systematic design procedure and the results of the proposed SMC schemes provide a good starting point for the application of SMC schemes on the AVR system and encourage us to investigate the performance of other SMC schemes in the future. Since the switching control law is dominant in the transient-state, evaluation of the performance of other smooth control laws is another aim of our future studies.