Energy flow estimation-control of two interconnected microgrids

Being dependent on weather, photovoltaic and wind system energy contributions fluctuate and are not continuously available, and sometimes not in the desired quantity. To avoid load shedding or blackout in this situation, the estimation-control of energy can be useful to ensure continuity of supply and assist the planning operation of the power system. This study proposes the estimation-control of the flow of energy between two microgrids interconnected via two alternating current tie-lines. Two sources of power generation depending on weather behaviours have been considered. The effectiveness of the proposed estimation-control model was shown using the Extended Kalman filter combined with the fmincon algorithm.


Introduction
To ensure the balance of an interconnected system, it is first necessary that each area must be able to supply its own load without depending on the other networks.It can happen that, due to variations in the power system operation, one or more areas have deficit in electricity, at which moment electrical power can be transferred between the areas because the load change occurs continuously and randomly.As a result, the deviations of load frequency and the tie-line power flow from scheduled generation limits.Regulating the frequency to its nominal value and maintaining the flow of energy in the tie-lines between areas are the strategies adopted for daily management of the power system.The integration of the renewable energy sources into the power network makes the network complex, requiring advance control methods so that the system can be run safely and controlled effectively [1][2][3].Active and reactive power controllers are needed to maintain quality of power supply under constant voltage and frequency.How to estimate and control this energy transfer between areas to ensure their balance is the question which is investigated in this paper.
Being dependant on weather, photovoltaic (PV) and wind energy contributions need to be estimated and controlled [4].A great deal of research has been devoted to energy estimation [5][6][7][8][9][10][11][12][13][14][15][16][17][18][19].A methodology for estimating the potential of rooftop solar photovoltaic was investigated [5].Large-scale standalone wind turbine energy estimation was proposed [6], including the accurate energy production estimation.Mabel and Fernandez [7] developed the model for estimating energy yield from windfarms using artificial neural networks.The results showed that the model was an efficient energy yield estimation tool for windfarms.An investigation was made of the analytical model and algorithm for tracing active power flow based on an extended incidence matrix [8], which could be applied to any power network.The daily solar energy production estimation for minimising energy storage requirements in PV power plants was proposed [9], in an optimised energy management strategy for reliably exploiting PV power plants.A study proposed the wind distribution and capacity factor estimation for wind turbines in coastal region of South Africa, looking at current methods and advances in forecasting wind power generation [10][11].Monteiro et al. [12] presented a model estimating PV power generation and carried out performance analysis using three artificial intelligence algorithms: a Kalman filter, artificial neural networks, and a support vector machine.The implementation of a new non-intrusive energy saving estimation has also been presented [13].Wind resource estimation was conducted to estimate its annual energy contribution based on windspeed and power curve models [14].Photovoltaic and wind power estimation and economic load dispatch using the firefly algorithm was presented [15], where four test cases were used to validate the approach experimentally.Active power deficit estimation in the presence of renewable energy sources was presented using DigSilent software simulator [16].Beltran et al. [17] proposed daily solar energy estimation based on minimisation of energy storage needed for power plants.Active power estimation of PV generators for distribution network planning was proposed based on correlation models [18].A wind estimation model was published based on a nonstandard extended Kalman filter (EKF) [19].This Kalman filter was applied to estimate the maximum power extraction for variable speed wind turbines.The energy storage system power output can, as a main component in the new power system (microgrids), be estimated for its good management by increasing the power system reliability.Studies were made on battery state of charge estimation applying Kalman filter process [20 -25].An online state of charge estimation for aerial lithium-ion battery packs based on the improved EKF was proposed [20] as an effective method estimating the state of the charge value for the lithium-ion-battery pack because of its capacity needs in high-power supply applications.The state of charge estimation of the battery pack using an improved extended Kalman filter is presented in [21].The Kalman filter for state of charge estimation of lithium-ion battery based on a model uncertainty is analysed in [22].The proposed model has better accuracy than with the unscented Kalman filter and adaptive unscented Kalman filter.State of charge estimation of lead acid batteries using an adaptive Kalman filter was applied in [23], where the model reduces the state of charge estimation error and makes it more reliable than using an a priori process and measurement noise covariance values.The state of charge estimation of two different commercial lithium-ion batteries was proposed in [24].The state of energy and power capability estimation of a batteries using Kalman filter was proposed in [25], essentially introducing a novel modelbased joint estimation approach against uncertain external operating conditions and internal degradation status of battery cells.A Kalman filtering state of charge estimation for battery management system based on a stochastic fuzzy neural network battery model was introduced in [26], reducing the maximum error when compared with the real state of charge obtained from the discharging test.
Changing from one state to another, a power system requires for its management the use of more advanced techniques to ensure its development.The integration of renewable energy sources into the traditional network makes the power system management problem even more complex because of their irregularities and their dependence on weather.
Estimating the flow of energy, therefore, finds its place in the daily management of a new electricity grid.The system in the present study consists of two areas interconnected by two alternating current (AC) tie-lines to allow the flow of electrical energy.When the operation of the system is not disturbed, the energy transfer takes place from area one to area two to charge the battery.The production of electrical energy in the first area is provided by a hydroelectric plant and the windmill farm.The conventional thermal power station and solar panels and battery storage of an unused energy produces electrical energy in zone two.The configuration of the studied system is explained in Section 2. Problem formulation and modelling are detailed in Section 3, while Section 4 presents the system data, simulations results and discussions.Finally, Section 5 gives conclusions.

