Iterative Approach for Tuning Multiple Converter-Integrated DER in Microgrids

This paper proposes an iterative approach to adjust the control parameters of multiple power converters within a microgrid, which operates in grid-connected and grid-islanded modes. The adequate control parameters are determined using an op-timisation-based strategy, local measurements, and results obtained in previous algorithm iterations. The proposed objective function is based on the integral time-weighted absolute error (ITAE), modiﬁed to improve the microgrid control performance. The proposed approach addresses the control tuning complexity by considering an incremental strategy, starting from adjusting basic microgrids, continuing to the setting of intermediate microgrids, and ﬁnalising when the target microgrid control is ﬁne adjusted. The results obtained at the CIGRE LV benchmark microgrid validate the proposal, obtaining during faults, the maximum deviations from rated frequency around 2.2% and 0.3% in grid-islanded or grid-connected cases, re-spectively. Also, voltage and power references are adequately followed during steady-state regardless of the microgrid operation mode, where the steady voltage proﬁle is below 10% variation. The obtained results demonstrate the proposed approach advantages, which straightforwardly adjust multiple converters integrated into a microgrid. The main contributions are as follows: (a) the microgrid model is not required, and (b) only measurements at the point of common coupling of the distributed energy resource are used; consequently, the proposed tuning approach is especially applicable to complex microgrids. Finally, ﬁnely adjusted microgrids are required for further operation or protection studies where complex system conﬁgurations are commonly required.


