Regulation of Voltage and Frequency in Solid Oxide Fuel Cell-Based Autonomous Microgrids Using the Whales Optimisation Algorithm

This study explores the Whales Optimization Algorithm (WOA)-based PI controller for regulating the voltage and frequency of an inverter-based autonomous microgrid (MG). The MG comprises two 50 kW DGs (solid oxide fuel cells, SOFCs) interfaced using a power electronics-based voltage source inverter (VSI) with a 120-kV conventional grid. Four PI controller schemes for the MG are implemented: (i) stationary PI controller with fixed gain values (Kp and Ki), (ii) PSO tuned PI controller, (iii) GWO tuned PI controller, and (iv) WOA tuned PI controller. The performance of these controllers is evaluated by monitoring the system voltage and frequency during the transition of MG operation mode and changes in the load. The MATLAB/SIMULINK tool is utilised to design the proposed model of grid-tied MG alongside the MATLAB m-file to apply an optimisation technique. The simulation results show that the WOA-based PI controller which optimises the control parameters, achieve 62.7% and 59% better results for voltage and frequency regulation, respectively. The eigenvalue analysis is also provided to check the stability of the proposed controller. Furthermore, the proposed system also satisfies the limits specified in IEEE-1547-2003 for voltage and frequency.


Introduction
The development of modern power electronics with the combination of distributed generation units led to the new notion of microgrid system (MGS).The MGS is considered as independent generating unit in the conventional power system that includes several distributed generators (DGs) and sensitive loads [1,2].The enhanced power quality and reliability of the supplied power for sensitive loads and increased utilisation of renewable energy sources (RES) are the main advantages of MGS.Moreover, owing to the proximity with the consumers, MGS provides added benefits to consumers and utility service providers.To achieve better performance, these DGs are commonly interfaced electronically to the microgrid (MG) using power inverters [3,4].The MGS incorporate an ingenious perception for DG units application and empower interconnection of several distributed energy resources (DER's) with the ability to independently operate within the power system requirements [1,3,[5][6][7][8].Although this arrangement can bring significant flexibility in the control of power distribution system, it shall also cause some intricate control-related problems.
The MGS works in conformity with the conventional grid.As a bulk power system, a MG can control the voltage and frequency of the interconnected system by managing power-sharing issues within MGS and the grid [9,10].However, in the case of any fault on the grid or the need to disconnect it due to some maintenance, the MGS should operate independently from the grid (in islanding mode), and must supply uninterrupted power to the load centres.During islanding mode, MGS is responsible for maintaining voltage and frequency of the supplied power within limits set by the distribution system.In this study, a control scheme is proposed to regulate voltage and frequency of the MGS system during its islanding mode and during the period of varying load.Furthermore, the coordination between multiple DG units for their power-sharing issue is also considered.To this end, this study applied a synchronous reference frame technique and an optimal PI controller to compensate the error between the reference and measured values by optimising control parameters to regulate voltage and frequency of an islanded MG.
During islanding mode of a MG, there may be voltage variation at a point of common coupling (PCC) and system frequency due to uncertainties in RES-based DGs [11].The proposed controller of this study is, as such, designed to address these variations to avoid power quality issues.Recently, many researchers have investigated power controllers for MGS based on inner current control loops for satisfactory MG operation.Methods for analyzing system dynamic stability while improving the system reliability and the parameters required for analysis and design of PV/Wind hybrid system are given at [12].The types of controllers utilized for microgrids (PQ and Vf), the criteria for power-sharing between the grid and MG during the grid-connected mode of MG and performance of MGS during islanding mode have also been analysed in [13][14][15].However, these systems did not consider the tuning of control parameters, which may be required during the transition of MGS operating modes or load variation.To arrive at an appropriate optimisation technique, power controller-based PSO has been proposed by [4,11,16] to regulate the voltage and system frequency for an inverter-based DG unit.In the referred papers, the researchers achieved a dynamic response of the system with total harmonic distortion (THD) within acceptable limits.However, those controllers lack the automatic tuning of control parameters of PI controller, and enhanced results can only be achieved by applying automatic tuning of the PI controller by using additional optimisation techniques, which can result in improved power quality of the system.Further, in [17], the authors have proposed GWO-based tuning of the PI controller for rotor and grid side converters to improve the dynamic behaviour of DFIG-based WECS.
Taking into consideration this earlier work, this study proposes a controller with automatic self-tuning of control parameters, using the Whale Optimization Algorithm (WOA) for better controllability of the power quality aspects of a MG.The proposed controller is designated to regulate the system voltage and frequency while the MG is either islanded or during varying load operation, thus maintaining the quality of supplied power.The proposed MG model consists of two 50 kW solid oxide fuel cells (SOFC) as distributed generators interfaced with a 120-kV conventional grid.The proposed system will be compared with the stationary PI controller without optimisation technique, PSO-and GWO-tuned PI controllers.Additionally, an eigenvalue analysis is also undertaken to verify the stability of the proposed system.
The paper is divided into the following sections: the structure of the MG and mathematical modelling of the three-phase grid is discussed in Section 2, the proposed controller details are given in Section 3, simulation results and discussion are presented in Section 4, and Section 5 summarizes of the conclusion of the paper.

Microgrid
This section describes the MG structure, interfacing with the conventional grid and the SOFC model, as elaborated in the following sub-sections.

Structure of Microgrid
An MG is an interconnection of different local loads and LV distributed generating units, such as wind turbines, solar PV panels, micro-turbines and battery storage systems [18].The model of the proposed modified grid-connected MG incorporating SOFC is shown in Figure 1.The group of radial feeders which form part of the distribution system are connected with DG units.Every DG unit has a dedicated feeder with a circuit breaker and controller for power flow instructed by the main controller (MC).The purpose of the circuit breaker is to disconnect DG unit and feeder to avoid any disturbance within the MG.The conventional grid and MG are connected at the point of common coupling (PCC) through a static switch (SS).The function of the SS is to transit the MG to islanding mode for maintenance purposes or during the occurrence of a fault.The DER's utilise power electronic-based circuits to interface with the MG.In general, these interconnecting agents depend on the type of device: ac-ac, dc-ac, or ac-dc-ac converter or inverter.Since the DG units connected in the MG are usually interfaced through power electronics-based devices, their control shall be subject to the control scheme selected for inverter control.Furthermore, for the enhancement of power system reliability, the MGS should achieve better performance in both of its operating modes.In islanding mode, the MGS is required to maintain voltage and frequency under specified values and sustain local load demand, while in grid-connected mode, the MGS acts as an active/reactive power generator because the conventional grid is taking care of power system conditions by maintaining its desired conditions [3,19,20].

Three Phase Grid Modelling
Figure 2 shows the model of VSI tied three-phase grid for this study.It can be noted that Rinv, Linv and C are the equivalent resistance, inductance, and capacitance of filter, respectively, while the inverter senses the grid itself.Further, Vs is the grid voltage, Rs, and Ls are the source resistance and inductance respectively.The state-space equations of the system in three-phase abc frame are given in Equations ( 1)-(3) [4,21]: where i a , i b and i c are three phase line current and V sa , V sb and V sc are three phase line voltage of the grid, and V a , V b and V c are line voltage of inverter.Equations ( 1)-( 3) can be converted in Equation ( 4) by using Park's transformation in the synchronous rotating dq frame: where υ d and υ q are dq axis voltage of the inverter.Additionally, the Park's transformation is defined as: In Equation (5), i d and i q are dq axis current of the inverter.The ratings of the three-phase grid are given in Table 1.

Model of SOFC
With the feature of the high potential efficiency of around 35-60% [22] fuel cells are the emerging technology in power generation.They have minimum to zero toxic emissions, noiseless operation and enhanced reliability as there are minimium moving parts.SOFCs generate electric power through an electrochemical process.The process starts with the electrolysis process to enable the exchange of ions with anode and cathode by passing hydrogen gas over anode and air on the cathode.In this process, the effectiveness of SOFC entirely depends on the reaction of an electrolytic process for transport of chemical ions between anode and cathode [23].The basic model of SOFC designed for the power system simulation given in [24] has been used as the DG in the proposed system of this study.Moreover, the control strategies proposed in [23] have been used to control the internal functions of the SOFC.

Proposed Methodology
The research framework of this study commences with the interfacing of DG unit with a three-phase conventional grid.The measured voltage, frequency and current from terminals of DG unit and PCC are given as input to the controller phase.In the first instance, the controller transforms three-phase abc values to synchronously rotating dq system and compare measured voltage (V) and frequency (f ) with reference values (V ref and f ref ) which are set to 1 p.u [11] in this case.Next the stationary PI controller with and without optimisation (PSO, GWO and WOA) minimises the error between measured and reference values which will generate current reference values (i * d and i * q ).The generated reference current is compared with a measured current of DG (ild and ilq) and accordingly compensates the error.Based on this compensation, switching system (SVPWM) generates gate trigger pulses and feed it to VSI to regulate voltage and frequency of the system.The performance of the proposed system will be compared to the PI controller with and without optimisation during switching of MG operation mode and load varying mode.

Control Strategy for VSI Based DG Unit
The proposed control strategy for the VSI based DG unit connected to the grid is shown in Figure 3.It is evident that the scheme for controller consists of three key blocks which are: power controller, the current controller, and optimisation block which are set for automatic tuning of the controller parameters.A brief description of each block is discussed in the following sub-sections.

Power Controller
The aim of adopting the proposed control strategy is to bring about better control of the power quality objectives during a sudden transition of MG operation mode or variation in load.As illustrated on the left-hand side of Figure 3, the power controller comprises of two conventional PI controllers.The power controller is contemplated as an outer loop of the proposed control system; the primary purpose of the outer loop is to generate current reference values i * d and i * q .If the reference current trajectory is slow, the power output of inverter will be of high quality [16].Owing to the limitations of the fixed value conventional PI controller, the gain values are set as fixed values (K p = 6.2836,K i = 7.3694) [25].The PI controller is not capable of achieving optimal results in regulating control objectives automatically.With this arrangement, an optimal self-tuning for PI controller gain values based on optimisation techniques (PSO, GWO and WOA), is applied to achieve better control objectives.In islanding mode of the MG, voltage and frequency are the two principal goals which need to be regulated.In this instance, the reference trajectory for regulating frequency and voltage depends on their reference values (V ref and f ref ).Furthermore, the proposed controller with and without optimisation separately generate control objectives, but as the WOA is an intelligent process and achieves a dynamic response in optimising PI controller gains.Therefore, it will provide optimal control parameters to yield the best reference current vectors as compared to GWO and PSO.Subsequently, the values of reference current generated by outer loop are expressed in Equations ( 6) and ( 7): where, K p_v and K i_v are PI controller gains for regulating the voltage of the inverter, whereas K p_ f and K i_ f are PI controller gains for regulating the frequency of the system during islanding mode of the MGS.

Current Controller
Figure 3 also illustrates an inner loop of current control which is based on a conventional PI controller and synchronous reference frame (SRF) technique, for generating a compensation signal v * d and v * q .This controller is usually used to minimise inductor impulse current error and to generate the amount of compensation required to minimise the effect of short transients in the inverter output current.Park's transformation has been used in the phased locked loop (PLL) to detect the phase angle.Besides, two conventional fixed value PI controllers are used to reduce the error between measured (i ld and i lq ) and reference current (i * d and i * q ) values.To enhance the steady state and dynamic response of the system, the inverter current loop and grid voltage feed-forward loop have been used.Subsequently, the synchronously rotating output of the current controller is converted back to abc frame by using inverse Park's transformation.Furthermore, by using Clarke's transformation, the voltage reference signal is obtained in the αβ axis for producing gate pulses through SVPWM to trigger VSI.The SVPWM technique is also utilised to confirm that the desired value of voltage given by the controller also has less THD.
The reference voltage values generated by the inner controller are expressed in synchronous dq frame as: where K p and K i are PI controller gain values of inner (current) controller.Subscript '*' designates reference values: Equation (8) can be converted to the abc frame and then to the αβ frame by applying the inverse Park's transformation and Clarke's transformation, respectively, as follows: Moreover, a low pass filter (LPF) is used to obtain the inductor current [7].In this study, the first-order transfer function is presented as LPF and is given by: where f is the value of input filter, f l is the filtered value, and T i is the time constant.

Design of WOA for Tuning of PI Controller Parameters
The optimal tuning of PI controller parameters based on the WOA technique is described in this section.The background and workings of WOA along with the parameter selection and execution of the WOA technique are further discussed in the following subsections.

Control Structure Based on WOA for PI Controller
The controller for regulating voltage and frequency based on the conventional PI controller and PSO based PI controller have been used in [11].In this case, the outer control loop (power loop) is used to separately regulate voltage and frequency of the system to generate a dq reference current i * d and i * q ).Under such a scheme, two PI controller loops are employed and required to be optimised by the WOA to enhance the power performance.Furthermore, the inner loop (current controller) regulates these two reference currents associated with compensation terms (v d and v q ), to achieve a final controller output (v * d and v * q ).The overall scheme of the proposed controller is shown in Figure 4.The relevant equations for the controller are already discussed in Section 3.1.
where V ref is reference voltage, f ref is reference frequency which are set to 1 p.u. V and f are the measured voltage and frequency at the terminals of the VSI.The simulation time is given by 't' and: during transition of MGS operation mode (14) and: subject to during load changing mode (15) where K p_v , K i_v , K p_ f and K i_ f are the PI controller gain values for the regulating voltage and frequency of MGS during transition mode of operation and K pv_load , K iv_load , K p f _laod and K i f _laod are gain values of the PI controller for regulating the voltage and frequency of the MGS during load variation mode.
The range of values for PI controller are selected based on a trial and error method as presented in [11].
The objective function designed for the formulation of the optimisation problem is based on the relationship between the system performance and time to get enhanced performance from the controller to respond.In this way, the optimisation techniques were selected by a trial and error method and the three closest best techniques were considered for this study.Furthermore, for analysing the system response and ability to respond to changes in the process, the following system parameters are considered; (i) maximum overshoot, (ii) rise time, (iii) settling time and (iv) steady-state response.Further, the integral time absolute error (ITAE) is considered in this study to measure the performance index of the controller as in Equations ( 12) and (13).

