Resynchronization of Islanded Unbalanced ADNs: Control, Synchrocheck and Experimental Validation

—The problem of securely reconnecting active distri- bution networks (ADNs) - e.g. microgrids - to their upstream grids at the point of common coupling (PCC) has been extensively discussed by the existing literature. The latter is commonly referred to as resynchronization and has to be done with care in order to avoid large transient current ﬂows resulting from differences of nodal voltage phasors at both sides of the PCC. The active resynchronization process can be split into two tasks: the PCC-control and the synchrocheck. The PCC-control refers to the process used to steer the PCC nodal voltage at the ADN’s side (i.e. downstream) towards the PCC nodal voltage at the upstream-grid’s side (i.e. upstream). The synchrocheck refers to the algorithm used to check the synchronization (i.e. phasor alignment within tolerances) of the upstream and downstream PCC nodal voltages. Methods for PCC-control and synchrocheck presented in the literature commonly ignore the ADN’s operational constraints and rely on the assumption of a balanced system. In this respect, the contribution of this paper is twofold. First, an approximated optimal-power-ﬂow problem is proposed to control ADNs’ resources in order to rapidly steer their PCC downstream nodal voltages close to their non-controllable up- stream counterparts. Second, an Interpolated-Discrete-Fourier-Transform (IpDFT)-based synchrocheck method that veriﬁes the alignment of all three-phases of both upstream and downstream nodal voltages at the PCC, is proposed. The algorithms as- sociated to both contributions are experimentally validated on the CIGRE-low-voltage-benchmark-microgrid at the Distributed Electrical Systems Laboratory (DESL) at the ´Ecole Polytechnique F´ed´erale de Lausanne (EPFL) where the results of the developed synchrocheck are further benchmarked against the Schneider Electric’s Micom P143 grid relay.

