Voltage Restoration Control for Microgrid With Recurrent Wavelet Petri Fuzzy Neural Network

This study presents a voltage restoration control (VRC) based on battery energy storage system (BESS), which can be used for both supporting power source and voltage compensation. Voltage restoration is an important task for the power control of microgrid during utility disturbances. One of the disturbances is caused by short circuit on power line of the microgrid, which may lead to voltage sag and even blackout of the microgrid system. To tackle this problem, the recurrent wavelet petri fuzzy neural network (RWPFNN) controller is proposed in this study for the VRC of BESS to provide fast control response to mitigate the transient impact. Moreover, to examine the compliance with the requirements of low voltage ride through (LVRT) of the photovoltaic (PV) plant and investigate the performance of the proposed VRC, the microgrid built in Cimei Island in Penghu Archipelago, Taiwan, is investigated. Furthermore, the PV system, the wind turbine generator (WTG) system and the BESS are connected to the same point of common coupling (PCC) with separated step-up transformers in the microgrid. In addition, the diesel generators provide the main power sources and form the isolated microgrid system. Through the hardware in the loop (HIL) mechanism, which is built using OPAL-RT real-time simulator, with two floating-point digital signal processors (DSPs), the effectiveness of proposed intelligent controllers can be verified and demonstrated.