Whale Optimization Algorithm
WOA is a new population-based meta-heuristic algorithm developed by Mirjalili et al. [26] in 2016.Whales have one unusual feature; that is, they are considered as one of the most intelligent animals since their brain has some common spindle cells similar to the human brain [27].Due to the presence of these spindle cells, we humans became distinct creatures of the world as these are responsible for the decision, feelings, and community behaviour.Whales brains contain double the number of these spindle cells than the brain of a human, which is the core basis of their intelligence.Whales have the proven ability of thinking, learning, judging, communicating and become emotional as an adult human does, but with a lower level of intelligence.It has been perceived that mostly killer whales are capable of the development of a communication dialect too.
The social behaviour of whales is also an interesting point; they either live alone or in groups, though, mostly they are observed to live in groups.However, some of their breed (killer whales) prefer to live in a family for their entire life.The biggest mammal is a whale (humpback whale), and an adult whale is nearly the size of a school bus and their favourite prey are krill and small fish herds.Further details of WOA has been discussed in [26,28].

Mathematical Formulation for devising of WOA
The following are the mathematical formulation steps of WOA as in [26]: 1. Encircling prey whales Initially, humpback whales recognise the location and then encircle the prey.Foremost, the algorithm of WOA assumes the present best solution of the candidate as the target prey or the solution close to optimal search agent, as the position of the optimal solution is not known a priori.Once the best solution is defined, the other whales (search agents) will then try to update their individual position towards the best solution.The mathematical relationship of whales encircling prey strategy can be represented by the following equations: where (it) indicates the current iteration, the position vector for best solution obtained so far is denoted by → Y and → Y p is the best position vector; the vector coefficient D and → E can be calculated by using following two equations: Here, over the course of iterations the value of