Abstract-The problem of securely reconnecting active distribution networks (ADNs) -e.g. microgrids -to their upstream grids at the point of common coupling (PCC) has been extensively discussed by the existing literature. The latter is commonly referred to as resynchronization and has to be done with care in order to avoid large transient current flows resulting from differences of nodal voltage phasors at both sides of the PCC. The active resynchronization process can be split into two tasks: the PCC-control and the synchrocheck. The PCC-control refers to the process used to steer the PCC nodal voltage at the ADN's side (i.e. downstream) towards the PCC nodal voltage at the upstream-grid's side (i.e. upstream). The synchrocheck refers to the algorithm used to check the synchronization (i.e. phasor alignment within tolerances) of the upstream and downstream PCC nodal voltages. Methods for PCC-control and synchrocheck presented in the literature commonly ignore the ADN's operational constraints and rely on the assumption of a balanced system. In this respect, the contribution of this paper is twofold. First, an approximated optimal-power-flow problem is proposed to control ADNs' resources in order to rapidly steer their PCC downstream nodal voltages close to their non-controllable upstream counterparts. Second, an Interpolated-Discrete-Fourier-Transform (IpDFT)-based synchrocheck method that verifies the alignment of all three-phases of both upstream and downstream nodal voltages at the PCC, is proposed. The algorithms associated to both contributions are experimentally validated on the CIGRE-low-voltage-benchmark-microgrid at the Distributed Electrical Systems Laboratory (DESL) at theÉcole Polytechnique Fédérale de Lausanne (EPFL) where the results of the developed synchrocheck are further benchmarked against the Schneider Electric's Micom P143 grid relay. Active distribution networks (ADNs), e.g. microgrids, are small power grids for electricity distribution hosting dispersed power generation, demand-side management and energy storage devices. ADNs can be controlled and operated in either grid-connected-mode, i.e. connected to an upstream network at the point of common coupling (PCC), or islanded-mode, i.e. disconnected from the upstream network. The latter configuration represents a solution to guarantee the continuity of supply when the upstream network is experiencing faults or outages that may propagate downstream [1]. In practice, a reconnection to the upstream-grid is inevitable due to lack of supply and/or sufficient energy storage. The transition between the two modes must be handled carefully. In particular, during a resynchronization process (i.e. islanded to grid-connected), it is important to ensure that the three-phase nodal voltages on both sides (i.e. upstream and downstream) of the PCC are within security bounds in terms of magnitude, phase-angle and frequency, before closing the breaker (i.e. ensure nodal voltage phasors synchronisation and alignment) [2]. Failing in doing so may provoke large current transients that can damage the ADN's equipments.
As explained in the IEEE std. on distributed resource island systems (e.g. islanded ADNs) [1], the resynchronization process can be done in three ways: open-transition, passive and active. Open-transition resynchronization refers to the 22nd Power Systems Computation Conference PSCC 2022 Porto, Portugal -June 27 -July 1, 2022 complete denergization of the ADN before reclosing the PCC breaker. Passive resynchronization relies on constantly checking the alignment of the upstream and downstream PCC nodal voltages and only closing the breaker if they are synchronised, without the need to denergize the local -i.e. downstream -grid. The algorithm used to detect the PCC nodal voltages synchronization is referred to as synchronismcheck or synchrocheck and its function is "the determination that acceptable voltages exist on the two sides of the circuit breaker, and the phase-angle and frequency difference (slip) between them is within a specified limit for a specified time." (c.f. [3] for details on when this functionality is needed and how it is configured). Active resynchronization, which is the process of interest in this work, refers to frameworks with a control mechanism that actively steers the PCC downstream nodal voltages in order to synchronize it with their upstream counterparts. The latter control mechanism is hereinafter referred to as PCC-control.
In the literature, methods tackling the problem of PCCcontrol can be clustered in two categories: single and multiple device-based frameworks.
Single device methods rely on having a specific device connected in close proximity to the PCC aiming to locally control the downstream PCC nodal voltages. Traditionally that device was a synchronous-generator-based-resource whose speed (i.e. frequency) and nodal voltage magnitude could be controlled, respectively, through their, governor and automatic-voltageregulators. For instance, in [4], a dedicated distributed generator (DG) is proposed to be installed in order to locally align the nodal voltage phase-angles and frequencies at both sides of the PCC. Another example is in [5] where authors propose to control the DG through an adaptive-droop-control-strategy to adjust the frequency, phase-angle and amplitude of the downstream PCC nodal voltages. Alternatively, non-generatorbased-dedicated devices used for the resynchronization process were also proposed in the literature. For instance, in [6], authors suggest to connect a controllable capacitor-bank near the PCC in order to locally change the downstream nodal voltages through reactive-power compensation. Even though such solutions relying on one physical device may work well, the fact that ADNs are not expected to resynchronize frequently, renders this solution costly as most dedicated devices may remain idle in long non-resynchronization periods.
Multiple device methods rely on controlling one or more resources already present in the ADN in order to steer the PCC downstream nodal voltages. In [7] authors present a Proportional-Integral-Derivative (PID)-based method where a central controller generates set-points for DGs that are assumed to be controlled using their respective droops. In [8] authors present a distributed synchronization strategy relying on PID-based transfer function control. To ensure better postresynchronization behavior they consider the ADN's voltage unbalances by extending the typical criteria listed in [2] to include harmonics and nodal voltage negative-sequence limitations. In [9], a distributed PI-controller-based method is proposed where DGs cooperatively communicate with each other to adjust their local droops in order to collectively steer the downstream PCC nodal voltages towards their upstream counterparts. Similarly in [10], authors present a distributed consensus-based phase-angle droop-method for DGs to perform PCC-control. Additionally, it leverages the use of phasor measurement units (PMUs) to get accurate measurements of the phase-angle of different nodal voltages.
In most of the above works the synchrocheck functionality is implemented through phasor-locked-loop (PLL)-based algorithms that measure both nodal voltage phase-angles and frequencies in conjunction with standard magnitude measurements. In the specific literature on synchrocheck most works do the same, however, some present alternative methods. For instance, in [11], the authors present a method leveraging lowpass filters, voltage zero-crossing detection coupled with a digitizer to measure nodal voltage magnitudes, phases and frequencies, then actuate a breaker in case of synchronism. More recently, data driven approaches have been proposed. For instance, in [12], a learning-based classification method is proposed to detect phasor synchronization. Alternatively, in [13], a method is proposed to detect phasor alignment by comparing the correlations of the different analog nodal voltage signals over several periods.
In all the above PCC-control frameworks, authors ignore the downstream-ADN's operational, i.e. static and power quality constraints, i.e. branch currents magnitudes, nodal voltages magnitudes, ratios of nodal voltages negative-over positive-sequences and zero-over positive-sequences, all within predefined bounds. Furthermore, none of these works explicitly use PMU measurements to detect the synchronisation of both upstream and downstream PCC nodal voltage phasors. Indeed, some use PMUs in order to get accurate measurements of nodal voltage phase-angles but it remains unclear whether PMUs are directly used in the synchronism-check. As a result, this paper proposes: (i) a centralised optimal-power-flow (OPF)-based algorithm to control an ADN's resources to steer the PCC downstream nodal voltages towards their upstream non-controllable counterparts, and (ii) an Interpolated-Discrete-Fourier-Transform (IpDFT)based synchrocheck method that checks the alignment of all three-phases of both upstream and downstream nodal voltages at the PCC. Both contributions are experimentally validatedi.e. an active resynchronization using both contribution was achieved within 1-2 seconds -on the CIGRE low-voltage benchmark microgrid available at the Distributed Electrical Systems Laboratory (DESL) at theÉcole Polytechnique Fédérale de Lausanne (EPFL), referred to as EPFL-DESL microgrid, where the results of the developed synchrocheck are further benchmarked against the Schneider Electric's Easergy Micom P143 grid relay [14].
The rest of the paper is structured as follows. Section II schematically presents an overview of the paper's contributions. Section III contains the details of the proposed PCCcontrol strategy. Section IV presents the proposed synchrocheck algorithm. Section V first presents the experimental setup, then, shows the experimental validation results of both As discussed in the IEEE std. for ADN controllers [15], the reconnection of an ADN to its upstream network requires the four steps reported in Tab. I. The proposed active resynchronization framework deals with steps 1 and 2 of Tab. I while also trying to guarantee smoothness and minimal effort for the fullfilment of steps 3 and 4. Fig. 1 schematically illustrates the contributions of this paper. Transition to grid-connected control and restore non-critical loads The first contribution is the ADN-central controller (ADN-CC) that aims at steering, over several control timesteps, the downstream nodal voltages at the PCC towards their upstream target counterparts while accounting for the ADN's operational, i.e. static and power-quality, constraints. This entails that the ADN is protected pre-and post-reconnection as invasive actions, e.g. non-essential load-shedding that will need to be restored post-resynchronization, are implicitly minimized. Therefore, the PCC-control algorithm running on the ADN-CC deals with steps 1 & 2 of Table I, but also minimizes said-restorations of step 4. As seen in Fig. 1, the ADN-CC needs as an input the ADN's-state, provided, for instance, by a centralised monitoring system (CMS), and, outputs setpoints for the ADN's controllable resources (c.f. Sec. III).
The second contribution, denoted as SYNCHRO, consists of a synchrocheck running an IpDFT-based method that extracts the per-phase phase-angle, frequency and magnitude of both PCC nodal voltage phasors then compares them, vis-a-vis the tolerances presented in [2], to verify and claim synchronization (c.f. Sec. IV). As seen in Fig. 1, the SYNCHRO block needs as inputs all six nodal voltages at both sides (i.e. DOWN and UP) of the PCC. Its output is a boolean signal guaranteeing the synchronization of the PCC phasors. The output can be directly coupled with breaker-actuation signals (see Sec. V-B).

