Advanced control strategy for an energy storage system in a grid-connected microgrid with renewable energy generation

The operating cost of the consumer can be reduced in an electricity market-based environment by shifting consumption to a lower price period. This study presents the design of an advanced control strategy to be embedded in a gridconnected microgrid with renewable and energy storage capability. The objectives of the control strategy are to control the charging and discharging rates of the energy storage system to reduce the end-user operating cost through arbitrage operation of the energy storage system and to reduce the power exchange between the main and microgrid. Instead of using a forecasting-based approach, the proposed methodology takes the difference between the available renewable generation and load, state-of-charge of energy storage system and electricity market price to determine the charging and discharging rates of the energy storage system in a rolling horizon. The proposed control strategy is compared with a self-adaptive energy storage system controller and mixed-integer linear programming with the same objectives. Empirical evidence shows that the proposed controller can achieve a lower operating cost and reduce the power exchange between the main and microgrid.


Introduction
A microgrid is a small-scale power grid with local energy generation and control capability.It can operate independently or in conjunction with the main grid [1].To operate independently, a microgrid consists of multiple renewable energy sources (RES) such as photovoltaic (PV) and wind energy, and energy storage systems (ESS).The energy output of RES is intermittent as it greatly depends on the time of the day and meteorology conditions [2].The intermittent nature of RES presents a great challenge to the grid operators as they must balance the supply and demand to ensure stability and reliability of the grid [3].To address this uncertainty, many research efforts have been made to integrate ESS into the existing power system.ESS is seen as the key enabling technology for the integration of RES into the existing grid as it can provide instantaneous power [4,5].Other than using it to mitigate the intermittency of RES, ESS offers many benefits to the power system operator such as: (i) ensuring reliable operation for critical infrastructure during outages [6], (ii) balancing supply and demand [7], (iii) reducing transmission congestion [8], (iv) providing ancillary services [9], (v) local frequency and voltage regulation [10], (vi) shifting peak demand [11][12][13] and (vii) operation of ESS based on different electricity pricing strategies [14][15][16][17].
Real-time operation of ESS in the electricity market has gained popularity in the research community in recent years due to the different electricity pricing strategies offered by the power system operators (PSO).Instead of a flat tariff, PSO can offer real-time electricity pricing (RTP) or a time-of-use (TOU) tariff.The RTP strategy employs different pricing strategies based on the time of the day and the demand.The TOU tariff employs different fixed pricing strategies based on different periods of the day.Both RTP and TOU pricing strategies can incentivise consumers and PSO [18].To design a control strategy for input variables of high stochastic nature such as RES, RTP and consumers' demand is challenging yet important.
In a dynamic environment where demand, availability of RES, and electricity pricing are constantly changing, it is important that the control strategy is designed for arbitrage opportunities in an electricity market apart from providing ancillary services since ESS is costly and energy-limited resources.As such, many recent studies have been done in the operation of the energy storage system based on forecasting of RES, demand, and pricing.Several methods such as mixed integer linear programming (MILP) [14,15], quadratic programming [16], adaptive dynamic programming [17], and convex optimisation [19] are proposed.
Similar optimisation approaches and objectives are taken into consideration, e.g.maximising revenue/minimising cost, power exchange between the main grid and microgrid [14,15].However, these studies focus on day-ahead and week ahead scheduling based on forecasting of renewable energies, demand and electricity pricing to reduce the end-user electricity bill or to smoothen the variation introduced by renewable energy sources [16,25].The electricity pricing considered is time-of-use rather than real-time electricity pricing which is highly stochastic [19].The fuzzy logic controller approach only considers the state-of-charge and difference between demand and renewable energy sources and did not consider arbitrage operation as one of its objective [23][24][25].Furthermore, these studies only consider a single function for the energy storage system.This paper proposed a decision making fuzzy energy management system (FEMS) with three inputs and one output to simultaneously reduce the end-user electricity bill and the variation introduced by renewable energy sources while satisfying the load without any demand side management techniques.The proposed controller is designed for a day-to-day operation of the energy storage system in a microgrid.
Compared to the previous studies, this paper proposed a multifunction control strategy for the energy storage system.This paper also considers the real-time electricity market price to determine the charging/discharging rate for the current time step using the FLC.This paper proposed a decision making FEMS with three inputs and one output to simultaneously reduce the end-user electricity bill and the variation introduced by renewable energy sources while satisfying the load without any demand side management techniques.The FEMS is designed with the historical data of RES power generation, demand, and electricity pricing.
The FLC rules are designed to reduce the fluctuation in the microgrid.Several performance evaluation indices are proposed in this paper to measure the effectiveness of the FLC.Since the effectiveness of the FLC greatly depends on the fuzzy membership function.A uniformly distributed triangle is usually chosen for simplicity purpose.However, it may not yield satisfactory performance when the standard deviation of the variable is high.In this paper, a median-σ method is proposed to design the membership function for the electricity market price as it is volatile and non-stationary due to the dynamic market environment.
The main contributions of this paper are listed as follows: i.A decision making controller for ESS control designed with historical data hence omitting the need for forecasting.ii.Multiple application of ESS without any demand side management techniques (a) reduction in the end-user electricity bill, (b) power exchange between the main and microgrid.
The rest of this paper is organised as follows: Section 2 presents the system modelling and problem formulation, Section 3 presents the proposed fuzzy energy management system and Section 4 shows the performance evaluation indices.The simulation studies and results are presented in Section 5. Finally, the paper is concluded in Section 6.