Attacking mechanism of the WOA (bubble-net hunting)/exploitation phase
In order to mathematically model the bubble-net behaviour of humpback whales, two approaches are defined in [26]: Shrinking encircling mechanism (First approach) The shrinking behaviour of whales is attained by decreasing the value of → d as in the Equation (18).
It may be noted that the variation range of A detailed discussion about shrinking encircling is given in [26,29].

Spiral updating position
In order to design spiral updating position behaviour, the following equation is used: During hunting, whales use to swim around the prey in the abovementioned two methods simultaneously.In order to update the position of whales, 50% probability is considered for these two methods as follows: where F = Y p (it) − Y(it) represents the best position between whale and prey, e is constant to define shape of a spiral, l is a random number between 1 and −1.Equation ( 21) defines the approach of updating the spiral position.

Prey Searching (exploration phase)
The process of exploration (searching) is also based on the fluctuation of the vector.Based on each other's position, humpback whales search the best position randomly.To get the optimum global position, following equation is used: where Y rand is a random whale (random position vector) is chosen from the current population.
Concluding, WOA have only two key internal parameters to be adjusted i.e., → D and E.

Algorithm for WOA to Obtain Optimal PI Controller Values
In order to implement WOA in determining the optimal PI controller gains (K p and K i ), the following steps are undertaken, as shown in Figure 5.The pre-defined parameters for WOA are a maximum number of iteration (it max ) and population size (NSA).In this study the number of iterations considered are 100.These values shall help in determining optimal solution and execution time of the algorithm.Further steps of applying the WOA are stated as follows: Step 1-Initialization At first, NSA, it max and boundaries of the system parameters are initialised, which are the driving sources of the algorithm.

