1 Introduction

With the rapid development of global science and technology and economy, the energy demand worldwide is increasing day by day. To integrate distributed generation (DG) [1] into the primary power grid and weaken the negative impact on the power grid, the concept of the microgrid is derived, and it mainly has two operation modes, grid connection and island [2]. However, the working capacity of a single microgrid is limited, and the capacity of resisting disturbance is relatively weak, which can only meet the access needs of DGs in some areas [3, 4]. Moreover, when faced with cyber-attack, a single microgrid is easy to cause line faults and economic losses [5, 6]. Therefore, connecting multiple adjacent heterogeneous AC and DC microgrids to form AC/DC hybrid microgrid groups is an essential direction of microgrid development in the future.

The traditional centralized control mode [7] uses the microgrid central controller to carry out unified information processing and command regulation [8]. Still, the flexibility and scalability of this control mode are relatively poor, and the reliability in case of a single point of failure is low [9]. It is hard to deal with the above application scenarios with high permeability of distributed power generation effectively, and to meet the " plug and play " capacity [10]. Therefore, distributed control methods become a hot topic [11].

Due to the diversity of microgrid equipment and the complexity of control optimization objectives, the hierarchical control strategy is generally adopted, to realize the stable parameter recovery and optimal economic operation of AC/DC hybrid microgrid groups [12, 13]. At present, the first layer of voltage control and the second layer of DG control are widely used [14, 15], to realize the fast droop control of the traditional inverter [16, 17], that is, the first layer of voltage control and the second layer of DG control are complementary. In the steady state, there is a deviation between the system frequency and voltage and the reference value, if only existing voltage and frequency control loop. Therefore, it is necessary to add second layer control to realize frequency correction and optimal power distribution [18].

The economic control strategy of the AC/DC hybrid microgrid groups can be divided into two parts. One is the internal control strategy, which is used to realize the stable and optimal operation of each microgrid [19, 20]. The other is the intergroup control strategy, which is used to realize the optimal cooperative process between microgrids and interlinking converters (ILCs) [21, 22].

At present, many scholars have studied the stability control of microgrids. Reference [18] proposes a distributed quadratic control method based on the PI consistency algorithm, which is used to eliminate the estimation error generated by the voltage observer in the presence of input disturbances. Finally, the control method realizes the recovery of voltage/frequency and the accurate distribution of reactive/active power. Reference [23] divides the existing quadratic controllers into four categories. Based on delay margin, four types of controllers are compared, and the sensitivity expression of delay margin to system parameters in steady-state operation is further deduced theoretically. Reference [24] proposes a microgrid fully distributed power dispatching method, which can realize fast frequency recovery and minimize generation costs. In the stage, the consistency algorithm based on a sub-gradient is used to recover the frequency. Reference [25] proposes a new random consistent quadratic voltage and frequency recovery method considering communication delay and derives the proof of mean-square consistent recovery using strict Lyapunov analysis. To solve the problems of distributed economic dispatching and stability optimization, reference [26] proposes a new distributed power system control scheme based on consistency. Based on considering the problems of communication noise and fault, the PI frequency controller and neural network frequency controller are adopted to improve the robustness of the control method. In [27], a two-stage robust optimization model is established to find a balance between the economy and robustness of microgrid operation and uses the Benders dual algorithm to solve and calculate the established optimization model. Reference [28] proposes an improved Benders algorithm. The proposed robust adjustment parameters can reflect the balance between economy and robustness better, which are most suitable for microgrid operation. Based on the traditional secondary voltage control method, the reference [29] establishes the nonsingular terminal sliding mode control model by introducing the error function. At the same time, the distributed controller can adjust the voltage amplitude to the reference value without considering the dynamic uncertainty and bounded external interference. In [30], aiming at the problem of voltage and frequency recovery of isolated microgrid, a secondary voltage and frequency recovery method based on consistency fault tolerance considering disturbance and controller fault is proposed. However, less attention has been paid to the problem of economic optimization. Most of the literature is focused on the two-layer control, that is, the stable recovery of voltage and frequency. Although some literatures such as [31] consider the problem of economic optimization, the minimization of the total operation cost of the power grid is realized in the third layer control. But this method makes the response speed slow. When the economic optimal goal is met, the actual operation of the microgrid deviates from the optimal state, and the optimal operation and economic operation cannot be balanced.

In terms of intergroup control of hybrid microgrids, the algorithm in [32] can switch smoothly between two operation modes, islanded and grid connected. Reference [33] introduces the discrete consistency control principle into the control layer of AC/DC microgrids to realize the accurate distribution of reactive power and DC current. A distributed coordination control embedded with VSG control is proposed in [34], which makes power distribution more reasonable, and frequency and voltage recover faster. Reference [35, 36] proposes a distributed control method, which realizes the economic control of the hybrid microgrids. Reference [37] presents a multi-mode master–slave control approach to increase the flexibility of DC-coupled hybrid microgrids. The algorithm in [38] also utilizes double consistency iteration of the incremental cost price and the estimated value of equipment output to effectively coordinate the relationship among energy equipment outputs. However, the research objects of the above literature are single hybrid microgrid, and the effectiveness of its control strategy in hybrid microgrid groups remains to be verified. To solve the problem of power distribution, optimization, and stability of AC/DC hybrid microgrid groups, reference [39] proposed a distributed collaborative control method based on event trigger mechanism, which realizes the reasonable distribution of power among different microgrids. However, this control method doesn’t involve the optimal control of the AC/DC hybrid microgrid groups. Therefore, it is lack of the capacity of realizing the economic operation of the hybrid microgrid groups.

To study the distributed autonomous economic control strategy of the AC/DC hybrid microgrid groups, this paper rises innovations from four aspects as follows.

