Fuzzy PI controller-based model reference adaptive control for voltage control of two connected microgrids

An efﬁcient control strategy for two connected microgrids (MGs) is proposed to ensure stable and economic operation. One of the most important means of improving energy efﬁciency is to achieve the best response for sudden and stochastic disturbances to which the MGs are subjected. Traditionally, MGs are controlled using a linear controller, such as conventional proportional-integral (PI) controller. Fuzzy PI (FPI) controller-based model reference adaptive control that can adapt to a wide range of operating conditions for regulating the voltage is investigated and its performance is compared with the conventional linear PI controller that is not able to mitigate these disturbances efﬁciently. Parameters of the proposed controller are optimised using an advanced optimisation technique called global porcellio scaber algorithm (GPSA). Performance of the controllers is demonstrated on two connected microgrids for a number of scenarios such as load variations, weather ﬂuctuations and faults. Simulation results verify that the proposed control strategy is effec-tive and feasible under various operating conditions for this system. The results also show that the dynamic performance of the system with the model reference adaptive fuzzy PI (MRAFPI) controller is better than that with the most common controller used for this application, the conventional PI


INTRODUCTION
Thanks to the advances in power electronic converters and renewable energy technology like solar PV and wind turbine (WT), microgrids (MGs) have recently grown significantly within electric power systems [1]. A typical MG is a cluster of distributed generators, energy storage devices, loads, power converters and control devices [2]. The MG controllers should be designed to maintain system stability and quality of supply under uncertainties in weather prediction and load demand during real-time operation. DC bus voltage in islanded hybrid MGs can be used as an information medium to detect the state of the operating system [3].
There is limited previous research on studying the dynamic performance and operation of multi-MGs (MMGs). MGs is investigated in [4] without considering the economic dispatch of sources. Optimum operation and dynamic performance of two connected MGs using linear proportional-integral (PI) controller is investigated in [5]. Power management strategy based on two-layer cooperative framework for multiple AC MGs is proposed in [6,7]. The proposed strategy is used to regulate voltage and frequency using conventional droop controller under normal operating conditions rather than actively control large disturbances due to sudden changes in generation, step changes in load and line faults, and so forth. In the present study, a hierarchical control strategy for energy management of two connected MGs is introduced and also the dynamic performance of the proposed system based on non-linear adaptive control is studied.
Each source in an MG has its own characteristic. For instance, battery has two different operating modes, one for charging and the other for discharging, whereas PV array or WT can operate in either maximum power point tracking (MPPT) or limiting power mode, and a dispatchable source can operate at different output power [8]. An MG central controller (MGCC) enables energy sources inside the MG to interact with each other and MGs cooperate among themselves through a multi-MGCC (MMGCC) to achieve economic and optimum operation. For example, in times of increasing solar irradiance or wind speed, it is not only the PV or WT controller that will respond to this disturbance but the battery controller may also decrease the rate of battery discharge or increase its charging. Similarly, the controller at the dispatchable source may reduce the generated power from the source. Various conditions can be achieved by communication between the controllers.
In most previous researches related to MG control, classical controllers like PI [5,9,10,11], PID [4] and droop control [9,12,13,14] have been applied because of their simple structure and acceptable performance. However, these conventional linear controllers are designed to provide best performance only at a certain operating range and hence they may not be so efficient for non-linear processes that have wide operating conditions [15]. Controllers such as fuzzy logic and artificial neural networks have been proposed to overcome the drawbacks of linear controllers. Comparative study of the system response based on model reference adaptive fuzzy PI (MRAFPI), fuzzy PI (FPI) and classical PI controllers is presented in this study.
FPI controller that combines the fuzzy logic controller (FLC) with a PI controller is proposed in [16] to enhance the dynamic performance of the permanent magnet synchronous motor and also is applied in [17] to control the speed of a gas turbine. Model reference adaptive controller (MRAC) has been implemented previously in [18] for the design of a static synchronous compensator to enhance the dynamic performance of grid connected wind energy conversion system under abnormal conditions. Also, MRAC has been proposed in [19] for the design of shunt active power filter to improve line power factor and reduce harmonics. However, this is the first time that MRAFPI controller is developed and applied to two islanded interconnected MGs.
Various meta-heuristic techniques have been used in recent years to solve complex optimisation problems and also as effective methods for tuning controller parameters instead of the conventional techniques. Social-spider optimiser and genetic algorithm are applied in [4] to tune the gains of PID controllers. Particle swarm optimisation (PSO) is proposed in [9] to tune the PI controller parameters for an MG system. Also, PSObased PI controller of an inverter in a grid-tied MG is proposed in [10]. An optimal power flow controller with parameters optimised using a grasshopper optimisation algorithm to enhance the dynamic response and power quality of an MG connected to the main grid is presented in [11]. An advanced metaheuristic optimisation technique, global porcellio scaber algorithm (GPSA), is used for the first time in the present study to fine tune the controller parameters of two connected MGs.
The main contributions of this study are: (i) Providing an efficient control structure for two connected MGs isolated from the main grid that is able to maintain balance between generation and load, and system stability in an economical manner under different operating conditions. (ii) A novel adaptive control for two connected MGs based on MRAFPI controller is proposed, evaluated under different disturbances at both MG1 and MG2, and compared with the FPI controller and conventional PI controller. (iii) An advanced optimisation technique called GPSA is applied to optimally tune the parameters of the used controllers.
The study is structured as follows: The proposed two connected MGs system and control strategy applied are presented in the next section. In Section 3, various local controllers (LCs) for voltage control loop are explained. Optimisation technique proposed to design the controllers is summarised in Section 4. Dynamic performance of the system based on MRAFPI controller is evaluated and compared with that of the FPI controller and conventional PI controller, and the simulation results are presented in Section 5. Finally, the conclusions are given in Section 6.