Step 2-Calculation of Fitness Function
The initial best value of fitness function is calculated and simultaneously update the vector coefficients (D, E and d) and another variable (l and p).

Step 3-Quality Solution
In determining a quality solution, the constraint of each search agent is checked and if constraints are satisfied the value for the best position will be calculated using Equations ( 17), ( 20) and (23).

Step 4-Choose Best Position So Far
The position of search agents is updated for each iteration and then included in Equations ( 17), ( 20) and ( 23) to save the best solution for the current iteration.
Step 5-Calculation of New Positions of Search Agents The new positions of the search agents are determined, and the whole process is repeated.
Step 6-Termination In the proposed study, the stop criterion is set as it max .When the criterion is satisfied, then the simulation is stopped, and the optimum value for K p and K i which satisfy all the specified constraints of the proposed controller system are obtained.

Case Studies and Proposed Test System
The proposed WOA has been applied to achieve optimal performance of a PI controller to regulate the voltage and frequency of a MGS in two case studies; transition of the operation mode and load changing mode.The output of the proposed controller is compared with PI controller without optimisation, PSO and GWO tuned PI controllers.The parameters of the system are represented in per unit (p.u) system, and simulation is carried out in MATLAB/SIMULINK 8.3.0.532 (R2014a).The simulation model of the proposed system is shown in Figure 5. Two cases are investigated in this section; the first case includes the performance of the proposed controller during a change in MGS operation mode considering the optimisation objectives as given in Equations ( 12)-( 14).The second case investigates the performance of controller when the load varies, for which the control objectives as described in Equations ( 12), ( 13) and ( 15) are considered.