I. INTRODUCTION
To fight the climate change requires the actions including greenhouse gas emissions reduction, energy efficiency improvement, renewable energy portfolios, and policies aimed at slowing climate change to keep the global warming under 2 degrees Celsius. One of the most effective way is to promote the penetration level of the RERs, such as PV plant, WTG and BESS. Owing to its ability to integrate various kinds of RERs, the microgrid system has gotten increasing attention recently as means toward a greener future all over the world [1], [2]. However, some technical challenges are necessarily taken into consideration, for instance, voltage regulation, reliable operation during short-circuit faults, and reactive power management [3]- [5].
The proposed voltage restoration strategy has two components: one is the regulatory grid code, which is the requirements of LVRT to support grid operations, and the other is the VRC during voltage sags. The LVRT requirements have been applied to WTGs, and recently PVs are also required to fulfill these grid codes [6], [7]. E.ON-Netz, a power company of Germany, is the first to issue LVRT requirements for DESs, in which the DESs have to remain on grid and inject reactive power into the grid during grid faults [8]. Though the published requirements are for the DESs connected to the high-voltage system, these requirements can also be applied to the medium or low-voltage systems. When the voltage drops below the limit curve of the E.ON grid requirements, the DESs must inject additional reactive current into the grid amounting to 2% of the rated current for each 1% of the voltage drop to support grid voltage recovery [9], [10]. Certainly, the injection of reactive current of 100% of the rated current is necessary when the voltage drops below 50% of the nominal voltage. Since the proposed control strategy is developed to control the power of the grid-connected PV system to satisfy the most stringent grid requirements, the E.ON LVRT requirements will be used in this study to determine the ratio of the required reactive current during grid faults.
In terms of voltage restoration during voltage sags, the unbalanced grid voltage sags will worsen the performance of microgrid, especially load tripping and degradation of gridconnected devices. In order to overcome these disadvantages, many advanced techniques have been proposed for minimizing network disturbances during grid faults. A STATCOM combined with a small SDBR was studied in [11] to enhance the stability of a wind farm composed of a fixed-speed WTG system. In recent years, load sharing among DGs for voltage restoration became popular inspired by the idea of cooperative control with DGs in multi-DG microgrid [12]- [14]. In [12], the active and reactive droop control were used to maintain active and reactive power sharing among parallel DGs in the primary control, then PI regulators were used to control reactive power and voltage with the references obtained from the dynamic consensus algorithm. Moreover, some researches have been implemented with DVR in the past decade to mitigate voltage disturbances and sags including three-phase voltage unbalance and short circuit [15]- [18]. To restore the PCC voltage and protect the DVR itself for voltage disturbances, a multifunctional DVR control strategy with current limitation has been proposed in [15]. In [16], an innovative designed DVR has been developed by using the PI controller method in dq0 coordination to attest the mitigation of power quality disturbance in secondary distribution transformer networks due to voltage variation and voltage unbalance. In [17], the effectiveness of the DVR to mitigate voltage disturbances in a hybrid PV-wind system was demonstrated. Furthermore, an inverter-based DVR topology by using the adaptive noise canceling technique for both voltage compensation and harmonic mitigation was investigated in [18]. In addition, the control of DVR for fast detection and corresponding compensation plays a significant role, and several studies have been done on the relative aspects to improve the performance of DVR. A pseudo-derivativefeedback based voltage controller was implemented in [19] for more effective operation of DVR under voltage disturbances. In [20], the DVR using a PI controller based gradient adaptive-variable step-size least mean square control algorithm was proposed to make the control robust and assure better control performance.
Due to the intermittent nature of solar and wind energy, the grid-connected PV and WTG system with BESS have been in use for many demand-related issues to mitigate the intermittency of renewable energy and to support the reactive power [21], [22]. Moreover, the BESS can maintain seamless operation even for the most severe voltage-sag conditions. Thus, the grid-connected BESS can guarantee high availability and flexibility of a power system [23]. Besides the above benefits of the grid-connected BESS, the novel benefits of the BESS for the microgrid are the peak demand management and voltage sags mitigation by supplying different amounts of active and reactive power for the support of frequency and voltage [24], [25]. Owing to the charging and discharging characteristics of BESS, several works have been done on using the BESS as agents for power management in recent years. The BESS is adopted as battery ancillary services in [26] to provide a good utilization of renewables and maintain the desired DC-link voltage. In [27], a clustering algorithm was applied to cluster batteries with similar power demand and capacity into VPPs in order to reduce the line currents and power losses in the microgrid. From the above literature, it is found that the recent research works are focused on DVR and voltage regulation by utilizing BESS in microgrid, while BESS gets more and more attentions since it has been an essential part in a microgrid. Nevertheless, all the voltage regulator, voltage variance regulator, or reactive power regulator mentioned above adopted PI-based control mechanism for the voltage restoration. However, the control performance of the PI control system will be degraded in the VOLUME 10, 2022 microgrid owing to the nonlinearities and uncertainties of the controlled plants in the microgrid.
It is well known that a combination of NNs and fuzzy logic possesses the advantages of artificial learning in modeling the system dynamics and the benefits of fuzzy reasoning in handling uncertain information. The combined FNNs have been demonstrated being effective in different control applications [28], [29]. Moreover, the PN has been developed into a powerful and effective tool for the concurrent, distributed, parallel, asynchronous, and uncertain information processing systems owing to its analytical and graphical capabilities [30]. Recently, the WFNN has successfully increased the convergence speed and enhanced the computational preciseness with the time-frequency characteristics of wavelet [31]. Furthermore, the WPFNN control combining the merits of the stability of petri network and the time-frequency characteristics of wavelet was proposed in [32] for wind power applications. In addition, some research studies have successfully combined the recurrent structure with FNN and WFNN, that is, the RFNN and RWFNN, in the applications of various fields [33], [34]. In this study a RWPFNN, in which the outputs of wavelet-petri layer are multiplied by the outputs of the FNN with recurrent structure in the outputs of rule layer, is proposed to improve the control performance of the controlled plants.
The microgrid model of Cimei Island [35]- [37] is devised to emulate the operation of a microgrid system in this study. Two control strategies are designed to fulfill the voltage regulation during grid faults: the control of PV to satisfy the requirements of LVRT support according to the grid codes; the control of BESS to implement VRC while sags happen. In the PV control strategy, the E.ON grid requirements are applied for the injection of reactive current when the voltage drops. Moreover, in the BESS control strategy, the active and reactive power provision schemes are developed to emulate the voltage restoration of a microgird. Furthermore, in order to test the performance of the voltage restoration, two different short-circuit fault conditions are designed. In addition, to improve the control performance of the voltage restoration, a RWPFNN controller is developed. Since the proposed RWPFNN comprises both the WPFNN and recurrent structure, the transient control performance of VRC in a microgird can be much improved. Additionally, this article is the extended study of [37], in which the voltage stabilization control methods are investigated for stabilizing grid transition from the grid-connected mode to the islanded mode. In this study, further research for enhancing the function of microgrid with voltage restoration strategy during grid faults in Cimei Island microgrid is proposed. The major contributions of the proposed voltage restoration strategy using intelligent control are: (1) the reactive power control and VRC of BESS use the same controller and coordinate transformation to reduce the design complexity; (2) the fast voltage restoration during grid faults by using VRC of BESS can provide smooth operation of the microgrid system; (3) the RWPFNN controller is proposed to improve the voltage restoration and active power control performance of BESS; (4) the voltage restoration strategy and the proposed RWPFNN controller are successfully implemented in a DSP-based microgrid power system built with OPAL-RT real-time simulator.
The rest of this study is organized as follows: the control strategies of microgrid for the PV and BESS are presented in Section II. The network structure, online learning algorithm and the convergence analysis of the proposed RWPFNN are derived in Section III. To verify the performance of the proposed controllers, the HIL mechanism, which is built using OPAL-RT real-time simulator OP4510, is developed with two floating-point DSPs the Texas Instruments TMS320F28335 for the LVRT control and VRC, respectively, and some comprehensive case studies in the Cimei Island microgrid are investigated in Section IV. Finally, some conclusions are presented in Section V.