CONTROL STRATEGY
The proposed system consists of two MGs (MG1 and MG2) linked through two DC tie-lines, 5 km for each cable. MG1 contains three converter interfaced sources, 100 kW PV array, 50 kW diesel generator (DG) and 75 Ah battery (BAT1); and MG2 comprises three converter interfaced sources, 100 kW WT, 100 kW microgas turbine (MGT) and 75 Ah battery (BAT2) as shown in Figure 1. DC output is interfaced to AC bus through inverter. Each MG has six controllers; five of these controllers are physical entities that directly control converter interfaced sources called LC, whereas the sixth controller (MGCC) directs the five physical controllers. MMGCC allows two MGs to communicate with one another to achieve optimum operation. Control strategy for two connected MGs based on three control levels, MMGCC, MGCC and LC, as shown in Figure 2, is proposed. The input data to MGCC includes the operating mode of each source in the MG and measured DC bus voltages. The aim of MMGCC is the allocation of different sources at both MGs to meet the load at all times with high quality of supply and lowest cost by exchanging power between the two MGs. In case a DC bus voltage disturbance occurs, MMGCC determines one MGCC as responsible to regulate the voltage and maintain system stability as below:  After regulating the voltage, the MMGCC determines the unit commitment of dispatchable sources by Lagrange multiplier to achieve economic operation.
MGCC regulates the voltage in an economic manner by maintaining the balance between generation and load under various conditions of loads and supply as below: (1) where P WT , P PV , P B1 , P B2 , P DG and P MGT are the power generated from WT, PV, BAT1, BAT2, DG and MGT, respectively. S 1 = 1 and S 2 = 0 for charging mode while, S 1 = 0 and S 2 = 1 for discharging mode of BAT1 (the same for S 3 and S 4 of BAT2). P losses is the line loss during power transmission between MGs and P L is the load power.
The control strategy should respect the following technical constraints of sources: (1) The state of charge (SOC) of batteries at both MGs has to be kept in the allowable range to avoid overcharging or deep discharging: Also, the battery charging and discharging power should not exceed the power limit as in Equation (3): (2) The generated power (Ps) by DG and MGT is restricted by its lower and upper limits as shown in Table 1: (3) The generated power from WT (kW) [20] is directly proportional to the cube of the wind speed (V) and constrained by rated speed (V R ) (9 m/s), cut-in (V cut-in ) (1 m/s) and cut-out (4) The power exchange between the two connected MGs via tie-line (S K ) should not exceed the maximum value based on thermal and stability considerations The running cost of dispatchable sources can be defined as [21] F DG = 0.0002484 × P DG 2 + 0.0156 × P DG + 0.3312$∕hr (7) F MGT = 0.0001987 × P MGT 2 + 0.0116 × P MGT + 0.496$∕hr (8) where F DG and F MGT are the running cost of DG and MGT, respectively. P DG and P MGT are the output power from DG and MGT, respectively. The computational procedure for MGCC at MG1 can be summarised in the following steps: LC, for DG at MG1 and MGT at MG2, consists of two control loops as shown in Figure 3. The first control loop maintains the generated power from the source at the set-point value. The other control loop regulates the DC bus voltage by controlling the power supplied from the source.
The controller used in closed-loop power control is PI controller, while PI, FPI and MRAFPI are used for voltage control loop system. Also, LC of PV and WT switches between two   Figure 4. The first one keeps the source at MPPT operating mode and the other regulates the DC bus voltage. LC of bidirectional buck-boost converter interfaced battery at both MGs is composed of two control loops (one for power control and the second for voltage like dispatchable sources) for charging mode and also two loops for discharging mode.
The maximum power extraction algorithm from WT used in this study is tip speed ratio (λ) control and the block diagram of a WT with λ control is shown in Figure 5.
can be expressed as : Tip speed ratio control of wind turbine (WT) where ω is the turbine speed (rad/s), R is the turbine blade radius (m) and V w is the wind speed (m/s).
The λ control method [22] regulates the generator speed in order to maintain λ at the optimum value (λ opt ) which corresponds to the maximum extracted power.
Incremental conductance (INC) algorithm based MPPT for PV is used in this study.
Simply, the maximum possible power from PV is extracted by satisfying the following condition [23,24]: where P, Vo and I represent the PV array output power, voltage and current, respectively. Hence, maximum power point is obtained when The aim of this algorithm is to find the voltage operating point at which the negative PV array instantaneous conductance (-I/Vo) is equal to the INC (dI/dVo).