Simulation Results of Case 1 (Change in MGS Operation Mode)
The plot of fitness function obtained from all three optimisation techniques is shown in Figure 6a,b.It is evident from this plot that the convergence speed and stability of WOA is the highest as compared to other two techniques because of its appropriate arrangement for exploration and exploitation processed.Furthermore, it is noted that for the smallest value of fitness function, WOA is giving the optimal values for PI parameters which verify the best comprehensive convergence curve of WOA.
The simulation results obtained from the proposed controller for regulating voltage and frequency during the transition of the operation mode of MGS are given in Figure 7a,b, respectively.An MGS can function in both of its operation modes; islanding and grid connected.In general, MGS changes its operation mode due to maintenance on the power grid or due to some fault, and in either situation the MGS must maintain a stable and reliable supply of voltage and frequency to the consumers.
The effectiveness of proposed controller for the grid-connected MGS during transit to islanding mode at 0.5 s is analysed.This result in a fluctuation in voltage and frequency at PCC.However, the results obtained from WOA tuned PI controller shows the smallest overshoot (≈0.02 s), minimum rise time (≈0.03 s) and settling time (≈0.03 s) in voltage parameter and (≈0.04 s), (≈0.03 s) and (≈0.14 s) overshoot, rise time and settling time for frequency parameter.Further, WOA-tuned controllers regulate the voltage and frequency more smoothly as well as the steady state time of WOA is also less compared to PSO-and GWO-tuned controllers.The searching process of WOA for finding optimal gain (K pv , K iv , K pf and K if ) is shown in Figure 8a,b.

