Real-Time Operation of Microgrids Real-Time Operation of Microgrids

Microgrid (MG) systems effectively integrate a generation mix of solar, wind, and other renewable energy resources. The intermittent nature of renewable resources and the unpredictable weather conditions contribute largely to the unreliability of microgrid real-time operation. This paper investigates the behavior of microgrid for different intermittent scenarios of photovoltaic generation in real-time. Reactive power coordination control and load shedding mechanisms are used for reliable operation and are implemented using OPAL-RT simulator integrated with Matlab. In an islanded MG, load shedding can be an effective mechanism to maintain generation-load balance. The micro-grid of the German Jordanian University (GJU) is used for illustration. The results show that reactive power coordination control not only stabilizes the MG operation in real-time but also reduces power losses on transmission lines. The results also show that the power losses at some substations are reduced by a range of 6% - 9.8%.


Introduction
MG systems have spurred increasing interest in the electric power industry [1] [2] [3].MG is a smart small-scale electric power system that consists of a mix of generating units, controllable loads, storage units, low-voltage transmission lines, transformers and a point of common coupling (PCC) to the main grid.PCC represents the main circuit breaker that is used to switch between two operation modes: islanded and grid connected.The successful implementation of these modes in MG has contributed to its widespread deployment, worldwide [4].
References [5] [6] have presented a number of challenges in MG implementa-tion.These include demand-side management, control of energy resources, and frequency restoration in momentary generation failures or abrupt load change.
In a grid-connected mode, the MG system is generally stable since frequency and voltage variations can be tuned by the grid.In an islanded mode, a robust control system has to be implemented to maintain consistent power flow within voltage and frequency limits [7].The intermittent nature of renewable resources and the unpredictable weather conditions driving solar power can easily make MG systems unreliable and unstable.Different types of control systems have been introduced to address the unreliable and unstable behavior of MG [8].Generally, these behaviors are simulated using OPAL-RT and MATLAB [9].An important real-time energy management system was presented to reduce cost of operation [10] for different stability scenarios.Reference [11] presented an implementation of intelligent controls to ensure stability of MG in real-time.Further investigations have been made to provide insights on inverter-based PV and controllable load mechanisms to control voltage variations in an islanded mode [12].These variations are probabilistic in nature and so a stochastic modeling approach for reactive power control was used for an industrial 47-bus MG system [13] .The results have shown that stochastic modeling can accurately capture voltage variations and can produce consistent reliable MG operation.Software and hardware implementation of voltage and load controls have been presented using FPGA [14].Real-time simulation of MG is still an open research.
In this paper, OPAL-RT real-time analysis of MG is presented.The objective is to optimally allocate solar power to meet power demand in realtime.In an islanded mode, momentary failures in power generation are introduced and recovery of critical loads is simulated in real-time based on a priority scheme.The impact of power balance while varying the amounts of power generation and demand is examined.In the simulation of MG mode transition, reactive power coordination control is used in order to minimize power loss while load shedding is used in order to maintain generation-load balance.GJU microgrid system is used for illustration.The results show that reactive power coordination control not only stabilizes the MG operation in real-time but also reduces power losses.
The remaining sections of the paper are organized as follow: Section 2 gives details of MG system.Section 3 presents GJU MG for real-time simulation.Reactive power control and load shedding mechanisms are presented in Section 4.
Section 5 presents simulation results of GJU case study.Finally, the paper is concluded in Section 6.

MG System
As shown in Figure 1, MG generally consists of controllable loads and renewable generation resources (e.g.wind and solar) that are complemented by on-site diesel generators and/or storage batteries.MG is managed and operated in realtime either in a grid-connected mode or an islanded mode mainly controlled through PCC.In the following subsections, formal models of MG components are introduced as a basis of formulation.

Controllable Loads
Controllable loads consist of load profiles that are generally time varying and are mainly driven by the type of customer behavior.Methods such as linear regression, time series, autoregressive, exponential smoothing, curve fitting, permutation and machine learning, are used for load forecasting [15].Using curve fitting and given the dominant load profile at MG site under study, a piecewise function in three-time intervals is developed and gives the forecasted total power demand ( ) D P t at time t as follows: where A and B represent constant values that can be calculated using curve fitting of historical data and ω and ϕ denote angular frequency and phase shift of a sinusoidal function that best fits the load profile during 24 hours of a given day, respectively.