II. CONTROL STRATEGY OF MICROGRID
Cimei Island is situated at the southernmost tip of the Penghu Archipelago, which lies in the Taiwan Strait. To promote the penetration rate of renewable energy and storage system, Taiwan Power Company (Taipower) has implemented an isolated microgrid in Cimei Island [35]- [37]. The single-line diagram of Cimei Island is shown in Fig. 1 including two diesel generators, a 355-kWp PV system, a 1000-kWh BESS and a wind farm with 305-kW WTG system. Moreover, the diesel generators provide the main power sources and form the grid-connected power system. The PV system, BESS and the WTG system are connected to the same PCC with separated step-up transformers on Bus 1. For the promotion of usage for the renewable energy and storage system, only 1 diesel generator is switched-on generally. Since the BESS system would play an important role to support and stabilize the microgrid operation, the control strategy is focused on the voltage restoration for the active and reactive control during faults. On the other hand, the PV system is responsible for the LVRT control to meet the requirements of voltage support. Figure 2 displays the active and reactive power control structure of PV system. In Fig. 2, P * m and P are the active power command and active power; Q * m and Q are the reactive power command and reactive power; P * LVRT and Q * LVRT are the required active and reactive power command during LVRT; v a , v b and v c are three-phase voltages; i a , i b and i c are three-phase currents; I * d and I * q are dq-axis current commands; i * a , i * b and i * c are three-phase current commands of the DC/AC inverter for current controlled PWM; θ i is synchronous angle obtained from the phase-lock loop based on SOGI-PLL; v + a , v + b and v + c are positive phase-sequence three-phase voltage. Moreover, P * m can be obtained from MPPT control algorithm of the PV system. When the voltage sag on Bus 1 shown in Fig. 1 exceeds 10%, which triggers the grid fault signal, then P * LVRT becomes the active power command and Q * LVRT is the reactive power command, which is obtained according to the E.ON grid requirements [9], [10]. Furthermore, the PV controller performs the voltage sag detection and power calculation by using the grid voltages  and currents. Then, the closed-loop control of the active and reactive power are achieved. After the coordinate transformation and three-phase current control, the PWM control signals are delivered to the three-phase inverter for the active and reactive power control. The required compensation reactive power command Q * LVRT is a function of the voltage sag V sag and can be expressed as: where Q max equals to the maximum power capacity of PV system and V sag is the voltage sag at the PCC reflected to low voltage side of the transformer. Since there is no LVRT requirement to clearly specify the voltage reduction ratio under the condition of unbalance three-phase voltage, the voltage sag V sag at the PCC can be evaluated as follows [38]: where V + p represents the peak value of the positive sequence of three-phase voltage and V base is the peak value of the nominal phase voltage of PV system, which equals 310 V in this study. Accordingly, equation (2) can also be applied to voltage reduction ratio for the balance three-phase voltage.
The active/reactive power control and VRC structure of BESS system is shown in Fig. 3. P * BS and P BS are the active power command and active power; Q * BS and Q BS are the reactive power command and reactive power; v ao , v bo and v co are three-phase voltages; i ao , i bo and i co are three-phase currents; I * dm , I * qm and I do , I qo are dq-axis current commands and dq-axis currents; V * dm and V * qm are dq-axis SPWM voltage commands of the DC/AC inverter; θ i is synchronous angle obtained from the PLL; u * a , u * b and u * c are threephase voltage commands of the DC/AC inverter for SPWM; V PCC is the instantaneous voltage at the PCC reflected to low voltage side of the transformer. In order to restore the V PCC as quickly as possible, the direct voltage control is necessary instead of indirect control. Therefore, when the voltage sag on Bus 1 shown in Fig. 1 exceeds 10%, the VRC will be triggered and the voltage control is ON. Then, the command becomes V * ref , i.e., the peak value of the nominal phase voltage of 310 V, for the voltage restoration. On the other hand, since V PCC will increase abruptly when the grid recovers from the grid faults, the voltage control is OFF and the command becomes Q * BS when V PCC is higher than 1.03 pu. In Fig. 3, the control system processes the active and reactive power calculations by using the grid voltages and currents. After that, the closed-loop control of active/reactive power or voltage are performed. The control objective is to regulate the quantity (active power, reactive power and voltage) to follow the control command. Moreover, besides the proposed RWPFNN controller, both conventional PI controller and FNN controller are implemented in this study for the comparison of the control performance. Furthermore, to simplify the implementation of control strategy, the PI controller with fixed parameters is adopted for the inner-loop current controller. The control error and fluctuation would be compensated by the outer-loop controller, i.e., the PI, FNN, or proposed RWPFNN controller. The algorithm of the VRC is shown in Fig. 4.
The active/reactive power control structure of WTG system is shown in Fig. 5. An AC/DC converter with current controlled PWM is considered as the first stage and responsible for transferring the power energy from the WTG terminal to the DC bus. The second stage is a DC/AC inverter and designed to dispatch the power from the DC bus to the threephase microgrid system. In the first stage, P m is pole number of the PMSG; V * dc and V dc are the DC bus voltage command and regulated DC bus voltage; θ m and θ e are the rotor shaft position and flux position; i as , i bs and i cs are sensed phase currents; I * ds and I * qs are dq-axis current commands; i * as , i * bs and i * cs are three-phase current commands of the AC/DC converter. For the DC/AC inverter, it is used for active and reactive power control. P * WTG and P WTG are the active power command and active power; Q * WTG and Q WTG are the reactive power command and reactive power; v aw , v bw and v cw are three-phase voltages; i aw , i bw and i cw are three-phase currents; I * dw , I * qw and I dw , I qw are dq-axis current commands and dqaxis currents; V * dw and V * qw are the dq-axis SPWM voltage commands of the DC/AC inverter; θ i is synchronous angle obtained from the PLL;u * aw , u * bw and u * cw are three-phase voltage commands of the DC/AC inverter for SPWM. The controllers of the WTG system are modeled in the OP4510 as shown in Fig. 5. Moreover, the function of LVRT is not considered in the control of the WTG in this study.