Simulation Results of Case 2 (Load Changing)
The fitness function plots acquired for voltage and frequency during this test case from WOA, GWO and PSO are shown in Figure 9a,b, respectively.It is evident from these illustrations that, the speed and stability of convergence curve of WOA are highest when contrasted with GWO and PSO because of its covenant planning for exploration and exploitation process.Also, WOA is giving the smallest fitness value along with optimal values for the PI controller, which proves its process as comprehensive for finding the best values.The simulation results obtained from the proposed controller for regulating voltage and frequency during the variations in connected load are shown in Figure 9c,d.It is evident that an MGS in its islanding mode is capable of coping with sudden variations in the load by regulating the voltage and frequency.
In order to determine the efficiency of the proposed controller during islanding mode of MGS, the load is decreased from 4 kW to 2.5 kW at 0.7 s.At this point, there occurs a fluctuation in the voltage at PCC.The results achieved are shown in Figure 9c,d.The WOA-based controller has the smallest overshoot (≈0.01 s), minimum rise time (≈0.02s) and settling time (≈0.04 s) in voltage parameter but have almost similar overshoot, rise time and settling time in case of frequency parameter.Further, the proposed controller is regulating these parameters very smoothly when compared with other techniques.Also, the steady state time of WOA is less as compared to two other techniques.The searching process of WOA for finding optimal gain (K pv , K iv , K pf and K if ) during load changing mode are shown in Figure 10a,b.

Comparative Results for both Cases
It can be noted that algorithms for WOA, GWO and PSO for both the cases are applied for offline optimisation, and when the optimal parameters for PI controller are obtained, the attained parameters will be used in the PI controller.The PI parameters obtained from offline optimisation of all algorithms in both cases are summarised in Table 2.
The integral time absolute error (ITAE) indices of two cases as in Equations ( 12) and ( 13) are also calculated and presented in Table 2.In both cases, WOA has slightly lower ITAE indices for voltage and frequency parameters.For the case 1, the ITAE indices for the voltage during transition mode of WOA is 90% better than that of GWO, and 69.23% better than of PSO.The indices for WOA in the case of regulating frequency is 75.15% and 83.44% better as compared to GWO and PSO, respectively.Furthermore, the performance of WOA in tuning PI controller during load varying is 90.9% and 71.42% improved as compared to GWO and PSO for the voltage and in the case of frequency the minimisation is higher as 81.25% and 72.22% concerning GWO and PSO, respectively.Further, the overall performance of regulating voltage and frequency in both cases is reviewed in graphs provided in Figure 11.In both cases, WOA achieves the least value for control objectives and minimises the error between measured and reference values.Besides, it can be promptly seen from Figure 7a,b and Figure 9c,d that the overall control objectives are reduced in both cases, and their correlative ITAE indices are given in Table 2. To conclude, the closest optimum solution with relatively minimised error is achieved by WOA algorithm as compared to GWO and PSO.Thus, the overall performance of WOA is optimum and satisfactory.
In utilising WOA technique, the total harmonic distortion in supplied voltage (THDv) and current (THDi) also reduces to a satisfactory level as mentioned in IEEE-1547-2003 standard.The values of THD are mentioned in Table 3.It is evident that the values of THD with WOA algorithm are less as compared to GWO and PSO.
To this end, Table 2 provides statistical results/analysis of all three algorithms after running each algorithm for ten times.In all these cases, the obtained optimal results were similar regarding mean and standard deviation.There was no change in the solution up to predefined trials and 20 decimal places.Hence, WOA, GWO and PSO all have generated consistency in finding the optimal solution.
The WOA provides the fastest convergence as compared to other algorithms.However, a pre-developed convergence curve may generate a low-quality solution.Among all three cases, WOA achieves optimal results in low computational time as can be seen from Table 4, GWO and PSO have higher mean processing time than WOA.In the case of transient studies, computational time is of great importance.Therefore, processing time weighs a significant importance in the solution of algorithm's steps.Table 5 shows the results of eigenvalue analysis for the oscillatory modes of operation obtained from the solution of system state matrix A MG .The analysis of the model determines that the nine eigen pairs exhibit three real parts and six complex conjugates.Values from 1-14 eigenvalues characterise the seven oscillatory modes of the VSI system, and the obtained values of all these modes are negative.Thus, it specifies that system (as given in Table 1) offers excellent dynamic properties within given conditions of operation and the optimal control parameters achieved from the WOA algorithm as given in Table 2.The remaining two pairs 8 and 9 are also negative real numbers and describing the network and load oscillatory modes, respectively.Hence, the simulation results as shown in Figure 7a,b and Figure 9c,d, and the eigenvalue analysis authenticates that the performance of the proposed controller is reliable and stable with the application of WOA algorithm.From the calculations, it has been observed that the maximum time-delay that the proposed controller can maintain the stability is 0.02 s.

