## 1. Introduction

As an important distribution system, a microgrid integrates a variety of renewable and traditional distributed generations and different loads [

1]. How to design optimal controllers to guarantee that the microgrid operates well in both islanded and grid-connected modes is one of the critical issues in the microgrid research area [

2,

3,

4,

5,

6]. More specifically, it is important to control the voltage and frequency of each power converter connected to each distributed generation, called the VF control, in the islanded mode while it is necessary to regulate the output active and reactive powers of each distributed generation, called the P-Q control in the grid-connected mode. Some recent works have studied the optimal voltage control issue of the distribution systems in the presence of distributed energy resources [

7,

8]. This paper focuses on the optimal P-Q control issue of a microgrid in the grid-connected mode.

In the past decade, some P-Q control methods have been proposed for distributed generations [

9,

10,

11,

12,

13,

14,

15]. Dai [

9] developed an effective power flow control method for a distributed generation unit in the grid-connected mode by adopting a robust servomechanism voltage controller and a discrete-time sliding mode current controller on the basis of Newton–Raphson-based parameter estimation and feed forward control approaches. The research work [

11] studied the control problem of active and reactive powers using a second-order generalized integrator in a single-phase grid-connected fuel cell system based on the boost inverter. In Reference [

12], an individual-phase decoupled P-Q control method based on six control degrees was proposed for a three-phase voltage source converter. Adhikari and Li [

13] proposed a P-Q control method with solar photovoltaic, maximum power point tracking (MPPT), and battery storage in the grid-connected mode. Adhikari et al. [

14] proposed a two-selected control method using theP-Q control in the load-following mode while the P-V control was in the maximum power point tracking mode. Unfortunately, the design processes of multivariable parameters used in P-Q controllers in the above works rely on deeply empirical rules of the engineers, so the performance under dynamic loads variations often becomes poorer. In fact, the design issue of P-Q controllers is essentially optimally solving a constrained optimization problem, but there are only a few reported works concerning the design of P-Q controllers from the perspectives of constrained optimization. Al-Saedi et al. [

16] presented a particle swarm optimization (PSO)-based P-Q control method in grid-connected operation under variable loads conditions. This seminal work has demonstrated the importance of PSO in the automatic tuning of P-Q control parameters for optimized operation during abrupt loads change, but two current control parameters in the designed control system lack the optimization process based on PSO, so it may be considered as an incomplete optimization process for designing P-Q controllers. On the other hand, some popular evolutionary and swarm algorithms have been applied successfully to the optimal control of power converters and power systems [

17,

18,

19], which motivate us to design an effective and efficient optimization algorithm to the optimal P-Q control issue of three-phase grid-connected inverters in a microgrid.

As a novel optimization framework originally inspired by the far-from-equilibrium dynamics of self-organized criticality (SOC) [

20], extremal optimization (EO) [

21,

22] is different from other evolutionary algorithms because it merely selects against the bad instead of favoring the good based on a uniform random or power-law probability distribution. According to the iterated mechanism, EO can be classified into two categories. The first one is the individual-based discrete EO such as the standard EO [

21,

22] and the self-organized optimization algorithm [

23,

24] for combinatorial optimization problems, where an individual often represents a discrete sequence, e.g., a cyclic permutation of cities for the traveling salesman problem, and individual-based iterated operations including selection and discrete mutations, e.g., the 2-Opt, 3-Opt, and Lin–Kernighan (LK) rules for TSP are adopted. In the binary-coded EO (BCEO) algorithm [

25], a set of decision variables of a continuous optimization problem are coded as a binary string, and the power law-based selection and binary mutation operate on this binary string. The second is the population-based continuous EO by using population iterated operations, e.g., polynomial mutations and multi-non-uniform mutations. A variety of simulation and experimental results on different kinds of benchmark and real-world engineering optimization problems have shown that EO and its modified algorithms perform better than or at least the same as other popular evolutionary algorithms such as genetic algorithm (GA) and PSO [

26]. In the past decade, some modified EO algorithms have been applied to the optimal design issue of PID and fractional-order PID controllers for complex control systems [

27,

28,

29,

30,

31,

32,

33]. To the best of the authors’ knowledge, the applications of EO to the optimal P-Q control of power converters have never been reported.

Encouraged by the aforementioned analysis, a novel intelligent P-Q control method is proposed for three-phase grid-connected inverters in a microgrid by using an adaptive population-based extremal optimization (APEO). The proposed method formulates the optimal P-Q control issue of three-phase grid-connected inverters in a microgrid as a typical constrained optimization problem firstly, where six parameters of decoupled PI controllers are real-coded as the decision variables and the integral time absolute error (ITAE) between the output and referenced active power and the ITAE between the output and referenced reactive power are weighted as the objective function. Then, an effective and efficient APEO algorithm with an adaptive mutation operation is proposed to solve this optimal issue.

The major contributions of this work are described as follows:

- (1)
To the best of the authors’ knowledge, the adaptive population-based extremal optimization is applied firstly to the optimal P-Q control issue of three-phase grid-connected inverters in a microgrid.