Configuration of the system studied
The analysed system consists of two interconnected micro-grids (a two-area system) as shown in Figure 1.Each area feeds its consumers and the tie-line allows electric energy to flow between the areas.Each power area has several generation sources, which are closely coupled to form a coherent group.All power sources respond in unison to the changes in the load demand., which was taken as the control horizon in this study.

Problem formulation and modelling 3.1 Problem definition
Microgrid interconnection presents many benefits, such as improved reliability in supplying the load, so that the total power generated can supply the peak load demand of the interconnected system.The bidirectional power flow via tie-lines allows the load demand to be met and well managed.The efficiency of the interconnected system is increased, and the generating units of each area cannot be overloaded by meeting the limits of the power reserve.The management of such interconnected system is more complex, despite its advantages.For stable operation, each area must be capable of feeding and totally absorbing its own load; and the power flow in the tie-line must be kept equal to zero (frequency deviation equal to zero).
A microgrid, while considering the varied production and the power demand, presents high nonlinearities, changing dynamics and uncertainties that may require more advanced intelligent approach strategies, such as the optimal approach.Using more effective strategies would increase the performance of these find of systems.Wind and PV are sources of energy working in turbulent conditions and an unforeseeable environment.The microgrid control operation must be adjusted to improve the reliability and effectiveness of microgrids which strongly depend on the chosen and applied control operation strategies.This study proposes the control of active power and frequency in two tie-lines linking two microgrids.The active power output of the SG, PV, and the system constraints of the state of charge (SOC) of the battery are used as control variables.The power balance and the limits of the generation source should be met during the control horizon.Active power flowing in the tie-lines are considered as a state variable and the objective function is formulated as the minimisation of the difference of active power in both.

Mathematical modelling of the system
To maintain balanced power network operation, the total energy generated must be controlled and correctly dispatched to meet the total power demand.The total active power generated in Figure 1: PG1 and PG2 for the respective microgrids 1 and 2 is given by Equations 1 and 2.

( ) ( ) ( )
where, for microgrid 1, ( ) is the active power from the SG1 and ( ) the active power from the wind farm.