Conclusions
The transition of MG operation mode and the variations in load value affect the power supply quality pertaining to voltage and frequency.The issues of voltage and frequency fluctuation will disturb the end users.For this, a robust controller has been proposed in this study to regulate voltage and frequency of an autonomous microgrid during the sudden transition of MG operation mode and variation in load.The proposed controller comprises of Whales Optimization Algorithm for interactive tuning of PI controller to achieve optimum output from the controller.The performance of proposed controller has been evaluated and compared with Grey Wolf Optimizer and Particle Swarm Optimization-based controllers.Based on the switching of MG operation mode and variation in load, the proposed controller achieved optimum values with faster response and minimised transient and steady state time of system control parameters.Moreover, the performance index of WOA-based controller is better as compared to other techniques and it has fewer THD values in the output voltage and current of the system.The simulation results also proved that the WOA-based PI controller which optimises the control parameters achieves 62.7% and 59% better results for voltage and frequency regulation, respectively.The eigenvalue analysis is also provided and the obtained results verify the system stability of the proposed controller.

Figure 1 .
Figure 1.Block diagram of the proposed modified model for a grid connected MG incorporating SOFC.

Figure 2 .
Figure 2. Three Phase Grid connected with DG units.

Figure 3 .
Figure 3. Internal structure of the proposed controller.

→d
is decreasing from 2 to 0. The value of r 1 and r 2 ranges between 0 and 1 and the magnitude of → D is a random number that lies within the range [− → d , d].

→D
is also in between [− → d , d].By setting [-1,1] as random values for → D, then the updated position of search agents can be defined between current best search agent and original position.

Figure 5 .
Figure 5. Flowchart of proposed WOA for finding optimal values of PI controller.

Figure 6 .
Figure 6.Obtained fitness function curves during change of MG operating mode.(a) Best Fitness Function for Voltage; (b) Best Fitness Function for Frequency.

Figure 7 .
Figure 7. Simulation results during change of MG operating mode.(a) System Voltage Response.(b) System Frequency Response.

Figure 8 .
Figure 8. Optimal gain value searching process of WOA change of MG operating mode.(a) Gain values for voltage parameter; (b) Gain values for frequency parameter.

Figure 9 .
Figure 9. Simulation results during load changing.(a) Best Fitness Function for Voltage; (b) Best Fitness Function for Frequency; (c) System Voltage Parameter; (d) System Frequency Parameter.

Figure 10 .
Figure 10.Optimal gain value searching process of WOA during load changing mode, (a) Gain values for voltage parameter, (b) Gain values for frequency parameter.

Table 1 .
Ratings of considered three phase grid.

Table 2 .
Optimal parameters obtained by optimization techniques in both cases.

Table 3 .
THD values of supplied voltage and current.

Table 5 .
Result of eigenvalue analysis.