III. RWPFNN CONTROLLER
Voltage restoration by using the BESS is important to the microgrid operation during grid faults. To improve the transient control performance of VRC in a microgrid, the intelligent RWPFNN controller is designed to replace the PI controller or FNN controller in the BESS as shown in Fig. 3. The proposed RWPFNN is constructed by a five-layer network as depicted in Fig. 6, which comprises the input layer (layer i), membership layer (layer j), wavelet layer and petri layer (layer k), rule layer with recurrent structure (layer l), and output layer (layer o). The online backpropagation learning algorithm is applied to perform the parameters adaptation. In this way, the controller can maintain the robust and stable real-time control performance under the disturbances of the microgrid. The signal propagation and the fundamental function for each layer of the RWPFNN are illustrated in the following.

A. NETWORK STRUCTURE OF RWPFNN
The signal propagation and the basic function in each layer of the RWPFNN are described as follows:

1) LAYER 1: INPUT LAYER
There are two inputs in this layer, the input and the output can be defined as: where x 1 i and y 1 i (N ) are the input and output of the ith neuron, N is the iteration index. In this study, e 1 (N ) = e represents the error between reference command and the response. Thus, P * BS − P BS and Q * BS − Q BS represent the errors between the reference active/reactive power and instantaneous output active/reactive power of controller for the BESS in normal operation, respectively. On the other hand, the error between the reference voltage and instantaneous voltage of PCC would be V * ref − V PCC accordingly. Then e 2 (N ) =ė is the derivative of error and define x 1 1 as e while x 1 2 asė.