III. PCC-CONTROL
As previously mentioned, the proposed PCC-control strategy is an OPF that is approximately-solved using a gradientdescent-based algorithm. The idea of the proposed algorithm is to quickly and securely steer the PCC downstream nodal voltages over several timesteps. In the following, first an overview of the control framework is given, second, the problem formulation is detailed, and, finally the algorithm used to solve the problem is presented.

A. Control framework: Assumptions and Overview
In this work, we consider that distributed energy resources (i.e. loads, sources and storage) in an ADN can be regulated by means of controllable power converters (CPCs). Furthermore, we only consider two control-modes for CPCs: i. grid-forming mode where the converter's ADN-side-nodalvoltage magnitude and frequency are regulated, and, ii. gridfollowing mode where the converter's ADN-side-nodal-activeand-reactive-power injections are regulated. As a result, no rotating machines are present in the considered ADNs. Additionally, in the adopted control framework, as long as the ADN is islanded, only one CPC is assumed to be controlled in gridforming mode. This entails that the latter plays the role of the slack bus since it sets the voltage at its bus and the frequency of the ADN 1 . Naturally, this implies that it must be connected to a bidirectional resource able to respond to power imbalances and compensate grid-losses (e.g. energy storage device [16]). It is important to note that, the unique slack assumption is not strict as the proposed PCC-control strategy can easily be extended to multi-slack islanded ADNs by accounting for the slacks grid-forming CPCs' power-sharing-law in the problem constraints (c.f. Sec. III-B5 for considered constraints) and by ensuring that the latter all implement the same frequency setpoint.
Next, we assume that the ADN's grid topology, lineparameters and compound admittance matrix are known 2 and that its state (i.e. nodal voltagae phasors at every bus), including the upstream 3 PCC bus, is available in real-time by means of a PMU-aided state-estimation 4 algorithm running on the CMS. The deployed state estimator is assumed to output estimates with at least the same accuracy as the minimum measurement requirements found in the IEEE std. 1 We assume that the frequency is the same everywhere in the ADN, which is reasonable given the small size of distribution grids. 2 This assumption is only needed for the method used for the considered grid model linearizations (c.f. Sec. III-B3). However, as explained in [17], other model-less techniques exist in the literature and can achieve similar linearization performance accuracies without the knowledge of the grid-model. 3 There are no particular assumptions made on the upstream PCC nodal voltages, however, the state of grounding of both upstream and downstream networks needs to be identical and, naturally, all measurement devices used in the process of inducing the states need to have the same references. 4 This assumption is considered to (i) match the setup (c.f. Sec V-A) used to perform the experimental validation, and, (ii) achieve high-controlling speeds enabled by the accuracy and high-reporting rates of PMUs. However, it is important to note that, other forms of slower state-estimators can be used to feed the states to the proposed PCC-control algorithm forcing it to adapt the rapidness of its control decisions but ultimately reach its intended target. for interconnecting distributed resources with electrical power systems [2]. Furthermore, the use of a state-estimator increases reliability as they are inherently built for redundancy and baddata rejection, e.g. the state can be accurately estimated even if 20-30% of the input measurements are lost or erroneous. The CMS communicates -with a high reporting rate of, e.g., 20 ms -the state to the ADN-CC, which is the device running the PCC-control algorithm that computes explicit setpoints to be implemented by the CPCs. If that communication is broken, or if the CMS fails to compute the grid state, the ADN-CC halts its control actions. The control period of the ADN-CC is chosen to be short enough (e.g., 100 ms) such that the downstream nodal voltages at the PCC are steered towards their upstream targets after a few control-steps even if the set-points computed at each control-step are suboptimal (c.f. Sec. III-C). Note that, the fast reporting rates and control-periods, given as examples above, correspond to the ones of the setup used for the experimental validation (c.f. Sec V-A). However, if these numbers increase due to practical limitations, the proposed methods would still be applicable.
Finally, we consider that each CPC is managed by a dedicated agent (real-time controller) that communicates with the ADN-CC. The ADN-CC sends explicit set-points to be implemented and, oppositely, the CPC's agent advertises the measured active and reactive nodal power injections as well as the updated power limits of the resource it is connected to (e.g. the maximum discharge power of a battery decreases with it's state-of-charge). Fig. 2 shows an overview of the adopted PCC-control framework, as presented above. In this paper, we consider three-phase 5 ADNs with any grid topologies, i.e. meshed or radial, and |N | nodes, where N is the set of all nodes. PQ is the set of both zero-injection nodes and nodes where uncontrollable resources are connected. K is the set of PQ-nodes where CPCs in grid-following mode are connected. S = {s} is the set containing the slack node (i.e. the node to which is connected the only considered CPC in grid-forming mode when the ADN is islanded). Without loss of generality 6 , we assume that PQ∩ K ∩ S = ∅ and |PQ| + |K| + |S| = |N |. The set of all electrical branches is denoted by being the submatrices composing the compound-block-admittance matrixȲ ( [18]).
Finally, the power flow equations, i.e., the relation between the nodal phase-to-ground voltagesĒ 2) Voltage-dependent loads: In this paper, we model the active and reactive nodal power absorptions of voltage-dependent loads using the generalised model presented in [17], namely, where, for phase φ of node i, P φ i,n and Q φ i,n denote the reference active and reactive nodal power injections at nominal voltage. Λ φ i and Ω φ i are sets containing weights and exponents. Some examples of weights and exponents together with their identification methods can be found in [19].
3) Linearization of the grid model: In order to achieve a convex OPF that can be solved in real-time, the power-flow equations are linearized around the estimated states provided by the CMS. The linearization of the power flow equations (1) including (2), is made possible through the computation of sensitivity coefficients (SCs), namely the partial derivatives of electrical quantities (e.g. nodal voltages, branch currents, nodal sequence voltages, slack apparent power) with respect to control variables, which are in our case, the active-and-reactivenodal-power-injection-set-points for grid-following converters and the nodal-voltage-magnitude-and-frequency-set-points for the grid-forming converter. The derivation of the SCs uses the method presented in [17], which enables the computation of the magnitude and phase-angle SCs as well. By leveraging a first-order Taylor expansion, the variations of electrical quantities can be estimated using SCs that are computed using the 5 Phases are denoted by superscripts a, b and c. 6 Virtual branches (i.e. close-to-lossless) and buses could be added in case different-mode CPCs or resources share the same node. 7 The operator • denotes the Hadamard product and z denotes the complex conjugate of the complex numberz = |z|∠ (z).
22nd Power Systems Computation Conference PSCC 2022 Porto, Portugal -June 27 -July 1, 2022 system's present state (denoted thereafter with the subscript 0). Note that, even though the control time-step is short (e.g., 100 ms), the ADN-CC steers the ADN's global state slowly enough such that the use of phasors and, consequently, SCs are adequate to formulate the constraints of the optimization problem (see Sec. III-B5). Finally, since the islanded-ADN's operating frequency is constrained within a tight range (e.g., ±0.6 Hz) around 50 Hz, we assume that its contribution to the variations of other electrical quantities (e.g. nodal voltage magnitudes) can be neglected without loss of accuracy; hence, the SCs involving the frequency as a control variable are ignored.
4) Power converters' dynamics: The implementation of a new control set-point by a CPC is not done instantaneously due to the latter's dynamics. Let us denote by ∆x * the desired variation of the control set-point sent to a CPC at the beginning of the control step, and by ∆x the actual implemented variation at the end of the control step, that is, after the control period ∆T . Thus, we can write without loss of generality where β (t) is a function that tends to 0 as the control period is shortened and tends to 1 when the latter gets sufficiently long compared to the CPC's time-constant (e.g. slew-rate).
The control period being a fixed parameter, we assume that the gain β is known a-priori and is, therefore, constant for each control variable. This is acceptable for all control variables except the frequency as its dynamics are needed for the estimation of the downstream phase-angles at the PCC. Indeed, the latter is based on the integral of the frequency, hence, the function accounting for the frequency evolution during some prediction horizon ∆T h must be known. In this respect, we model the frequency dynamics of the CPC in grid-forming mode as a first-order transfer function, with a step response given by where H(t) is the Heaviside function, L is the converter's delay and r its slew rate. Consequently, at the end of the prediction horizon, the angle variation due to the frequency evolution is:

5) Full optimization problem:
In this section, we formulate the PCC-control problem in the form of a constrained convex optimization problem. For the sake of readability, we adopt the notation |z| = z where z is the vector of moduli of the complex vectorz ∈ C n , n ≥ 1. By leveraging on first-order Taylor expansions, we consider implicitly the relation between an approximated quantity x ∈ R n (orx ∈ C n ), n ≥ 1, and its variation ∆x (∆x) from its initial centroïd x 0 (x 0 ), that is, x = x 0 + ∆x (x =x 0 + ∆x). The optimization problem (OP) OP1, is given by The objective function of OP1 is the weighted sum of the 2 -norms of the deviations between the upstream (· up ) and downstream (· dwn ) PCC nodal voltage magnitudes and phaseangles. The tuning parameter γ ∈ R ensures that both objective terms are comparable (i.e. are of the same nature) enabling it to give more importance either to the nodal voltage magnitude or phase-angle realignment. Note that, the frequency deviation is not explicitly minimized because it is already accounted for in the phase-angle objective term. Indeed, the phaseangle being the integral of the frequency, if the former is resynchronised continuously for multiple timesteps, then the latter is necessarily resynchronized as well. Therefore, this 22nd Power Systems Computation Conference PSCC 2022 Porto, Portugal -June 27 -July 1, 2022 requires to compute the integrals of the ADN's and upstream frequencies over a prediction horizon that is longer than the control period, i.e. ∆T h > ∆T . Additionally, the frequency control law resulting from the resolution of OP1 would be aggressive if ∆T h = ∆T as the PCC nodal-voltage phaseangles would be forced to be synced at the end of the short, e.g. 100 ms, ∆T which may lead to large setpoint oscillations between subsequent control timesteps.
The optimisation variables are the variations of the active and reactive power set-points ∆P * k , ∆Q * k for CPCs in gridfollowing mode k ∈ K, and the variations of the voltage magnitude and frequency set-points ∆E * s , ∆f * for the CPC in grid-forming mode.
Constraints (6a) to (6e) guarantee the static constraints, namely, that the nodal voltage magnitudes , ∀(i, j) ∈ L and slack nodal power injectionsS s = P s + jQ s = S a s ,S b s ,S c s are within bounds. Constraints (6f) and (6g) guarantee the power quality constraints by enforcing nodal voltage grid balance to be within the bounds stated in [20]. Let the vector of voltage sequence components be defined asĒ seq denotes the zero-sequence nodal voltage magnitude, E pos i the positive-sequence nodal voltage magnitude and E neg i the negative-sequence nodal voltage magnitude, of node i. The parameters tol zero , tol neg ∈ R + define, respectively, the maximum acceptable magnitudes of zero-and negative-sequence nodal voltages with respect to the positive-sequence (c.f. [20]).
Constraints (6h) to (6j) ensure that the active and reactive power setpoints respect the power limits -in terms of active, reactive and apparent powers -of all CPCs in grid-following mode. Similarly, constraints (6k) and (6l) ensure that the voltage magnitude and frequency setpoints given to the CPC in grid-forming mode comply with the converter's and ADN devices' operating limits.
The linearized model of the grid is described by constraints (6m) to (6r), which are first-order Taylor expansions of grid-quantities around centroids inferred from the states provided by the CMS. As previously explained, the expansions leverage the use of SCs. To simplify notation, the SCs and the dynamics of the power converters (c.f. Sec. III-B4) are encapsulated in the matrices C y x , D y x ∈ R 3×3 andCȳ x ∈ C 3×3 . More specifically, the latter are defined as where φ, ψ ∈ {a, b, c}, x ∈ {P * k , Q * k , E * s }, k ∈ K, s ∈ S. 8 For more information about the computation of branch-currents and their associated SCs refer to [17]. Finally, constraints 9 (6s) and (6t) describe, respectively, the evolution of the phase-angles (i.e. phases a,b & c) at the downstream (θ dwn ) and the upstream (θ up ) sides of the PCC. The variations of the downstream PCC nodal voltage phase-angles depend on: (i) the integral of the ADN's frequency during the prediction horizon which is given by (5) and (ii) control setpoints variations other than the frequency (i.e. ∆P * k , ∆Q * k , and ∆E * s ) which are given by (6r) where ∆ϕ ∈ R 3 . Unlike the downstream case, the model of the upstream grid is assumed to be unknown. As a result, the frequency of the upstream network is considered constant between control timesteps, which means that the variation of the upstream PCC nodal voltage phase-angles θ up during the prediction horizon (∆T h ) is computed as the integral of the upstream frequency estimate provided by the CMS.
6) Decoupling the full optimization problem: Even though OP1 can be solved in real-time, we propose to go one step further by splitting the downstream PCC nodal voltage magnitudes steering and phase-angles/frequency regulation. The reason behind this is that in OP1 the only constraint where the frequency intervenes with other control variables is (6s), namely the variation of the downstream PCC nodal voltage phase-angles. In practice, in ADNs with low-power rating devices, a change in frequency will have more effect on nodal voltage phase-angles compared to variations of any other control variables (i.e. nodal active and reactive power injections for PQ-nodes and nodal voltage magnitudes for slacknodes). Thus, if control setpoints variations other than the frequency do not lead to big downstream-PCC-nodal-voltagephase-angles' variations, i.e. ∆ϕ φ β f ∆f * , ∀φ ∈ {a, b, c}, OP1 can be reduced to only steer the downstream PCC-nodalvoltage-magnitudes, i.e. all variables and constraints related to the frequency and downstream-PCC-nodal-voltage-phaseangles can be removed from the optimization problem. As a result, the objective is reduced to E P OC − E up,0 2 and constraints (6l), (6r), (6s) and (6t) can be removed. Thus leading to the optimization problem OP2, given by, In parallel to solving OP2, a control law regulating the frequency (FCL2) and, therefore, the nodal voltage phase-angles at the downstream-side of the PCC needs to be derived. We propose an analytical control-law. More specifically, the idea is to equate the downstream phase-angles with the upstream phase-angles at the end of the prediction horizon (∆T h ), in other words, the control-law computes the optimal downstream ADN frequency setpoint that would guarantee nodal voltage 9 The symbol e denotes the three-dimensional vector of ones, that is, phase-angles' alignment at both sides of the PCC after the prediction horizon. Starting from