Generation Resources
Renewable generation consists of solar and wind.Since the output power of solar and wind is intermittent and non-controllable, it is necessary to have storage and/or controllable generation that can replace power shortage and maintain constant local power.Solar Power: Solar power pv P is produced by large array of photovoltaic cells, formally defined as, [16]: ( ) ( ) where G, T, A, η, and α denote solar radiation, ambient temperature, area of panels, system efficiency, and power degradation, respectively.
Wind Power: Wind power w P is produced by converting the kinetic energy of wind turbines, formally defined as, [17]: where σ, b A , and ν denote air density, swept area of rotor blade, and wind speed, respectively.
Diesel Generating Power: The output power of N diesel generators G P is for- mally defined as: where Gi P denotes the output power of the ith diesel generator, cost of which at time t is defined as: and i C , A, F, and ∆t denote the cost ($), price of diesel ($/Liter), variable cost, and time interval, respectively.
Utility power: In a grid-connected mode, the operational cost also includes the cost of power absorbed from utility grid, defined where K is the price of utility grid energy ($/kWh).A negative value represents that energy is being sold from MG to the utility grid.

Storage Batteries
Storage batteries are considered the fastest element to provide power when it is needed.Charging and discharging of storage batteries depends on the utility grid price of energy when the microgrid is working with grid-connected mode, [18].
At high load peaks, discharge of batteries provides more economic benefits.It avoids the MG from paying high energy prices to the utility grid and in some cases selling can take place When the MG is turning into islanded mode, storage batteries can contribute in stabilizing the system and mentaing generation-load balance.

GJU Microgrid
The single line diagram of the GJU campus microgrid is shown in Figure 2. The main components represented as controllable loads; generating units; and PCC to the main grid.Loads are categorized in buildings A, B, C, D, E and F as essential, nonessential, and air conditioning that are connected through remotely controllable circuit breakers.Details of demonstration have been throughly investegated in the 3DMicrogrid project, [19].Figure 3 shows a typical load profile for a Winter and a Summer day, where peak loads occur during working hours  The transmissions lines interconnect generation resources and building substations with 11/.4KV bus transformers.The PV generation is dependent mainly on weather conditions which vary over the year.Figure 5 shows the energy patterns of PV generation and Load for 12 months.In January, for instance, PV produces 40% less power than load.In May and June, PV produces 32% and 24% more power than load, respectively.
Power losses and power balance factors are important keys in power system analysis.They have direct impact on performance and economic operation.Power balance is impacted by the amounts of power generation and demand.Maintaining generation-load balance of the islanded MG while keeping a stable real-time operation is a challenging task.Furthermore, in electrical power systems, reactive power plays a vital role in power stability.This leads to the necessity of addressing reactive power losses as a critical term.Two scenarios are analyzed for real-time generation-load balance in a stabilized MG.One is the reactive power coordination control that aims to minimize power losses and the second is the load shedding that aims to meet accurate generation-load balance, especially during transition between MG operation modes.

Reactive Power Control
Inverter-based systems have a critical role in controlling the injection and absorption of reactive power in order to perform several functionalities such as voltage variation control, power losses control, and power curtailment.This is mainly achieved through reactive power control which largely reduces power loss in transmission lines.The power loss on a given transmission line is formally defined as, [20]: where V, R, P and Q represent the voltage, line resistance, active power and reactive power, respectively.
The reactive power control is known as Q-coordination control and generally contributes to a loss reduction of few percentages.The process begins with adjusting reactive power set points based on the local variation of feeder power losses.The value of the set point is essential in performing the inverter operation in terms of reactive power compensation.Accordingly, the power transfer through system buses will be limited and hence the power losses will be decreased.The PV block has two predefined set points for both active and reactive power parameters.Inside the PV subsystem, a large group of blocks has been built to perform a robust control system for the PV operation in MG.Reactive power directly affects the inverter functions in terms of the reactive power compensation based on acceptable voltage limits.
The determination of the new setpoint in the PV block is based on reactive power of load, leading to a minimum reactive power flow via the network feeder.Figure 6 presents an illustration diagram of the proposed coordination control, starting with sensing the reactive power output from the load (Qload).The value of Qload will be fed to Zero Order Hold block.This value will be transformed to a per-unit (pu) value in order to be utilized as a set point of the PV block that is connected with the specified load.PV systems are installed and connected with substations 2, 4, 5 and 6.Q-coordination control has been implemented in substations 2 and 4 for testing.Figure 7 represents the output reactive power realtime readings of substation 2.  solution in the absence of enough storage and insufficient DG capacity.When ΔP is negative, load is curtailed by a percentage defined by the load at a given substation over the total load and the priority of the load connected to the substations.The load with a small load percentage and a lower load priority is considered as the first choice to be disconnected in order to decrease the overall required demand.After load shedding, ΔP is computed again and curtailment is made on the basis of load priority as described.Based on GJU load profile, load curtailment is made at substations 6, 5, 2, 3 and 4 with percentages 6%, 10%, 25%, 45% and 19% respectively.For load shedding in real-time, a robust sensor system is built.This system has the responsibility of sensing the power flow from MG.In an islanded mode, the power flow from the main grid becomes zero.During transition to an islanded mode, a triggering pulse will be set to measure the power difference that triggers load shedding algorithm providing on/off signals to load points at substations.