2) LAYER 2: MEMBERSHIP LAYER
The Gaussian function is adopted as the membership function to realize the fuzzification operation in each node of this layer. The input and output node of this layer are described below: where y 2 j (N ) represents output of jth neuron in the membership layer; m 2 j (N ), σ 2 j (N ) are the mean, standard deviation of Gaussian function in the jth term associated with the input layer, respectively. VOLUME 10, 2022

3) LAYER 3: WAVELET AND PETRI LAYER
The wavelet function in this layer can be expressed as where φ 3 ik (N ) is the kth term of wavelet function output associated with the ith neuron, ψ 3 k (N ) is the summation of the kth term of wavelet function output, and w 3 ik is the weight of wavelet layer.
Since the PN has been proven powerful for modeling and analysis of complex system, a properly designed transition function can aid the system to process the urgent events such as grid faults in order to fulfill requirements [30]. In this layer, the transition of node starts when the token is created in the input place. Then, it is controlled to activate or cancel the transition through the following equations: where t 3 p (N ) is the transition state, d th is the threshold value which is determined by the function V =(e +ė)/2, α and β are positive constants. Once the error e and the derivative of errorė have the trend to increase, the threshold value is lower causing the transition easier to happen; otherwise the threshold value tends to become higher trying to prevent the transition. When the transition is activated, the token can be moved from the input place to the output place. Hence, the relationship between input and output can be given as follows. 9 (13) where y 3 p (N ) is the output of pth neuron.

4) LAYER 4: RECURRENT AND RULE LAYER
The first part of this layer is to multiply the outputs of layer 2, y 2 j . For the neuron y 4 jl (N ), the output can be expressed as where w 4 jl is the weight between the jth neuron in the membership layer and the lth neuron in the rule layer, which is set to be 1 in this study. Then, y 4 jl (N ) is multiplied with its recurrent part and the output of layer 3 y 3 p (N ) as follows: where y 4 l (N ) is the output of lth neuron in the rule layer. Since a recurrent structure is able to store the previous data of the network by capturing the past dynamic behavior of the system, it will enhance the computational strength and the generalization ability of RWPFNN and hence is more appropriate in dealing with the control of non-linear complex systems [33], [34].