OP2: min
one can write, using (5) and -as previously explainedassuming that the upstream frequency remains constant during the prediction horizon, from which we isolate the frequency set-point variation ∆f * -that will be sent to the CPC in grid-forming mode -leading to (10).
Finally, in order to guarantee constraint (6l) of the non-decoupled problem, the proposed decoupled frequency control-law, i.e. FCL2, outputs a coerced set-point f * . FCL2 is given by (11).

C. Optimzation problem resolution
As previously explained, thanks to the high update rate of the ADN-CC, computing sub-optimal set-points at each control step is acceptable as it would still succeed at steering, over time, the PCC downstream nodal voltages towards their upstream counterparts (i.e. it does not need to necessarily achieve full-resynchronization in one control step). Thus, solving the convex optimization problem by computing gradientdescent-iterates that converge towards the optimum in a few control timesteps is perfectly fine. In this respect, we propose to solve the optimization problems (i.e. OP1 and OP2) using a projected-gradient-descent-algorithm coupled with a barriermethod. To illustrate how the gradient descent operates, let us consider the following generic-form-optimization-problem: where, in our case, x is the vector of control setpoints variations (i.e. [∆P * k , ∆Q * k , ∆E * s , ∆f * ] for OP1 and [∆P * k , ∆Q * k , ∆E * s ] for OP2, ∀k ∈ K and s ∈ S), g 0 (x) is the objective function, g 1...m (x) are the inequality constraints (i.e. (6a) to (6l) for OP1 and (6a) to (6k) for OP2) and Ax = b the linear equality constraints (i.e. (6m) to (6t) for OP1 and (6m) to (6q) for OP2). As suggested in [21], to approximately solve the problem, the constrained problem is first relaxed into an unconstrained one. Namely, the inequality constraints (g i (x) ≤ 0) are included in the objective function (g 0 (x)) by means of logarithmic barriers c i (x) = − log(−g i (x)), ∀i = 1, . . . , m and the linear equality constraints (Ax = b) are injected into g 0 (x) and each c i (x) by means of direct substitution. This leads to, where the parameter u > 0 tunes the trade-off between optimality and feasibility. The unconstrained optimization problem can be solved using the barrier method as presented in [21]. The barrier method consists in solving a sequence of subproblems, called centering steps, while varying u. Each centering step is composed of several gradient steps. For each gradient step, the step-size is chosen by means of backtracking line search 10 . Indeed, each centering step yields a sequence of iterates x (1) , x (2) , . . . , x (k) , . . . called a central path. The last element of every central path is called the central point.
The subsequent centering step starts at the previous-iteration's central point considering a new objective for the unconstrained optimization problem where u is increased by a factor µ > 0, hence putting more weight on optimality. The first starting point of the first centering and gradient steps is set to 0.
In addition to the barrier method, the vector of setpoints variations is projected onto the feasible set, Γ = {x|g i (x) ≤ 0, ∀i = 1, ..., m}, at the end of each gradient step. The projection is done to: (i) ensure the strict feasibility of each iterate in case some constraints g i ≤ 0 are not strictly ensured by the barrier method, and (ii) make sure that the subsequent gradient descent step starts from a feasible point. A Euclidean projection onto the feasible set is computationally as complex as solving the original optimization problems (i.e. OP1 and OP2). As a result, the Euclidean projection is approximated by the method of alternating projections [22], denoted by Π Γ (x), that is, the projection of x onto the feasible set Γ. Note that, each inequality constraint of the optimization problems OP1 and OP2 defines either a half-space or a disc. Hence, the application of the method of alternating projections to both problems only requires the computation of orthogonal projections onto hyperplanes and circles, which can be done analytically.
The proposed method, coupling the barrier method and the method of alternating projections, to solve the generic-formoptimization-problem is presented in Alg 1. The parameters n c and n g denote the number of centering and gradient steps, respectively. The parameter u 0 is the initial trade-off between optimality and feasibility. We propose to set it to: , 0 < η < 1 meaning that during the first centering step, feasibility is preferred to optimality, thus steering the first central point near the analytic center of the feasible set. 10 Given the complexity of OP1 and OP2, an exact line-search is not used to compute the optimal step-size for each gradient-step. For more information about inexact and exact line-search algorithms see [21]. Parameters: n c , n g , u = u 0 , µ for j = 0 to n c − 1 do # Loop of centering steps for k = 0 to n g − 1 do # Loop of gradient steps Compute step size α (k) using backtracking line search in the direction of −∇h Output: x (ng)