- (2)
The superiority of the proposed method is demonstrated by both the simulation and experimental results for a three-phase grid-connected inverter in a microgrid. In fact, the previous reported PSO-based P-Q control method [

16] was tested only using its simulation results.

- (3)
In cases of both nominal and variable reference active power values, the proposed APEO-based P-Q control method can improve the performance of a three-phase grid-connected inverter in a microgrid compared to the traditional Z-N empirical method, the adaptive GA-based, and the PSO-based P-Q control methods.

The rest of this paper is structured as follows.

Section 2 presents the preliminaries concerning grid-connected inverters and extremal optimization. In

Section 3, an intelligent P-Q control method is designed for grid-connected inverters in a microgrid based on adaptive population EO.

Section 4 gives the simulation results on a three-phase grid-connected inverter. Moreover, in order to further validate the superiority of the proposed APEO-based P-Q control method, the experimental results on a real 3 kW three-phase grid-connected inverter in a microgrid are presented in

Section 5. Finally, the conclusion and open problems are given in

Section 6.

## 2. Problem Formulation

Figure 1 shows the circuit diagram and the corresponding P-Q control scheme for a three-phase grid-connected inverter in a microgrid [

16,

34]. Here,

V_{dc} is the DC voltage provided by a distribution generation unit,

C_{d} and

C_{f} are the capacitance of the DC side and the LC filter, respectively,

L_{f} represents the equivalent inductance of the LC filter, and

R_{f} is the equivalent resistance of the LC filter. The P-Q control scheme consists of the following key operations: the grid-side voltage, a current and phase detector, an inverter-side voltage and current detector, active and reactive power calculation, an active power PI controller, a reactive power PI controller, a current PI controller, abc/dq and dq/abc transformations, and space vector pulse width modulation (SVPWM).

The block diagram of decoupled P-Q controllers for a three-phase grid-connected inverter in a microgrid is presented in

Figure 2. The active and reactive powers of the inverter denoted as

P and

Q, respectively, are computed as follows:

where

v_{od} and

v_{oq} are the

d-coordinate and

q-coordinate of the grid-side voltage, respectively, and

i_{od} and

i_{oq} are the

d-coordinate and

q-coordinate of the grid-side current, respectively.

The transfer functions of active and reactive power PI controllers denoted as

G_{P}(

s) and

G_{Q}(

s) are defined as follows:

where

P_{ref} and

Q_{ref} are the reference values of active and reactive powers, respectively;

i_{dr} and

i_{qr}_{1} are the output values of the active and reactive PI controllers, respectively;

K_{p}_{1} and

K_{i}_{1} are the proportional and integral parameters of the active PI controller, respectively;

K_{p}_{2} and

K_{i}_{2} are the proportional and integral parameters of reactive PI controller, respectively.

The reference voltage signals in the

dq frame of SVPWM is defined as follows:

where

i_{d} and

i_{q} are the

d-coordinate and

q-coordinate of the inverter-side current, respectively;

K_{p}_{3} and

K_{i}_{3} are the proportional and integral parameters of the current PI controller, respectively;

w is the angular frequency; and

i_{qr} is the reference input of the

q-coordinate of the current PI controller, i.e.,

i_{qr} =

w ×

C_{f} × v_{od}−

i_{qr}_{1}. Note that

i_{dr} is also the reference input of the

d-coordinate of the current PI controller.

In order to manage the active and reactive power of each distributed generation in a microgrid under the grid-connected mode, the design issue of an optimal P-Q controller with six parameters, including

K_{p}_{1},

K_{i}_{1},

K_{p}_{2},

K_{i}_{2},

K_{p}_{3}, and

K_{i}_{3}, can be formulated as a typical constrained optimization problem. More specifically, six parameters of decoupled PI controllers are real-coded as decision variables and the integral time absolute error (ITAE) between the output and referenced active power and the ITAE between the output and referenced reactive power are weighted as a minimized function. The complete formulation of the optimal P-Q control issue for a three-phase grid-connected inverter is as follows:

where

P_{ref} and

Q_{ref} are the referenced active and reactive powers, respectively;

w_{1} and

w_{2} are the weighted coefficients;

T_{max} is the maximum time of the time window;

l_{1},

l_{2},

l_{3},

l_{4},

l_{5}, and

l_{6} are the lower limits of

K_{p}_{1},

K_{i}_{1},

K_{p}_{2},

K_{i}_{2},

K_{p}_{3}, and

K_{i}_{3}, respectively; and

u_{1},

u_{2},

u_{3},

u_{4},

u_{5}, and

u_{6} are the upper limits of

K_{p}_{1},

K_{i}_{1},

K_{p}_{2},

K_{i}_{2},

K_{p}_{3}, and

K_{i}_{3}, respectively.

## 3. The Proposed Method