5) LAYER 5: OUTPUT LAYER
In the output layer, the defuzzification is implemented with where w 5 lo is the weight between layer 4 and layer 5, and y 5 o (N ) is the output of RWPFNN. In this study, y 5 o (N ) = I * qm is used for the active power control and y 5 o (N ) = I * dm is used for the reactive power/voltage control.

B. ONLINE LEARNING ALGORITHM FOR RWPFNN
The online BP learning algorithm is based on the supervised gradient descent method to update the connected weights and the network parameters in the RWPFNN adaptively. For the reactive power control of BESS in normal operation, the objective function E(N ) can be defined as where e(N ), which is Q * BS (N )−Q BS (N ), represents the tracking error in the learning process of the RWPFNN controller for each discrete time N , with Q * BS and Q BS represent the reference reactive power and the instantaneous output reactive power. In layer 5, the error term to be propagated is given by The weight w 5 lo (N ) between the rule layer and output layer can be updated by the following amount.
where η lo is the learning rate. Two error terms are necessary to be propagated in layer 4, as listed in (23) and (24) as follows: By adopting the chain rule, the connective weight w 4 r for recurrent feedback can be computed by the following equation: The error term to be propagated in layer 3 can be expressed as: Accordingly, the weight w 3 ik (N ) can be updated by the following amount: where η ik is the learning rate of weight w 3 ik (N ). Therefore, the weight w 3 ik (N ) can be updated with: In layer 2, the error term needs to be propagated as: The mean of the Gaussian function m 2 j is calculated in the following: where η m is the learning-rate factor of the mean of the Gaussian function. The standard deviation of the Gaussian function σ 2 j can be calculated as below: where η σ is the learning-rate factor of the standard deviation of the Gaussian function. The means and standard deviations of the Gaussian function are updated as follows: Owing to the uncertainties in the microgrid system, the exact Jacobian calculation, which is ∂Q BS /∂y 5 o (N ), is difficult to determine accurately. To solve this problem and speed up the online updating of weights, the error adaptation law proposed in [38] is adopted in this study to replace the Jacobian term with: whereė is the derivative of error e. In addition, to guarantee the convergence of the proposed RWPFNN controller, specific learning-rate factors for the training of the parameters of the RWPFNN are designed in the Appendix to guarantee the convergence of the tracking errors.