System modelling and problem formulation
This paper consider the problem of operating an energy storage system which is connected to a microgrid with renewable energy generation capability over a finite-time horizon, t = 0, Δt, 2Δt, ⋯, T, where Δt is the time step.The time interval is the electricity market trading period.All system variables, constraints and decisions are made at discrete time intervals of an equal and constant length.This discrete time interval is based on the real-time electricity trading market of fifteen minutes.The rest of this section describes the mathematical model of the microgrid and energy storage system.

Microgrid model
An overview of the microgrid test system is shown in Fig. 1.The microgrid test system is similar to those considered in [25][26][27].It consists of a photovoltaic and wind power, load and energy storage system.The renewable energy system and energy storage system are connected to a DC bus via a unidirectional and bidirectional DC/DC converter.The DC bus is then connected to the AC bus via a bidirectional DC/AC converter.The AC bus is then connected to the main grid and the AC load.The DC/DC bidirectional conversion losses, for the energy storage system, are considered in this paper.
The power generated from the wind turbine and photovoltaic panel is P wind and P pv , respectively.The total renewable power, P res , generated in the microgrid can be calculated from P res (t) = P wind (t) + P pv (t) Due to the intermittent nature of wind and photovoltaic power, the power generated may be more or less than the actual load, P load .
The difference between the actual load and renewable energy is expressed as P balance .A positive P balance means the actual load is more than the renewable power generated and a negative P balance means the renewable power generated is more than the actual load from This difference is compensated by charging/discharging the energy storage system, P ess from P grid (t) = P balance (t) + P ess (t) P grid is the resultant power that has to be met by the main grid.
• P grid (t) > 0 if electricity is purchased from the grid; • P grid (t) < 0 if electricity is sold back to the grid.

Energy storage model
The model of an energy storage system considers the following technical characteristics.

Charging/discharging efficiency:
where p, η and P are the DC power, efficiency and AC power, respectively.Subscripts c and d denote charging and discharging, respectively.The energy losses during conversion between DC/AC and AC/DC are considered in ( 5) and ( 6).The net output power of ESS is considered in (4) in kW.The energy storage can only charge or discharge concurrently.

Output power limits:
where P ¯c and P ¯d are the maximum charging and discharging rates of the ESS, respectively.The maximum charging and discharging rates are considered in ( 7) and (8) in kW.

Capacity of ESS:
The current capacity of the ESS can be expressed as follows: where Δt is assumed to be the duration of the trading period of the electricity market and ESS(t) is in kWh.This paper adopts a rolling-horizon approach, all system variables, constraints and decisions are made at discrete time intervals of equal and constant lengths.In this paper, the time interval is the electricity market trading period, hence each day is divided into equal time interval, t.