( ) ( ) ( )
where, for microgrid 2, ( ) k P 5 is the power from the SG2, ( ) k P 6 the active power from the PV array and ( ) k P 7 the power of the ESS (charge and discharge mode).All these powers are taken as control variables.
The power ( ) ( ) k P 4 are considered as power flow in tie-lines and taken as state variables.The power deviations for each microgrid (or area) are given by Equations 3 and 4. The equations demonstrate the difference between the power generated and the demand of the system.
The frequency deviation of the system is calculated using Equations 5 and 6 for each microgrid [27].A tie-line is essentially used for energy exchange between control areas to provide inter-area support in severe conditions.If there is a mismatch between the power generated and demanded, a deviation in frequency for a particular area occurs.Since a tieline transports power in or out of an area, it must be accounted for in the incremental power balance equation of each area.The tie-line power deviation, TL P ∆ , using the microgrid's frequency deviation and synchronising power coefficient, ) ( S P , is calculated as follows [27]:

Proposed model
The problem is solved using seven control variables that are active power from all the sources.The power from the windfarm and PV array are modelled as a variable source, with a profile that varies from zero to its maximum for 24 hours.Each area feeds its own load: load 1 is supplied by power from the wind farm and SG1, and load 2 is fed by power from PV and SG2.For two interconnected networks, there always comes a time of energy exchange because of load variation on two sides and the impact of interconnection of energy sources that depend essentially on the weather.If power from the SG in either area 1 or 2 is insufficient and power from the windfarm and PV cannot meet the active power load demand, the power from the battery ESS can be used to feed the load and to keep the system balanced.
The estimation-control model applied in this study will help to estimate and control the energy flow from PV and wind sources, and the energy exchange between the two areas.The formulation of power system state estimation and generation of data can be found in the literature [28][29][30][31].Estimation of energy (active power flowing) in the system is the first objective function.The optimal control approach is then applied by controlling active power flowing in the areas and power flow in the tie-lines as a second objective function and the maximisation of the use of renewable energy resources as a third objective function.

