Patent Publication Number: US-2019190274-A1

Title: An energy management system and method for grid-connected and islanded micro-energy generation

Description:
The present invention is concerned with an energy management system and method for grid-connected and islanded micro-energy generation. In particular, the present invention is concerned with an energy management system and method for “main grid”-connected and islanded micro-grids comprising renewable energy generators. 
     INTRODUCTION 
     Generation of electrical power by renewable means is becoming increasingly common. Decreasing cost of photovoltaic arrays and the use of government subsidies have led to a significant uptake in the installation of solar panels on homes, offices and factories. In addition, solar farms can be established and used to generate power as a commercial undertaking. 
     In addition to photo-voltaic panels, electricity can be generated on the micro-scale by other means, e.g. small domestic wind turbines. Both are sources of renewable energy, the meaning of which is well understood in the art. 
     Typically, a country will have a main grid which distributes alternating current electricity at a predetermined voltage, frequency and phase. Such main grids are designed to receive a stable AC electricity feed from e.g. a fossil fuel or nuclear source. The feed from such means of power generators will typically not vary—i.e. they are “synchronous generators”. 
     Prior art synchronous generators, as their name suggests, are synchronised to the main grid frequency when they are connected. The system that controls frequency is called a governor. The governor monitors the generator&#39;s rotor speed (which is proportional to grid frequency) and adjusts the input mechanical power from a prime-mover (such as a steam turbine) according to a droop characteristic. Droop speed control is well known in the art. 
     For example, if speed drops less than synchronous speed (which means frequency is less than 1 pu) more power is demanded from the prime-mover and vice versa. The same system also controls the frequency in the islanded operation of a prior art synchronous generator. Evidently such governors are not appropriate for renewable sources as the input power of the generator (which could be e.g. incident sunlight or wind speed) cannot be manipulated. 
     Interfacing renewable sources with the main grid is not straightforward. PV panels produce a DC output which needs to be converted to AC via a solar inverter (DC/AC converter). Such solar inverters must be configured to match the voltage, frequency and phase of the main grid. 
     Because renewable sources are highly variable in their power output, it is usual to combine them with energy storage (ES) so energy can be stored and used when required. A problem arises in the case where PV panels are combined with ES. ES also provides the operator with the ability to store generated energy and sell it at his or her convenience. Conventionally ES is connected to the AC side of the solar inverter requiring an AC/DC converter to charge the ES. This energy management system can be expensive due to the addition of an AC/DC converter and suffers from limited flexibility in the choice of use, store or sale of the energy generated. Prior art systems do exist with ES upstream of the inverter, but these are series-connected. 
     Another problem with interfacing PV panels with the main grid is that their output is dependent on the solar radiation incident on the panel surface. The efficiency of the power extraction from the panel is also dependent upon the amount of incident radiation, panel temperature as well as the load attached to the panel. Various techniques which fall within the term “maximum power point tracking” (MPPT) have been used to ensure that the characteristics of the load (controlled electronically) can be set to ensure the maximum power point is utilised. 
     It is known for a plurality of electricity generators to be connected in a “micro-grid”. A micro-grid typically comprises a plurality of interconnected distributed generation (DG) units (e.g. PV panels) and energy storage (ES) units (e.g. batteries) which can operate in parallel with, or isolated from, the main power grid. Micro-grids can benefit customers through providing uninterruptible power, enhancing local reliability, reducing transmission loss, and supporting local voltage and frequency. 
     When such micro-grids are islanded (i.e. when the main grid ceases to be operational) the intention is for them to remain operational. To achieve this, micro-grids must be designed such that they can operate in both grid-connected and islanded (i.e. grid-disconnected) modes. Four operating scenarios can be defined for a micro-grid:
         grid-connected;   islanded;   transition from grid-connected to islanded; and,   transition from islanded to grid connected.       

     In grid-connected mode, where voltage and frequency are imposed by the main grid, the imbalance between generated and demanded local active and reactive power will be supplied or absorbed by the grid (depending on whether the imbalance is a power deficit or excess respectively). 
     In islanded mode, the active and reactive power imbalance must be handled locally. This is usually achieved through using energy storage (ES) systems and auxiliary generators (AG) for active power imbalance, and exploiting the power electronic converters (PEC) of DGs and AGs, to supply/absorb reactive power imbalance. This means that the micro-grid&#39;s voltage and frequency must be locally controlled within limits defined by international standards such as IEEE 1547. 
     In the same way that prior art non-renewable governed generators are frequency matched to the grid, a renewable DG such as a PV panel must be synchronised to grid frequency during grid-connected mode and must be able to control frequency during islanded operation. The common approach in grid-connected mode is to use a Phase Locked Loop (PLL) to synchronise the DG with the grid, while during islanded mode, droop control (as mentioned above) is the most common approach to control voltage and frequency of the microgrid. 
     Transition from islanded to grid-connected is usually handled through utilisation of a phase locked loop (PLL) in order to synchronise DG units to the grid frequency. Grid connection is always intentional. 
     However, grid disconnection (islanding) can be either planned (e.g. for maintenance) or unplanned (e.g. due to a fault on the grid side). According to the current regulations, all distributed generation and storage units must be disconnected from the grid within a specified time interval after an islanding event being detected (e.g. within 2 seconds according to IEEE 1547). However, this undermines the whole concept of micro-grid, which must be able to supply local loads (or at least the critical loads) even after being disconnected from the grid. Therefore, a micro-grid must be able to detect an unplanned islanding event in order to switch from grid-connect mode to islanded mode. 
     Since there are two different control schemes, an islanding detection method is required to detect an unplanned islanding event and switch from grid-connected to islanded control. Since grid reconnection is always planned (unlike grid disconnection which can be either planned or unplanned), it is less problematic. However, still some sort of communication from the grid to the DG is required to change the control back to grid-connected mode i.e. bringing back the PLL in order to get synchronised to grid again. 
     Islanding detection methods can be categorized into three groups: passive, active, and communication-based. 
     Passive 
     In passive method, one or more local parameters are monitored in order to detect an islanding event. Different parameters have been proposed in literature, for example, voltage and frequency, unusual changes of active power and frequency, fast increases in the voltage phase, reactive power, difference in phase angle or Total Harmonic Distortion (THD). However, passive methods suffer from a relatively large non-detection zone (NDZ). NDZ refers to certain area in the active power vs reactive power plane which is associated with very small (non-detectable) variations of voltage and frequency. In other words, a real grid failure may not be detected. 
     Active 
     In active methods, a controlled disturbance is injected into the system and islanding being detected according to the response of the system. Although active methods have zero (or very small) NDZ, they might be slower than passive methods (due to the dynamics of the system). In addition, active methods can deteriorate the power quality with the injected disturbance. 
     Communication-Based 
     The main disadvantage of communication-based methods is that they fully depend on a fast and reliable communication between the main grid and DGs, which can be very expensive. Furthermore, any communication method can be subject to noise and disruptions that can endanger the operation. 
     What is required is a micro-grid energy management system which overcomes, or at least mitigates, the aforementioned problems with the prior art. 
     BRIEF DESCRIPTION OF THE INVENTION 
     According to a first aspect of the present invention there is provided an energy management system according to claim  1 . 
     According to a second aspect of the present invention there is provided a method of management according to claim  13 . 
     The present invention method can seamlessly ride-through a fault, control voltage and frequency during islanded operation and seamlessly get synchronised with the grid upon reconnection. 
     Effectively, the invention mimics the operation of a synchronous generator&#39;s AVR and governor utilising the energy storage as a prime mover. 
     Unlike previous system, the system according to the invention:
         Can be augmented to classical current controlled VSC (voltage source converters).   Covers all area related to renewable energy such as energy storage control and maximum power point tracking.   Introduces a comprehensive active and reactive power control that minimises the utilisation of a fossil-fuelled auxiliary generator.   Makes sure that the rating of the converter is not violated due to a high active and/or reactive power.   Is quite “user-friendly” in terms of energy storage control. Hence, the user can decide how much energy store and how much energy sell, at will.       

     Moreover, the proposed over-charged protection, although is not the necessary part of the control, unlike similar schemes, does not need a dumping resistor to dissipate the generated power. 
     A comprehensive reactive power management scheme is also introduced that utilises all the available capacity of the distributed generator&#39;s converter while making sure that its rating is not violated through supplying/absorbing the remaining load reactive power by the auxiliary generator. 
     According to a third aspect of the present invention there is provided an energy management system (EMS) for a renewable energy source capable of providing local energy usage, local energy storage and selective feed of either or all of generated and stored energy into a load or to a grid whereby:
         a. the EMS comprises a local storage mechanism upstream of the DC to AC converter controlled by a MPPT and energy storage control mechanism; and,   b. the EMS determines in a predetermined manner or by algorithm or by user preference how much energy is stored or used locally or sold to a grid.       

     Preferably the local energy storage mechanism is connected between the renewable energy source and DC/AC converter in parallel. 
     Preferably the energy storage mechanism and associated DC/DC converter and controller are configured to undertake MPPT for the renewable energy source. 
     Preferably the local energy storage comprises a DC to DC converter and a local energy storage device upstream of the DC to AC converter. 
     The energy storage mechanisms may be electric (e.g. supercapacitors) or mechanical (e.g. flywheels). 
     The energy storage mechanism can be augmented to the previously existing renewable generation units with minimal alternation and costs. 
    
    
     
       DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a diagram of a first grid-connected PV panel energy management system according to the present invention; 
         FIG. 2 a    is a diagram of the MPPT control system for the system of  FIG. 1 ; 
         FIG. 2 b    is a diagram of the operation of the energy management system of  FIG. 1 ; 
         FIG. 3  is a detail diagram of the DC/AC converter control of the system of  FIG. 1 ; 
         FIG. 4  is a set of graphs showing the simulated results from the energy management system of  FIG. 1 ; 
         FIG. 5  is a diagram of a second PV panel energy management system according to the present invention; 
         FIG. 6 a    is a diagram of the DC/DC controller of the energy management system of  FIG. 5 ; 
         FIG. 6 b    is an energy management scheme of the system of  FIG. 5 ; 
         FIG. 7  is a detail diagram of the DC/AC converter control of the system of  FIG. 5 ; 
         FIG. 8  is a diagram of a SRF-PLL; 
         FIG. 9  is a schematic diagram of the DG&#39;s inverter and filter; 
         FIG. 10  is a simplified schematic of a static AVR system; 
         FIGS. 11 a  and 11 b    are a set of graphs showing the simulated results from the energy management system of  FIG. 5 ; 
         FIG. 12  is a detail view of a portion of the graphs (f) and (g) of  FIG. 11 ; and, 
         FIG. 13  is a set of graphs showing ES over-charge protection. 
     
    
    
     DETAILED DESCRIPTION 
     Energy Management System 
       FIGS. 1 to 4  show an energy management system  100  which forms a part of the present invention. 
     The system  100  is connected to a photovoltaic panel  102  at a first, upstream side and to a main electricity grid  104  at a second, downstream side. The system  100  comprises:
         A solar inverter  106 ;   An energy storage (ES)  108  in the form of a battery;   A DC/DC converter  110  connected in parallel between the panel  102  and the inverter  106 ;   A first controller  112  controlling the DC/DC converter; and,   A second controller  114  controlling to the DC/AC converter (i.e. the solar inverter  106 ).       

     It will be noted that the energy storage  108  (which as discussed is, in the prior art, often located downstream of the inverter  106 ) is positioned upstream of the inverter  106 . In other words, the energy storage  108  is positioned on the DC side of the inverter  106 . 
     Output power  102  (P pv ) and output current (I pv ) from the PV panel are captured across a capacitor  116  as a voltage (V dc ) which is converted to an appropriate voltage for local storage in the ES  108  by the DC to DC converter  110 . 
     Maximum Power Point Tracking (MPPT) which optimises the dynamically varying P pv  with the input impedance of the energy management system is conventionally done by the inverter  106 . However, in the present system  100 , MPPT is undertaken by the DC/DC converter  110  and the first controller  112 . The control is such that the power generated by the PV panel  102  is shared/split between (i) power stored locally at the ES  108  (P es ) and (ii) power to be supplied to the inverter  106  and thereby converted to grid power (P dc ). The split is determined according to the state of charge (SoC) of the battery (ES  108 ), in a manner to optimise power supplied to the load (P L , Q L ) and to the grid (P g , Q g ). By monitoring the SoC of the ES  108 , the locally stored energy can be selectively released to the grid in a controlled manner. 
     In further detail, the proposed energy management system (EMS) shares the generated PV power P pv  between the ES (P es ) and the DC/AC converter (P con ≈P dc ) according to the SoC of the ES. The proposed EMS therefore provides the owner of the energy harvesting system (commonly known as a distributed grid (DG)) with the ability to sell the stored energy to the grid according to the SoC. 
       FIGS. 2 a  and 2 b    show the manner of operation of the controller  112 . The DC/DC converter is controlled to perform maximum power point tracking (MPPT). In this embodiment, the exact means of MPPT is using the method proposed in M. Fazeli, P. Igic, P. M. Holland, R. P. Lewis, and Z. Zhou, “Novel Maximum Power Point Tracking with classical cascaded voltage and current loops for photovoltaic systems,” presented at the IET Conference Renewable Power Generation RPG Edinburgh, UK, 2011. This document is hereby incorporated by reference where permissible. 
     The proposed EMS, which is illustrated in  FIG. 2 b   , creates three gains according to the SoC of the EM  108 , those being:
         K es —ES gain;   K con =1−K es —DC/AC converter gain; and,   I d-sell —selling current (power) gain.       

     The gains are used according to the following method:
         As shown in  FIG. 1 , K es , K con  and I d-sell  are fed into the DC/AC converter controller  114 , illustrated in detail in  FIG. 3 ;   K es  and K con  are used to share P pv  between P es  and P con  (K es +K con =1);
           Therefore P pv =P es +P con  (this neglects the converter&#39;s losses i.e. for the purposes of this description, P dc =P con . It will be understood that in reality P con &lt;P dc ):   
           The operation of the DC/AC controller  114  is based on the power balance: P con =K con (P pv −K es ·P es ). Referring to the upper branch of  FIG. 2 b   , with Ctrl=0:
           For a low charge level, SoC&lt;a predetermined “low” threshold (10% in this embodiment). In this condition, K es =1, hence K con =0 and P pv =P es .   For a high charge level, SoC&gt;a predetermined “high” threshold (95% in this embodiment), K es =0, hence K con =1 and P pv =P con .   For charge levels between the thresholds, 10%&lt;SoC&lt;95%, K es  varies linearly with SoC. As SoC decreases, K es  increases. P pv  is split between P es  and P con , proportional to K es  and K con .   
           The d-component current I d-p  ( FIG. 3 ) is calculated using P con* =√{square root over (3)}|V con |I d PF con , (note I q =0) where, V con  and PF con  are the converter AC-side voltage and power factor respectively. At steady state V con ≈1 pu and PF con ≈1.   The reference d-component current I d *=I d-p +I d-sell , where I d-sell  is determined by the owner/operator of the DG through how much of the stored energy they want to sell.
           For SoC&gt;a predetermined “energy release option” threshold, which should be less than or equal to the “high” threshold above (90% in this embodiment), the owner will be informed that they have the option to sell some of their stored energy. If they decide to sell, a reference SoC* will be created according to the amount of the energy they want to sell. If the option is taken to feed stored energy into the grid, the control signal is set to Ctrl=1. This affects the top branch of  FIG. 2 b    by setting K es =0, which means K con =1 so P pv =P con  (i.e. all PV power is routed into the main grid).   A proportional controller K sell  is used to control SoC. A low bandwidth filter is used to make sure that P con  does not jump (hence, avoiding voltage jump).   When SoC=SoC* (which, as discussed above is based on the amount of energy the owner wants to sell) the owner has the option to either continue at SoC* or choose the not selling option, which makes Ctrl=0, and P pv  will be shared by P es  and P con  according to the current SoC (as above).   
               

     It will be noted that the thresholds mentioned above (high/low/energy release) can either be predefined or dynamically controlled by the DG user or by an algorithm which reflects the optimum user requirements or the practical limitations of the ES or the national grid regulations.
         The output of the SoC controller is multiplied by the base current (I base ) to get I d-sell  in Amps.   I d-sell  is added to I d-p  to constitute the reference d-component current I d *.   Standard PI controlled current loop are used to determine dq-components of converter voltage which are transformed to 3-phase frame using a Park Transform, to get the PWM signal ( FIG. 2 a   ).       

     The proposed energy management system has been simulated with the following model:
         The EMS shown in  FIGS. 1 to 3  was simulated in PSCAD/EMTDC environment. The results are presented in  FIG. 4 , in which:
           The top graph shows Load Power (P L ) and grid power (P g ) vs. time;   The second graph shows PV power (P pv ), DC/AC converter power (P con ) and ES power (P es ) (pu) vs. time;   The third graph shows the state of charge vs. time; and,   The lowest graph shows the various controller parameters vs. time.   
           At t=0
           PL=1 pu, P pv =0, hence P g =−1 pu.   SoC=7%, hence, K es =1, K con =0.   
           At t=0.5 s
           P pv =1 pu.   Since SoC&lt;10%, at first P es =P pv .   As SoC increases, P es  reduces and P con  increases until when SoC=95%, P es =0 and P con =P pv .   For SoC&gt;90% (sell option threshold), the owner has the option to sell the stored energy.   
           At t=7.5 s
           The owner decides to sell up to SoC*=50%. Ctrl=1, P con  increases and P es  reduces until SoC=50%.   If the owner does not change the selling status, the SoC will remain at SoC*.   
           At t=14 s
           The owner chooses “not selling” option.   Hence Ctrl=0.   Hence, P pv  is shared between P es  and P con  according to K es  and K con .   As SoC increases, P es  reduces and P con  increases until when SoC=95%, P con =P pv  and P es =0.   
           At t=21 s
           P pv =0, hence, P con =0 and Pg=PL=1 pu.   
           At t=22.5
           The owner decides to use the stored energy down to SoC*=20%   
               

     It will be noted that the DC to DC converter used in the present invention is significantly lower cost than the equivalent AC to DC converter in prior art configurations. In addition, by making a parallel (as opposed to series) connected between the PV panels, energy storage and inverter, the ability is provided to share P pv  according to the SoC and desired level of stored energy in a flexible manner. 
     Energy Management System for Universal and Seamless Control of Microgrids 
     Referring to  FIGS. 5 to 13 , an energy management system in accordance with the present invention will be described. In particular, the system is well suited to handling transitions between grid connected and islanded states. 
     An energy management system  200  is shown in  FIG. 5 . The skilled addressee will note the similarities between the system  200  and the system  100 . The system  200  is connected to a photovoltaic panel  202  at a first, upstream side and to a main electricity grid  204  at a second, downstream side. 
     The system  200  comprises:
         A solar inverter  206 ;   An energy storage (ES)  208  in the form of a battery;   A DC/DC converter  210 ;   An auxiliary generator (AG)  218 ;   A first controller  212  controlling the DC/DC converter and an AG  218  (see below);   A second controller  214  controlling to the DC/AC converter (i.e. the solar inverter  206 ); and,   A third controller  220  controlling the AG  218 .       

     It will be understood that the three controllers above are described separately for the sake of clarity, but they form a single “control system” whose functions may be performed by a single unit, or several distributed units as required. 
     As with the system  100 , it will be noted that the energy storage  208  is positioned upstream of the inverter  206 . 
     First Controller  212 —DC/DC and ES Control 
     The ES  208  is connected to the DC link of the PV system through the DC/DC converter  210 . The DC/DC converter  210  is controlled by the controller  212  to track maximum PV power. As with the system  100 , the maximum power point tracking (MPPT) used in this embodiment is described in M. Fazeli, P. Igic, P. M. Holland, R. P. Lewis, and Z. Zhou, “Novel Maximum Power Point Tracking with classical cascaded voltage and current loops for photovoltaic systems,” presented at the IET Conference Renewable Power Generation RPG Edinburgh, UK, 2011. This document is hereby incorporated by reference where permissible. It will be noted that other MPPT methods may also be used in the present invention. 
       FIGS. 6 a  and 6 b    show the DC/DC converter control (via controller  112 ), which uses the classical cascaded voltage and current loops, developed in the above referenced paper, to control the DC-link voltage V dc  to follow its reference (V dc *) from the MPPT algorithm. 
       FIG. 6 b    illustrates the proposed energy management system (EMS) according to the level of battery&#39;s state of the charge (SoC). The EMS operates through defining four variable gains based on the level of SoC. 
     As with the system  100 , the combined cooperation of EG gain (K es ) and converter gain (K con =1−K es ) determines how much of the generated PV power (P pv ) is stored in ES or being passed through the DC/AC converter  206 . This is shown with reference to the upper branch of  FIG. 6 b   . When SoC is more than a predetermined “high” threshold (in this embodiment 90%), all P pv  must go through the DC/AC converter  206  and for SoC less than a predetermined “low” threshold (in this embodiment 10%) all P pv  will go to the ES. Between those points, the distribution varies linearly. Hence, if:
         SoC&gt;90%→K es =0 and K con =1   SoC&lt;10%→K es =1 and K con =0   10%&lt;SoC&lt;90%→K es  and K con  vary linearly between the two points, as shown in  FIG. 6   b.          

     Note that these thresholds are merely examples and they can change according to the preferences of owner/operator of the DG (e.g. how much they want to store in ES determines the “high” threshold), practical limitations on ES mechanisms, and the defined regulations and standards. 
     In islanded mode if load power P L &gt;P pv , SoC keeps reducing (i.e. the ES is being discharged). At some point, the auxiliary generator (AG) needs to be used. The AG is controlled by the AG power demand signal P ag *. Generation of the AG power demand signal P ag * is shown in the middle branch of  FIG. 6 b   . When SoC becomes less than an AG power demand threshold (which must be more than the “low” threshold of K es  e.g. in this embodiment 30%, being greater than 10%), a power demand signal P ag * will be sent to the AG. For SoC less than a discharge prevention threshold (in this embodiment 5%), P ag *=1 pu. Between the discharge prevention threshold and the AG power demand threshold, P ag * varies linearly with SoC. 
     In islanded mode if load power P L &lt;P pv , SoC keeps increasing (i.e. the PV panels  202  are generating more power than required by the load). Thus, measures must be taken into account to make sure that the ES will not get over-charged. Prior art solutions propose a “dumping” resistor to dissipate the extra generated energy. This is clearly inefficient and wasteful. The present invention acts to instead reduce generation rather than dumping power. The present invention deals with this as shown in the lower branch of  FIG. 6 b   . As SoC increases more than an overcharge prevention threshold (which must be higher than K es  high threshold—e.g. 95% being higher than 90%), a gain (K d ) is generated and is added to V dc * ( FIG. 6 a   ). Since, V dc * is the voltage at which P pv  is at its maximum point, P pv  will be reduced by increasing V dc * with K d . The rate at which K d  increases depends on the P pv −V dc  characteristic of the PV array. As shown in  FIG. 6 b   , a first order filter is used to add a dynamic to the system and helps to damp the oscillations (τ d =0.05 in this embodiment). 
     Second Controller  214 —DC/AC Control 
       FIG. 7  illustrates the proposed control system for the second controller  214  controlling the DC/AC converter shown in  FIG. 1 . The control, which is based on the standard d-q current controllers aims to: 
     1. Control the Power Through DC/AC Converter P con    
     As discussed above, P pv =P es +P dc  (neglecting the converter&#39;s loss, we assume P dc =P con ). In order to take into account SoC, a reference converter power is defined as: P con *=K con (P pv −K es ·P es ) Therefore whenever:
         SoC&gt;90%→P con *=1(P pv −0 P es )=P pv      SoC&lt;10%→P con *=0(P pv −1 P es )=0→P es =P pv      10%&lt;SoC&lt;90%→P pv  will be shared between ES and the  206  according to SoC.       

     Neglecting I d-v  for now, the reference d-component current I d * ( FIG. 7 ) will be calculated using P con *=√{square root over (3)}|V con |I d * PF con , where, V con  and PF con  are the inverter AC-side voltage and power factor respectively. At steady state PFcon≈1, hence, 
     
       
         
           
             
               I 
               d 
               * 
             
             = 
             
               
                 
                   P 
                   con 
                   * 
                 
                 
                   
                     3 
                   
                    
                   
                      
                     
                       V 
                       con 
                     
                      
                   
                 
               
               . 
             
           
         
       
     
     2. Control/Support Frequency 
     The proposed method, shown in  FIG. 5 , is used in both grid-connected and islanded operations; hence, there is no need for an islanding detection method. Moreover, since PLL remains as part of the islanding operation, there is no need for any communication between the grid and DG. The proposed method utilises the combined DG-ES-AG similar to a prime-mover in a conventional synchronous generator. The principal of the operation is explained below: 
     Steady State 
     The present invention uses a synchronously-reference-frame (SRF)-PLL, which is the most common PLL explained in literature such as S. Golestan and J. M. Guerrero, “Conventional Synchronous Reference Frame Phase-Locked Loop is an Adaptive Complex Filter,” IEEE Transactions on Industrial Electronics, vol. 62, No. 3, 2015 (hereby incorporated by reference where permitted). It will be understood that other types of PLL may be implemented. 
     As shown in  FIG. 8 , the PLL measures frequency through keeping the q-component of filter voltage V C-q =0. Neglecting the filter losses, according to Park Transform: 
         P   con =3/2( V   C-d   I   d   +V   C-q   I   q ) 
         Q   con =3/2( V   C-d   I   d   +V   C-d   I   d )  (Eq. 1)
 
     Therefore, at steady state when V C-q =0 and V C-d ≈1 pu, active power is proportional to I d  and reactive power is proportional to I q . Since the DC-link voltage of the DG is controlled by the ES, after grid disconnection, DG-ES appears as a current source to the local loads. In other words, the local loads impose I d  and I q  at steady state. Since PLL remains as part of the control in islanding operation, P con  and Q con  remain proportional to I d  and I q , at steady state (V C-q =0). 
     Transient 
     During transient since V C-q ≠0, both I d  and I q  can be used. However I d  and I q  exhibit different characteristics in respect to frequency variations. Considering  FIG. 9 , the following equations can be written using KVL and Park Transform: 
         V   con-d   =V   C-d   +I   d ( R+sL )− LωI   d   (Eq. 2)
 
         V   con-q   =V   C-q   +I   q ( R+sL )− LωI   q   (Eq. 3)
 
     Where, R and L are filter&#39;s resistance and inductance respectively. 
     According to  FIG. 8 , one can write: 
     
       
         
           
             
               
                 
                   
                     
                       
                         V 
                         
                           C 
                            
                           
                             - 
                           
                            
                           q 
                         
                       
                        
                       
                         ( 
                         
                           
                             k 
                             p 
                           
                           + 
                           
                             
                               k 
                               i 
                             
                             s 
                           
                         
                         ) 
                       
                     
                     + 
                     
                       ω 
                       * 
                     
                   
                   = 
                   
                     
                       ω 
                       → 
                       
                         V 
                         
                           C 
                            
                           
                             - 
                           
                            
                           q 
                         
                       
                     
                     = 
                     
                       
                         ω 
                         - 
                         
                           ω 
                           * 
                         
                       
                       
                         
                           k 
                           p 
                         
                         + 
                         
                           
                             k 
                             i 
                           
                           s 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     4 
                   
                   ) 
                 
               
             
           
         
       
     
     Where ω and ω′ are the reference frequency and measured frequency in rad/s, and k p  and k i  are proportional and integral gains of PLL&#39;s PI controller. Since according to (Eq. 4) V C-q  is a function of frequency, (Eq. 3) seems more suitable for investigating frequency variations, while (Eq. 2) seems a better equation for investigating the variation of voltage: 
     Substituting (4) into (3) and solving it for I d  gives: 
     
       
         
           
             
               
                 
                   
                     I 
                     d 
                   
                   = 
                   
                     
                       
                         
                           
                             v 
                             
                               con 
                               - 
                               q 
                             
                           
                           
                             L 
                              
                             
                                 
                             
                              
                             ω 
                           
                         
                         - 
                         
                           1 
                           
                             L 
                              
                             
                               ( 
                               
                                 
                                   k 
                                   p 
                                 
                                 + 
                                 
                                   
                                     k 
                                     i 
                                   
                                   s 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             ω 
                             * 
                           
                           
                             L 
                              
                             
                                 
                             
                              
                             
                               ω 
                                
                               
                                 ( 
                                 
                                   
                                     k 
                                     p 
                                   
                                   + 
                                   
                                     
                                       k 
                                       i 
                                     
                                     s 
                                   
                                 
                                 ) 
                               
                             
                           
                         
                         - 
                         
                           
                             
                               I 
                               q 
                             
                              
                             
                               ( 
                               
                                 R 
                                 + 
                                 sL 
                               
                               ) 
                             
                           
                           
                             L 
                              
                             
                                 
                             
                              
                             ω 
                           
                         
                       
                       → 
                       
                         
                           ∂ 
                           
                             I 
                             d 
                           
                         
                         
                           ∂ 
                           ω 
                         
                       
                     
                     = 
                     
                       
                         
                           - 
                           
                             v 
                             
                               con 
                               - 
                               q 
                             
                           
                         
                         
                           L 
                            
                           
                               
                           
                            
                           
                             ω 
                             2 
                           
                         
                       
                       - 
                       
                         
                           ω 
                           * 
                         
                         
                           L 
                            
                           
                               
                           
                            
                           
                             
                               ω 
                               2 
                             
                              
                             
                               ( 
                               
                                 
                                   k 
                                   p 
                                 
                                 + 
                                 
                                   
                                     k 
                                     i 
                                   
                                   s 
                                 
                               
                               ) 
                             
                           
                         
                       
                       - 
                       
                         
                           
                             I 
                             q 
                           
                            
                           
                             ( 
                             
                               R 
                               + 
                               sL 
                             
                             ) 
                           
                         
                         
                           L 
                            
                           
                               
                           
                            
                           
                             ω 
                             2 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     5 
                   
                   ) 
                 
               
             
           
         
       
     
     Substituting (4) into (3) and solving it for I q  gives: 
     
       
         
           
             
               
                 
                   
                     I 
                     q 
                   
                   = 
                   
                     
                       
                         
                           
                             v 
                             
                               con 
                               - 
                               q 
                             
                           
                           
                             ( 
                             
                               R 
                               + 
                               sL 
                             
                             ) 
                           
                         
                         - 
                         
                           ω 
                           
                             
                               ( 
                               
                                 R 
                                 + 
                                 sL 
                               
                               ) 
                             
                              
                             
                               ( 
                               
                                 
                                   k 
                                   p 
                                 
                                 + 
                                 
                                   
                                     k 
                                     i 
                                   
                                   s 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             ω 
                             * 
                           
                           
                             
                               ( 
                               
                                 R 
                                 + 
                                 sL 
                               
                               ) 
                             
                              
                             
                               ( 
                               
                                 
                                   k 
                                   p 
                                 
                                 + 
                                 
                                   
                                     k 
                                     i 
                                   
                                   s 
                                 
                               
                               ) 
                             
                           
                         
                         - 
                         
                           
                             L 
                              
                             
                                 
                             
                              
                             ω 
                              
                             
                                 
                             
                              
                             
                               I 
                               d 
                             
                           
                           
                             ( 
                             
                               R 
                               + 
                               sL 
                             
                             ) 
                           
                         
                       
                       → 
                       
                         
                           ∂ 
                           
                             I 
                             q 
                           
                         
                         
                           ∂ 
                           ω 
                         
                       
                     
                     = 
                     
                       
                         
                           
                             - 
                             1 
                           
                           
                             
                               ( 
                               
                                 R 
                                 + 
                                 sL 
                               
                               ) 
                             
                              
                             
                               ( 
                               
                                 
                                   k 
                                   p 
                                 
                                 + 
                                 
                                   
                                     k 
                                     i 
                                   
                                   s 
                                 
                               
                               ) 
                             
                           
                         
                         - 
                         
                           
                             LI 
                             d 
                           
                           
                             ( 
                             
                               R 
                               + 
                               sL 
                             
                             ) 
                           
                         
                       
                       = 
                       
                         
                           
                             - 
                             1 
                           
                           
                             ( 
                             
                               R 
                               + 
                               sL 
                             
                             ) 
                           
                         
                          
                         
                           ( 
                           
                             
                               1 
                               
                                 ( 
                                 
                                   
                                     k 
                                     p 
                                   
                                   + 
                                   
                                     
                                       k 
                                       i 
                                     
                                     s 
                                   
                                 
                                 ) 
                               
                             
                             + 
                             
                               LI 
                               d 
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     6 
                   
                   ) 
                 
               
             
           
         
       
     
     Equation (Eq. 5) shows that 
     
       
         
           
             
               ∂ 
               
                 I 
                 d 
               
             
             
               ∂ 
               ω 
             
           
         
       
     
     is inversely proportional to ω 2 . In other words, as frequency increases, the sensitivity of I d  to change of frequency reduces. On the other hand, according to (Eq. 6), 
     
       
         
           
             
               ∂ 
               
                 I 
                 q 
               
             
             
               ∂ 
               ω 
             
           
         
       
     
     is independent of frequency variation. Therefore, it can be concluded that I q  is a better option to control frequency than I d . This may seem contradictory to the well-known fact that (in an inductive system) frequency is proportional to active power. However, it is noted that |I con |=√{square root over ((I d   2 +I q   2 ))} and since active power is in fact proportional to |I con |, both I d  and I q  can be used to control active power during transient (note V C-q ≠0). It is also noted that although 
     
       
         
           
             
               ∂ 
               
                 I 
                 q 
               
             
             
               ∂ 
               ω 
             
           
         
       
     
     is a function of I d , since inductance L is relatively small and LωI d  is added to I q  current control loop as a compensation term; the effect of I d  can be ignored, hence, 
     
       
         
           
             
               ∂ 
               
                 I 
                 q 
               
             
             
               ∂ 
               ω 
             
           
         
       
     
     will be mainly effected by the dynamics of PLL (i.e. k p  and k i ). Equation (Eq. 7) explains the proposed I q-f  droop which is illustrated in  FIG. 7 : 
       Δ I   q   =K   f ( f−f *)  (Eq. 7)
 
     Where f*=1 pu (50 Hz in the UK), K f  is droop gain. K f  is determined according to the acceptable frequency deviations which is different according to different standards e.g. it is ±0.1 Hz in the Northern EU, ±0.2 Hz in Continental EU, and ±0.5 Hz in Australia. In this embodiment the most restricted standard which is ±0.1 Hz (=±0.002 pu taking 50 Hz as base) is illustrated, however, the skilled addresse will understand that variations are possible. K f  is set such that when frequency deviation is maximum, ΔI q =±1 pu (K f =−1/0.002=−500 pu). 
     3. Damp Oscillations 
     In prior art non-renewable systems, due to a relatively large inertia, the speed of a synchronous generator (and hence frequency) does not change very quickly. Moreover, due to existence of losses (friction and damper bars), any oscillations after a disturbance get damped (assuming stable operation). In order to add a similar dynamic and damping characteristic to the control paradigm of the present invention, a first order low pass filter is augmented to the output of the proposed I q-f  droop ( FIG. 7 ). The following demonstrates that the augmented first order filter exhibits similar characteristics to the dynamics of a synchronous generator: 
     The rotor dynamics of a synchronous generator is described by swing equation: 
         P   m   −P   e   =M{umlaut over (δ)}+D{dot over (δ)}   (Eq. 8)
 
     Where, P n , and P e  are mechanical input power from prime-mover (in pu) and the generated electrical power (in pu) respectively. M is angular momentum which in pu 
     
       
         
           
             
               M 
               = 
               
                 H 
                 
                   π 
                    
                   
                       
                   
                    
                   f 
                 
               
             
             , 
           
         
       
     
     H is inertia constant D is damping factor and δ is rotor angle. It is known that Δ{dot over (δ)}=Δω where ω=2πf, hence equation (Eq. 8) can be rewritten as: 
         P   m   −P   e   =M{dot over (ω)}+Dω→ΔP=MΔ{dot over (ω)}+DΔω   (Eq. 9)
 
     In the Laplace domain: 
     
       
         
           
             
               
                 
                   
                     Δ 
                      
                     
                         
                     
                      
                     P 
                   
                   = 
                   
                     
                       
                         
                           Ms 
                            
                           
                               
                           
                            
                           Δω 
                         
                         + 
                         
                           D 
                            
                           
                               
                           
                            
                           Δω 
                         
                       
                       → 
                       Δω 
                     
                     = 
                     
                       
                         
                           
                             Δ 
                              
                             
                                 
                             
                              
                             P 
                           
                           
                             Ms 
                             + 
                             D 
                           
                         
                         → 
                         
                           Δ 
                            
                           
                               
                           
                            
                           f 
                         
                       
                       = 
                       
                         
                           Δ 
                            
                           
                               
                           
                            
                           P 
                         
                         
                           2 
                            
                           π 
                            
                           
                               
                           
                            
                           
                             D 
                              
                             
                               ( 
                               
                                 
                                   
                                     M 
                                     D 
                                   
                                    
                                   s 
                                 
                                 + 
                                 1 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     10 
                   
                   ) 
                 
               
             
           
         
       
     
     Considering (Eq. 7), the output of the proposed virtual governor, illustrated in  FIG. 7 , is: 
     
       
         
           
             
               
                 
                   
                     f 
                     - 
                     
                       f 
                       * 
                     
                   
                   = 
                   
                     
                       Δ 
                        
                       
                           
                       
                        
                       f 
                     
                     = 
                     
                       
                         I 
                         q 
                       
                       
                         
                           K 
                           f 
                         
                          
                         
                           ( 
                           
                             
                               
                                 τ 
                                 f 
                               
                                
                               s 
                             
                             + 
                             1 
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     11 
                   
                   ) 
                 
               
             
           
         
       
     
     Comparing (Eq. 11) with (Eq. 10), τ f  is proportional to M/D. H is normally between 1 and 10 pu, which makes M=0.0064-0.064 pu (f=50 Hz). Assuming D=0.1 pu, τ f =0.064-0.64 pu. 
     The output of the virtual governor is multiplied by base current (I base ) and then is limited using a variable hard limit which varies according to I q-lim =√{square root over (S rating   2 −I d   2 )}. S rating  is the rated apparent power of the DG&#39;s converter. It is noted that at steady state I q  is proportional to reactive power, which is relatively small. If converter capacity is not sufficient to supply load reactive power Q L , AG will supply the difference, which will be discussed below. 
     4. Control/Support Voltage 
     In a prior art/non-renewable synchronous generator an automatic voltage regulator (AVR) is used to control the terminal voltage of the generator (V t ) through varying its excitation current (I f ).  FIG. 7  proposes a virtual AVR which augments I d  from power control scheme by I d-v  to form I d *. 
     As discussed above, since at steady state V C-q =0, P and Q are proportional to I d  and I q  respectively. However, during transient since V C-q ≠0, both I d  and I q  can be used to control P and Q. The following demonstrates that I d  (compared to I q ) is a better option for controlling voltage: 
     Equation (Eq. 2) can be rewritten as: 
       Δ V   d   =I   d ( R+sL )− LωI   q   (Eq. 12)
 
     Where, ΔV d  is the d-component of the voltage drop across the filter&#39;s impedance. Solving (Eq. 12) for I q  gives: 
     
       
         
           
             
               
                 
                   
                     I 
                     q 
                   
                   = 
                   
                     
                       
                         
                           
                             
                               I 
                               d 
                             
                              
                             
                               ( 
                               
                                 R 
                                 + 
                                 sL 
                               
                               ) 
                             
                           
                           
                             L 
                              
                             
                                 
                             
                              
                             ω 
                           
                         
                         - 
                         
                           
                             Δ 
                              
                             
                                 
                             
                              
                             
                               V 
                               d 
                             
                           
                           
                             L 
                              
                             
                                 
                             
                              
                             ω 
                           
                         
                       
                       → 
                       
                         
                           ∂ 
                           
                             I 
                             q 
                           
                         
                         
                           
                             ∂ 
                             Δ 
                           
                            
                           
                               
                           
                            
                           
                             V 
                             d 
                           
                         
                       
                     
                     = 
                     
                       
                         - 
                         1 
                       
                       
                         L 
                          
                         
                             
                         
                          
                         ω 
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     13 
                   
                   ) 
                 
               
             
           
         
       
     
     Solving (Eq. 12) for I d  gives: 
     
       
         
           
             
               
                 
                   
                     I 
                     d 
                   
                   = 
                   
                     
                       
                         
                           
                             
                               I 
                               q 
                             
                              
                             L 
                              
                             
                                 
                             
                              
                             ω 
                           
                           
                             ( 
                             
                               R 
                               + 
                               sL 
                             
                             ) 
                           
                         
                         + 
                         
                           
                             Δ 
                              
                             
                                 
                             
                              
                             
                               V 
                               d 
                             
                           
                           
                             ( 
                             
                               R 
                               + 
                               sL 
                             
                             ) 
                           
                         
                       
                       → 
                       
                         
                           ∂ 
                           
                             I 
                             d 
                           
                         
                         
                           
                             ∂ 
                             Δ 
                           
                            
                           
                               
                           
                            
                           
                             V 
                             d 
                           
                         
                       
                     
                     = 
                     
                       1 
                       
                         ( 
                         
                           R 
                           + 
                           sL 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     14 
                   
                   ) 
                 
               
             
           
         
       
     
     Equation (Eq. 13) demonstrates that 
     
       
         
           
             
               ∂ 
               
                 I 
                 q 
               
             
             
               
                 ∂ 
                 Δ 
               
                
               
                   
               
                
               
                 V 
                 d 
               
             
           
         
       
     
     is inversely proportional to ω. Therefore, as frequency increases, the sensitivity of I q  to voltage variations reduces. However according to (14), 
     
       
         
           
             
               ∂ 
               
                 I 
                 d 
               
             
             
               
                 ∂ 
                 Δ 
               
                
               
                   
               
                
               
                 V 
                 d 
               
             
           
         
       
     
     only depends on filter&#39;s impedance. Hence, I d  is a better option for controlling voltage. 
     Equation (Eq. 15) explains the proposed I d-v  droop illustrated in  FIG. 7 : 
       Δ I   d   =K   v ( V−V *)  (Eq. 15)
 
     Where, V and V* are the measured and reference voltages (V*=1 pu), K v  is the voltage droop gain. K v  is determined according to standard voltage variation i.e. 0.94 pu&lt;V&lt;1.1 pu. Assuming 3% voltage drop on transformers, voltage variation used  FIG. 7  will be: 0.97 pu&lt;V&lt;1.07 pu. K v  is defined such that when V=0.97 pu, ΔI d =1 pu; and when V=1.07 pu, ΔI d =−1 pu:K v =−33.33 pu for V&lt;1 pu, and K v =−14.28 pu for V&gt;1 pu. 
     Similar to the virtual governor, the output of the Id-V droop is passed through a first order low-pass filter in order to add dynamics and damping characteristic to the system. 
       FIG. 6  shows a simplified diagram of a static AVR system where, R e  and L e  are the resistance and inductance of the synchronous generator&#39;s excitation winding; V* and V t  are the reference and terminal voltage of the generator; and I f  is the excitation current. 
     It can be shown that the voltage across the excitation winding must be proportional to the voltage error i.e. ΔV. Thus: 
     
       
         
           
             
               
                 
                   
                     K 
                      
                     
                         
                     
                      
                     Δ 
                      
                     
                         
                     
                      
                     V 
                   
                   = 
                   
                     
                       
                         
                           I 
                           f 
                         
                          
                         
                           ( 
                           
                             
                               R 
                               e 
                             
                             + 
                             
                               sL 
                               e 
                             
                           
                           ) 
                         
                       
                       → 
                       
                         I 
                         f 
                       
                     
                     = 
                     
                       
                         K 
                          
                         
                             
                         
                          
                         Δ 
                          
                         
                             
                         
                          
                         V 
                       
                       
                         
                           R 
                           e 
                         
                          
                         
                           ( 
                           
                             
                               
                                 
                                   L 
                                   e 
                                 
                                 
                                   R 
                                   e 
                                 
                               
                                
                               s 
                             
                             + 
                             1 
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     16 
                   
                   ) 
                 
               
             
           
         
       
     
     According to (15), the output of the proposed virtual AVR, shown in  FIG. 7  is: 
     
       
         
           
             
               
                 
                   
                     I 
                     
                       d 
                       - 
                       v 
                     
                   
                   = 
                   
                     
                       
                         K 
                         v 
                       
                        
                       
                         ( 
                         
                           V 
                           - 
                           
                             V 
                             * 
                           
                         
                         ) 
                       
                     
                     
                       1 
                       + 
                       
                         
                           τ 
                           v 
                         
                          
                         s 
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     17 
                   
                   ) 
                 
               
             
           
         
       
     
     Comparing (17) with (16) demonstrates that τ v  is proportional to L e /R e . An AVR system is much faster than a governor, hence, τ v =0.02-0.1 pu is appropriate in this embodiment. 
     Third Controller  220 —AG Control 
     The AG is a fossil-fuelled generator (e.g. a microturbine). Hence, the idea is to minimise its usage. 
     Active power control of AG is illustrated in  FIG. 1  and  FIG. 6 b   . In this embodiment, the AG does not make any contribution in load active power P L  during grid-connected mode (although it is possible to do so, if required). Hence, the load is shared between DG and the grid. The ratio of sharing depends on generated solar energy and how much energy the owner of DG wants to store (here assumed 90%, based on the predetermined “high” threshold in the upper branch of  FIG. 6 b   ). 
     In islanded mode the load is mainly supplied by the DG-ES. 
     Since SoC is an indicator of shortage (or excess) of energy, for SoC&lt;the AG power demand threshold (30% in this embodiment, as discussed above) a demand signal will be sent to the AG which increases as SoC drops such that when SoC is at the discharge prevention threshold=5%, Pag*=1 pu. It is also possible to use load shedding schemes prior to bringing in the AG in order to supply only the “critical loads” by the AG. 
     In this embodiment the DG&#39;s converter does not make any contribution in load reactive power Q L  during grid-connection mode (assuming a strong grid). However if required, it is possible to augment the reference I q * form the virtual governor with another reference to supply part of Q L . 
     During islanded operation, Q L  will be automatically supplied by the converter. Since both P L  and Q L  are (initially) supplied by the DG-ES, measures must be taken into account to make sure that the DG&#39;s converter rating S ratting  is not violated. In order to achieve this, it is proposed in  FIG. 5  to utilise the AG when Q L  is high. As shown in  FIG. 1 , Q con  is limited using a variable hard limit which varies according to Q limit =√{square root over (S sm   2 −P con   2 )} (since P con  changes, a variable hard limit is needed), where S sm =S rating −3% (3% is the proposed safety margin). Then, the limited Q con  is subtracted from Q con  to constitute the error reactive power Q e  (hence, as long as Q con &lt;Q limit →Q e =0). Q e  is controlled to zero using a PI controller actuating the reference AG&#39;s reactive power Q ag *. The integrator of the PI controller will be rest when Q con &lt;(Q limit −0.03 pu), 0.03 pu is a suggestion to make sure that Q con &lt;&lt;Q limit , hence, avoiding possible oscillation. If the integrator is not reset, Q L  will be shared by the converter and the AG even when QL&lt;Q limit . 
     Results 
     The model shown in  FIG. 5  was simulated in PSCAD/EMTDC environment. The PV converter&#39;s S rating =1.1 pu (based on PV array rating). Considering 3% safety margin S mt =1.07 pu. The AG is simulated by a 3-phase current source. The rest of the parameters are given in Table I. 
     
       
         
           
               
               
               
             
               
                   
                   
               
               
                   
                 Variable 
                 Value(s) 
               
               
                   
                   
               
             
            
               
                   
                 Filter impedance Zf 
                 R = 1 mΩ 
               
               
                   
                   
                 L = 0.1 mH 
               
               
                   
                 Transformers&#39; leakage reactance 
                 10% 
               
               
                   
                 Transmission line impedance Zt 
                 R = 0.16 Ω 
               
               
                   
                   
                 L = 0.6 mH 
               
               
                   
                 Current loops PI controllers 
                 K p  = 0.157 
               
               
                   
                   
                 K i  = 1.57 (pole placement) 
               
               
                   
                 τ f , τ v  and τ d   
                 0.3 pu, 0.05 pu and 0.05 pu 
               
               
                   
                 AG&#39;s reactive power PI controller 
                 K p  = 2 
               
               
                   
                   
                 K i  = 17 
               
               
                   
                 PLL PI controller 
                 K p  = 5 
               
               
                   
                   
                 K i  = 10 
               
               
                   
                   
               
            
           
         
       
     
     Two scenarios are simulated: 
     Scenario A. When During Islanding P PV ≤P L    
     The simulation results are shown in  FIGS. 11 a  and 11 b   . The simulation events are as follows:
         t=0-0.5 s
           P L =1 pu with PF=0.95 lagging. Since P pv =0, the main grid supplies both load P L  (active power) and Q L  (reactive power). SoC starts at 90%. It is noted that since due to voltage drops on transformers and transmission line impedances, V C &lt;1 pu, the proposed virtual AVR uses the energy stored in ES to restore the voltage. In practical systems, this is normally done using transformer&#39;s tap changer; however, it was intentionally removed to demonstrate the ability of the present invention to support local voltage in case of weak grids.   
           t=0.5 s
           A 3-phase fault occurs at the grid-side and after 0.16 s (standard time for relay operation), the circuit breaker opens (CB in  FIG. 5 ), islanding the micro grid.   
           t=0.5-125 (Islanded operation)
           The voltage of point of common coupling V p  and f are very well-controlled (note that just before the fault P L =P g =1 pu i.e. worst-case scenario in terms of power imbalance). It is noted that the reduction in P L  is due to a slight reduction in voltage (V pcc =0.97 pu which is within acceptable limits). P L  is supplied by ES through P con  (See graph (b)) and Q L  is supplied by PV converter (Q con , graph (e)). When SoC&lt;30% (around t=25), P ag  increases to supply P L  (graph (a)). Using the proposed method, when SoC=5%, P ag =P L =1 pu. At t=4.5 s, P pv  increases to 1 pu. Since SoC&lt;10%, first ES power P es  (graph (b)) increases, then as SoC increases, P con  increases which causes P es  and P ag  to reduce (note that due to V pcc =0.97 pu, P L  is slightly less than 1 pu, hence, for P pv =1 pu, some power is still available for ES). It is noted that Q limit  (graph (e)) drops as P con  increases. As a result, when at t=7 s, PF drops to 0.8 lagging, Q L &gt;Q limit  (graphs (d) and (e)). The proposed scheme makes sure that Q con  does not violate its limit (graph (e)) through supplying the difference by the AG Q ag  (graph (d)). At t=8 s, PF increases to 0.9 lagging, which causes Q L , hence, Q ag  to reduce. However, since Q con  not less than (Q limit −0.03 pu), the PI controller is not reset, leading to Q ag ≠0. At t=9 s, P pv  drops to 0.5 pu, SoC reduces to supply the shortage. Again when SoC&lt;30%, P ag  increases to feed load. When P ag  supplies the load, P con  reduces which in turn causes to Q limit  to increase i.e. more capacity from the converter to supply reactive power. As a result, Q con &lt;(Q limit −0.03 pu), which resets the PI controller, hence, Q ag =0.   
           t=12 s (grid reconnection)
           C.B. is closed and voltage and frequency are restored. After a short transient (about 0.5 s), Q con =Q ag =0, Q g =Q L ≈0.5 pu (PF=0.9 lag). As discussed, it is possible to supply part of Q L  using the converter if required. It can be seen than after reconnection, since SoC is less than 90%, first P es  increases. However, as SoC increases toward 90%, P es  reduces and P con  increases. It is emphasised again that the 90% threshold can be set by the owner/operator of the DG and theoretically can be any value.     FIG. 12  shows the zoomed in voltage and frequency. As it can be seen, V pcc &gt;0.97 pu, and f&lt;50.1 Hz, at steady state, during islanded operation.   
               

     Scenario B: When During Islanding P PV &gt;P L : 
     It is possible (although unlikely) that P pv &gt;P L  for longer than the capacity of ES. In such cases different “dumping” mechanisms are introduced in literature such as using a dumping resistance. The invention proposes to reduce the generation through altering V dc *, which is produced by MPPT algorithm, as illustrated in  FIG. 6 . Since V dc * is a unique voltage (for each solar irradiance) at which P pv  is maximum, adding a gain (K d ) to it will reduce the generated power. It should be emphasised that the proposed dumping algorithm is not a necessary part of the proposed voltage and frequency control and any other dumping methods such as those introduced in can be used as well. 
     The simulation results are shown in  FIG. 13 :
         t=0
           Initially P pv =P L =0.5 pu. Since SoC&lt;90% (graph (c)), P pv , is shared between P con  and P es  (graph (b)). However, since SoC is close to 90%, P con ≈P pv &gt;&gt;P es  (graph (b)). The difference between P L  and P con  is supplied by P g  (graph (a)), until:   
           t=0.5 s
           a three-phase fault occurs, and after 0.16 s, the C.B. is opened. Hence, P con =P pv =P L =0.5 pu.   
           t=1.5 s
           P pv =0.75 pu. Since P pv &gt;P L , the difference is stored in ES causing SoC to increase. Using the proposed voltage control in Fig. ?, I d-v  is reduced to keep V pcc  less than 1.1 pu as shown in graph (e).   
           t=3 s
           As SoC&gt;95%, according to the proposed method, K d , (the rate is 50) is added to V dc * hence, P pv  reduces=P con =P L . As a result SoC remains constant at almost 98%.   
           t=4.5 s
           P L  increases to 1 pu, hence SoC reduces to compensate for the shortage which causes K d  to reduce, hence, P pv  returns back to its maximum value (0.75 pu).   
           t=5.5 s
           Grid is re-connected, hence, V and f are restored. Since SoC=85% (very close to 90%), P con ≈P pv =0.75 pu (P es ≈0), and P g  supplies the difference.   
               

     Variations fall within the scope of the invention. The embodiment described above can be extended to other types of ES mechanisms where by the SoC can be replaced by other parameters such as voltage (for supercapacitors) or speed (for flywheels). Further, the invention can be applied to other energy harvesting devices e.g. windmills/wind turbines where there is conventionally a DC to AC converter with a downstream AC to DC converter to accommodate long term local energy storage. It is noted that if other types of ES systems are to be used, their energy level (Ees) can be used instead of SoC. 
     It will be understood that the a virtual automatic voltage regulator (AVR), virtual governor and phase-locked loop (PLL) elements of the system may be used separately, however the greatest advantage is in using the three elements together.