Proposed fuzzy energy management system
A Mamdani type fuzzy logic controller has been used as an energy management system to control the active power of ESS based on the difference between RES and load, ESS capacity and electricity market pricing.An overview of the FEMS is illustrated in Fig. 2. The proposed FEMS aims to: i. reduce power exchange between the main and microgrid, ii.end-user electricity bill reduction, iii.avoid over/under charging by maintaining energy storage capacity within the upper/lower boundary.
The first and second aims are achieved by discharging the ESS during high demand or cost period and charge during low demand or cost period.The third aim is achieved by limiting the upper and lower limit of the ESS.
The proposed FLC is designed to reduce the consumers' electricity bill and reduce the power exchanged between the main and microgrid.To numerically evaluate the proposed FLC, a set of performance evaluation indices are proposed in the next section.

Design of proposed median-σ FLC membership function
One important procedure in implementing a FLC is to determine the fuzzy membership functions.In this paper, triangle and trapezoid membership functions are used.Uniformly distributed triangle membership functions are used for P balance , P ess and ESS.The three inputs are divided into five linguistic terms: negative big (NB), negative small (NS), zero (ZE), positive small (PS) and positive big (PB).
For P balance , NB means renewable generation is higher than the actual load from (2).ZE means renewable generation is equal to the actual load and finally, PB means the load is a lot higher than the renewable generation.For ESS, NB means the ESS is very low, ZE means the ESS is at half capacity, and PB means the ESS is near full capacity.For P ess , NB means a high discharging rate, ZE means idle, and PB means a high charging rate.Historical data of P res and P load are used to calculate P balance .This P balance is used to determine the range of the fuzzy membership function.
The technical constraints from ( 7)-( 9) of the ESS are considered when designing the membership functions for P ess and ESS.Equations ( 7) and ( 8) are the maximum and minimum allowable charging/discharging rates and ( 9) is the lower and upper bound of the ESS.
For electricity market pricing, C p , there are five linguistic terms for this input which is: negative (N), zero (ZE), positive small (PS), positive big (PB), and positive big big (PBB).The standard deviation of C p is significantly higher than that of P balance .Instead of having a uniformly distributed membership function for C p , another approach is taken and explained in details below.From Table 1, it can be seen that the real-time electricity price has a much higher standard deviation compared to P balance .As such, a uniformly distributed triangle membership function does not represent the linguistic term properly.
The real-time electricity price for the year of 2014 is shown in Fig. 3.It is observed that C p experienced significant numbers of peaks and abrupt changes throughout the sampled period.The proposed method can be modified to suit different market data.
The median and standard deviation, σ, of C p are used to design the membership functions.For C p , N means low price (−1σ from the median), ZE means median price and PBB means extremely high price (+3σ from the median).A trapezoid membership function is used to represent N and PBB, while a triangle membership function is used to represent ZE, PS, and PB.Firstly, the median price of C p is used to represent the peak of ZE.Secondly, since the majority of the price is within ±1σ, hence it is used to represents the peaks of N and PS, respectively.Thirdly, the peak of PB is represented by +2σ since the occurrence is significantly lower.Finally, the peak of PBB is represented by any prices beyond +3σ.

Design of proposed fuzzy logic controller rules
The proposed FLC has the liberty to buy (charge) and sell (discharge) power from the main grid when P balance is zero to reduce the end user operating cost.This set of fuzzy rules is designed yielding economic rewards by charging when P balance is zero and the price is low and discharging when the price is high.In this manner, P grid will slightly increase/decrease due to the additional charging/discharging when P balance is zero.On top of this, to reduce the fluctuation of the grids' power profile, the storage discharges when renewable energy is absent and charges when there is an excess.
The ESS will operate in two different modes based on the value of P balance .The P balance can take one of the three states; positive, negative or zero as mentioned in Section 2. When P balance is zero, it will operate in an arbitrage mode, and when P balance is positive or negative, it will operate to reduce a power exchange mode.

Arbitrage mode:
When P balance is zero, fuzzy rule numbers 51-75 enable the ESS to operate in arbitrage condition.To discharge when the price is high, in the example shown in Table 2, rule number 53 corresponds to: If P balance is ZE and ESS is PB and C p is PS then P ess is NS.This means when there is no difference between the supply and demand, battery capacity is near its maximum capacity, and the price is high, the ESS will discharge.
Similarly, to charge when the price is low, in the example shown in Table 2, rule number 71 corresponds to: If P balance is ZE and ESS is NB and C p is N then P ess is PB.This means when there is no difference between the supply and demand, battery capacity is near its minimum capacity, and the price is low, the ESS will charge.

Reduce power exchange mode:
When P balance is positive or negative, fuzzy rule numbers 1-50 and 76-125 reduce the power   exchange between the main and microgrid.To reduce the power exchange between the main and microgrid, in the example shown in Table 2, rule number 1 corresponds to: If P balance is PB and ESS is PB and C p is N then P ess is NB.This means that when the load is more than RES, and the battery capacity is near its maximum capacity, the ESS will discharge at a high rate to compensate for the shortfall of renewable.
Similarly, when P balance is negative, it means that there is a surplus of RES.In the example shown in Table 2, rule number 125 corresponds to: If P balance is NB and ESS is NB and C p is PBB then P ess is PB.This means that when there is a surplus of RES, and the battery capacity is near its minimum capacity, the ESS will charge at a high rate to absorb the surplus RES.
Extending this reasoning to other linguistic terms results in the fuzzy rules shown in Table 2.

Performance evaluation
To quantify the proposed controller, several performance evaluation indices are proposed in this section.Furthermore, the proposed methodology is compared using the proposed performance evaluation indices with two other controllers, selfadaptive ESS controller (SAEC) and mixed-integer linear programming (MILP) scheduling.

Performance evaluation indices
Three performance evaluation indices to quantify the effectiveness of the proposed controller are defined in this subsection.They are standard deviation, σ, operating cost and load factor.

Standard deviation, σ:
σ is used to measure the variation in P grid away from its mean.As shown in (3), P grid is the resultant power that has to be met by the main grid.The variation in the power profile is reduced by reducing the standard deviation, σ: where t is the tth sample and T is the total number of samples.

Operating cost:
To quantify the amount economic benefits of the proposed controller, ( 12) is used to calculate the operating cost.The proposed controller considers a real time pricing, C p , in $/MWh as one of its input to determine the charging and discharging rates.This index should be reduced The focus of this paper is the operation of ESS.Initial capital and maintenance costs are not considered, and arbitrage operation of ESS will not have a considerable effect on the electricity market price.
The microgrid can freely purchase and sell electricity from the main grid at time t at the same market price, C p (t).

Load factor:
The ratio between the average and peak load over a period of time, τ, is calculated: |P grid , μ .τ| |P grid , max .τ| (13) where P grid , μ is the average power and P grid , max is the maximum power consumption over the time period of interest, τ, where τ is the monthly billing period.
The load factor (LF) is always less than one and a higher load factor signifying the load profile over the period of interest is close to constant.A low load factor signifies an erratic power profile.The LF can be increased in two ways: decrease P grid , max or increase P grid , μ.The former is favourable because operating cost increases when P grid , μ increases.

Benchmark I: self-adaptive ESS controller
The proposed fuzzy logic controller is compared against a selfadaptive ESS controller (SAEC).This controller is explained in details in this subsection.The SAEC evaluates the requirement of the microgrid and decides the charging/discharge rate of the ESS.This is achieved by the following: (a) determine the state of the ESS (charge/discharge/idle), (b) determine the charging/discharging rate, The controller determines the state of the ESS, whether to charge, discharge or idle.If the state of the ESS is charging or discharging, it will then determine the rate of charging or discharging.
Fig. 4 shows an overview of the control strategy of SAEC.The top half of the diagram shows how the state of ESS is determined and the bottom half of the diagram shows how the rate of charging/ discharging is determined.For instance, if P balance is positive, P load is more than P res , there is a need to discharge ESS to make up for this shortfall.After deriving the state of ESS as 'discharge', the discharging rate is determined.For the discharging rate, if P balance is more than the maximum discharging rate, P ¯d, then the discharging rate will be P ¯d, else discharging rate will be equal to the shortfall, P balance .
In this manner, the proposed controller can adequately compensate any surplus/shortfall by charging/discharging at the required rate without exceeding the charging/discharging and capacity constraints in ( 7)-( 9).The SAEC is also able to sell excess power that is not required by the microgrid to the main grid to reduce the operating cost.However, it is unable to exploit the arbitrage pricing as it does not consider the electricity price as its input.The SAEC described in this section is implemented in MATLAB.

Benchmark II: mixed-integer linear programming scheduling
The proposed fuzzy logic controller is compared against an MILP.It is assumed that the values of P load (t), P res (t) and C p (t) from t = 0 to t = T can be accurately forecast.The optimum P ess (t) for each time step, t, can be solved using MILP.
The mathematical model introduced earlier in Section 2 is used to formulate into a MILP minimising problem: By adding two binary variables, U c (t) and U d (t) to ( 7) and ( 8) and constraint (16) ensures that the status of ESS is either charging, discharging or idle.Using the constraints from ( 9), ( 14), ( 15) and ( 16), MILP will solve the values of p c (t), p d (t), U c (t) and U d (t) for every time step to minimise the objective function.The MILP is formulated as follows: The solution obtained by MILP represents the optimum charging/ discharging schedule for p c (t) and p d (t) from t = 0 to t = T.The MILP problem described in this section is implemented in AMPL and solved using CPLEX.

Experimental results and discussion
In this section, the effectiveness of the proposed methodology is compared against different control strategies.The FEMS is

Simulation: real-time pricing microgrid
The rating of the test system is shown in Table 3.The test data used in this paper are obtained from National Renewable Energy Laboratory (NREL) [28] and wholesale electricity prices from Energy Market Company Singapore (EMCSG).A year of data was used in this paper and is sampled at a 15 min interval.The resulting dataset consists of 35,040 data points.The test system is implemented using MATLAB/Simulink and consists of photovoltaic, wind, ESS and load as shown in Table 3.
The first eleven months of data were used to design the fuzzy membership functions and the last month of data is used to validate the proposed fuzzy logic controller.The range of the fuzzy membership functions is shown in Table 4.
The median-σ tuned C p membership functions are shown in Fig. 5.The membership functions of C p and histogram are superimpose for clarity.Even though the difference between C p , max and C p , min is relatively large, majority of its distribution falls within ±1σ.
The performance of the proposed FEMS is compared with a microgrid without ESS, SAEC, and MILP in terms of operating cost, load factor and standard deviation.

Results: comparison with SAEC and MILP
The last month of data is used to compare and validate the proposed controller.The results of the test data are presented in this section.Figs. 6 and 7 show the grid power profile and ESS power, for the first day of the test data.
The grid power profile of a microgrid without ESS, SAEC, MILP, and the proposed FEMS is shown in Fig. 6.It can be observed that the grid power profile of the proposed controller is the smoothest compared to SAEC and MILP.The grid power profile of MILP has many peaks and trough throughout the day which is undesirable to the grid operator.In contrast, the proposed controller grid power profile is fairly consistent compared to SAEC and MILP.
The increase in power exchange between the main and microgrid under MILP is even higher than a microgrid without an ESS.This result in a trade-off between lower operating cost and a higher variation in the power profile for MILP.The integration of RES and ESS should reduce the variation in the power profile and operating cost.Frequent abrupt changes in the power exchange between the main and microgrid are unfavourable to the grid operator.This is especially important with the integration of high intermittent RES such as wind power.The power profile of MILP and the proposed controller demonstrate the importance of a controller specifically designed to reduce the power exchange.
From Table 5, when the proposed controller is compared to SAEC, the operating cost and standard deviation are 1.87 and 22.79% higher than the proposed controller, respectively.The load factor is 10.34% lower than the proposed controller.In terms of operating cost, load factor and standard deviation, the proposed controller can achieve a lower operating cost and reduce the power exchange between the main and microgrid simultaneously.
When the proposed controller is compared to MILP, it is important to reiterate that the solution obtained from MILP is the optimum solution and assumes that all the values P load (t), P pv (t), P wind (t) and C p (t) are known in advance.Even though the operating cost is 13.69% lower than the proposed controller, the load factor   of MILP is 37.5% lower than the proposed controller.The standard deviation is 187.27%higher.
The proposed FEMS can reduce the operating cost without increasing the power exchange between the main and microgrid.Furthermore, it only relies on the values of P load (t), P pv (t), P wind (t) and C p (t) to compute P ess .
The charging/discharging rate of ESS, P ess , is shown in Fig. 7.It can be observed that MILP frequently charge and discharge at the maximum rate while the proposed controller charge and discharge at a much lower rate.By frequently charging and discharging at the maximum rate will have an adverse effect on the energy storage lifespan.
The number of the life cycle of ESS can be estimated with (18) and the results are shown in Table 6: As shown in Table 6, the estimated life cycle of ESS under MILP is significantly higher than the proposed controller even though the ESS is only used for a month.
The MILP objective function is to minimise the operating cost within the technical constraints.However it does not consider the additional variation in the power profile as long as the solution is within the technical constraints.The MILP can be rewritten into a multi-objective optimisation to consider load factor and standard deviation as the second and third objective function.
A multi-objective optimisation problem can be formulated as follows: where k is the objective function and x is the solution.For instance, this paper considers ( 11)-( 13) as the performance evaluation indices.Let the objective functions f 1 , f 2 and f 3 be ( 11)-( 13), respectively As ( 13) is a maximising objective function, it can be change it into a minimising objective function by inverting the objective function.
In general, there are two approaches for multiobjective optimisation.The first approach is using a weighted sum to sum up the two objective functions into a single figure of merit.However, the weight of each objective function is heuristically determined and may not guarantee an optimum solution compared to single objective optimisation.The second approach is finding the solutions on the Pareto front.The solutions are sorted into their Pareto front as discussed in [29].
Solution p is considered to dominate solution q if: i. f i (p) ≤ f i (q) for all indices i ∈ 1, 2, …, k and ii.f j (p) < f j (q) for at least one index j ∈ 1, 2, …, k The solutions of without ESS, SAEC, MILP and proposed controller are sorted into their respective Pareto front and shown in Table 5.
Fig. 8 shows the search space for three objective functions.The optimum region is located at the bottom centre of the search space.The proposed controller is the closest to the optimum region.
From the non-dominating sorting, the proposed controller belongs to the first Pareto front, which is considered to be the optimum solution as it dominates all the other solutions.Whereas SAEC, without ESS and MILP, takes the second, third and fourth Pareto front, respectively.
The main advantage of the proposed controller is that is it designed based on the historical data of P load (t), P pv (t), P wind (t) and C p (t) and does not rely on forecasting compared to MILP scheduling, which relies on the accurate forecast.It is especially important to design a controller that does not rely on forecasting as it is challenging to obtain an accurate forecast for highly stochastic natured variables such as wind and electricity pricing [30].In this highly dynamic and uncertain operating environment, the proposed controller can reduce the end-user operating cost without increasing its reliant on the main grid as shown in Table 5.

Conclusion
This paper presents an advanced control strategy for a gridconnected microgrid with an energy storage system and renewable energy generation.The control strategy was developed and implemented in a MATLAB/Simulink environment to reduce the operating cost and power exchange between the main and microgrid.Numerical studies demonstrate the effectiveness of the proposed advanced control strategy and the possibilities of multiple applications with a single energy storage system.Furthermore, the control strategy is compared with SAEC and MILP, and the proposed control strategy is able to obtain a better solution on the Pareto front.The proposed control strategy can be readily applied to other microgrids using historical data.

Fig. 2
Fig. 2 Framework of the proposed controller

Fig. 3
Fig. 3 Real-time electricity price for 2014, C p

Fig. 5 Fig. 6 Fig. 7 P
Fig. 5 Superimpose of C p membership functions and histogram of C p

Table 1 P
balance and C p parameters Max Min Median Standard deviation, σ

Table 2
Proposed fuzzy logic controller rules No. P balance is positive, P load > P res P balance is zero, P load = P res No. P balance is negative, P load < P res P balance ESS Price P ess P balance ESS Price P ess IET Smart Grid, 2018, Vol. 1 Iss.3, pp.96-103 This is an open access article published by the IET under the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/)

Table 3
Commercial microgrid data Parameter Values

Table 6
Estimated number of the life cycle of ESS ControllerNo. of life cycles Fig. 8 Search space for three objective functions 102 IET Smart Grid, 2018, Vol. 1 Iss.3, pp.96-103 This is an open access article published by the IET under the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/)