D. PCC-Control synthesis and scalability
To summarize, two methods are proposed to steer the downstream-PCC-nodal-voltage phasors towards their upstream counterparts. The first relies on approximately solving OP1 using Alg. 1 and is applicable to ADNs with high-powerrated CPCs in grid-following mode that can induce nodalvoltage-phase-angle variations comparable to ones resulting from frequency variations. The second relies on using FCL2 together with the approximate solving of OP2 using Alg. 1 and is applicable to ADNs where the induced nodal-voltage-phaseangle variations due to set-point-changes at CPCs in gridfollowing mode are negligible compared to ones following frequency changes. Indeed, for a generic ADN, a-priori loadflow computations should be done to determine which method is best-suited.
Concerning the scalability of the proposed methods, as the grid size increases -e.g. larger number of power grids' nodes and more controllable resources -there are three aspects to consider: 1) Minor delays in the construction of optimization problem objective and constraints 11 ; 2) Minor delays in the execution of Alg. 1.

3)
No delays in the state-estimator and subsequent sending of the state to the ADN-CC: The state estimator problem remains linear and can be solved efficiently.
The first two aspects entail possible minor delays in steering the downstream-PCC-nodal-voltages towards their upstream counterparts as the ADN-CC is forced to have longer control timesteps.

IV. SYNCHROCHECK
As previously mentioned, the proposed synchrocheck strategy relies on an IpDFT-based method that extracts the perphase nodal voltage phasor of both-sides of the PCC then checks whether their differences are within the tolerances given in [2]. If the tolerances are successively respected for a given amount of time, the phasors are deemed synchronised and the PCC breaker can be closed (i.e. the process of reconnecting the ADN to its upstream-grid is green-lighted). In the following, first the IpDFT-based method for phasor estimation is presented, then, an algorithmic formulation of the full synchrocheck algorithm of the SYNCHRO block (see Fig. 1) is presented.