In this section, an intelligent P-Q control method is presented for three-phase grid-connected inverters in a microgrid by using an adaptive population-based extremal optimization algorithm (APEO). The key idea behind the proposed method is firstly formulating the optimal P-Q control of grid-connected inverters in a microgrid as a typical constrained optimization problem shown as Equation (8). Then, an effective and efficient APEO algorithm with an adaptive mutation operation is designed to solve this optimization problem.

The detailed steps of the proposed algorithm are described as follows:

**Input:** The model of a three-phase grid-connected inverter with P-Q controllers, a sampling period T_{s}, the lower limits constraints (l_{1}, l_{2}, l_{3}, l_{4}, l_{5}, l_{6}) and upper limits constraints (u_{1}, u_{2}, u_{3}, u_{4}, u_{5}, u_{6}) of the P-Q control parameters (K_{p}_{1}, K_{i}_{1}, K_{p}_{2}, K_{i}_{2}, K_{p}_{3}, K_{i}_{3}), the weight coefficients w_{1} and w_{2} used for evaluating the objective function, a population size of N, the maximum number of iterations I_{max}, and the shape parameter b of the adaptive mutation operation.

**Output:** The best solution S_{best} (the best control parameters K_{po}_{1}, K_{io}_{1}, K_{po}_{2}, K_{io}_{2}, K_{po}_{3}, K_{io}_{3}), the corresponding global fitness F_{best}, the real-time curve of the active and reactive power, and the current waveform of the transformer.

Step1: Generate a random initial real-coded population **P**_{I} = {S_{1}, S_{2}, …, S_{N}}, where the population size N is generally set as an even number, each solution S_{i} represents a real-coded sequence of six control parameters including K_{p}_{1}, K_{i}_{1}, K_{p}_{2}, K_{i}_{2}, K_{p}_{3}, K_{i}_{3}, and set **P** = **P**_{I}. More specifically, the generated process of S_{i} is ${S}_{i}=L+{R}_{i}(U-L),\text{}i=1,2,\dots ,N$, where L = (l_{1}, l_{2}, l_{3}, l_{4}, l_{5}, l_{6}) and U = (u_{1}, u_{2}, u_{3}, u_{4}, u_{5}, u_{6}), and R_{i} is a set of randomly generated values between 0 and 1.

Step 2: Evaluate the fitness {F_{i}, i = 1, 2, …, N} of each solution S_{i} in population **P** by means of Equation (8) firstly. Then rank all the solutions {S_{i}, i = 1, 2, …, N} in ascending order of the fitness values {F_{i}, i = 1, 2, …, N}, which means obtaining a permutation П of the labels i such that. Set the best fitness of the current iteration as F_{best} = F_{П(1)} and the corresponding best solution S_{best} = S_{П(1)}.

Step3: Select the solutions whose fitness ranks are from П(1) to П(N/2) to replace those solution whose fitness rank from П(1+N/2) to П(N), and set the intermediate population **P**_{M} = {S_{M}_{1}, S_{M}_{2}, …, S_{MN}}, where S_{M}_{j} = S_{M}_{(j+N/2)} = S_{П(j)}, j = 1, 2, …, N/2.

Step4: Generate a new population

**P**_{N} = {

S_{N}_{1},

S_{N}_{2}, …,

S_{NN}} from

**P**_{M} by adopting a multi-non-uniform mutation (MNUM). To be more specific,

S_{Ni} is computed by the following equations:

where

t is defined as the current number of iterations,

r and

r_{1} are the randomly generated numbers between 0 and 1, and

b represents the shape parameter, which adjusts the dynamics of the mutation operation.

Step 5: Set S_{NN} = S_{best} and accept **P** = **P**_{N} unconditionally.

Step 6: Repeat step 2 to step 5 until some stopping criterion, e.g., the maximum number of iterations I_{max}, is satisfied.

Step 7: Output the best control parameters solution S_{best} = (K_{po}_{1}, K_{io}_{1}, K_{po}_{2}, K_{io}_{2}, K_{po}_{3}, K_{io}_{3}), the corresponding global fitness F_{best}, the real-time curve of the active and reactive power, and the current waveform of loads.

Figure 3 presents the flowchart of APEO-based P-Q controllers design algorithm for three-phase grid-connected inverters. From the design perspective of the evolutionary algorithm, the proposed APEO-based P-Q controller design algorithm for three-phase grid-connected inverters has only the selection and mutation operations. Moreover, the proposed APEO method has fewer adjustable parameters than the adaptive genetic algorithm (AGA) [

35] and the particle swarm optimization (PSO) [

16]. More specifically, except for the maximum number of iterations

I_{max} and the population size

N, only one shape parameter

b needs to be tuned in the proposed APEO algorithm. However, two additional adjustable parameters in AGA and five additional parameters in PSO need be tuned for a specific practical three-phase grid-connected inverter. In this sense, the proposed APEO-based P-Q controller design algorithm can be considered as being simpler than the AGA and PSO-based P-Q control methods. In addition, the superiority of the proposed APEO method to the AGA and PSO-based P-Q algorithms will be verified by the simulation and experimental results on a three-phase grid-connected inverter in a microgrid under both nominal and variable reference active power values in the next two sections.