VOLTAGE CONTROL LOOP
Comparative study between the performance of conventional PI, FPI and MRAFPI controllers for regulating the system voltage is investigated in this study.

PI Controller
The control signal that represents the duty cycle (D) of the converter, produced from digital PI controller, can be given by the following formula: where Ts is sample time of the error signal, V ref and V m are the reference and measured voltages, respectively. The block diagram of PI controller-based closed loop control system is shown in Figure 6. GPSA is applied to tune the gains (K p and K i ) of the PI controller.

FPI Controller
FPI controller, an extension of the FLC, is considered in this study as a hybrid controller between conventional PI controller and Mamdani method-based fuzzy controller. The fuzzy inference process [25] can be implemented in three steps. The first step in FLC is fuzzification that converts crisp inputs into a set of fuzzy membership values (from 0 to 1) in the corresponding fuzzy sets. In this study, triangular membership functions are used for two inputs, error (e) and change in error (ce), and one output. Each of the inputs and output is represented by seven membership functions, which are NB (negative big), NM (negative medium), NS (negative small), Z (zero), PS (positive small), PM (positive medium) and PB (positive big) as shown in Figure 7.
After that, the rule inference stage is applied to make decision based on the rules of inference in fuzzy logic employing fuzzy implication and aggregation. The fuzzy rules are defined in Table 2 and can be written linguistically as: If e is PB and ce is PB then output is PB. The final process is defuzzification that converts the aggregate output fuzzy set into a single crisp value using centroid method in this study.
Mathematically, FPI controller ( Figure 8) can be described as follows: FPI output where e = V ref -V m , F is a non-linear function representing the fuzzy controller, K p and K i are PI controller gains, and K e and K ce are scale factors for e and ce. K p , K i , K e and K ce are optimally tuned by GPSA.

MRAFPI CONTROLLER
The MRAFPI controller is composed of three main components which are reference model, adjustment mechanism, and FPI controller as seen in Figure 8. The reference model (G r ) is a discrete-time transfer function that reflects the desired behaviour of the closed-loop system (zero overshoot and 0.05 s settling time in this research) and can be modelled as According to the Massachusetts Institute of Technology (MIT) rule [19], the cost function can be defined as where V is the reference model output, V m is the system output and θ is the adaptation parameter. The model reference output voltage, depending on the type of disturbance, is chosen as an exponential rise (decay) from the minimum (maximum) voltage supposed to be tracked to the desired value 500 V. For MIT rule, the parameter θ is adjusted in such a way that the cost function is minimised. This can be achieved by changing the parameter θ in the direction of the negative gradient of J, that is, Hence, the adaptation mechanism adjusts the control action based on the error between the reference model output and the system output as The control equation is From the previous equation, FPI controller-based MRAC can be viewed as adaptive non-linear PID like controller.
GPSA is applied to tune the adaptation gain γ and the gains (K p and K i ) of PI controller, and adjust the input membership functions by tuning the gains (K e and K ce ).

4
META-HEURISTIC TECHNIQUE GPSA (Figure 9), an extension of PSA, is developed to improve and address shortcomings of the basic PSA explained in detail in [26]. According to PSA, porcellio scabers move toward the best environmental condition according to the following equation: where the term λрτ relates to the propensity to explore novel areas, and i = 1, 2, …, N (number of porcellio scabers). The parameter λ represents the weight between aggregation and the propensity to explore new environments and τ is random vector that determines randomly a direction of each porcellio scaber (PSC) to detect the environmental condition of surroundings. The value p is a function to map the fitness of a PSC to an action strength and can be written as For GPSA, avoiding the possibility of moving the best PSC to worse position like PSA, when PSC (A) (A ∈ i) that has min{ f (x k + ø)} differs from one (B) (B ∈ i) which has min{f(x k )}, and min{f(x k )} is less than min{ f (x k i + )}, min{ f (x k + )} is replaced by min{f(x k )}) and x k B + τ is replaced by argmin However, if min{ f (x k + )} is less than min{f(x k )}, min{f(x k )} and argmin According to GPSA, λ is changed from a fixed value to an adaptive parameter during the optimisation as shown in the following equation: where k is the iteration number and NI is the total iterations number.
The second and third terms in Equation (20) depend on the variable λ that is constrained between 0 and 1. As a result, the random movement may be small and this will force the PSC for local search. For GPSA, Equation (23) is proposed instead of Equation (20) to cover larger search space as below: where d is number of design variables, β0 and γ are positive constants in the range [0, 1]. Finally, according to GPSA, the movement of PSCs is based on two rules: Moving PSC towards the best one based on the weighted decision between aggregation and exploring the area surrounding the best one or random movement. At each iteration, a uniform random number r in the range [0, 1] is generated. If r is less than a pre-set value (α) constrained between 0 and 1, PSC moves according to Equation (23); otherwise, PSC moves to new randomly generated position in the specified range as shown in the next equation: where LB(i) and UB(i) are lower and upper bounds of decision variables, respectively. The value α is dynamicaly adapted as in Equation (26) to avoid local exploitation and global exploration: where α max and α min are positive pre-set values. GPSA has some advantages: Simple to implement, requires few mathematical operations and no previous data is required as the search process is stochastic.
The controllers parameters are optimally tuned using GPS by minimising the performance measure 'integral of time multiplied by absolute error (ITAE)':

SIMULATION RESULTS
The system is subjected to different scenarios to evaluate the effectiveness of the proposed control strategy for maintaining the system balance economically and also the performance of LCs in regulating the system voltage. Assume, according to day-ahead unit commitment, the optimal set-points of sources at MG1 are 20.09 kW for DG, 12.64 kW for BAT1 (discharging mode) and 76.35 kW for PV; and at MG2 are 36.46 kW for MGT, 0 kW for BAT2 (50 % SOC) and 40.65 kW for WT. Also, the DC load demands are 17 and 20 kW for MG1 and MG2, respectively; and the AC load demand is 68 kW, 0.96 pf at MG1, and 80 kW, 0.97 pf at MG2 before the occurrence of disturbances for scenarios 1 through 5. The results are based on MRAFPI controller, except for the voltage at MG2 where performance with FPI and PI is also given for comparison.

Scenario 1: Sudden change of wind speed
In this scenario, the wind speed driving the WT at MG2 decreases from 6.67 to 4.42 m/s at 0.2 s and then increases to 5.32 m/s at 2.2 s.
At the instant of decreasing wind speed, the rotor speed of WT should be decreased from about 373 to 248.6 rpm in order to track the maximum power point. This can be achieved through MPPT controller by controlling the duty cycle of the boost converter-interfaced WT. Also, the DC bus voltages increase due to an increase in the generated power from the demand power. When the rotor speed approaches the desired speed, the steady state generated power from WT decreases to about 11.7 kW and this leads to decreasing the system voltage as seen in Figure 10. Also, the WT terminal voltage decreases and hence the steady state duty cycle increases from about -0.51 to 0.66 as shown in Figure 11(b). Modulation index of inverter at both MGs increases to regulate the AC bus voltages as shown in Figures 12(c) and (d). MGCC at MG2 sends signal to LC at MGT to turn on the voltage control loop to regulate the DC bus voltage at MG2. As a result, the generated power from MGT is increased by increasing the duty cycle of MGT converter as shown in Figure 11(d), and this leads to a decrease in the rotor speed of MGT and hence the governor increases the input mechanical power to MGT to regulate the rotor speed as seen in Figure 13.
Voltage regulation can be achieved by LC at MGT while optimum system operation is achieved by MMGCC. After regulating the voltage, at about 1.3 s by MRAFPI, the MMGCC allocates dispatchable generation units; MMGCC sends commands to DG and MGT to operate at 32.7 and 53.3 kW, respectively. Hence, the power transferred from MG1 to MG2 increases from about 23 to 35 kW as seen in Figures 12(b). Ultimately, the balance between generation and load is achieved returning the voltage to the desired value as shown in Figure 10    When the wind speed increases, the rotor speed is increased by the MPPT controller to maximise the extracted power from WT as shown in Figure 12(a). The WT terminal voltage increases and the power generated from WT increases to about 20.5 kW. As a result, the DC bus voltage increases and MGCC sends signal to LC at MGT to regulate the voltage. The power supplied from MGT decreases to achieve the system balance and regulate the system voltage. After returning the voltage to the required value, the MMGCC determines the power required from MGT and DG to achieve economic operation. The generated power from MGT increases to about 48 kW while, the generated power from DG decreases to about 29 kW by decreasing the duty cycle as in Figures 11(a) and (c).
It is clear from Figure 10(b) and Table 3, that MRAFPI is slightly better than FPI and significantly more efficient than conventional PI controller as far as maximum overshoot (%POS), maximum undershoot (%PUS), ITAE and settling time are considered under wind speed disturbance.

Scenario 2: Sudden change of load at MG2
When the DC load demand at MG2 decreases 25% from 20 to 15 kW, and also AC demand decreases 25% from 80 kW, 0.97 pf to 60 kW, 0.95 pf at 0.2 s, the DC voltage increases as shown in Figure 14. MMGCC sends signals to MGCC at MG2 to regulate the voltage since there is power transfer from MG1 to MG2. Then, MGCC sends signal to LC at MGT to decrease its generated power by decreasing the duty cycle of boost converter at MGT as seen in Figures 15(b) and (d) to return the voltage to the desired value and keep system stability.
After voltage regulation, MMGCC determines the optimal set-points for DG and MGT based on Lagrangian multipliers to achieve the least running cost. The power generated from DG decreases from about 20.2 to 9.4 kW by decreasingthe duty cycle of boost converter interfaced DG as shown in Figures 15(a) and (c) and this leads to decrease in the power transferred from MG1 to MG2 to about 12.6 kW as in Figure 16(b). WT keeps tracking the optimal rotational speed as shown in Figure 16(a).
In contrast, when the DC load at MG2 increases again to 20 kW and AC demand increases again to 80 kW, 0.97 pf at 1.7s, the output power from MGT increases by increasing the duty cycle to cover the over-load demand and regulate the voltage. The optimal set-points for DG and MGT are about 20.2 kW and 37 kW, respectively. The transferred power from MG1 to MG2 increases to about 23 kW. MRAFPI is slightly better than FPI and substantially better than conventional PI controller in terms of settling time, ITAE, %POS and %PUS as seen in Figure 14(a) and Table 4 under load disturbance at MG2.

Scenario 3: Change in system parameters
The modelling inductance of boost converter at MGT is increased from 10 to 15 mH and the system is subjected to step change in wind speed from 6.67 to 4.42 m/s at 0.2 s like scenario 1. It can be observed from the system response shown in Figure 17 and Table 5 that the MRAFPI is able to maintain the optimal performance during system parameters change and is significantly better than FPI and PI controller in terms of settling time, %PUS and ITAE.

Scenario 4: Occurrence of a fault on the tie-line
System voltage response on the occurrence of a short circuit fault at 0.2 s at the middle of one of the tie-line cables is shown in Figure 18. DC bus voltage at MG1 and MG2 drops to about 228 and 236 V, respectively. After fault clearance by opening the breakers at both ends of the faulted cable after 3 ms, the system voltage returns quickly to the required value and the system keeps it stability.

Scenario 5: Three phase fault at MG2
In this scenario, a three phase short circuit fault occurs at 0.2 s on the AC load terminals with fault resistance 0.02 ohm and lasts for 10 ms. DC bus voltage at MG2 drops to about 365 V as shown in Figure 19(a). After clearing the fault, the system voltage recovers quickly ( Figure 19). It is clear from scenarios 4 and 5 that MRAFPI controller and FPI controller give approximately the same response which is better than the PI controller in terms of settling time and ITAE as shown in Figures 18(a) and 19(a), and Tables 6 and 7.
Assume that, according to day-ahead unit commitment, the optimal set-points of sources at MG1 are 14.19 kW for DG, 0 kW for BAT1 (idle mode (50% SOC)) and 38.76 kW for PV; and at MG2 are 26.34 kW for MGT, 5.1 kW for BAT2 (discharging mode) and 94.1 kW for WT. Also, the DC load demands are

Scenario 6: Step change in solar irradiance at MG1
In this case, the solar irradiance directed to PV array at MG1 decreases from 413 to 164 w/m 2 at 0.2 s and then increases to 314 w/m 2 at 1.6 s. MPPT controller at PV array decreases its terminal voltage from about 260 to 166 V to generate maximum possible power as seen in Figure 20(a). Hence, the steady state duty cycle increases from about 0.48 to 0.66 (Figure 21(a)). The generated power from PV decreases to about 10.3 kW and this leads to decreasing the DC bus voltages as seen in Figures 20(c) and (d). Because there is power transfer from MG2 to MG1, MMGCC sends command to MGCC at MG1 that in turn turns on the voltage control loop at DG to regulate the voltage. The generated power from DG increases to compensate the deficiency from PV and this leads to decreasing its rotor speed that can be regulated by adjusting the input mechanical power to the DG. After adjusting the voltage, the output power from MGT  Figures 21(b) and (d) to achieve the least cost function. There is more power transfer from MG2 to MG1 as seen in Figure 20(b). The inverse happens when the solar irradiance increases, where the DC bus voltage increases and DG decreases its output to keep the system balance and voltage at the desired value. After voltage regulation, MMGCC sends the optimal set-points for DG and MGT that are 19 and 32 kW, respectively, as shown in Figures 21(c) and (d).
As seen from Figure 20(c) and Table 8, the performance of the system based on MRAFPI is better than FPI and PI as far as the settling time, ITAE, %PUS and %POS are considered under sudden change of solar irradiance.