Estimation process
The EKF [26,[32][33][34] was chosen for the prediction of the tie-lines energy transfer and PV and wind energy flow output for the control purpose for 24 hours, considering the high nonlinearities characterising the power system and for control purpose that must be done in dynamic manner.
The power system can be defined using the discrete system given by Equation 8. where are state vector, input vector, vector of state noises and vector of measurement noises respectively.The function f is used to cal- culate the next state using the past estimated state.
The function h is used to calculate the predicted measure using the predicted state.Using the Jacobian matrices (partial derivatives matrices), the covariance matrix of errors is determined using Equation 9.
where k F and k H are partial derivatives matrices of the system.
The Jacobian matrix in Equation 9 is computed using the corrected and predicted states.These equations allow the system to be linearised around the estimated state values.Five steps were used to predict with the EKF [32][33]: • start process by updating equations • calculate the covariance matrix of the a priori error • calculate the covariance matrix of a posteriori error are a priori state estimate vector, a priori error covariance matrix, process noise covariance matrix and measurement noises covariance matrix respectively.
The first objective function is given by Equation 10.The second objective function is given by Equation 11.

( ) ( ) (
) where t ∆ is the sampling time, ( ) k P 3 and ( ) k P 4 are the power flow for tie-lines 1 and 2 respectively, and is the frequency deviation constant, with Bf constant parameter depending to the fre- quency and f ∆ frequency variation.
The third objective function is given by Equation 12.
The problem is formulated as a multi-objective function given by Equation 13, considering the conflict of the three objective functions in the model.

Objective function
Considering Equations 6 and 9, the objective function can be expressed by Equation 14.This is subject to the equalities constraint given in Equation 15. and ( ) t P 7 .Equation 18represents the limit of the BESS.

( ) ( ) ( ) ( ) ( ) ( ) ( )
The model has been applied using fmincon solver in Matlab because of the non-linearity of the power systems [28].The canonical form is given by the basic conditions for the optimisation, as in Equation 21.
The vector X is a binary integer vector represented by the power flow from different components of the system.
The equality constraints given in Equation 12 can be converted into matrix form as in Equations 22 and 23.

  
The overall proposed estimation-control system is given in Figure 2. The main steps of the optimisation-control process are: • Input parameters for EKF process (active power under profile form, voltage measurements and angles generated for estimation process) [28][29][30][31].( ) ( ) ( ) ( )

Battery storage system state of charge
The dynamic of the battery, charge and discharge gives its SOC.For the BESS in area 2 the SOC is given by Equation 24 [35]: Using optimal control theory, Equation 22 can be translated into inequality constraints matrix for BESS as in Equation 25.
The linear vector constraint is represented by the vector in Equation 26.

Experimental analysis of the proposed model System data:
The main generator SG in each area has the following rating power: P1(t)=117MW and P5(t)=126MW.Table 1 gives the variations on both during 24 hours because of power loss and other operating requirements.The rated frequency is 50Hz.The SG1 is a thermal power plant and SG2 is a large hydro.The characteristics of the windfarm and PV and a group of loads are given and used under profile form.The data for hydro-electric power plant and thermal plant (steam turbine) can found in the literature [27,[35][36].The EKF and fmincon were implemented in Matlab 2016 in a H97M-D3H system with a processor: Intel(R) Core(TM) i5 CPU @ 3.30GHz, 3301MHz, 4 Core(S), 4 Logical Processor(S) and a RAM of 8.00 GB.

Results and discussion
Three perturbations models (sudden increase of load demand) were introduced in microgrid 1 and microgrid 2 simultaneously and separately to observe the different deviations of active power in the tie-lines.Table 1 presents the optimal power flow of the system in MW, particularly the estimated and produced (or real values) active power form wind and PV systems: P2 est and P2 for wind in area 1; P6 est and P6 for PV in area 2. Energy transfer occurs when there is a disturbance in either area: from microgrid 1 to microgrid 2 at 12h00, 17h00, 18h00, 19h00, 20h00, 21h00, from microgrid 2 to microgrid 1 at 7h00, 13h00, 14h00, 16h00, and 17h00.The tielines, meanwhile, are solicited and stressed by the transfer of energy coming from the energy storage system to cover the power deficit.4 gives in 4(a) and 4(b) the representation of load demand variation versus active power produced in areas 1 and 2 while the interconnected system goes under disturbance mode (regime).Active power from the windfarm can be produced during 24h daily and is dependent on the wind speed.This can be seen from Figure 3(a), which gives the variations of the active power production for 24 hours.
The production of active power using PV arrays is only possible from 6 am to 5 pm or 6 pm, whenever there is sunshine.The simulations results presented in Figure 3 (a) and (b) show the estimation of the wind and PV output during 24 hours.Based on the state estimation model using EKF, the predicted output values of wind and PV are well estimated except few errors.The estimation process was conducted with satisfactory results.One of the main goals of the proposed controller was to continuously supervise the interconnected system and the flow of energy from the windfarm and PV plant to the microgrids and to do their estimations.
The energy storage system state of charge is given in Figure 5, which presents its dynamics for 24 hours (charge and discharging modes).Figures 6(a) and 6(b) present the active power deviation in tielines 1 and 2 with disturbance in areas 1 and 2. The active power variation in tie-lines 1 and 2 when microgrid 2 (area 2) is perturbed is given in Figure 6(c) and 7(a).Figures 7(b) and 7(c) represent the active power variation in tie-lines 1 and 2 when microgrid 1 is disturbed.
Experimental observations: A classical perturbation system, for the first case, perturbation was introduced in area 1 and area 2. The objective was to test the robustness of the control strategy against a sudden active power demand variation (load) at the same time in both areas.Figure 6 (a) and 6 (b) indicates that, despite harsh conditions, the controller had a better performance.The active power control deviation was effectively damped to zero with small oscillations in a very short time: 3 s was enough to regulate the system.
Similar analyses (case 2 and case 3) were carried out using a disturbance model in area 1, Figures 6(c) and 7(a); and in area 2, Figures 7(b) and 7(c).Based on the three cases studied, the deviations of the active power in the tie-lines 1 and 2 are noted and controlled.For the case where both microgrids 1 and 2 are disturbed at the same time, the ripples showing the deviations in power in tie-line 1 goes to ≈ -3.7MW and tie-line 2 goes to ≈ -5.1MW before starting stability process (Figure 6(a) and 6(b)).In the case where microgrid 1 is disturbed alone, the tie-lines 1 and 2 vary differently from s 0 to s 1 for tie-lines 1 and 2 from   was driven to zero shortly after disturbance occurred, with less oscillations.The perturbed system was regulated after a short time.

Conclusion
This study has presented an energy flow estimationcontrol model of two interconnected microgrid systems, estimating the output power from wind and a photovoltaic array and minimising the difference in active power flow between two AC tie-lines.The robustness, reliability and nonlinearities associated with the control power system were ensured when solving the problem.The results graphically showed that the tie-lines power deviations due to the three disturbances introduced in areas 1 and 2 were controlled and limited.The response curves show the deviations in power system in the respective areas.
It can be concluded from the analysis of these that the proposed optimal active power control regulator was effective in settling the change in the power system network to the required value in a reasonably short time.The controller model has led to the balance of the total active power generated and power demand of the studied system.

2 ω∆
are the frequency difference for microgrids 1 and 2 respectively, and Ksys is the system frequency characteristic constant of the microgrid.
power from PV and wind, and their estimated values respectively.

4 w
are the weight factors.

7 PFigure 3 :
Figure 3: Active power estimated from wind and PV sources, where (a) = Active power estimated from wind source, and (b) = Active power estimated from PV source.

Figure 4 :
Figure 4: Total active power generated and load demand in two areas, where (a) = total active power generated and load demand in area 1, and (b) = total active power generated and load demand in area 2.

Figure 5 :Figure 3
Figure 5: Battery state of charge and charging-discharging modes, where (a) = BESS state of charge, and (b) = BESS charging-discharging modes.

Figure
Figure3represents the energy estimation simulations for wind 3(a) and for PV 3(b).Figure4gives in 4(a) and 4(b) the representation of load demand variation versus active power produced in areas 1 and 2 while the interconnected system goes under disturbance mode (regime).Active power from the windfarm can be produced during 24h daily and is dependent on the wind speed.This can be seen from Figure3(a), which gives the variations of the active power production for 24 hours.The production of active power using PV arrays is only possible from 6 am to 5 pm or 6 pm, whenever there is sunshine.The simulations results presented in Figure3(a) and (b) show the estimation of the wind and PV output during 24 hours.Based on the state estimation model using EKF, the predicted output values of wind and PV are well estimated except few errors.The estimation process was conducted with satisfactory results.One of the main goals of the proposed controller was to continuously supervise the interconnected system and the flow of energy from the windfarm and PV plant to the microgrids and to do their estimations.The energy storage system state of charge is given in Figure5, which presents its dynamics for 24 hours (charge and discharging modes).Figures6(a) and 6(b) present the active power deviation in tielines 1 and 2 with disturbance in areas 1 and 2. The active power variation in tie-lines 1 and 2 when microgrid 2 (area 2) is perturbed is given in Figure6(c) and 7(a).Figures7(b) and 7(c) represent the active power variation in tie-lines 1 and 2 when microgrid 1 is disturbed.

SYNCHRONOUS GENERATOR SYNCHRONOUS GENERATOR Figure 1: Power system network model, where i PCC and i P are respectively the point of common coupling and active power from each microgrid components.
Equation 20 ensures that the tie-lines keep the net energy exchange out of the area at its schedule value, for the area to absorb its own load variations.Equation17gives the power generation limits of