i. In the element of control in a microgrid, an improved two-layers control strategy is proposed. The third layer of traditional economic optimization control is integrated into two-layers control. The goal of frequency stabilization and power optimization under the first-level control is achieved through the equal micro-increment droop control. The economic optimization control is promoted to the second layer, and the optimal operation efficiency of the microgrid is significantly improved.

ii. In the distributed control of one microgrid and microgrid groups, the power mapping factor and average power mapping factor are introduced respectively to achieve the goals of frequency stability and power optimization of microgrid and realize the joint power optimizing operation of different microgrids.

iii. In the element of intergroup control, AC/DC hybrid microgrid groups are formed by connecting each microgrid with ILC. The ILC control strategy with the average power mapping factor realizes the economic power distribution among AC/DC hybrid microgrids, the rapid recovery of the frequency and the voltage of the microgrids, improve the real-time response speed of the control strategy when the system fluctuates, and enhance the reliability, flexibility and economy of the power system. The power between microgrids flows bidirectional through ILC to improve the utilization rate of DGs in the microgrids.

iv. By introducing time-varying gain and secondary control items, the finite time consistency algorithm in this paper can maintain a stable convergence rate in a whole iteration cycle and overcome the problem that the convergence rate of the traditional finite time consistency algorithm decreases when the system is close to the steady-state.

The rest of this paper is organized as follows. In Sect. 2, the system structure and distributed control principle of the AC/DC hybrid microgrid groups are introduced. In Sect. 3, the hierarchical distributed control strategy of the AC/DC hybrid microgrids is designed. In Sect. 4, the stability and convergence of the finite time consistent control strategy are analyzed. In Sect. 5, an example of the system is given. Finally, Sect. 6 concludes the paper.

2 System Structure and Distributed Control Principle of AC/DC Hybrid Microgrid Groups

2.1 System Structure

The structure of the AC/DC hybrid microgrid groups is shown in Fig. 1. It is composed of AC/DC microgrids and ILC. Each microgrid has its own distributed power supply, energy storage and load, and each DG in the microgrid can realize information sharing among neighbors and maintain a stable balance in the microgrid. Microgrids are connected together using ILC devices, through which any two DGs in a hybrid multi-microgrid system can communicate with each other and react according to the current generation and load of each microgrid. It provides the communication network foundation for the distributed control between and within AC/DC hybrid microgrid.

Fig. 1
figure 1

AC/DC hybrid microgrid groups structure

2.2 Principle of Finite Time Consistency Algorithm

The primary control only acts on the DG units in the physical layer. In contrast, the secondary control rises from the physical layer to the information level and requires sparse communication between DGs to realize information exchange and coordinated control. The traditional two-layer control based on consistency is formulated as

$$\begin{aligned} \theta_{i} = \int {u_{i}^{tra} dt} \hfill \\ u_{i}^{tra} = - c\sum\limits_{j = 1}^{n} {a_{ij} \left( {\theta_{i} - \theta_{j} } \right)} {\kern 1pt} {\kern 1pt} ,{\kern 1pt} \quad {\kern 1pt} {\kern 1pt} c > 0 \hfill \\ \end{aligned}$$
(1)

where \(u_{i}^{tra}\) is the control input of \(\text{DG}_{i}\), \({\kern 1pt} {\kern 1pt} c\) is a constant-coefficient, \(a_{ij}\) is the communication weight. In this paper, the metropolis method is used to construct the weight coefficient and is formulated as