IV. DESIGN AND EXPERIMENTATION
The experimental setup of the proposed control strategies is shown in Fig. 7. The test platform includes the HIL mechanism built with OPAL-RT real-time simulator OP4510 and RT-LAB environment, an oscilloscope, a host computer, peripheral circuits and two DSP TMS320F28335 control boards. There are two 16-channel digital-to-analog converter modules (OP5330), one 16-channel analog-to-digital converter module (OP5340), and one 32-channel digital signal conditioning module (OP5353) in the OP4510. The PI, FNN, and proposed RWPFNN controllers of BESS are realized using the C language on the Texas Instruments TMS320F28335 DSP and the observation signals are transferred to the oscilloscope with the SPI. Moreover, 2, 6, 9, 9, 9, 1 nodes are designed in the input layer, membership layer, wavelet layer, Petri layer, rule layer, and output layer, respectively, of the RWPFNN. The structure of OPAL-RT and peripherals are shown in Fig. 8. The entire Cimei Island microgrid except the PV and BESS controllers is modeled in the host and transferred to the OP4510 with Ethernet. The controllers of the PV and BESS are modeled in two dedicated DSPs. Furthermore, as shown in   rule layer, the recurrent connective weights w 4 r , the connective weights w 3 ik in the wavelet and petri layer, and the mean m 2 j and standard deviations σ 2 j of the membership functions in the membership layer using the BP algorithm.
All the PI, FNN and RWPFNN controllers are coded in the current control loop with 1ms sampling time. Since the clock rate of the adopted DSP TMS320F28335 is 150MHz, the operation cycles and execution time of the PI, FNN and RWPFNN controllers are 179 cycles (1.1933 µs), 1612 cycles (10.7467 µs) and 15214 cycles (101.4267 µs), respectively. Though the proposed RWPFNN controller is more complicated than both PI and FNN, the execution time is still within the 1ms sampling time of the current control loop with the same hardware environment.
To evaluate the control performance of the mentioned controllers, the IAE index and the response time during the grid faults, and the MAE index after the restoration of the grid faults are listed in (36), (37) and (38) as follows: where the time parameters of performance measurings can be found in Table 1. Due to the short-circuit current of the diesel generator is rising rapidly, which may exceed the maximum short-circuit capacity of the diesel generator, a three-phase FCL circuit is adopted to limit the excess current in this study. FCLs are proper means for reducing fault current level in the microgrid system. Considering that a large inductor can present extremely large impedance to system with high frequency component, the inductive FCLs, compared with its resistive counterpart, are very effective in restricting the rising speed of the short-circuit current of the diesel generator which may cause major damage during the grid faults [39]- [41]. Therefore, a three-phase inductive FCL is connected in series with the diesel generator and the microgrid system as shown in Fig. 10. In the simulation, the FCL impedances, Z FCL , are obtained via trial and error considering the requirements of maximum capacity of the diesel generator and the system stability. The result is: As shown in Fig. 10, the FCL is disconnected from the system in normal operation. On the other hand, the FCL is connected in series with the power line and diesel generator during grid faults in order to reduce the fault current from exceeding the maximum capacity of the diesel generator and enhance the stability of the microgrid system. In the following, Case A and Case B two test cases at heavy load and light load with grid fault for the Cimei Island microgrid are designed to consider the effect of parameter uncertainties and external disturbances on the control performance of the microgrid and examine the transient responses of the PI, FNN and proposed RWPFNN controllers for the VRC of BESS and the compliance with the E.ON standard of the LVRT for the PV. Moreover, Case C is designed to further investigate the effect of variations in power output of PV and wind turbine on performance.

A. FAULT OCCURS AT HEAVY LOAD WITH BESS IN DISCHARGING MODE
In Case A, the PV, WTG and BESS all output power to supply the loads. A three-phase short-circuit and grounding fault occurs in c1 of the microgrid as shown in Fig. 1 causing the voltage sag with 16.15% drop at the PCC. The resistance of grounding fault is set to be 8.63 . In the beginning, the microgrid is in normal operation with No. 1 diesel generator (G1) operating with loads 956.34 kW and 314.31 kVar. The PV system outputs 300 kW and the WTG outputs 305 kW. The control command for the BESS is in the discharging mode with 300 kW as shown in Figs. 11, 12 and 13. In this way, the diesel generator would provide 51.34 kW and 341.31 kVar to support the operation of the microgrid. Due to the three-phase short-circuit and grounding fault at 0.4 s, the microgrid is facing voltage sag and the PV system, WTG system and BESS should maintain the same output power. Meanwhile, the PV system and BESS have captured the voltage sag exceeding 10%, and then output the reactive power to meet the LVRT requirements and execute VRC, respectively. At the same time, the diesel generator will increase or decrease its active and reactive power outputs to balance the load. Afterwards, the fault is removed at 0.6 s, the microgrid restores to the normal operation. The voltage responses of voltage sag without LVRT and VRC and voltage restoration with LVRT and VRC of the PI, FNN and proposed RWPFNN controllers are in Figs. 11(a), 12(a) and  The performance measurings of the PI, FNN and RWPFNN controllers with VRC and active power control of BESS at heavy load are compared in Table 2. From Table 2, the IAE, the response time and the MAE of voltage restoration of the proposed RWPFNN controller are lower than both the PI and FNN controllers. Moreover, the IAE, the response time and the MAE of active power control of the proposed RWPFNN controller are still the lowest among three controllers.