A. IpDFT-based phasor extraction
The IpDFT-based phasor extraction used in this work is the enhanced-IpDFT (e-IpDFT) method presented in [23]. In the following, we briefly summarize the basics of e-IpDFT. Assuming that an electrical quantity ( l p ) can be modelled in time by a main tone varying around a rated frequency f rate (i.e. neglecting harmonics, DC offsets and amplitude and/or phase modulations) and is sampled, e.g. by a PMU, with a frequency f sam = 1/t sam over a time window T win (= D × t sam , where D is the number of samples per sampling period t sam ) short-enough to assume stationarity, one can write where l p , f p and φ p are the amplitude, frequency and phaseangle of the main-tone that will be estimated. Following the assumptions in [23] and assuming the use of the Hanning windowing function with a window sequence {w(d)}, the DFT of (12) can be written as, w(d) and κ d = 2πd/D. Following the assumptions in [23], the true frequency f p is situated between two successive DFT bins and can be expressed, as a function of the DFT frequency resolution 1/T win , as with −0.5 < δ ≤ 0.5 being the deviation of f p from the frequency with the maximum DFT bin (i.e. m 1 T win ). From there, as explained in [23], with ψ = sign | L p (m 1 + 1)| − | L p (m 1 − 1)| , one can directly write, where As explained in [23], from this point, one can go a step further by trying to remove the spectral interference due to the negative image of the DFT spectrum from the positive binsused-in (15). To do so, first, the DFT of (12) is re-expressed as, Finally, substituting (14) in (17) can lead to an improved δ, namely, Thus, the final-e-IpDFT-estimates for nodal-voltage magnitudes, phase-angle and frequency are respectively given by l p ( δ), φ p ( δ) and f p ( δ).

B. Full Synchrocheck algorithm
Alg. 2 summarizes the proposed synchrocheck algorithm running on the SYNCHRO block with the a refresh-period ∆T SY N . Taking as input samples of the three-phase upstream ( E up (d)) and downstream ( E dwn (d)) PCC nodal voltages, it computes the magnitude, phase-angles and frequencies of all the signals using the e-IpDFT method presented in Sec. IV-A and checks whether, for each phase, the differences between the phasors are within the bounds, i.e. tol E = 10%, tol φ = 0.34 rad and tol f = 0.3 Hz, presented in [2]. If all criteria are satisfied, the intra-iteration counter (Count) is updated. If all constraints are satisfied for several subsequent timesteps (i.e. Count is larger or equal than an input parameter n syn ), the boolean-flag-output of Alg. 2, i.e. SYNC, is set to 1, otherwise, it is set to 0. Setting SYNC to 1 confirms the synchronization of the inputted three-phase signals which means that the PCC breaker can be securely closed.

A. Setup
The experimental validation of the proposed PCC-control and synchrocheck algorithms was done on the EPFL-DESL microgrid [24]. Fig. 3 shows a schematic depiction of the ADN with its base-values. The EPFL-DESL-ADN is a three-phase replica of the CIGRE benchmark microgrid whose description and branch parameters can be found in [25]. The PMUs of the ADN are all streaming measurements to the phasor-dataconcentrator of the CMS (unit that runs the state-estimationprocess). The agents in Fig. 3 are software-based units that can monitor and explicitly-control the resources they are connected Algorithm 2 Proposed synchrocheck