$$a_{ij} = \left\{ \begin{aligned} 1/(\max [l_{ii} ,l_{jj} ] + 1),{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} j \in N_{i} \hfill \\ 1 - \sum\limits_{{j \in N_{i} }} {a_{ij} ,{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} i = j} \hfill \\ 0,{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} other \hfill \\ \end{aligned} \right.$$
(2)

where \(l_{ii}\) indicates the number of nodes having communication relationship with node \(i\).The traditional consistency-based control strategy in (1) has an asymptotic convergence. As the iterative process ends, the convergence speed of the traditional control strategy will gradually decrease. In this paper, the quantitative gain of the conventional consistency algorithm is improved to a time-varying gain, and it is formulated as

$$\begin{aligned} \theta _{i} & = \int {u_{i}^{{fin}} dt} \\ u_{i}^{{fin}} & = - \mu \sum\limits_{{j = 1}}^{n} {a_{{ij}} \left( {\theta _{i} - \theta _{j} } \right)} \\ {\kern 1pt} \mu & = \mu (t) > 0 \\ \end{aligned}$$
(3)

where \(u_{i}^{fin}\) is the control variable of finite-time control strategy, and \(\mu\) is a time-varying gain.

To maintain a stable convergence rate in a whole period \(T_{con}\), this paper makes stable and normal in each iteration period, so that the system can still ensure a good iteration speed at the end of the iteration. As shown in Fig. 2b, if the black line keeps increasing infinitely, the system will fall into a crash state. To ensure the regular operation of the algorithm, a minimal time interval \(\delta\) is added after the iteration cycle.

Fig. 2
figure 2

Finite-time consistency schematic

Therefore, the form of \(\mu\) is formulated as

$$\begin{aligned} \mu & = \left( {\frac{{T_{{\exp }} }}{{T_{{\exp }} - r}}} \right)^{2} \\ T_{{\exp }} & = T_{{con}} + \delta \\ {\kern 1pt} r & = \left( {t\;\bmod \;T_{{con}} } \right) \in \left[ {0,T_{{con}} } \right) \\ \end{aligned}$$
(4)

where \(T_{\exp }\) is the final iteration time.

3 Distributed Control Strategy of AC/DC Hybrid Microgrids

3.1 Control Objectives of AC/DC Hybrid Microgrid Groups

3.1.1 Control Objectives of AC Microgrid

Each DG in the AC microgrid is to distribute the active power according to the principle of equal incremental to realize the economic control of active power,

$$\left\{ {\begin{array}{*{20}l} {\lambda _{{m1}} = \cdots = \lambda _{{mi}} = \cdots = \lambda _{{mp}} } \hfill \\ {\lambda _{{mi}} = 2\alpha _{{mi}} P_{i} + \beta _{{mi}} } \hfill \\ \end{array} } \right.,\quad \forall m \in N^{{ac}}$$
(5)

where \(\lambda_{mi}\) is the power mapping factor of the \(i\)th DG in the \(m\) th AC microgrid. \(\alpha_{mi}\) and \(\beta_{mi}\) is the power mapping factor coefficient. \(N^{ac}\) is the collection of AC microgrid.

The frequency of the AC microgrid is to restore the reference frequency,

$$\mathop {\lim }\limits_{t \to \infty } (\omega_{mi} - \omega^{*} ) = 0,{\kern 1pt} {\kern 1pt} \quad {\kern 1pt} \forall m \in N^{ac}$$
(6)

where \(\omega_{mi}\) and \(\omega^{*}\) are the frequency measurement value and the reference value of the \(m\) th AC microgrid, respectively. The voltage at the common bus of the AC microgrid is to restore the reference value,

$$\mathop {\lim }\limits_{t \to \infty } (U_{{{\text{PCC}},{\kern 1pt} m}} - U_{{{\text{PCC}},{\kern 1pt} m}}^{*} ) = 0,{\kern 1pt} {\kern 1pt} \quad \forall {\kern 1pt} m \in N^{ac}$$
(7)

where \(U_{{{\text{PCC}},{\kern 1pt} m}}\) and \(U_{{{\text{PCC}},{\kern 1pt} m}}^{*}\) are the voltage measurement value and the reference value of the \(m\) th AC microgrid common connection bus respectively.

Each DG in the AC microgrid is to distribute reactive power according to the principle of equal proportion distribution,

$$k_{ac,m1}^{Q} Q_{m1} = k_{ac,m2}^{Q} Q_{m2} = \cdots = k_{ac,mp}^{Q} Q_{mp} ,{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} \forall m \in N^{ac}$$
(8)

where \(k_{ac,mi}^{Q}\) and \(Q_{mi}\) are the reactive power/voltage droop coefficient and reactive power of the \(i\)th DG in the \(m\)th AC microgrid, respectively. To simplify the analysis, this paper sets \(k_{ac}^{Q}\) of each DG to the same value, that is, to realize the equal distribution of reactive power among DGs.

3.1.2 Control objectives of DC microgrid

Each DG in the DC microgrid is to distribute active power according to the principle of equal incremental,

$$\lambda_{n1} = \cdots = \lambda_{nj} = \cdots = \lambda_{nq} ,\quad {\kern 1pt} {\kern 1pt} \forall n \in N^{dc}$$
(9)

where \(\lambda_{nj}\) is the power mapping factor of the \(j\)th DG in the \(n\) th DC microgrid, \(N^{dc}\) is the DC microgrid set.The voltage at the common bus of the DC microgrid is to restore the reference value,

$$\mathop {\lim }\limits_{t \to \infty } (U_{{{\text{PCC}},{\kern 1pt} n}} - U_{{{\text{PCC}},{\kern 1pt} n}}^{*} ) = 0,{\kern 1pt} \quad {\kern 1pt} {\kern 1pt} \forall {\kern 1pt} n \in N^{dc}$$
(10)

where \(U_{{{\text{PCC}},{\kern 1pt} n}}\) and \(U_{{{\text{PCC}},{\kern 1pt} n}}^{*}\) are the voltage measurement value and the reference value of the common connection bus of the \(n\)th DC microgrid, respectively.

3.1.3 Control objectives among microgrids

By controlling the transmission power of ILC, the power mapping factors of different microgrids are consistent,

$$\overline{{\lambda_{1}^{ac} }} = \cdots = \overline{{\lambda_{m}^{ac} }} = \overline{{\lambda_{1}^{dc} }} = \cdots = \overline{{\lambda_{n}^{dc} }}$$
(11)

where \(\overline{{\lambda_{m}^{ac} }}\) is the mean value of the power mapping factor of the \(m\)th AC microgrid, \(\overline{{\lambda_{n}^{dc} }}\) is the mean value of the power mapping factor of the \(n\)th DC microgrid.

3.2 AC microgrid control strategy

The traditional primary control usually adopts droop control strategy to realize the stable operation of the system,

$$\omega_{mi} = \omega^{*} - k_{ac}^{P} P_{mi}$$
(12)

where \(k_{ac}^{P}\) is droop coefficient.

The secondary control obtains the globally consistent compensation amount through the consistency algorithm for droop compensation and realizes the floating control goal in frequency by using the droop characteristic curve upward. Different from the traditional control strategy, the control strategy in this paper presents the power optimization in the second layer. That is, the dual objectives of frequency recovery and power optimization are concerned in the secondary control, which simplifies the control steps. In addition, the load in the system is unknown, so it is usually difficult to calculate the optimized active power reference value in the off-line. If the primary control method still adopts the traditional droop control, the difficulty of the secondary control design will be greatly increased. Therefore, to better adapt to the improved secondary control strategy, the concept of power mapping factor is introduced into the primary control. Unlike the traditional droop control, this paper directly adopts droop control with an equal incremental principle. The secondary control realizes the secondary adjustment of microgrid frequency, voltage, and reactive power through the information interaction among DGs. It avoids the problems of active power distribution imbalance and system instability caused by frequency instability. The principle process is shown in Fig. 3.

Fig. 3
figure 3

DG secondary control process based on equal incremental principle droop control

So, the corresponding DG control strategy of the AC microgrid is formulated as

$$\left\{ \begin{aligned} \omega_{mi} = \omega^{*} - k_{ac}^{P} \lambda_{mi} + \gamma_{mi} \hfill \\ U_{mi} = U_{m}^{*} - k_{ac}^{Q} Q_{mi} + \delta_{mi} \hfill \\ \end{aligned} \right.$$
(13)

where \(\omega^{*}\) and \(U_{m}^{*}\) are the frequency reference value and rated voltage of AC microgrid respectively, \(\gamma_{mi}\) and \(\delta_{mi}\) are the secondary control items of DG active and reactive power control respectively, and \(k_{ac}^{P}\) is the power mapping factor/frequency droop coefficient of AC microgrid.

The secondary control items of the DG active power control correspond to (5) and (6) in the control objectives of the AC microgrid, including cost secondary control item \(\gamma_{mi}^{\lambda }\) and frequency secondary control item \(\gamma_{mi}^{\omega }\) for DG active power output,

$$\gamma_{mi} = \gamma_{mi}^{\lambda } + \gamma_{mi}^{\omega }$$
(14)

According to the finite time consistency principle, the power mapping factor quadratic control term to realize the economic distribution of active power is formulated as,

$$\left\{ \begin{aligned} \gamma_{mi}^{\lambda } &= [\lambda_{mi}^{*} (t) - \lambda_{mi} ](k_{p}^{ac,\lambda } + \frac{{k_{i}^{ac,\lambda } }}{s}) \hfill \\ \lambda_{mi}^{*} (t)& = \lambda_{mi} (t) + \mu \sum\limits_{{j \in N_{m} }} {a_{ij} [\lambda_{mj} (t) - \lambda_{mi} (t)]} \hfill \\ \end{aligned} \right.$$
(15)

where \(\lambda_{mi} (t)\) and \(\lambda_{mi}^{*} (t)\) are the power mapping factor of DG \(i\) at time and the reference value updated by the finite time consistency protocol, respectively, \(k_{p}^{ac,\lambda }\) and \(k_{i}^{ac,\lambda }\) are the proportional and integral parameters of PI control, respectively.

To meet the frequency control goal of the AC microgrid, the frequency secondary control item of the leading node is constructed and is formulated as

$$\left\{ \begin{aligned} \gamma_{mi}^{\omega } &= [\omega_{mi}^{*} (t) - \omega_{mi} ]\left( {k_{p}^{\omega } + \frac{{k_{i}^{\omega } }}{s}} \right) \hfill \\ \omega_{mi}^{*} (t) & = \omega_{mi} (t) + \mu \left\{ {\sum\limits_{{j \in N_{m} }} {a_{ij} [\omega_{mj} (t) - \omega_{mi} (t)]} { + }g_{i} {[}\omega_{m}^{*} - \omega_{mi} (t){]}} \right\} \hfill \\ \end{aligned} \right.$$
(16)

where \(\omega_{mi} (t)\) and \(\omega_{mi}^{*} (t)\) are the frequency value at DG \(i\) at time \(t\) and the reference value obtained from the finite time consistency protocol including the leader node, respectively. \(g_{i}\) is the link weight between node \(i\) and the common connection bus. If node \(i\) has a communication link with ILC, it is \(g_{i} = 1\), otherwise, it is 0.

In terms of reactive power control, to achieve (7) and (8) in the control goal of the AC microgrid, the reactive power secondary control item can be divided into voltage control item \(\delta_{mi}^{U}\) and reactive power distribution secondary control item \(\delta_{mi}^{Q}\),

$$\delta_{mi} = \delta_{mi}^{U} + \delta_{mi}^{Q}$$
(17)

The voltage secondary adjustment component is formulated as

$$\left\{ \begin{aligned} \delta_{mi}^{U} &= [U_{mi}^{*} (t) - U_{mi} ](k_{p}^{ac,U} + \frac{{k_{i}^{ac,U} }}{s}) \hfill \\ U_{mi}^{*} (t) & = U_{mi} (t) + \mu \{ \sum\limits_{{j \in N_{m} }} {a_{ij} [U_{mj} (t) - U_{mi} (t)]} { + }g_{i} {[}U_{PCC,m}^{*} - U_{PCC,m} (t){{]\} }} \hfill \\ \end{aligned} \right.$$
(18)

where \(U_{mi} (t)\) and \(U_{mi}^{*} (t)\) are the voltage value at DG \(i\) at time \(t\) and the reference value obtained from the finite time consistency protocol including the leading node, respectively.

To achieve the control goal of reactive power, the secondary control item of reactive power distribution is formulated as

$$\left\{ \begin{aligned} \delta_{mi}^{Q} &= [Q_{mi}^{*} (t) - Q_{mi} ](k_{p}^{Q} + \frac{{k_{i}^{Q} }}{s}) \hfill \\ Q_{mi}^{*} (t) &= Q_{mi} (t) + \mu \sum\limits_{{j \in N_{m} }} {a_{ij} [Q_{mj} (t) - Q_{mi} (t)]} \hfill \\ \end{aligned} \right.$$
(19)

where \(Q_{mi} (t)\) and \(Q_{mi}^{*} (t)\) are respectively the reactive power value of DG \(i\) at time \(t\) and the reference value updated by the consistency protocol.

3.3 DC microgrid control strategy

Like the control strategy of the AC microgrid, its control structure can also be divided into two layers. The primary control adopts the voltage droop control strategy based on the voltage/power mapping factor, which is used for the economic distribution of DC DG power. Based on the principle of finite time consistency, the secondary control realizes the secondary adjustment of DC microgrid voltage. It avoids the problem that the active output cannot be allocated according to the power mapping factor due to the unbalanced node voltage. The control strategy is formulated as

$$U_{ni} = U_{n}^{*} - k_{dc}^{P} \lambda_{ni} + \eta_{ni}$$
(20)

where \(U_{n}^{*}\) is the rated voltage of DC microgrid, \(\eta_{ni}\) is the secondary control item of DG active power, and \(k_{dc}^{P}\) is the power mapping factor/voltage droop coefficient of DC microgrid.

According to (9) and (10) in the control objectives, it is also composed of cost adjustment component \(\eta_{ni}^{U}\) and DC voltage adjustment component \(\eta_{ni}^{\lambda }\) of DG active output,

$$\eta_{ni} = \eta_{ni}^{U} + \eta_{ni}^{\lambda }$$
(21)

Similarly, we can construct the secondary control item of DC microgrid DG cost according to (15),

$$\left\{ \begin{aligned} \eta_{ni}^{\lambda } &= [\lambda_{ni}^{*} (t) - \lambda_{ni} ]\left( {k_{p}^{dc,\lambda } + \frac{{k_{i}^{dc,\lambda } }}{s}} \right) \hfill \\ \lambda_{ni}^{*} (t) &= \lambda_{ni} (t) + \mu \sum\limits_{{j \in N_{n} }} {a_{ij} [\lambda_{nj} (t) - \lambda_{ni} (t)]} \hfill \\ \end{aligned} \right.$$
(22)

In terms of DC voltage control, it is also necessary to consider the convergence of node voltage to the mean value and the tracking of reference value by common connection bus. Therefore, the corresponding voltage secondary control item is formulated as

$$\left\{ \begin{aligned} \eta_{ni}^{U} &= [U_{ni}^{*} (t) - U_{ni} ]\left( {k_{p}^{dc,U} + \frac{{k_{i}^{dc,U} }}{s}} \right) \hfill \\ U_{ni}^{*} (t) &= U_{ni} (t) + \mu \left\{ {\sum\limits_{{j \in N_{n} }} {a_{ij} [U_{nj} (t) - U_{ni} (t)]} { + }g_{i} {[}U_{PCC,n}^{*} - U_{PCC,n} (t){]}} \right\} \hfill \\ \end{aligned} \right.$$
(23)

where \(U_{ni} (t)\) and \(U_{ni}^{*} (t)\) are the voltage value at DG \(i\) at time \(t\) and the reference value, respectively.

3.4 Control strategy among microgrid groups

The AC and DC sub-microgrids are connected through ILCs. An ILC realizes the independent balance of each microgrid by controlling the exchange of power among microgrids and maintains the stability of the AC and DC hybrid microgrids. To simplify the analysis, this paper sets ILC to operate at unity power factor. That is, it only undertakes the tasks of active power transmission among microgrids, frequency recovery of AC microgrid and voltage recovery of DC microgrid. Finally, the control objective (11) is realized by controlling each ILC.

The control objective (11) can be analyzed from two aspects: one is to make the same average power mapping factor of the AC microgrid and DC microgrid directly connected to the ILC, which is formulated as

$$\left\{ \begin{aligned} f_{g} &= \overline{{\lambda_{n}^{dc} }} - \overline{{\lambda_{m}^{ac} }} \hfill \\ \mathop {\lim }\limits_{t \to \infty } f_{g} &= 0 \hfill \\ \overline{{\lambda_{m}^{ac} }} = \sum\limits_{{i \in N_{m} }} {g_{i} \cdot \lambda_{mi} } \hfill \\ \overline{{\lambda_{n}^{dc} }} & = \sum\limits_{{i \in N_{n} }} {g_{i} \cdot \lambda_{ni} } \hfill \\ \end{aligned} \right.$$
(24)

where \(\overline{{\lambda_{m}^{ac} }}\) is the average power mapping factor of the \(m\)th AC microgrid connected to the interlinking converter ILC, and \(\overline{{\lambda_{n}^{dc} }}\) is the average power mapping factor of \(n\)th DC microgrid connected to ILC. \(f_{g}\) is the difference in the average power mapping factor between the two microgrids. The calculation method of the average power mapping factor of each microgrid is as follows. The DG communicating with ILC in each microgrid transmits the power mapping factor at the current sampling time to the converter station and calculates the average value.

So, the ILC active power control strategy is constructed in the positive direction of injecting power from the AC power grid to the DC power grid,

$$P_{ILC,g}^{*} = f_{g} \left( {k_{p}^{ILC} + \frac{{k_{i}^{ILC} }}{s}} \right)$$
(25)

where \(P_{ILC,g}^{*}\) is the setting value of ILC transmission power.

In addition, as an active power transmission device, the ILC can also participate in the frequency control of AC microgrid and the voltage control of DC microgrid public connection bus to speed up the stable recovery process of sub-microgrids. Therefore, the auxiliary control is formulated as

$$\left\{ \begin{aligned} \gamma_{g}^{\omega } &= \left( {k_{p} + \frac{{k_{i} }}{s}} \right)(\omega_{{\text{pu}}}^{*} - \omega_{{\text{pu}}} ) \hfill \\ \eta_{g}^{U} &= \left( {k_{p} + \frac{{k_{i} }}{s}} \right)(U_{{\text{PCC,pu}}}^{*} - U_{{\text{PCC,pu}}} ) \hfill \\ \end{aligned} \right.$$
(26)

where \(\omega_{{\text{pu}}}^{*}\) and \(\omega_{{\text{pu}}}\) are the normalized values of the reference frequency and the actual measured frequency of the common connection bus on the AC side, respectively. \(U_{{\text{PCC,pu}}}^{*}\) and \(U_{{\text{PCC,pu}}}\) are the normalized values of the reference voltage and the actual measured voltage of the DC side common connection bus, respectively.

So, the corresponding ILC primary control strategy is formulated as

$$P_{ILC,g}^{*} = f_{g} \left( {k_{p}^{ILC} + \frac{{k_{i}^{ILC} }}{s}} \right) - \gamma_{g}^{\omega } + \eta_{g}^{U}$$
(27)

where \(\gamma_{g}^{\omega }\) and \(\eta_{g}^{U}\) are obtained according to the local measurement information of ILC. \(f_{g}\) is obtained from the power mapping factor information of ILC local microgrid. However, the primary control strategy of ILC only considers the power mapping factor of the bilateral microgrid directly connected by the local ILC, which is easy to lead to the power snatching of the same microgrid among ILCs. For the sub microgrid with relatively small capacity, a slight change in switching power will have a significant impact on the power mapping factor of the sub microgrid, resulting in a significant fluctuation in the power of the AC/DC hybrid microgrid groups and even leading to system disconnection in severe cases. Therefore, it is necessary to design a secondary control strategy for ILC based on primary control.

The second consideration of the control objective (11) is to make the difference of the power mapping factors of the two-sided microgrid at each ILC consistent and finally, converge to 0, which is formulated as

$$\mathop {\lim }\limits_{t \to \infty } f_{1} (t) = \cdots = \mathop {\lim }\limits_{t \to \infty } f_{g} (t) = \cdots = \mathop {\lim }\limits_{t \to \infty } f_{G} (t) = 0$$
(28)

\(f_{g} (t)\) is designed as a constant state variable, and the cost quadratic control item \(\zeta_{g}\) of ILC based on the finite time consistency principle is formulated as

$$\left\{ \begin{aligned} \zeta_{g} &= \Delta f_{g} \left( {k_{p}^{Con} + \frac{{k_{i}^{Con} }}{s}} \right) \hfill \\ \Delta f_{g} (t) & = \mu \sum\limits_{h \in O} {a_{gh} [f_{g} (t) - f_{h} (t)]} \hfill \\ \end{aligned} \right.$$
(29)

where \(\Delta f_{g} (t)\) is the state difference between the \(g\)th ILC device and its neighbor ILC device at time \(t\), and \(O\) is ILC set. \(k_{p}^{Con}\) and \(k_{i}^{Con}\) are the proportional and integral parameters of the PI controller, respectively.

So, according to (24) and (29), \(\Delta f_{g} (t)\) can be formulated as

$$\Delta f_{g} (t) = \mu \sum\limits_{h \in O} {a_{gh} \{ [\overline{{\lambda_{n}^{dc} }} (t) + \overline{{\lambda_{q}^{dc} }} (t)] - [\overline{{\lambda_{m}^{ac} }} (t) + \overline{{\lambda_{p}^{ac} }} (t)]\} }$$
(30)

where subscripts \(p\) and \(q\) correspond to AC microgrid and DC microgrid connected to ILC, respectively.

Based on the local control of ILC, the operation information of other ILCs is introduced, which is more conducive to the economic distribution of active power among all sub microgrids.

Therefore, the control strategy of combining ILC primary control and secondary control is formulated as

$$P_{ILC,g}^{*} = f_{g} \left( {k_{p}^{ILC} + \frac{{k_{i}^{ILC} }}{s}} \right) - \gamma_{g}^{\omega } + \eta_{g}^{U} + \zeta_{g}$$
(31)

4 Performance Analysis of Finite-Time Control Strategy

A Lyapunov function is constructed in (32),

$$V = \frac{1}{2}{\mathbf{e}}^{T} {\mathbf{e}}$$
(32)

According to the method of reference [40], we can get,

$$\begin{aligned} - \frac{{\dot{V}}}{V} \ge \mu \left( {\lambda_{2} + g_{0} {\varvec{g}}^{T} {\varvec{g}}} \right) \times \left( {1 - \sqrt {1 - \frac{{4g_{0} \lambda_{2} }}{{n\left( {\lambda_{2} + g_{0} {\varvec{g}}^{T} {\varvec{g}}} \right)^{2} }}} } \right) \hfill \\ {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} \ge \frac{{2\mu g_{0} \lambda_{2} }}{{n\left( {\lambda_{2} + kg_{0} {\varvec{g}}^{T} {\varvec{g}}} \right)}} \ge \frac{{\mu g_{0} \lambda_{2} }}{{ng_{0} }} \ge \frac{1}{{n^{2} D}} > 0 \hfill \\ \end{aligned}$$
(33)

Then,

$$\dot{V} \le - \frac{1}{{n^{2} D}}V < 0$$
(34)

Therefore, the Lyapunov function will eventually converge to 0.

It is assumed that there is no load adjustment or generator is switching from \(t = 0\) to \(t = T_{con}\).

Let \(\mu_{0} = T_{\exp } /\left( {T_{\exp } - r} \right)\), we can see that \(\mu_{0}\) is satisfied.

$$\dot{\mu }_{0} = \frac{{\mu_{0}^{2} }}{{T_{\exp } }} = \frac{\mu }{{T_{\exp } }}$$
(35)

It can be inferred from (34),

$$\begin{aligned} \dot{V} + \frac{{\dot{\mu }_{0} T_{\exp } }}{{n^{2} D}}V \le 0 \hfill \\ \frac{d}{dt}(e^{{\frac{{\mu_{0} T_{\exp } }}{{n^{2} D}}}} V) = e^{{\frac{{\mu_{0} T_{\exp } }}{{n^{2} D}}}} \left( {\dot{V} + \frac{{\dot{\mu }_{0} T_{\exp } }}{{n^{2} D}}V} \right) \le 0 \hfill \\ \end{aligned}$$
(36)

Therefore, \(V\) satisfies the inequality,

$$V \le e^{{ - \frac{{(\mu_{0} - 1)T_{\exp } }}{{n^{2} D}}}} V^{0} = e^{{ - \frac{{rT_{\exp } }}{{(T_{con} - r)n^{2} D}}}} V^{0}$$
(37)

where \(V^{0}\) represents the initial value of \(V\).

When \(t\) approaches \(T_{con}\), \(V\) meets,

$$\mathop {\lim }\limits_{{t \to T_{con} }} V \le e^{{ - \frac{{T_{con} T_{\exp } }}{{(T_{\exp } - T_{con} )n^{2} D}}}} V^{0} = e^{{ - \frac{{T_{con} T_{\exp } }}{{\delta n^{2} D}}}} V^{0} = \chi V^{0}$$
(38)

5 Example Analysis

5.1 Verification of AC Microgrid Control Strategy

To verify the effectiveness of the AC microgrid control strategy proposed in this paper, an AC microgrid simulation model, as shown in Fig. 4, is built based on MATLAB/Simulink.

Fig. 4
figure 4

Simulation model of AC microgrid control strategy

Figure 4 shows the simulation model of AC microgrid control strategy. It shows the physical topology and communication connections between the four terminal DGs. Figure 4a shows the physical topology of the four DGS, which are connected in pairs and interact with the power supply through lines and loads. Figure 4b is their communication topology, they respectively communicate with neighboring power generation units, while there is no direct communication path between DG1 and DG3, DG2 and DG4.

The AC microgrid consists of DG1, DG2, DG3, and DG4 with a rated voltage of 380 V. The power mapping factor of each DG unit is expressed as \(\lambda (P_{i} ) = 2\alpha_{i} P_{i} + \beta_{i}\). The values of control parameters and system parameters are shown in Table 1. Each DG is equipped with a corresponding load. The active load adopts resistive load, and the reactive load adopts inductive load.

Table 1 Control strategy and system parameters of AC microgrid

The initial active load of the AC microgrid is 480 kW, and the reactive load is 60kVA. After 2 s, increase the active load of Load5 by 60 kW and the reactive load by 10kVA. After 3 s, reduce the active load of Load1 by 60 kW and the reactive load by 10kVA. After 4.5 s, Load5 returns to the starting load. The simulation results of the AC microgrid under different control strategies are shown in Fig. 5.

Fig. 5
figure 5figure 5

Simulation results of AC microgrid under different control strategies

In order to illustrate the superiority of the control strategy in this paper, the DG unit using only ordinary droop control strategy and ordinary droop combined with classical consistency protocol strategy are compared as a control example.

From Fig. 5a–c, the changes of node frequency under three control strategies are shown respectively. In the face of load changes, the frequency of each DG in the microgrid will fluctuate correspondingly, but the frequency synchronization can always be maintained. The strategy in Fig. 5b cannot restore the system frequency to the rated reference frequency of 50 Hz, and the microgrid system cannot maintain stable operation for a long time. The control strategy in Fig. 5c can realize the differential operation of each DG frequency in the system. Figure 5a adopts the control strategy proposed in this paper to stabilize the frequency at about 0.5 s, with fast convergence speed and small frequency fluctuation, overcoming the inherent defects of traditional sagging and making the system basically run at 50 Hz during the whole process.

Figure 5d–f show the changes of power mapping factors under three control strategies respectively. When the load changes, the active power output of each DG in the microgrid also changes accordingly to maintain the supply and demand balance of the system. However, the incremental cost of each DG in the microgrid cannot be consistent only under the droop control, so the system cannot operate under the economic optimal state. After the introduction of the third-level optimization control strategy, although the incremental cost fluctuates correspondingly when the system load fluctuates, the incremental cost of each DG unit in the system can remain consistent, and the total power generation cost in the microgrid system can be minimized, that is, the system can always run in the economic optimal state. The control strategy proposed in this paper can maintain the same global incremental cost at 0.1 s, the convergence rate is faster, the system fluctuation is smaller, and the active power can be accurately allocated.

From Fig. 5g–i, node voltage changes under three control strategies are shown respectively. In the case of load fluctuation, droop control can maintain the operation of the system by adjusting the output voltage of each DG in the system and has certain effectiveness in the case of system fluctuation. However, as droop control is a kind of differential control, the system voltage cannot be restored to the rated reference voltage 380 V only under the sag control strategy, and the microgrid system cannot maintain long-term stable operation. After the introduction of the second-level compensation control strategy, although the voltage of each DG fluctuates correspondingly when the system load fluctuates, the overall stability is about 380 V, which can realize the non-differential operation of each DG voltage in the system. The control strategy in this paper can achieve stable voltage at 0.3 s, with faster convergence and smaller voltage fluctuation, so that the system can basically run at 380 V.

Figure 5j–l show the reactive power distribution under the three control strategies respectively. In order to maintain the reactive power balance of the system when the reactive load in the system changes, the reactive power output of each DG in the microgrid changes accordingly. However, the reactive power of each DG in the microgrid cannot be distributed proportionally only under the action of droop control, which cannot meet the reactive power control goal in the microgrid. After the introduction of the second-level optimal control strategy, although the reactive power output of each DG fluctuates correspondingly when the system load fluctuates, the reactive power output of each DG unit in the system can maintain proportional distribution, and the system can run stably. In this paper, the global reactive power output can be consistent at about 0.1 s, the convergence rate is faster, the reactive power fluctuation is smaller, and the accurate reactive power allocation can be achieved.

As evident from the simulation results stated above, the control strategy proposed in this paper demonstrates faster convergence than the other two strategies when the AC microgrid load undergoes changes. Notably, the reactive power output achieves consistency at 0.3 s when the global incremental cost remains consistent at 0.1 s, while the frequency stabilizes at 0.5 s and the voltage stabilizes promptly at 0.1 s. Furthermore, the parameter fluctuations are observed to be smaller, thereby realizing an economic distribution of active power.

5.2 Verification of DC Microgrid Control Strategy

To verify the effectiveness of the DC microgrid control strategy, the system model shown in Fig. 6 is taken as the research object for simulation analysis. The DC microgrid consists of three DG1, DG2, and DG3 with a rated voltage of 380 V, each of which is connected by line and load. DG1 and DG2 are both connected to DG3, but there is no direct physical line or communication line between them. The values of control parameters and system parameters are shown in Table 2. The initial active load is set to 350 kW. After 1.5 s, increase the active load to 700 kW. The simulation results of the DC microgrid under different control strategies are shown in Fig. 7.

Fig. 6
figure 6

Simulation model of DC microgrid control strategy

Table 2 Control strategy and system parameters of DC microgrid
Fig. 7
figure 7

Simulation results of DC microgrid under different control strategies

From Fig. 7a–c, the power mapping factor changes under the three control strategies are shown. In the face of sudden load changes, drooping control alone cannot make the incremental cost of each DG in the microgrid consistent. After the introduction of the three-level optimal control strategy, although the incremental cost fluctuates correspondingly when the system load fluctuates, the incremental cost of each DG unit in the system can remain consistent, that is, the system can maintain stable operation under the economic optimal state. The control strategy proposed in this paper can maintain the same global incremental cost at 0.2 s, the convergence rate is faster, the system fluctuation is smaller, and the active power can be accurately allocated.

From Fig. 7d–f, node voltage changes under three control strategies are shown respectively. In the case of load fluctuation, droop control can maintain the operation of the system by adjusting the output voltage of each DG in the system, but the system voltage cannot be restored to the rated reference voltage of 380 V, and the microgrid system cannot run stably for a long time. After introducing the three-level optimal control strategy, the voltage of each DG can be stabilized at the rated reference voltage of 380 V, and the differential operation of each DG voltage in the system can be realized. The control strategy proposed in this paper can achieve voltage stability at 0.4 s, convergence speed is faster, voltage fluctuation is smaller, overcoming the inherent defects of traditional droop, and the system can basically run at 380 V.

The simulation results reveal that compared to the other two strategies, the control strategy proposed in this paper expedites the convergence rate while ensuring the accurate distribution of active power and restoring the node voltage to the desired reference value.

5.3 Verification of Intergroup Control Strategy for AC/DC Hybrid Microgrids

To verify the effectiveness of the intergroup control strategy of the AC/DC hybrid microgrid submitted in this paper, an AC/DC hybrid microgrid groups simulation model, as shown in Fig. 8, is built based on MATLAB/Simulink. The hybrid microgrid group consists of four microgrids and three ILC devices. The AC/DC hybrid microgrid groups comprises two AC sub microgrids MG1 and MG2, with a rated voltage of 380 V, and two DC sub microgrids MG3 and MG4, with a rated voltage of 700 V, including five AC DG units and five DC DG units. The values of \(\alpha\) and \(\beta\) are shown in Table 3. The public bus of each microgrid is equipped with a corresponding load. The active load adopts resistive load, and the reactive load adopts inductive load. Each microgrid contains two DG units that can communicate with ILCs, and the interlinking converter ILC2 can communicate with the other two ILCs in two directions. Load, line parameters, and system control parameters are shown in Table 4.

Fig. 8
figure 8

Simulation model of AC/DC hybrid microgrid groups system

Table 3 The cost factor of DGs
Table 4 Line parameters and initial load

In 0 ~ 2.5 s, ILCs are placed in the locked state, and each microgrid reaches the stable operation state by itself. At 2.5 s, the ILCs are placed in the operating state, and the whole microgrid groups can realize the economic dispatch of power through the transmission of active power among microgrids. At 5.5 s, increase the active load of the DC sub microgrid from 100 to 210 kW. The operation simulation results of the AC/DC hybrid microgrid groups are shown in Fig. 9.

Fig. 9
figure 9

Simulation results of the AC/DC hybrid microgrid groups control strategy

As shown from Fig. 9a, b, each DG node can converge quickly and uniformly under the internal control strategy of the microgrid. After the ILCs are put into use at 2.5 s, each ILC quickly adjusts the exchange power among the microgrids to reach a consistency on the power mapping factor of each microgrid. During this period, the economic distribution within each microgrid can still be maintained. In the subsequent process of load increase, the AC/DC hybrid microgrid groups control strategy can still meet the target requirements.

As shown from Fig. 9c, d, under the action of the internal control strategy and ILC control strategy of the microgrid, the frequency of the AC microgrid and the voltage of the DC microgrid can be quickly restored to the reference value to ensure the power balance of the microgrid groups.

As shown from Fig. 9e, f, the DG nodes in each microgrid distribute reactive power according to the principle of equal proportion distribution. When the DC load changes, the system stability is realized by exchanging energy under the action of inter-group control strategy. Under the action of secondary voltage adjustment, the voltage of each microgrid can be restored to the reference value.

The strategy proposed in this paper is implemented in AC/DC hybrid microgrid groups, and the simulation results demonstrate that ILC devices effectively facilitate the transfer of active power flow among microgrids and achieve an equal average incremental cost for each microgrid. The internal control strategy of each microgrid can be integrated with the inter-group control strategy to ensure the stable operation of AC/DC hybrid microgrid groups.

6 Conclusion

Aiming at the stability optimization problem of the AC/DC hybrid microgrid groups, a distributed optimization control strategy for the AC/DC hybrid microgrid groups based on finite time is proposed in this paper. Through theoretical analysis and experiment, it is proved that the control strategy is effective and can achieve the established control goal. Given the growing grid penetration, the control strategy proposed in this paper is designed to successfully integrate various sources and load equipment, including wind energy, solar energy, energy storage devices, electric vehicles, and others, thereby enhancing the grid’s ability to handle these resources. The main contents of the policy are as follows:

i. At the level of microgrid control, this paper introduces the secondary control term based on finite-time consistency protocol into the improved power mapping factor droop control strategy, realizes the distributed optimal control of AC/DC microgrids, realizes the proportional distribution of reactive power of AC microgrid and the economic distribution of DC microgrid, and can restore the frequency and voltage of microgrid to the reference value.

ii. In terms of microgrid intergroup control, the ILC control strategy with the average power mapping factor realizes the economic power distribution among AC/DC hybrid microgrids, and the application of finite-time consistency algorithm further speeds up the convergence of microgrids.

The potential limitation of the control method proposed in this paper is that only the ideal communication conditions are assumed. For the non-ideal communication conditions, there will be delay and packet loss in the process of data transmission. In the future, we can improve the algorithm considering delay and packet loss and consider the design of event triggering mechanism in the case of limited communication bandwidth.