B. FAULT OCCURS AT LIGHT LOAD WITH BESS IN CHARGING MODE
In Case B, the PV and WTG output power to supply the loads with BESS in charging mode. A three-phase short-circuit and grounding fault occurs in d2 of the microgrid as shown in Fig. 1 causing the voltage sag with 26.47% drop at the PCC. The resistance of grounding fault is set to be 13 . In the beginning, the microgrid is in normal operation with No. 1 diesel generator (G1) operating with loads 680.25 kW        Table 3. From Table 3, the IAE, the response time and the MAE of voltage restoration of the proposed RWPFNN controller are lower than both the PI and FNN controllers. Moreover, the IAE, the response time and the MAE of active power control of the proposed RWPFNN controller are the lowest as well.

C. FAULT OCCURS WITH VARIATIONS IN POWER OUTPUT OF PV AND WIND TURBINE
In Case C, the PV, WTG and BESS all output power to supply the loads with the PV system changing its output to 330 kW (+30 kW) and the WTG system changing its output to 275 kW (−30 kW) abruptly at 0.4 s, while the rest of the conditions are the same as Case A to further consider the effect of variations in power output of PV and wind turbine on performance. A three-phase short-circuit and grounding fault occurs in c1 of the microgrid as shown in Fig. 1 causing the voltage sag with 16.25% drop at the PCC. The resistance of grounding fault is set to be 8.63 . In the beginning, the microgrid is in normal operation with No. 1 diesel generator (G1) operating with loads 956.34 kW and 314.31 kVar. The PV system outputs 300 kW and the WTG outputs 305 kW. The control command for the BESS is in the discharging mode with 300 kW as shown in Figs. 17, 18 and 19. In this way, the diesel generator would provide 51.34 kW and 341.31 kVar to support the operation of the microgrid. Due to the three-phase short-circuit and grounding fault with the PV system changing its output to 330 kW and the WTG system changing its output to 275 kW abruptly at 0.4 s, the microgrid is facing voltage sag and BESS should maintain the same output power. Meanwhile, the PV system and BESS have captured the voltage sag exceeding 10%, and then output the reactive power to meet the LVRT requirements and execute VRC, respectively. At the same time, the diesel generator will increase or decrease its active and reactive power outputs to balance the load. Afterwards, the fault is removed at 0.      Table 4. From Table 4, the IAE, the response time and the MAE of voltage restoration of the proposed RWPFNN controller are significantly lower than both the PI and FNN controllers. Moreover, the IAE, the response time and the MAE of active power control of the proposed RWPFNN controller are still the lowest among three controllers.

V. CONCLUSION
To provide fast response of voltage restoration during grid faults in a microgrid, a VRC based on BESS has been successfully developed in this study. Since the BESS can maintain seamless operation for severe voltage-sag conditions and reduce the impact of intermittent renewable energy, the BESS has been broadly used in the microgrid system nowadays. In this study, two control strategies have been designed to fulfill the voltage restoration of the PCC during grid faults. The first one is the control of PV system to satisfy the requirements of the reactive power support of LVRT according to the grid codes; the second one is the control of BESS to implement the VRC when voltage sags happen. Moreover, the RWPFNN, which combines the merits of the functional advantages of the PN, RFNN and WFNN, has been successfully developed and adopted in the VRC. From the experimental results of the Cimei Island microgrid, it has been verified that the proposed RWPFNN controller can provide fast voltage restoration response which is very helpful to mitigate the transient impact during grid faults of the microgrid.

APPENDIX
To guarantee the convergence of the proposed RWPFNN controller, specific learning-rate factors for the training of the parameters of the RWPFNN can be obtained by using the convergence analysis [38]. First, the error function shown in (19) is considered as a discrete-type Lyapunov function. Then, the variation of the Lyapunov function can be rewritten as follows: Linearized model of the Lyapunov function is obtained via (21), (25), (28), (31) and (32) as follows [38]: