Published by 1.Dominika KACZOROWSKA, 2.Przemysław JANIK, 3.Łukasz JASIŃSKI, 4.Jacek REZMER, 5.Vishnu SURESH, Wroclaw University of Science and Technology
ORCID: 1. 0000-0002-2312-2903; 2. 0000-0001-5300-7845; 3. 0000-0002-7484-9424; 4. 0000-0002-2822-7595; 5. 0000-0003-2891-9206
Abstract. This paper discusses power flow control algorithm in a microgrid with battery energy storage system. Depending on the state of charge of the storage and the power difference between generation and load, the storage operates in charge or discharge modes adjusting the instantaneous power. The goal is to obtain exchange power changes with the distribution system according to a pre-set curve. The system is simulated in MATLAB. The results show the effectiveness of the proposed control algorithm.
Streszczenie. W artykule zaproponowano algorytm sterowania przepływem mocy w mikrosieci z akumulatorowym zasobnikiem energii. W zależności od stanu naładowania magazynu i różnicy mocy między generacją a obciążeniem, zasobnik operuje w trybach ładowania lub rozładowywania dostosowując moc chwilową. Celem jest uzyskanie zmian mocy wymiany z systemem nadrzędnym według zadanej krzywej. Mikrosieć jest symulowana w środowisku MATLAB. Wyniki pokazują skuteczność proponowanego algorytmu sterowania. (Algorytm sterowania przepływem mocy w mikrosieci z magazynem energii)
Keywords: microgrid, energy storage system, control algorithm.
Słowa kluczowe: mikrosieć, system magazynowania energii, algorytm sterowania.
Introduction
Regulations on the functioning of the electricity market must consider the features related directly to the way how power system operates. It is necessary to constantly balance supply and demand and ensure reliable operation of the power system. The assumptions made so far about the inability to directly store electricity have implied limited flexibility in energy production. This is currently changing, among others, thanks to the introduction of microgrids [1].
The aim of power flow control can be achieved in the global electricity market, as well as, in a local technical market. The goals of the energy market, where active energy is traded (quantity, price, time, place of delivery) may differ from the aims of the technical market, where local regulatory system services, necessary for proper system operation, are traded. The development of distributed generation DG and microgrids with battery energy storage systems BES is an important element of the transformations in modern power systems [2]. The main element of the presented research results was the development of a strategy for energy storage in BES. That is why experimental and simulation studies of BES performance in the microgrid for various concepts of power flow control allow verification of assumptions, parameters and algorithms in use [3,4].
The paper describes the principles of developed scenarios of power flow control, and the results of conducted research based on measurements made in the real network. Based on recorded generation and load data, numerical simulations were performed.
Microgrid
The goals of power flow control in microgrids are most often directly related to the economic aspects [5,6]. Control algorithms switch to storage mode when low energy prices are forecasted and to discharge mode during electricity prices peaks. However, technical issues cannot be overlooked by implementation of proposed solutions into a particular microgrid. For example, the voltage levels in the network nodes must absolutely be within the range specified in the standards, and the values of currents in the lines and in the transformer windings must not exceed the permissible limits. The issues of energy storage operation, such as safety and robustness are also important. The performance of a microgrid and its interaction with the power system can be studied by means of power flow analysis. Simulation of power flow control is carried out at the initial stages of design work using the DC current power flow method, i.e. considering only changes in active power. This approach is often used in an initial state of microgrid development, helping to determine global assumptions and reduce the influence of uncertain initial data [7,8].
The proposed microgrid model related to a real system consist of a battery energy storage BES, a photovoltaic generator PV, and local loads (Fig. 1). The battery energy storage comprises a converter enabling control of charging and discharging power. The microgrid is connected to the distribution system ensuring energy balance. The measurements were conducted in the key nodes of the system, which allowed to determine the changeability of e.g. voltages, currents, power and power quality indices.

A load profile was determined for local customers and a generation profile of a PV generator. Both based on longterm measurements at nodes of a real microgrid. Resampling method and median filtration were used to determine averaged power values over ten-minute intervals. As a result, a database of synchronized power generation and load data was obtained, further used in long- and short-term simulations.
Determining the BES characteristics is a basic issue related to power flow control in charging and discharging modes. The relations between the maximum charging power PM/discharging power and the SoC of the storage unit is given by the manufacturer. The conducted research assumed a typical, real characteristics of the BES, comprising lithium-ion batteries and control by a battery management system BMS (Fig. 2). The shape of the characteristics depends on the technical limitations of the batteries, technology, operating temperature, degree of wear, and the particular control method of BMS [9]. Moreover, the operator can influence the shape of the characteristic within certain limits, e.g. by preferring quick charging or discharging in a specific SoC range. This way the efficiency of the storage may be optimized, its lifetime prolonged and safety increased.

Scenario
The right strategy of energy storage control in the BES helps to optimize the operation of the microgrid. Despite the simple layout of the microgrid, the selection of a right control scenario is far from obvious and choosing the right variant allows to optimize the operation of the system. The proposed scenario assumes control of the PM power of the storage in such a way that the exchange power between the microgrid and the PS distribution grid is at a predetermined upper level, given as PZ. The algorithm is deterministic and at each step determines the charging and discharging power of the BES taking into account the restrictions resulting from the characteristics of the storage and the forecast of the loads PO and the power of generation PG.

In general, the proposed algorithm aims at leveling the peaks and valleys of exchange power between the microgrid and the distribution system PS. In an ideal case, with optimally selected parameters of the storage and generation, this power curve can follow a predefined shape, e.g. it can be constant. The scheme of operation of the proposed algorithm is shown in Fig. 3. When the demand of local consumers for power exceeds the PZ setpoint, it is covered by the local PG generation.
When this power is not enough, the storage is discharged in accordance to the BES characteristic. If the power is still not sufficient, the distribution system PS is used and the exchange power exceeds the set PZ value. In the event that the PG generation exceeds the power of the PO loads, the surplus energy is directed to the BES or to the distribution system so as to maintain the PS power at the set PZ level. The algorithm allows both, loading and unloading of the storage with the energy exchanged between the microgrid and the distribution system.
Results of simulations
The simulation results should assess the microgrid performance under a set of given parameters for the storage unit, including storage capacity, maximum charging and discharging power, shape of the charging characteristics. Assuming one algorithm of power flow control, which should be unchanged during tests. Moreover, it is important to determine, which variant of the microgrid optimally cooperates with the distribution grid.
In the real system controlling the PM charging and discharging power, the forecast of PG generation power and power consumed by local PO loads is used. Depending on the needs, to ensure an energy balance, power is also exchanged with the distribution system PS. In the conducted simulations, the forecasts were replaced by active power measurement data generated by the real PV plant and measurements [10] of active power consumed by local loads of the tested network. The calculations were performed with the planned energy storage connected to the microgrid.
The research was carried out for short-term, daily forecasts, which are usually related to the energy market, and for long-term, weekly forecasts, mainly related to the analysis of microgrid behaviour at variable daily generation from renewable energy sources. The storage charging and discharging power is set by the proposed scenario based on the current generation power and the load demand.
In the figures presenting the power changes in individual nodes of the microgrid, the principle was adopted that the generation power has a negative sign and the load power has a positive sign. Following the same principle, both the storage energy and the distribution system supplying energy to the microgrid work with negative power like a generator, while the storage and the distribution network when consuming energy from the microgrid work with positive power sign as does the load.
The simulations were performed according to the microgrid diagram shown in Fig. 1. The charging and discharging power of the storage unit were calculated following the algorithm shown in Fig. 3. The power transferred or taken from the distribution system results from the power balance and was calculated using Matpower, which is a Matlab toolbox dedicated to power flow analysis. The schematic workflow is presented next:
>Start
> load the measurement data PG, PO
> load the storage unit characteristics
> load the shape of the power exchange level with the grid
> load the matrix containing microgrid data
> for (each of the values of the PG and PO vectors)
> calculate PML, PMR according to storage unit
> characteristics
> calculations based on control scenario and matpower
> save EM, PS
> end
> power flow charts
>Stop
Storage unit simulations with a maximum power of 1 MW and a capacity of 3 MWh were carried out. The storage characteristics are shown in Fig. 2. Fig. 4 shows the results of the simulation of microgrid operation in the case of PV generation with 0.7 MW nominal power and variable local load power in the range from 0.3 MW to 0.9 MW. The data was recorded in a real network on August 1, 2018. The scenario of PM BES power control assumes equalization of the exchange power level with the distribution network PS at a constant PZ level of 0.35 MW. As shown in the simulation, the distribution system treats the microgrid as a load with constant power equal to 0.35 MW due to the use of a storage with selected parameters and a control algorithm. Not only are load peaks levelled, but also the exchange power PS level is much lower than the power of local loads


Figure 5 shows the change in state of charge of the BES during the daily work of the microgrid. It can be seen that the storage does not work in the whole range of its capacity. This can be an advantage because the BES is not deeply discharged, which significantly increases the battery life period. Performed simulations also allow to verify the required capacity of the BES. The example shown in Fig. 6 assumes a variable power level PZ throughout the day. The BES power control scenario tries to match the exchange power level with the distribution network to the set curve defined within the PZ 0.2 – 0.5 MW. The proposed approach is aimed at attempting to use a control algorithm that considers both, economic and technical conditions. The PZ curve is a required daily plan for changing the power of PS exchange between systems and may correspond to, e.g. forecasted changes in energy prices on the market. The parameters of the BES, power generation and load are identical to the previous example.


Figure 7 shows the change in state of charge of the energy storage unit during the daily operation of the microgrid for the simulation as in Fig. 6. The results of calculations confirm the effectiveness of the scenario for the control of BES power. The exchange power with the distribution system accepts the variability assumed by the algorithm. The results may be relevant in cases where strict control of power changes between systems is required, e.g. for economic reasons. Daily analyzes are also aimed at determining the correct operation of the proposed scenario of energy storage control due to detailed technical aspects. These include voltage and current parameters and power quality indices. It is expected that the largest voltage changes will occur at the BES connection point. The size and dynamics of changes will depend on the power variations. Limiting the value of voltage changes can be achieved by appropriate corrections to the BES control, e.g. by adjusting the shape of the charging/discharging characteristic.
The conducted weekly simulations can be used to check the immunity of the selected scenario of power flow control in the microgrid to generation and load forecasting errors.
Another aspect of the analysis may include checking the correctness of the selection of the BES or generator parameters for the selected location of a planned microgrid.