Motivation.
Distributed energy resources (DER) are integrated into the electric network as these represent technical and economic benefits [1]. Nevertheless, the study of DER integration is an issue considering the compromise between the model detail and the system size; frequently, when detailed representations are considered is at the expense of the microgrid size [2][3][4].
Power electronic devices such as the voltage source converter (VSC) are generally used to integrate DER into the AC microgrid. e VSC is a nonlinear device that requires several control layers, which are considered by the microgrid hierarchical control [5]. ese control schemes are usually based on proportional-integral (PI) strategies, whose parameters are cautiously selected to obtain an adequate microgrid behaviour [3,[6][7][8][9][10][11][12].
On the other hand, operation or protection studies require realistic microgrids, including several converter-integrated DER (CIDER), loads, and lines. Such microgrids can be operated in grid-islanded and grid-connected modes, requiring the zero and the primary control layers. e latter is used when the microgrid operates in grid-islanded mode, while the former is required under grid-connected and gridislanded cases. As above exposed, the requirement of realistic size microgrids, which must be adequately controlled, is an issue nowadays. Even though adjusting the PI control constants is considered in many proposals, a standard process is not available, which makes the microgrid adjustment from scratch difficult. Consequently, it is desirable to obtain a simple and effective method that allows researchers to design and adjust multi-CIDER microgrids straightforwardly, and then deeper and detailed studies can be developed [13].
In this way, this research is oriented to develop an offline approach to obtain adequate CIDER control parameters within a realistic size microgrid. e approach considers decentralised control strategies, several DER models, gridislanded and grid-connected modes, local measurements, and different microgrid operating conditions.

State of the Art.
Most of the proposed strategies to determine the VSC control parameters aim for optimal tuning. ese can be divided into three approaches: (a) ese that consider the physical model of the controlled system, where the control parameters are obtained using exact techniques or a combination of exact and nonexact techniques. (b) ese that use a transfer function equivalent model for the controlled system, where exact or nonexact tuning techniques are predominant and mixed techniques are also available. (c) ese where the controlled system model is not considered and nonexact tuning techniques are usually applied.
A tuning strategy based on the model is usually preferred since the optimal solution is obtained; nonetheless, the determination of VSC and microgrid dynamic models can be challenging in realistic size microgrids. As a consequence, the last two approaches are widely considered.

Tuning Approaches considering the Physical Component Modelling of the Controlled System.
In general, the controlled system model has more parameters as the complexity and size increase. In this approach, the models describe the behaviour of the components and consider at least the small-signal system model. Nonetheless, the model complexity is not always the same in microgrids since each of these include different considerations or components. e following paragraphs present some examples. In [2], a smallsignal model (SSM) described a microgrid with three VSCs, which included 55 state variables and considered internal model control (IMC) complemented with particle swarm optimisation (PSO). In [14], an eigenvalue analysis defined the PSO objective function and state equations described the main elements of the microgrid; then [14] considers both model and measures of the system. Finally, [15] propose a 2-VSC test microgrid represented by the state-space model; the search space and objective function of a modified whale optimisation (WO) technique were obtained from the eigenvalue analysis. In the two latter references, the optimisation strategy and the objective function definition were as crucial as the modelling process. However, the system size and number of VSCs were small due to model size. Furthermore, strong disturbances as short circuits were not deeply analysed.
Additionally, even though [16,17] do not consider a tuning technique, these references presented considerations for microgrid and VSC modelling; these are suitable examples of how daunting, a time-consuming and challenging task is the adjusting of an adequate microgrid model. In [17], the VSC model was analysed, and a proposal for VSC 6th order model was validated through the small-signal model and eigenvalue analysis. In [16], the IEEE37 bus system was modified to include 7 VSCs; as a result, the small-signal model of the whole microgrid reached 225th order, which was reduced to a 56-order system model. Finally, in [18], three types of controllers were tuned by using a small-signal model and the gravity centre of a stable area; however, only one VSC was considered in the test system.

Tuning Approaches considering the Transfer Function Equivalent Modelling of the Controlled System.
is approach is usually applied due to the entire microgrid model complexity; then, simplified transfer functions are considered. Usually, this tuning process does not include microgrid interaction or additional elements besides the VSC. Moreover, the simplifications to obtain TF equivalent make the obtained solutions inadequate for all operating conditions [19]. erefore, the VSC can be modelled by an equivalent first-order transfer function (TF). is tuning approach is considered in the following papers. In [10], a VSC dominant pole TF and pole placement method were considered. Also, in [20], a zero-level TF for the VSC zero control was complemented with fuzzy logic; then, the system response under small and large signal disturbances was enhanced. In [21], the state-space representation of the microgrid was simplified to a TF, and IMC was applied to obtain adequate VSC behaviour under grid transition. In [22], the gridforming mode of operation was studied, TFs and restrictions in the frequency domain (s) were applied to define boundaries for the primary control parameters and also explored with different primary control strategies. In [23], the simplified microgrid TFs and eigenvalue analysis was carried away. However, it was remarked that a strict mathematical formulation of the optimisation problem was not acquirable, so the solution was obtained through a genetic algorithm (GA) and validated through eigenvalues. Additionally, even though the control parameters selection was not evident in [24], it considered the microgrid modelling using TFs, analysing stability issues and phase-locked loop (PLL) bandwidth, and it also included multiple-input multiple-output (MIMO) representation and parameters boundaries. Finally, it was usual to validate the proposals using a reduced and simplified test system in the references above.

Tuning Approaches Which Do Not
Require the Model of the Controlled System. As described in the two previous tuning approaches (model-based approaches), the microgrid model can differ from one work to another, leading to confusion when implementing and tuning a microgrid from scratch. Moreover, even with the model acquirement, a nonexact technique was usually considered since the model used to determine the control parameters was quite complex in many cases. erefore, this third approach avoids the modelling stage for the control tuning but requires the definition of an optimisation function (OF). As the microgrid model is not considered or is unknown, OF is based on the error in the signals of interest. Also, nonexact techniques are applied, which means that the obtained solution is the best from all explored solutions. As an advantage, this is a fast and straightforward approach, where OF can be estimated using local measurements.
On the other hand, nonexact techniques are a wide field of research in microgrid applications, especially when the system size conduces to a complex model. Among these techniques, [25] presented a review of the operation cost, concluding that swarm strategies had the best performance. Other proposals, as presented in [26], applied PSO to adjust the primary level control for a simplified microgrid. Additionally, in [12], the grey wolf optimisation (GWO) adjusted the control parameters for a wind turbine generator. In [6], the zero-level control for a simplified wind-battery microgrid was adjusted using GA. In [27], the PSO was applied to train a modified fuzzy controller, where tests were compared to PI controller regarding power-sharing and frequency regulation.
As a result of state of the art, the main characteristics of references with control tuning strategies are summarised in Table 1. is table includes for comparison purposes the system model, the applied tuning technique, the adjusted control, the signals used for control adjustment, commonly power, voltage, and frequency; in some cases, also damping coefficient ξ and the real part of eigenvalues Re(λ i ) were also used. Table 1 also includes the microgrid operating mode, the test system size, and the proposal scalability.
From the comparison table, small test systems were noticed in most cases. Some approaches, as [28,29], used large test systems, but the use of communication systems jeopardised the overall microgrid behaviour. is last aspect is not considered in the proposal presented in this paper since primary and zero control layers are decentralised, no communication links are required, constituting an essential advantage by reducing costs and reliability issues. e comparison in Table 1 allows concluding about the proposal scalability, where qualitative labels, low, medium, or high, are considered. Low scalability means a proposal that was not clearly validated nor presented to be implemented in realistic size microgrids and also a proposal that presents a high dependence of correct microgrid modelling. Medium scalability means a proposal that addressed the tuning problem with a high potentiality for implementation on realistic size microgrids, mainly for the flexibility to partially or totally dismiss the microgrid model, which is complex to obtain in realistic microgrids. High scalability is associated with a proposal that addresses the tuning problem and can be easily implemented in realistic size microgrids. Additionally, the proposal presented in this paper has adequate results with low modelling efforts and can be straightforwardly implemented in several microgrids, regardless of the operating mode.

Contribution.
e paper proposes a straightforward approach to define the control parameters, applied to tune realistic size microgrids with several CIDERs, operating in grid-connected and grid-islanded modes. e considered CIDER representation includes the primary energy resource, the VSC, and the output filter. Additionally, as the microgrid model is not required, the proposed strategy can tune controls of complex microgrids. In the proposal, only measurements at the CIDER point of common coupling (PCC) are considered and compared with a reference signal to calculate OF, minimised through an iterative strategy based on an optimisation technique. ese measurements contain information about the CIDER's behaviour and the remaining part of the microgrid. e proposed approach allows the tune of the control parameters easily; besides, it can be applied to multiple CIDER microgrids. As the used measurements contain the microgrid response under different disturbances, the obtained control parameters allow the stable behaviour for a wide range of operating conditions. is approach speeds up other studies since an adequately tuned microgrid control is the base of upcoming operation or protection analysis.

Paper Organisation.
is document is divided into five sections. In Section 2, the required fundamental theoretical aspects related to the control of CIDERs are exposed, while in Section 3, the proposed approach is described. Later, Section 4 presents the proposed tests, their results, and the corresponding analysis. Finally, Section 5 highlights the conclusions.

Control of Converter-Interfaced Distributed Energy Resources
is section briefly introduces the fundamental aspects of microgrid hierarchical control, which comprises four layers known as zero, primary, secondary, and tertiary [4,5,30,31]. Zero layer control is the VSC local control, including the inner and outer loops. e primary level controls the voltage, frequency, and power-sharing. e secondary level improves the quality of voltage and frequency and is in charge of islanding detection. e tertiary level deals with the optimal power flow and the unit commitment in microgrids.
Specifically, this proposal discusses the zero-level control for grid-following CIDERs, while the zero and primary level controls are analysed in the grid-forming CIDERs. e zerolevel control for the grid-following CIDERs aims to deliver the reference power imposed by the secondary and tertiary control, while the microgrid is in grid-connected mode. e zero-level control requires proportional and integral parameters (k P1 , k I1 ), as depicted in Figure 1. e respective set International Transactions on Electrical Energy Systems of equations for the inner loop is presented in equation (1), while the outer loop is represented by equation set (2).
where U d and U q are the dq voltage references for the VSC, which at the same time are the output of the inner loop. Variables u d , u q and i d , i q are the dq voltages and currents measured at VSC PCC, which come from the Park transformation of u abc and i abc . ω is the system frequency while θ is the angle reference for the Park transformation. L is the filter inductance. k P 1 and k I 1 are the proportional and integral gains, respectively, for the PI controller.
where i d  (1). e grid-forming CIDER regulates frequency and voltage in grid-islanded mode. It requires three pairs of parameters in the zero-level control, namely, (k P2 , k I2 ) for the inner loop and (k P3 , k I3 ) for the outer loop. Additionally, the primary control requires the parameters related to active and reactive power (m p , m q ), as depicted in Figure 2. In the case of the grid-forming CIDER, the set of equations for the inner loop is the same as presented in (1), where the PI gains are now k P 2 and k I 2 ; the outer loop is represented by equation set (3). Droop equations describe the primary control in (4) and (5).
where C is the filter capacitance, k P 3 and k I 3 where u d ref is the voltage reference in the direct axis for the outer loop in (3) As a result, two parameters have to be tuned for each grid-following CIDER (k P1 and k I1 k I1 ), while six are required for each grid-forming CIDER (k P2 , k I2 , k P3 , k I3 , m q , and m p ).

Proposed Iterative and Incremental
Approach for CIDER Tuning is section presents a three-stage approach to adjust the control parameters of several CIDERs within a target microgrid. Each CIDER uses the control scheme in Figures 1 or 2 for grid-following and grid-forming operating modes, respectively. e structure of the proposed approach is presented in Figure 3. It starts by identifying the target microgrid and defining the basic microgrids as is presented in stage 1. e target microgrid is defined as the complex system of interest to the network analyst, while the basic microgrids are simplifications that consist of a single CIDER connected to a load through a line, as presented in Figure 4. Next, in Stages 2 and 3, the controls of basic microgrids are optimally adjusted; then, these tuned microgrids are used to obtain intermediate microgrids by adding lines, loads, or CIDERs. ese intermediate microgrids are iteratively enlarged and tuned, using an optimisation strategy based on the measurements at the CIDER PCC. Finally, the target microgrid is obtained and tuned as a result of this iterative process.

Stage 1: Identification of the Target and Definition of the Basic Microgrids.
is stage is devoted to identifying the target microgrid's characteristics and defining the two basic microgrids used for the CIDER control adjustment. us, instead of initially handling the target microgrid, two basic microgrids presented in Figure 4 are defined in this stage. e first basic microgrid presented in Figure 4(a) operates in grid-connected mode and includes a single grid-following CIDER. e second operates in grid-islanded mode and considers only one grid-forming CIDER, as depicted in Figure 4(b). e size of the CIDER, line, and load in the basic microgrids is defined considering the target microgrid rated values.
ese basic microgrids are initially tuned as presented in stage two; next, these are used to define the intermediate microgrids, as presented in stage three.

Stage 2: Optimisation of the CIDER Control Parameters.
Stage two focuses on determining the optimal control parameters for the CIDERs within a microgrid. In this stage, three main processes are proposed: (a) the objective function (OF) is defined, and an improvement criterion is also established to evaluate the control parameters. (b) A control parameter database is used to improve the odds of reaching a proper solution by the optimisation strategy. (c) e required microgrid control parameters are obtained from the execution of an optimisation process.

Definition of OF.
e OF is defined based on a modified ITAE index to consider evenly time-weighted measurements. e required variables are measured at the CIDER PCC. is index is a robust alternative frequently used for error estimation between two signals, which in this  case corresponds to the measured and the reference signals [32,33]. Initially, for a single CIDER and a signal of interest (x), the desired time window contains the microgrid response under a single disturbance, for example, short circuit and load change. is window is represented in Figure 5 and has a fixed time length (T); an initial time (t 0 ), corresponding to the first sample of interest (k � 1); and a total of K samples, which are defined according to the window length and the sampling time (t smpl ). e ITAE index for the signals in Figure 5 is defined as in equation where Δx(k) � x(k) reference − x(k) measured . Next, as several disturbances (d) are considered, the ITAE in equation (6) becomes where D is the number of considered disturbances. Additionally, several signals (s), such as voltage and current, are considered; then Δx contains a set of signals. Similarly, as the signals of interest differ according to the CIDER operating mode, the average error per signal is preferred. ese considerations turn equation (7) into (8), which is obtained for each CIDER (c).
where S is the number of considered signals at each CIDER c.
After that, ITAE c is estimated separately for the gridforming (C form ) and grid-following (C foll ) CIDERs. e evaluation of (9) is therefore performed.
Finally, the ITAE total is defined as the OF and presented in (10), which allows comparing CIDERs behaviour.
In (10), α is an adjustable weighting factor that gives relevance to either grid-forming or grid-following CIDERs, considering values from 0 to 1. In the grid-islanded microgrid, the weighting factor emphasises the fine parameter selection of the grid-forming CIDERs, while in the grid-connected microgrid, the importance is focused on the grid-following CIDERs.

Definition of the Control Parameter Database.
e purpose of the control parameter database is to initialise the parameters for the CIDERs within the microgrid.
Initially, this database is empty; then, control parameters at first executions of the optimisation process, which consider the basic microgrids, are obtained from empirical tuning methods or reported control parameters for similar applications, as these presented in [10,12,34]. After several iterations, this database also contains parameters obtained from the optimisation process, which is iteratively executed due to several intermediate microgrids being considered. It is necessary to execute the optimisation process multiple times since the CIDERs optimal control parameters are not the same in each microgrid. en, the number of executions of the optimisation process is given by the criteria at stage 3 as International Transactions on Electrical Energy Systems 7 Continue to the optimisation process execution, ∀ψ ≥ Y, where Y is a positive integer greater than 1. Finally, the parameters in the database are inputs for the optimisation strategy; then, as the information of previous solutions is available, the optimiser is more likely to find a proper solution in the actual iteration.

Execution of the Optimisation Process.
e considered optimisation problem is oriented to minimise the objective function (OF), selecting adequate CIDER control parameters (par), as presented in (12) Figure 6 portrays the process to minimise the OF, as proposed in (10). e initial set of parameters (par 1 ) is obtained from the database, as previously described. e OF is estimated using these parameters at the CIDERs control and the measured signals of interest. e OF i estimated in the internal iteration (i) is compared to the previous OF i−1 to calculate the tolerance. If the tolerance is lower than the desired value (ξ), then the best control parameters for the CIDERs control are obtained (par best ), which ends the execution of the optimisation process. Otherwise, the optimisation strategy selects a new set of parameters to be evaluated in the CIDER control.
Variable par is composed of two or six parameters for each grid-following or grid-forming CIDER, respectively. Additionally, since the number of parameters increases with each CIDER in the microgrid, these are grouped, and each group uses the same control parameters. us, the parameters sought by the optimisation strategy are given by (13).
e CIDERs are grouped considering this distance to the main grid connection node in the gridconnected case or to the grid-forming CIDER in the gridislanded case.
where Gr foll and Gr form are the number of groups for gridfollowing and grid-forming CIDERs, respectively.

Stage 3: Enlarging the Basic Microgrids.
is stage focuses on increasing the complexity of the defined basic microgrids until they become the target microgrid. erefore, new microgrids, known as intermediate microgrids, are iteratively generated and used to increase the control parameters database and analyse different microgrid topology or CIDER operating modes. In that way, once stage 2 is completed, a checkpoint verifies whether the two basic microgrids are already tuned, a case in which an intermediate microgrid is generated by adding p − type elements to the actual microgrid. Here, p − type refers to an element as line-type, load-type, or CIDER-type.
Once these elements are added, the proposal verifies whether the obtained intermediate microgrid is the same as the target microgrid, the case in which the optimisation process is executed for the last time, and the best control parameters for the target microgrid are obtained. If the intermediate microgrid differs from the target microgrid, its OF is calculated and compared to a limit value of Y times the best obtained OF, as in (11). When the limit value is surpassed, the optimisation process is once again executed. Otherwise, more elements are added to the actual microgrid, and then another intermediate microgrid is generated. is iterative strategy continues until the target microgrid is adequately controlled.

Tests and Discussion
is section presents the test results that validate the proposed approach, aiming to adjust the CIDER control parameters within a complex microgrid. Measurements at the CIDERs PCC and PSO are used in this paper considering previous satisfactory results [35], although the proposed approach allows other techniques as these presented in [25].
Initially, the target and the basic microgrids are presented; next, the results for the basic microgrid considering two testing scenarios. After, the analysis of one of the intermediate microgrids is presented, and finally, the last part presents the result analysis of the target microgrid tuned using the proposed approach.

Test System.
e target microgrid selected for tests is based on the CIGRE LV benchmark [36] and has 170 kVA maximum load, operating in islanded or connected modes as presented in Figure 7. e basic microgrids have a single 100 kW CIDER (as CIDER 5), 2/0 AWG conductor, 100 m line, and 80 kVA load.

Testing Operating Conditions for the Basic Microgrids.
e adequate signals used in evaluating the OF defined in (10) consider two testing scenarios in the case of basic microgrids. e first testing scenario is oriented to evaluate the dq currents or voltages, considering the CIDER control based on the dq frame. On the other hand, as the measurements are in the abc frame, the second scenario considers the active and reactive power signals and the RMS voltage to evaluate the OF. Frequency is considered in both scenarios.Finally, the testing operating condition for basic microgrids considers disturbances, including a three-phase fault (R f � 1.0Ω) at 0.20 s, and load changes of 15% and 8 International Transactions on Electrical Energy Systems 50% of the CIDER rated value at 0.56 s for grid-islanded and grid-connected cases, respectively.

Results for Grid-Following CIDER in the Basic Grid-Connected Microgrid.
In this case, both scenarios behave alike in the measured signals (i d , i q , P, and Q), which have a stable and flawless response after the load change and the fault clearance; then, no advantage of the dq frame scenario over the abc frame scenario is noticed. For comparison purposes, in the dq frame scenario, the OF best value is 5.13 when estimated using i d and i q i q , whereas it is 208.4 when P and Q are used. In the abc frame scenario, the OF is 5.91 when using i d and i q i q , whereas it is 208.1 with P and Q. en, the dq frame scenario is, on average, slightly better. Despite both scenarios being similar and valid to obtain control parameters, the dq frame scenario is selected. Still, the best parameters obtained in both scenarios are used as nourishment for the control parameter database. e best control parameters for the CIDER in the basic grid-connected microgrid are [k P1 , k I1 ] � [10.352 421.962].

Results for Grid-Forming CIDER in the Basic Grid-Islanded Microgrid.
e differences between scenarios in the grid-forming CIDER are bigger than in the grid-following case. erefore, in the dq frame scenario, the OF is 17.65 with u d , u q , and f, whereas it is 28.34 when u rms and f are used; on the other hand, the abc frame scenario has an OF of 40.13 with u d , u q , and f, whereas it is 11.90 with u rms and f. As a consequence, the dq frame scenario has slightly better performance, as is presented in Figure 8. Also, it is shown that the smaller difference is obtained for the i d signal, which under fault has a slightly higher overshoot in the dq frame scenario; however, it also recovers faster than the abc frame scenario. Still, results from both scenarios enrich the control parameter database. Finally, the best control parameters for the CIDER in the basic grid-islanded microgrid are

Analysis of the Intermediate Microgrids.
e evolution of the two basic microgrids towards the target microgrid is achieved at stage three of the proposed methodology. is   International Transactions on Electrical Energy Systems stage is the most complex since it handles the microgrid enlarging by adding a line, load, and CIDER-type elements. Adding elements raises the microgrid's complexity, whose behaviour is mainly jeopardised by the CIDER-type elements due to their nonlinear behaviour. As these elements cause significant increments in the OF, then one of the intermediate microgrids obtained by adding line and load-type elements and only the CIDER 5 to the basic grid-connected, resulting in the same topology presented in Figure 7, is here analysed as an example of the tuning process. In this case and using the same control parameters as in the basic microgrid, the obtained OF value is 6.37. e OF is severely varied when changing the location, rated power, and the number of CIDER-type elements; for example, changing the CIDER location from N6 to N5 causes an OF value of 9.06, while it rises to 94.85 or 268.11 when the CIDER rated power is reduced to 50 kW or 20 kW, respectively. Similar results are obtained from the intermediate microgrids based on the gridislanded basic microgrid. A high OF is related to strong and fast signal oscillations in both grid-islanded and gridconnected cases. e aspects mentioned above allow determining Y value. is is greater than 1, but not too small, never to stop the iteration process, and not too big that an intermediate microgrid with lousy behaviour (high oscillations or lowquality voltage or frequency signals) misses the optimisation process. A value of Y � 5 is considered.
Finally, the addition of CIDER-type elements causes drastic changes in OF that usually activate the optimisation process execution; that is, the associated OF is higher than 5 times OF best . For instance, in the intermediate microgrid, a second CIDER at N8 produces OF � 138.43, which is around 27 times larger than the OF best until the present iteration (OF best until now results from the grid-connected basic microgrid and is 5.13), activating the optimisation process. e sequence mentioned above for intermediate microgrid definition and performance evaluation is executed until the target microgrid is obtained.

Analysis of Target Microgrid.
is section summarises the optimisation process results for the CIDER control parameters and the target microgrid overall behaviour.

Control Parameters Obtained by the Optimisation
Process.
e target microgrid in Figure 7 operates in gridconnected or grid-islanded modes. During grid-connected, all CIDERs are grid-followers, while in grid-islanded, it has a single grid-forming at node N6. e best CIDER parameters for both microgrid operating modes are different, as presented in Tables 2 and 3. Additionally, Gr foll � 2 and Gr form � 1, and the criteria for assigning a CIDER to a certain group are related to the distance from the slack node (N1 in grid-connected mode or N6 in grid-islanded mode).    International Transactions on Electrical Energy Systems

Testing Operating Conditions for Target Microgrid.
Target microgrid contains intentional grid transition; then, CIDER 5 is selected to operate in grid-forming and gridfollowing modes according to the t sw state, while the remaining CIDERs only operate in grid-following mode. e best control parameters for grid-islanded and gridconnected modes are used while considering grid transition. As presented in Figure 9, the initial time instant of interest is 1 s. is is because at any time earlier, the considered CIDERs are in a start-up state, where grid-forming CIDER starts first, and grid-following CIDERs start sequentially to reduce stability issues. e aforementioned start-up sequence is similar to a plug and plays capability in the grid-following CIDERs. e main observations from the obtained results are as follows: (a) CIDER 5 maintains frequency and voltage during grid-islanded mode; (b) load changes during gridislanded mode are adequately compensated by the gridforming CIDER; (c) all CIDERs recover flawlessly after the three-phase fault, including voltage sags and frequency variations regardless of the microgrid operative mode; however, disturbances are severer in the grid-islanded mode; (d) the grid transition is supported by the microgrid, which forces CIDER 5 to follow power reference (Figure 9(a)) and voltage levels in all CIDERs are increased to slightly better values (Figure 9(b)). Additionally, the highest frequency disturbance is caused by the three-phase fault in the grid-islanded mode, followed by the grid transition as presented in Figure 9(c); however, all CIDERs measurements are consistent and stable under the analysed time window.
As presented, the proposed approach is successfully applied and validated to adjust the control parameters of several CIDERs within a complex microgrid and tested under several disturbances, including intentional grid transition.

Conclusions
Nowadays, the modelling of realistic size microgrids requires several studies. Nevertheless, the study of DER integration is an issue considering the compromise between the model detail and the system size; frequently, the microgrid size is reduced when detailed representations are considered. e proposed approach considers two basic microgrids used to iteratively enlarge the system towards the desired target microgrid. e approach helps to obtain an adequate microgrid behaviour because lines, loads, and CIDERs are sequentially added; then, the control parameters are updated considering the settings in the previous iterations and a parameter database. e application of the proposed approach is straightforward, as it avoids detailed modelling of the microgrid and the CIDER. As a consequence of simplifying the modelling efforts and reducing the computational burden, suitable solutions for larger systems, including several CIDERs, are obtained, which constitute relevant advantages of the proposal over those approaches usually addressed by the cited references. Moreover, the proposed objective function considers measurements under different system states; transient and small-signal stability is also addressed.
As demonstrated in the testing section, the proposal is validated and successfully applied to adjust the control parameters of several CIDERs in a complex microgrid, whose behaviour is analysed under small and strong disturbances, including load changes, faults, and intentional grid transition. Moreover, the proposed approach optimally adjusts CIDERs for operating under grid-connected or gridislanded microgrid modes; consequently, considering the observed results, the obtained microgrid and CIDER parameters configuration adequately supports grid transition.  is corroborates the suitability of the proposed iterative and optimisation-driven approach.
is proposal is also an integrated approach since it iteratively considers several systems prior to the target microgrid study. Also, the proposal considers parameter results from other works or systems, which enables the proposal to embrace many other proposals as an initial point database.
Additionally, the fine selection of the CIDER control parameters in a target microgrid influences the system stability since, in the case of a deficient adjustment process, high oscillations and time responses may lead to issues. In the performed tests, disturbances affecting small-signal and transient stability are indirectly considered by including the measured signals at the optimisation process. ese stability studies are challenging to consider in other approaches due to the complexity of the system modelling; then, this fact validates an additional demonstrated proposal advantage.
Finally, the main contribution is to propose and validate an off-line approach to optimally adjust the control parameters of a multiple CIDER microgrid, considering only local measurements at the objective function. is function is evaluated considering several microgrid operating conditions such as grid transition, power system faults, and load changes. e proposed approach accelerates microgrid studies since fine control adjustment is mandatory to obtain adequate test systems for studying further operation or protection issues.

AC:
Alternating current CIDER: Converter-integrated distributed energy resource DER: Distributed energy resource GA: Genetic algorithm GWO: Grey wolf optimisation IMC: Internal model control ITAE: Integral of time-weighted absolute error MIMO: Multiple-input multiple-output OF: Objective function PCC: Point of common coupling PI: Proportional-integral PLL: Phase-locked loop PSO: Particle swarm optimisation SSM: Small-signal model TF: Transfer function VSC: Voltage source converter WO: Whale optimisation.