Scenario 7: Sudden change of load at MG1
The DC bus voltages increase due to a decrease in the load at MG1 (Figure 22). MGCC at MG1 sends signal to LC at DG to regulate the voltage by decreasing its output power. After voltage regulation, for economic operation, the generated power from DG increases to about 10.25 kW and from MGT decreases to about 21.7 kW by decreasing the duty cycle of MGT converter as observed in Figures 23(b) and (d).
The inverse occurs when the DC load at MG1 increases from 15.3 to 19.6 kW and AC load from 61.2 kW, 0.95 pf to 78.2 kW, 0.97 pf at 1.6 s. The DC bus voltages decrease and DG generates more power to meet the over-load by increasing its duty cycle as shown in Figures 23(a) and (c). System response based on MRAFPI and FPI is significantly better than classical PI controller in terms of settling time, ITAE, %POS and %PUS as seen in Figure 22(a) and Table 9.

Scenario 8: DC fault occurrence at MG1
As illustrated in Figure 24, in the case of a short circuit fault occurring at 0.2 s at the DC load terminals at MG1 with fault resistance 0.5 ohm, the DC bus voltage at MG1 drops to about 445.5 V and also, the DC bus voltage at MG2 and the AC bus voltages at both MGs decrease. After the fault clearance, after 3 ms, the system DC and AC bus voltages return quickly to the desired value and the system keeps its stability.
The system response based on MRAFPI and FPI controllers is better than PI controller in terms of settling time as shown in Figure 24(a) and Table 10.

Scenario 9: Different disturbances at both MGs
The initial conditions for this scenario are assumed as follows: The generated power from sources at MG1 are 58.2, 0 and 10 kW for PV, BAT1 and DG, respectively; and for MG2 WT, BAT2 and MGT operate at 40.3,-2.5 (charging mode) and 23.2 kW, respectively. The following results are based on MRAFPI controller.
In this scenario, wind speed increases from 6.68 to 7.5 m/s at 0.2 s, AC load at MG2 decreases from 53 to 47 kW and also AC load at MG1 reduces from 54 to 49 kW at 2.2 s. When the wind speed increases, the rotor speed is increased by MPPT controller as shown in Figure 25(c). The power generated from WT increases to about 57.1 kW and this makes MGT decrease its output to maintain system balance. After returning DC bus voltage to the desired value, MMGCC determines the optimal set-points of DG and MGT that are 3 kW and 13.5 kW, respectively, as hown in Figures 25(a) and (b). About 5 kW is trans-ferred from MG2 to MG1 as seen in Figure 25(d). When AC load at both MGs decreases, MGCC at MG1 commands DG to decrease its output until reaching the minimum value (2.5 kW) and still the voltage is not regulated. MGT is commanded to reduce its output until reaching 5 kW and the voltage is still more than 500 V. As a result, BAT2 absorbs the surplus power to return the system voltages to the required value as shown in Figure 26.

CONCLUSIONS
An efficient control strategy for two connected MGs based on three control levels: LC at each source in MG, secondary control for each MG (MGCC) and tertiary control for the whole system (MMGCC) that communicates between the two connected MGs is proposed in this study. Simulation results show that this approach achieves the balance between generation and consumption in an economic manner under a wide range of A non-linear adaptive controller, that is FPI controller-based MRAFPI, is proposed for voltage control loop of LC at each source to regulate the system voltage. The effectiveness of this controller is investigated and compared with the FPI controller and conventional PI controller under various disturbances such as changes in weather conditions, variation of load demand and occurrence of faults.
Simulation results verify that the response of the system based on MRAFPI controller with parameters tuned by GPSA is better than GPSA-based FPI controller and GPSA-based PI controller that gives worse response and unsatisfactory performance in all applied disturbances.