Simulation Results
We use RT-LAB, the OPAL-RT's real-time simulation platform for GJU MG, with Edit, Compile, Execute, and Interact in three subsystems: Master, Slave, and Console as summarized in are represented in discrete time with a step size T. Two factors impact the simulation of RTS, namely: the model complexity and the computational speed of the installed hardware, [15].The historical data of GJU power profile during years 2015-2018 have been used, [19].Figure 11 shows the power difference of GJU model in a real-time mode.As the MG transmits to the islanded mode, the Power difference (ΔP) parameter becomes negative.This is due to the absence of power from the main grid.Accordingly, substation 6 is disconnected as the first choice in the proposed load shedding.
Figure 12 shows the voltage and current signals of the load attached with the substation 6 where the disconnection has occurred at t = 5.5 sec.After the disconnection of load 6 and since the value of the ΔP is still a negative value, the second choice of load shedding is then made for substation 5. Figure 13 shows the voltage and current signals.When ΔP goes to an acceptable positive value at t = 6.3,MG system is then said to have reached to the desired power balance level.Reactive power coordination control process was used in [21] to stabilize a 50 MWp PV power planet connected directly to the utility grid.Simulations show that in case of small disturbances, PV panels can recover the system while during large disturbances it depends on the power planet capability.The process was also used to reduce the power loss caused by the transmission lines.We have investigated the process on a MG that contains 2.1 MWp PV system, six low-medium voltage and two medium-medium voltage substations.The process showed high potential of achieving stability of the system supported with the load-shedding strategy.Authors of [22] have investigated the concept development and cost-benefit analysis of the reactive power management used at the distribution level.

Conclusion
This study has investigated the capability of MG to maintain a safe and stable operation in critical conditions through real-time simulation.Two scenarios have been studied to address the power losses and power balance factors.The first one is the reactive power coordination control which mainly aims to minimize power losses.The second scenario is load shedding which mainly aims to balance generation power and load in the absence of connection to the utility grid.Fault Ride Through technique has been used to examine the ability of generating units to stay connected and available in case of voltage sag occurrences.A real-time simulator using OPAL-RT platform with Matlab has been used for GJU MG model construction and analysis.The results have shown that reactive power coordination control not only stabilizes the MG operation in real-time but also reduces power losses by 6% -9.8%.Load shedding has also been implemented for generation-load balance of MG in the islanded mode.Further development of the study may include optimal resource allocation, load management, and sto-

Figure 3 .
Figure 3. Load profile for summer and winter day.

Figure 4 .
Figure 4. PV generation for summer and winter day.

Figure 6 .
Figure 6.Block B with the reactive power coordination control.

Figure 9
Figure9shows GJU MG in Matlab/simulink and RT-Lab with the main grid interconnecting six PV areas, load substations and the diesel generator units via the PCC breaker.The two main stations are connected with six substations.The parameters of transformers, cables, load, PV, DGs and other components have been identified for simulation,[19].The RT-LAB software is used in the second stage of the simulation.It is composed of two subsystems; Master and Console as shown in Figure10.The computational components are located in the Master subsystem, while the scopes blocks are located in the console subsystem.The "powergui" block performs simulation solver type, obtains steady-state values, adjusts initial state, and runs FFT (Fast Fourier Transform) analysis.The ARTEMIS is a Simulink block in OPAL-RT.The Solver of RTS is used and compatible with MATLAB and "SimPowerSystems".The "OpComm" block is a key component in the model during the RTS that is installed from the RT-LAB library.It has the responsibilities of providing the communication infrastructure between the MG subsystems.

Figure 10 .
Figure 10.Master and console subsystems in RT-LAB.

Figure 11 .
Figure 11.Power difference in a real-time mode.

Figure 12 .
Figure 12.Voltage and current signals of load 6.

Figure 13 .
Figure 13.Voltage and current signals of load 5.

Table 1 .
The generic voltage and frequency variables Energy and Power Engineering

Table 1 .
Subsystems in RT-LAB platform.It is a main component in any RT-LAB model.It can't be accessed after starting the simulation.Hence, there is no ability to change parameters inside this subsystem except the one in the console subsystem.