B. Experimental Notes
For the ADC-CC block, due to the relatively low-power rating of the resources in the EPFL-DESL microgrid, the decoupled-gradient-decent method presented in Sec. III-D is used in this paper's experimental-validation. The controlperiod ∆T and the prediction-horizon ∆T h of the ADN-CC were set to, respectively, 100 ms and 300 ms. The number of centering-steps n c , gradient-steps n g , the reduction parameter µ and the scaling parameter η of Alg. 1 were set to, respectively, 3, 5, 10 and 0.1. As previously stated, the backtracking-line-search algorithm (BLSA) used in Alg. 1 is the one presented in [21, pp. 33-35]. The latter's reduction factor of the step-size, minimum admissible decrease in the objective and maximum number of iterations, are set to, respectively, 0.5, 0.3 and 10. The latter parameters are chosen to ensure that during the BLSA's last iteration the setpoints residues are negligible. Furthermore, in the implemented version of Algo. 1, the alternating-projections method is made more conservative. Indeed, projecting exactly onto a constraint might be problematic since the logarithmic barrier of a binding inequality constraint is undefined. Therefore, numerical issues are avoided by projecting onto constraints with a margin of 1% inwards the feasibility regions of said constraints.
For the SYNCHRO block, a refresh period T SY N of 50 ms is chosen and the number of successive positive tolerances check to declare synchronization n syn is set to 20.
Finally, in its present form, the EPFL-DESL microgrid is practically a balanced three-phase grid. As a result, in the ADC-CC block the unbalanced constraints (6f)-(6g) are always verified. Consequently, in the next section, only the values of nodal-voltages and branch-currents of phase a of the microgrid are shown.
The results of the experiment are shown in Figs. 4 to 6. At t = 1 s the resynchronization process (i.e. ADN-CC) is activated. In a few iterations (∼300 ms) the grid is forced into 13 The low active peak power of the PV plants was due to the fact that experiments were held on a cloudy day. the feasibility set as shown in Figs. 5 & 6. Simultaneously, the realignment of the PCC nodal-voltage phasors is pursued and is achieved at t = 2.5 s, i.e. 1.5 s after the beginning of the resynchronization process. The alignment is guaranteed for the rest of the simulation as seen by the green-rectangles in Fig. 4. Fig. 4 shows that the proposed synchrocheck detects synchronization exactly 1 s after the criteria were met. This is perfectly in-line with our design choice as the SYNCHRO block's refresh period is set to 50 ms and the number of positive-successive-tolerances checks needed for it to detect synchronism is set to 20, i.e. synchronisation should be detected after 1 s of successive tolerance checks. To further benchmark our method, Fig. 4 shows that the Micom P143 relay [14] (Schneider SYNCHRO) also detects synchronism at t = 2.5 s. It is important to note that, the Micom P143's synchronism check relies on the three-phase balanceness of the upstream-grid and only senses phase-a of the nodal voltage signal of the upstream grid. The developed synchrocheck does not rely on such assumption and is therefore more robust against upstream-grid-irregularities. Finally, it can be seen that some resource injections (and consequently some branchcurrents) keep oscillating after the synchronization (i.e. after the 2.5 s mark), this is due to the gradient-descent-nature of the proposed PCC-control process that is naturally oscillating around a feasible equilibrium. Such oscillations can be reduced through the tuning of the parameters of Alg. 1 (e.g. retuning the BLSA parameters, the scaling parameter and/or the reduction parameter). VI. CONCLUSION This paper proposed: (i) a centralised PCC-control in the form of an algorithm that approximately solves an OPF aiming to steer an ADN's downstream PCC nodal voltages towards their upstream counterparts while guaranteeing threephase-unbalanced operational, i.e. static and power-quality, constraints for the ADN, and (ii) a synchrocheck algorithm relying on e-IpDFT phasor extraction to determine whether two three-phase phasors are aligned or not. Both contributions were experimentally validated on the EPFL-DESL microgrid. The proposed synchrocheck was further benchmarked against a Micom P143 grid-relay with synchronism check provided by Schneider Electric [14]. Unlike the proposed methods, the Micom P143 is designed to only detect, i.e. no resource control, synchronization and relies on the assumption that the PCC upstream nodal voltages are perfectly balanced.
The experimental validation showed that within 1.5 s the resynchronisation of PCC nodal-voltages was achieved by the proposed algorithm even if the process was launched when the islanded-microgrid was in an infeasible state. Finally, due to its present configuration, the tested microgrid was operating in a balanced three-phase condition which lacked in showcasing the ability of the proposed PCC-control algorithm to deal with unbalances. As a result, following planned three-phase controlenabling-expansions of the EPFL-DESL microgrid, further experimental validations will be carried out to showcase the ability to securely resynchronize an ADN to its upstream grid while not only guaranteeing static but also power-quality operational constraints.