Figure 8 it presents the work of a microgrid without an energy storage unit. The local generation from a photovoltaic source is used by the local load, but as the evening load peaks fall out when the generation is not working, the differences between the peaks and valleys of the load deepen. The situation is radically changed by the use of an energy storage unit in this location, as shown in Fig. 9.
Conclusion
Thanks to the appropriate control of the energy flow in the microgrid including battery energy storage system and the photovoltaic power plant connected to the distribution grid, it is possible to achieve the optimal state of the system’s operation in view of the selected technical issues. However, the applied power flow control scenario allows to regulate the power of the energy storage unit in such a way that the exchange power between the microgrid and the distribution network is at a set level. Therefore, it not only allows the execution of technical objectives, but also other objectives, resulting, for example, from economic conditions.
The real experimental network was used for the research. However, the applied scenario makes it possible to control the power flow not only for the presented photovoltaic plant and battery energy storage but also for other types of power plants and energy storage systems. This makes the proposed method flexible to solve a wide range of microgrid power flow control problems, resulting from both technical and economic conditions.
The applied scenario allows not only to control the operation of the microgrid based on the forecasts, but can also be used in the planning phase of the microgrid, for example to verify the performance of the microgrid under certain conditions. A different example of using a scenario in the planning process could be to see how the parameters or type of energy storage unit affects microgrid operation. Equally, it is possible to see what impact a change in nominal power and power plant type would have.
The results obtained may answer the questions as to how far the adopted control concept can be used in the technical market to help in energy balancing and support management of system.
REFERENCES
[1] Rigo-Mariani R., Sareni B., Roboam X., Integrated Optimal Design of a Smart Microgrid With Storage, IEEE Transactions on Smart Grid, vol. 8, no. 4, July 2017, 1762 – 1770
[2] Nguyen A., Crow M., Curtis A., Elmore Optimal Sizing of a Vanadium Redox Battery System for Microgrid Systems, IEEE Transactions on Sustainable Energy, vol. 6, no. 3, July 2015, 729-737
[3] Venayagamoorthy G.K., Sharma R.K., Gautam P.K., Ahmadi A., Dynamic Energy Management System for
a Smart Microgrid, IEEE Transactions on Neural Networks and Learning Systems, 2016, vol. 27, issue 8, 1643 – 1656
[4] Ke Jia, Yiru Chen, Tianshu Bi, Yaoqi Lin, Thomas D., Sumner M., Historical-Data-Based Energy Management in a Microgrid With a Hybrid Energy Storage System, IEEE Transactions on Industrial Informatics, vol. 13, no. 5, October 2017, 2597-2605
[5] Xu H., Meng Z., Wang Y., Economic dispatching of microgrid considering renewable energy uncertainty and demand side response, Energy Reports 2020, vol. 6, 196–204
[6] Gao J., Chen J., Cai Y., Zeng S., Peng K., A two-stage Microgrid cost optimization considering distribution network loss and voltage deviation, Energy Reports 2020, vol.6, 263-267
[7] Ringkjøb, H.-K.; Haugan, P.M.; Solbrekke, I.M., A review of modelling tools for energy and electricity systems with large shares of variable renewables., Renew. Sustain. Energy Rev. 2018, vol. 13, no. 96, 440–459
[8] Zhang C., Chen H., Shi K., Qiu M., Hua D., Ngan H., An Interval Power Flow Analysis Through Optimizing Scenarios Method, IEEE Transactions on Smart Grid 2018, vol.9, 5217-5226
[9] Chen S., Zhao Z., Gu X., The Research on Characteristics of Li-NiMnCo Lithium-Ion Batteries in Electric Vehicles, Journal of Energy 2020, vol. 2020, 1-10
[10] Suresh V., Janik P., Rezmer J., Leonowicz Z., Forecasting solar PV output using convolutional neural networks with a sliding window algorithm, Energies 2020, vol.13, no. 3, art. 723, 1-15
Authors: dr inż. Dominika Kaczorowska, Wrocław University of Science and Technology, 27 Wybrzeże Wyspiańskiego st., 50-370 Wrocław, E-mail: Dominika.Kaczorowska@pwr.edu.pl; dr hab. inż. Przemysław Janik, Wrocław University of Science and Technology, 27 Wybrzeże Wyspiańskiego st., 50-370 Wrocław, E-mail: Przemyslaw.Janik@pwr.edu.pl; mgr inż. Łukasz Jasiński, Wrocław University of Science and Technology, 27 Wyb. Wyspiańskiego st., 50-370 Wrocław, E-mail: Lukasz.Jasinski@pwr.edu.pl; dr hab. inż. Jacek Rezmer, Wrocław University of Science and Technology, 27 Wybrzeże Wyspiańskiego st., 50-370 Wrocław, E-mail: Jacek.Rezmer@pwr.edu.pl; mgr inż. Vishnu Suresh, Wrocław University of Science and Technology, 27 Wyb. Wyspiańskiego st., 50-370 Wrocław, E-mail: Vishnu.Suresh@pwr.edu.pl.
Source & Publisher Item Identifier: PRZEGLĄD ELEKTROTECHNICZNY, ISSN 0033-2097, R. 97 NR 7/2021. doi:10.15199/48.2021.07.23