1. Introduction
The role of distribution networks in power system management and support is changing dramatically. Revisions of the market framework are expected in the near future in order to exploit distributed resources for supporting upstream medium and high voltage grids [
1,
2]. In the perspective envisioned by the European directive [
3], microgrids will be the bricks of future electric systems. They embrace loads and sources that are close to each other and can be synergized to pursue a safe and cost-effective operation of the electric system and the innovative feature of allowing end-users to become actors of the electricity market. For this aim, microgrids are expected to evolve into systems capable to ensure degrees of scalability, flexibility, reliability, robustness, and readiness similar to networks of digital devices. From the perspective of this analogy, we may refer to E-LAN, namely, Local Area Energy Networks [
4]. E-LANs, represented in
Figure 1, allow important features, including optimal power flow control, dispatchability at multiple points of connections with the main grid, exploitation of all the energy resources available. In general, advanced control features rely on adequate information and telecommunication (ICT) infrastructures [
5]. Such infrastructures are an important constituent of modern intelligent energy systems, whose impact, also in case of malfunctions, is rarely included in studies considering low-voltage distribution grids. Indeed, from the perspective of the required communication protocols and specifications, the considered scenario shows still fluid and evolving [
6].
Various contributions align along the outlined direction organize microgrid control in multiple layers, as shown in
Figure 2. The planning of the resources based on energy arbitrage is found at the higher level of the E-LAN control hierarchy, that is, the transactive control layer, which can be applied both at the microgrid level [
1,
7,
8], also by exploiting detailed mathematical modeling of the distributed energy resources [
9], and at the premises of single consumers too [
10]. By these approaches, predictions about power needs and energy prices are taken into account to optimally exploit power flow control, as specifically done in [
1,
8,
9]. On the other hand, network models and power flow constraints, which are considered herein, are crucial for optimal utilization of the microgrid distribution infrastructure [
11]. This is particularly important when ancillary services, like demand–response, involving additional constraints to be met, have to be accommodated by relying on distributed energy resources interfaced by electronic power converters (EPCs). From this respect, automatic and predetermined power sharing techniques, see, for example, [
12], typically constituting the primary control layer of microgrids [
13,
14], should be augmented to adapt to actual power needs and fulfill given power flow constraints optimally. A contribution from this perspective is given in [
4], in which an optimal power flow controller is proposed considering steady-state operation. Herein, the approach is revised and implemented on a real-time simulation platform to evaluate its operation in dynamic conditions. Of course, such approaches may be applied jointly with load prioritization techniques based on load analyses, as proposed in [
15]. These techniques can schedule the on/off status of the loads to be supplied by the available sources. The available sources can then be coordinated by optimal power flow control signals. The optimization approach described herein aims at taking advantage of every source available in the grid without using power shedding methods except those enforced at higher levels of the control hierarchy. Instead, enhanced performance of the network is pursued by synergistic use of the control abilities of any distributed power sources.
The validation of the approaches mentioned above is a delicate task due to the complexity and the variety of the dynamics involved (e.g., the fast response of EPCs versus the slow optimization processes and power system dynamics). For these reasons, especially when particularly complex systems are analyzed, validation is often performed by means of computer simulations rather than experimental prototype realizations. Thanks to the recent advances in digital computing, real-time simulators have been employed lately for systems studies involving the interaction of power systems and power electronics systems that are characterized by fast dynamics (e.g., tens of
) [
16]. Validation via real-time simulations presents several advantages as compared to traditional simulations. The principal ones are (
i) the possibility of performing an on-line testing of models and controls, even while interacting with other hardware components or prototypes [
17], and (
ii) the possibility of emulating parts of a complex experimental scenario that may not be conveniently included otherwise, due to size, cost, safety, or availability constraints. Several hardware solutions are available to run real-time simulations. Some exploit general purpose toolsets, as shown in [
18] and, before, in [
19] and [
20], others use dedicated hardware and software solutions to ease the development of models of electrical and electronic systems, as done, for example, in [
21,
22,
23].
In this paper, a control architecture that makes use of an innovative optimization framework capable to fulfill the operating constraints while providing synergistic operation of all controllable sources acting in the grid is considered and analyzed. The system performances are optimized in terms of component stress, power sharing, voltage stability, energy efficiency, congestion management, demand–response, robustness against transients, and communication failures. The proposed control is tested by a real-time simulation setup combining real-time simulators (OPAL-RT), industrial central controllers, and communication network emulators. These two aspects constitute the contributions of the paper, that is, (i) describe a power flow optimization method applied dynamically to fulfill power constraints, and (ii) describe the implementation of the proposed power flow control considering a real-time simulation setup integrating fully modeled converters controllers, realistic communication performance, allowing to validate the effectiveness of the proposed optimal control.
In the reminder of the paper, the power flow control is presented in
Section 2, while
Section 3 presents the primary-local control of the distributed electronic power converters. The implementation of the whole control system is described in
Section 4, which also reports and discusses the obtained results.
Section 5 concludes the paper.
2. Coordination of Distributed Electronic Power Converters
The power flow control method considered herein is introduced in the following. The method allows to satisfy various operational constraints by exploiting the available distributed EPCs in an optimal way. The method is validated for the first time in this paper by means of real-time simulations and shown suitable for real-time control. The results are reported in
Section 4.
2.1. Network Equations
Consider an electrical grid, either single-phase or three-phase, with L branches and N nodes, plus the slack node (node 0) whose voltages are taken as reference voltages. Loads and sources are connected phase-to-phase or phase-to-neutral, while network branches interconnect pairs of nodes. The network graph is described by the incidence matrix , where the column corresponding to node 0 is omitted. For simplicity, but without loss of generality, in the following we will refer to a single-phase network where loads and sources are connected between the grid nodes and a common ground, corresponding to the neutral wire.
Let
be the (vector of) node voltage deviations from reference
,
the currents entering the grid nodes,
the voltages across the branches oriented according to the network graph, and
the corresponding branch currents. The Kirchhoff’s laws give:
where superscript
T denotes transposition. In sinusoidal operation, we represent currents and voltages as phasors and correspondingly we may define the diagonal matrix
of branch impedances. Correspondingly, the relations between branch currents and voltages become:
The relations between node voltages and currents are the following:
In (
3),
is the nodal admittance matrix and its inverse
is the nodal impedance matrix. Finally, we get the inverse relations of (
1) by:
Remarkably, such equations apply to both meshed and radial networks. In this latter case, .
2.2. Control Equations
Figure 3 schematically represent a network, indicating the kind of nodes and related referred to thereafter. In general terms, the nodes can be classified as:
- (a)
Voltage nodes, supplied by voltage sources. Let be the voltages imposed at these nodes, referred to the reference voltage . Currents supplied by the sources partially feed local loads () and partially enter the grid ().
- (b)
Current nodes, supplied by current sources. Currents supplied by the sources partially feed local loads () and partially enter the grid (). Let be the voltages at such nodes.
- (c)
User nodes, supplying passive loads. Let be the voltages at such nodes and be the related load currents.
The function of balancing the local generation by sources and consumption by possibly connected local loads is in charge of the local controller of the current or voltage nodes. The local controller, depending on the requests coming from the central controller, may adapt its power generation to fully compensate for local load or to pursue local optimization criteria.
It is easy to show that all network voltages and currents can be expressed as a function of voltages and currents impressed by the sources which, in turn, can be controlled by acting on the EPCs interfacing the sources with the grid.
In the following, we therefore consider the voltages impressed at voltage nodes, and the currents entering the grid at current nodes, as the control (input) variables for the entire grid. The main output variables are currents at voltage nodes and voltages at current nodes, all remaining grid quantities being easily derived.
We generally express the control-to-output equations in the form:
where
,
,
, and
are sub-matrices of
in (
3) that refer to voltage and current nodes, respectively, and
is the control-to-output transfer matrix.
From the above equations, we express the currents at voltage nodes as:
2.3. Constraints
In general, the grid control problem is twofold. On one side, we wish to optimize some aspects of grid operation, as explained in the following section. On the other side, we need to fulfill specific constraints in terms of power flow at a given set of grid nodes or branches.
More specifically, in order to control the active and reactive power entering the grid at voltage nodes, currents
can be constrained. In particular, constraints may apply to their direct (active) and/or quadrature (reactive) terms. Let:
we assume that, among the
currents
fed by voltage sources,
are subject to constraints on the direct component, and
are subject to constraints on the quadrature component. Let
and
be such constrained currents, the constraints are expressed as (superscript ref indicates reference values):
Similar constraints can also apply to the direct and quadrature currents entering the grid at slack node, which are related to the active and reactive power and at the point of coupling with the upstream grid.
Currents
fed by current sources can also be subject to constraints, expressed by:
In practice, constraints in (
9) reduce the number of control variables, freezing a subset of impressed currents
and
.
A last type of constraint may impose specific values to a set of branch currents. This corresponds to enforce the power flow in specific grid lines (power steering) or clearing specific branch currents (active insulation). Let
be the number of constrained branches, we may express these constraints, separately on
d and
q axes, as:
2.4. Cost Function
As mentioned before, the E-LAN control variables can be determined according to an optimal control approach, where a suitable cost function is minimized while fulfilling the above set of constraints.
In general terms, we define the cost function as:
where coefficients
,
,
are weighting factors, and variables
,
,
are the cost function terms, defined as follows.
corresponds to the power loss in the distribution grid, expressed in relative terms as:
where
is the grid loss in a generic operating condition,
is total power loss in the condition when all controllable quantities are set to zero,
is the vector of square rms values of branch currents, and
is the vector of branch resistances.
results by adding
(grid loss) and
(conversion loss).
corresponds to the total power loss in the EPCs interfacing the distributed generators with the grid, which can be driven as voltage sources or current sources to implement sources
and
, respectively. It is expressed by:
where
is the conversion loss in a generic operating condition,
and
are the vectors of equivalent series resistances of voltage and current sources,
and
are vectors of square rms values of source currents.
corresponds to the cumulative rms deviation of node voltages from voltage reference
; it is given by the ratio between the square cumulative rms voltage deviation in a generic condition and the corresponding value when all controllable variables are set to zero:
It is worth remarking that the coefficients in (
11) may be tuned independently in order to assign different weights to voltage deviations, grid losses, and conversion losses on the optimization on the basis of the specific requirements of the application scenario.
In a similar way, we may extend the cost function to include other terms related to the power stress of distributed sources, the thermal stress of feeders, the VA stress of EPCs. The result is a cost function that accounts for the main operation aspects influencing the grid performance, and prevents useless stress of the grid components.
2.5. Solution of the Optimal Control Problem
Eventually, the grid control problem can be formulated as a constrained optimum problem, where cost function
is minimized while fulfilling constraints
:
where
represents the set of constraints expressed in the linear form:
and the cost function is expressed in the quadratic form:
Expressing the matrices shown in (
16) and (
17) as a function of network quantities, the optimum control problem can solved in explicit form.
It can be observed that the above constraints do not include inequalities. Actually, the quantities that could be constrained by inequalities (e.g., current and power stresses, voltage deviations) are included in the cost function with proper weighting coefficients. The advantage of this approach is that the solution is found in explicit form, thus preventing convergence problems of the solving algorithm and making this latter very fast.
Finally, it is worth remarking that the above approach requires the knowledge of the network topology and network parameters. Actually, even if these data may be not fully available, there are methods presented in literature that allow identification of such information by measurements at grid nodes [
24,
25,
26].
3. Local Control of Electronic Converters
The literature categorizes the behavior of distributed EPCs when taken singularly in grid-feeding, grid-supporting, and grid forming [
27]. In the presence of a centralized microgrid controller dispatching optimal power commands to distributed EPCs, the grid-feeding behavior may be convenient, because it allows to easily operate multiple parallel-connected EPCs following given power references, regardless of grid parameters values. Instead, in case of accidental transition to islanded operation, the grid-supporting behavior may be the most favorable, because it allows sustaining the voltage of the local sub-grid section became isolated. This is often done by means of hierarchical structures, as described, for example, in [
28], which, typically, aim at defining the operating voltage and frequency of the microgrid, but without specific load sharing schemes based on the available resources and network structure. The control structure in
Figure 4, firstly presented in [
29], combines valuable merits of grid-following and grid-supporting: it achieves output power regulation when the grid voltage if stiff and supports the grid voltage during transients and in case of transitions to the islanded operation.
Specifically,
Figure 5 shows the complete structure of an EPC equipped with inner current and voltage controllers and
P-
f and
Q-
V droop loops. On top of these standard control loops, a power regulator with constrained output is employed. The two power control loops, that is, for the active and reactive powers, modify the droop characteristics by vertical shifts in order to make the converter follow given power references. In case of abnormal grid conditions that occur, for example, if the grid becomes particularly weak or islanded, the power controllers tend to saturate automatically. In this condition, the EPCs behave as traditional droop controlled converters, sharing incremental power needs in inverse proportion to their droop coefficients [
27].
Remarkably, the considered control attains output power flow control while operating connected to the main grid, and autonomous operation with load sharing in case islanded operation occurs.
4. Real-Time Simulation Results
The real-time simulation setup shown in
Figure 6 has been implemented in order to evaluate the proposed approaches in steady-state and dynamic conditions. To this end, the benchmark low-voltage network proposed in [
30] and arranged as indicated in
Figure 7 is considered.
Figure 8 displays its model on the real-time simulator.
The setup is composed of an OPAL OP4510 real-time simulator to execute the network model and the EPCs control algorithms, an iTrinegy NE-ONE network emulator to emulate the features of a real communication network, a computer to execute the microgrid controller, and the Yokogawa DL850EV for long-term data acquisition, processing, visualization, and recording. The network and the EPCs hardware are implemented using the eHS Gen 4 Solver and executed, with a time-step of
, on the Xilinx FPGA board Kintex-7 325T embedded in the OP4510. EPC controls and communication interface are implemented using Simulink blocks and they executed, with a time-step of
, on the four cores of the
-
Intel Xeon CPU embedded in the OP4510. Such a model partitioning allows performing accurate real-time simulations of the considered network and of the EPC’s hardware on FPGA and, concurrently, execute more complex converters controllers on CPU. The microgrid controller for optimal power flow control is implemented in Matlab and executed, with execution frequency of
, on the desktop computer. The performances of the used computer are reported by means of the vector returned by the Matlab command
bench:
. Control settings and monitoring is allowed by a dedicated graphical user interface, displayed in
Figure 9. The microgrid model that is emulated by the OP4510 and the power flow controller that is executed on the computer exchange information representing power-terms by UDP communication via the network emulator NE-ONE. The network emulator can reproduce ideal or impaired communication conditions by including delays, packet loss or corruption, latencies, etc., which allows validation with realistic communication network performances. Finally, data acquisition, visualization, and storage are performed by the DL850EV. This latter is also exploited for active and reactive power measurements using dedicated, embedded processing functions and real-time computation capabilities.
4.1. Model Structure Details
Figure 10 displays the whole real-time simulation model. The model is partitioned in two parts, one running on the FPGA, the other on the CPU. The FPGA partition contains the model of all the hardware parts, as shown in
Figure 8, namely, the grid network specified in
Figure 7 and the output filters of the EPCs hardware specified in
Table 1. The CPU partition comprises the following blocks.
Central_ctr_interaction is responsible for UDP ethernet communication between OP4510 and the microgrid controller running on the computer. The packet rate and control algorithm in execution are ; if needed, this time can be reduced to with computers of higher performance or by dedicated, optimized implementations. This block also (i) logs the results from the running experiment, (ii) acquires and dispatches the control signals that are sent by the microgrid controller to the EPCs, (iii) defines the active power generated by the PV source connected at node R-16 by reading stored data from experimental measurements, and (iv) defines the on/off status of the load breaker at node R-18.
InverterA_controller and
InverterB_controller contain the control loops of the EPCs connected at node R16 and R10, respectively. The control implements the structure shown in
Figure 5 and imposes the active and reactive power injection issued by the central microgrid controller and received and dispatched in the real-time simulation by means of the block
Central_ctr_interaction.
PQ-calculator computes the per-phase active and reactive power measured at each node of the network.
RMS-calculator computes the per-phase rms voltage measured at each node of the network.
PV_R16 generates the current reference for the PV source on the basis of the power profile generation recorded from a real plant and accessed inside the block Central_ctr_interaction.
Analog out routes the real-time simulation signals of the model to the analog output ports of the digital simulation platform, whose outputs are then measured by the DL850EV.
The devised partition allows to perform simulation with small discretization steps on FPGA for those models presenting fast dynamics and allow the execution of even complex control algorithm on CPU. The accuracy of the developed real-time simulation setup has been verified by comparison with equivalent desktop computer simulation models executed with variable time step simulations.
4.2. Results
The control system has been tested in different operating conditions. Six scenarios of operation with different kinds of constraints while minimizing the cost function (
11) are described next.
Case 0, no control: the situation in which distributed EPCs are switched off while loads and sources exchange nominal active and reactive powers as defined in
Figure 7.
Case 1, reactive power control: distributed EPCs are controlled by the power flow controller to generate only reactive power in order to minimize the cost (
11).
Case 2, active and reactive power control: as in the previous case, but with active power control too.
Case 3, power balance at PCC (point of common coupling): distributed EPCs are controlled by the power flow controller to generate the active and reactive power needed to balance among the phases the power absorption at the PCC while keeping the value of the total power exchange at the PCC as in Case 0.
Case 4, autonomous operation: distributed EPCs are controlled to generate the active and reactive power that is needed to achieve per-phase zero power flow at the PCC, satisfying, in this way, the whole power needs of the microgrid.
Case 5, demand–response at PCC: distributed EPCs are controlled to generate the active and reactive power to achieve balanced and purely active power flow at the PCC. The active power reference is set to .
The obtained results in steady-state conditions are reported in
Table 2, while transient behaviors in relevant conditions are displayed in
Figure 11. As a general remark, it is possible to note that voltage deviations and distribution loss significantly reduce in all the considered test cases when distributed EPCs are active and controlled by the microgrid controller. Each operating condition is considered in more details in the following.
Figure 11a refers to the transition from Case 0 to Case 1 and then to Case 2. It displays, from top to bottom, the total active and reactive power exchanged at the PCC and the measured total distribution losses. Case 1 allows a significant improvement in terms of power quality, indeed the maximum voltage deviation of the network nodes halves and the power factor at the PCC increases from
to
. In addition, distribution loss is mitigated by
. Significant improvements are obtained by activating active power control too: in this case distribution loss decreases by an additional
in the last time interval of
Figure 11a.
Figure 11b refers to Case 3, reporting the currents through the three phases at the PCC and the correspondingly measured active and reactive powers. Noticeably, power balance is achieved accurately, being the active and reactive powers among the phases at the PCC are of equal amount.
The dynamics related to power flow control are important when considering demand–response at the point of connection with the main grid, which is demonstrated in
Figure 11c,d. The former relates to a constraint of zero active and reactive power exchange, the latter to a constraint of pure, balanced active power exchanged with the main grid. Additionally in this case, the optimal coordination of distributed EPCs allows to accurately track the given references.
The impact on the dynamic performances of including communication impairments in the system is considered too in the validation.
Figure 11e–f show the effect seen at the PCC after a sudden increase of power absorption by
due to the connection of the load at node R18. During the condition in which the control system is set to impose zero power flow at PCC,
Figure 11e refers to the case of ideal communication whilst
Figure 11f refers to non-ideal and impaired communication with
packet loss and random latency in the interval [
,
]. Considering the random nature of the considered aspect, a batch of sixty consecutive acquisitions are simultaneously reported in the figures.
Figure 11e shows that the control brings back to zero the controlled quantity in a time compatible with the chosen control frequency of
if the communication is ideal. Instead, in the case of
Figure 11e, dynamics are significantly delayed even though steady-state performance is preserved. Such kind of considerations are important in the design of master–slave microgrid architectures (see, e.g., [
31,
32]) where a single EPC is expected to buffer possible energy unbalances. In such a case,
Figure 11e indicates that a master EPC should be able to buffer about
, while in case of communication fault as in
Figure 11e the buffered energy increases to
, which corresponds to
and
, respectively, of the capacity of a super-capacitor energy storage as in [
33]. In addition, it is possible to note an oscillation due to the active and reactive coupling of the droop control loop.
Figure 12 shows a long-term simulation over ten hours, in which the distribution loss in case of communication impairments is specifically considered. The simulation comprises variability in load power absorption at node R18, which is periodically switched on and off, and in PV power generation, sampled with a time step of one second, which considers a measured profile during a cloudy day. The simulation is run with ideal as well as non-ideal communication, showing negligible impact of communication impairments on power flow optimization: distribution loss increases from an average of
to an average of
, which confirms the effectiveness of the approach.
Finally,
Figure 13 shows a long-term simulation over twenty hours in which the load at node R15 is switched on/off randomly, the load at node R18 absorbs the actual power profile measured in a subsection of a university campus, and the source at node R16 generates the actual power profile measured at a PV installation. The figure shows, specifically, the instantaneous distribution loss when the distributed converters are disabled (i.e., case without optimal control) and the case in which the converters are controlled according to the presented optimal power flow (i.e., case with optimal control). Notably, the average distribution loss amounts to
in the first case, while, enabling distributed converters to respond to the optimal control signals, the distribution loss decreases to
, which corresponds to a distribution loss reduction of
.
In summary, the described control approach is based on a general algorithm with an explicit solution of the control problem. In this way, it is not affected by convergence issues even in case of communication failures and it is adaptable to generic networks and operating conditions. The approach is validated by means of a real-time simulation setup that is described in detail herein. This setup can be considered for the validation of generic systems involving fast electronic power converters, control algorithms for management of distributed resources, and a communication infrastructure allowing data exchange for distributed resources coordination. The considered scenario and validation testbed are useful in the forthcoming power-electronics-dominated grids, where control and communication play an important and substantial role [
34,
35].