### System description

Figure 1 shows the understudy DCMG including two DC distributed generation (DCDG) units, a multi-bus DC network, and cluster of local and common loads. Each DCDG unit is modelled by a DC voltage source and a DC–DC Buck–Boost converter (BBC). The point of common coupling (PCC) bus can be connected to the main DC grid through a circuit breaker. Depending on the status of the circuit breaker, the DCMG either can operates in grid-connected mode, or can autonomously operates in islanded mode. The parameters of the DCMG and DCDGs are given in “Appendix” [24].

### Modelling of a DCDG unit

Figure 2 shows a BBC-based DCDG unit [25]. Taking into account the parameters in the nominal conditions and neglecting the discontinuous conduction mode, the averaged dynamics model of the BBC can be expressed as:

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{{i}}= & {} {\theta _1}{\delta }-{\theta _2}{(1-\delta )v}-{\theta _3}{i} \end{aligned}$$

(1)

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{{v}}= & {} {\theta _4}{(1-\delta )i}-{\theta _4}{i_{\mathrm{o}}} \end{aligned}$$

(2)

where the state variables *i* and *v* are the average current and voltage of the BBC inductor and capacitor, respectively, \(i_{\mathrm{o}}\) is the output current of the BBC that is considered as a measurable external disturbance, \(\delta\) is the duty cycle of BBC switch, and

$$\begin{aligned} \theta _1=\frac{v_d}{L},\quad \theta _2=\frac{1}{L},\quad \theta _3=\frac{R}{L},\quad \theta _4=\frac{1}{C} \end{aligned}$$

(3)

are the BBC parameters in the nominal conditions. If the parameters \(\theta _1-\theta _4\) deviate from their nominal values, the BBC state equations can be modified as

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{{i}}= & {} \,{\theta _1}{\delta }-{\theta _2}{(1-\delta )v}-{\theta _3}{i}+\xi _{\mathrm{i}} \end{aligned}$$

(4)

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{{v}}= & {}\, {\theta _4}{(1-\delta )i}-{\theta _4}{i_{\mathrm{o}}}+\xi _{\mathrm{v}} \end{aligned}$$

(5)

where \(\xi _{\mathrm{i}}\) and \(\xi _{\mathrm{v}}\) are the lumped uncertainties imposed on system dynamics containing parametric uncertainties and system dynamic disturbances.

### Control strategy

In the grid-connected mode, all of the DCDG units operate in the current control mode. Therefore, both the DCDG1 and DCDG2 units are equipped with a designed adaptive current controller which regulates their current at pre-specified values. Adopting MS control strategy in the islanded mode, while DCDG2 operates in current controlled mode, as a slave unit, fulfilling the voltage control of the DCMG is deputed to DCDG1 as a master unit. Therefore, an adaptive voltage controller is designed in this paper that mounts on the inner current controller in a cascade structure, to force the voltage of DCMG to track pre-defined trajectory. In order to enhance the dynamic response, reference tracking performances, and robustness of the proposed control scheme, all of the controllers are adaptive designed in such a way that the lumped uncertainties imposed the system dynamics are estimated based on Lyapunov control theory. In the following subsections, the process of designing controllers is presented in details.

#### Current controller

The basis of both the master and slave controllers in the proposed control strategy is an adaptive current controller. Letting

$$\begin{aligned} e_{\mathrm{i}}=i^{{\mathrm{ref}}}-i \end{aligned}$$

(6)

be the reference current tracking error, and

$$\begin{aligned} \tilde{\xi }_{\mathrm{i}}=\hat{\xi }_{\mathrm{i}}-\xi _{\mathrm{i}} \end{aligned}$$

(7)

be the error between \(\xi _{\mathrm{i}}\) and its estimated value \(\hat{\xi }_{\mathrm{i}}\), then, to generate an adaptive control law, the following positive-definite Lyapunov function is selected

$$\begin{aligned} {{V_{\mathrm{i}}}}=\tfrac{1}{2}{e}_{\mathrm{i}}^{2}+\tfrac{1}{2}{{\gamma }_{\mathrm{i}}}\tilde{\xi }_{\mathrm{i}}^{2} \end{aligned}$$

(8)

where \({\gamma }_{\mathrm{i}}>{0}\) is an estimation gain. The time derivate of \(V_{\mathrm{i}}\) can be expressed as

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{i}}}={e}_{\mathrm{i}}\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{e}_{\mathrm{i}}+{{\gamma }_{\mathrm{i}}}\tilde{\xi }_{\mathrm{i}}\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}\tilde{\xi }_{\mathrm{i}} \end{aligned}$$

(9)

Using (6), (7), and (4), it can be obtain that

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{i}}}={e}_{\mathrm{i}}\left( \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{i}^{\mathrm{ref}}-{\theta _1}{\delta }+{\theta _2}{(1-\delta )v}+{\theta _3}{i}-\xi _{\mathrm{i}}\right) +{{\gamma }_{\mathrm{i}}}\tilde{\xi }_{\mathrm{i}}\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}\hat{\xi }_{\mathrm{i}} \end{aligned}$$

(10)

By cancelling the second term in right side of (10), the estimation law can be determined as [4]:

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}\hat{\xi }_{\mathrm{i}}=-{{\gamma }_{\mathrm{i}}^{-1}}e_{\mathrm{i}} \end{aligned}$$

(11)

Considering (11), \(\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{i}}}\) can be given by

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{i}}}={e}_{\mathrm{i}}\left( \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{i}^{\mathrm{ref}}-{\theta _1}{\delta }+{\theta _2}{(1-\delta )v}+{\theta _3}{i}-\hat{\xi _{\mathrm{i}}}\right) \end{aligned}$$

(12)

If the control input \(\delta\) is selected as

$$\begin{aligned} \delta =\left( \theta _1+\theta _2{v}\right) ^{-1}\left( \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{i}^{\mathrm{ref}}+{\theta _3}{i}-\hat{\xi _{\mathrm{i}}}+\theta _2+{k_{\mathrm{i}}}{e_{\mathrm{i}}}\right) \end{aligned}$$

(13)

where \({k_{\mathrm{i}}}>{0}\) is a control gain, then, it can be obtain that

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{i}}}=-{k_{\mathrm{i}}}{e}^2_{\mathrm{i}}<{0} \end{aligned}$$

(14)

that is a negative-definite function and based on Barballat’s Lemma [26], it can be conclude that the current controller system is asymptotically stable.

#### Voltage controller

The main control objective for master unit is to force the voltage of DCMG to remain at its nominal value. Letting

$$\begin{aligned} e_{\mathrm{v}}=v^{\mathrm{ref}}-v \end{aligned}$$

(15)

be the reference voltage tracking error, and

$$\begin{aligned} \tilde{\xi }_{\mathrm{v}}=\hat{\xi }_{\mathrm{v}}-\xi _{\mathrm{v}} \end{aligned}$$

(16)

be the estimation error, where \(\xi _{\mathrm{v}}\) is estimated value of \(\hat{\xi }_{\mathrm{v}}\), a positive-definite Lyapunov function can be chosen as:

$$\begin{aligned} {{V_{\mathrm{v}}}}=\tfrac{1}{2}{e}_{\mathrm{v}}^{2}+\tfrac{1}{2}{{\gamma }_{\mathrm{v}}}\tilde{\xi }_{\mathrm{v}}^{2} \end{aligned}$$

(17)

where \({\gamma }_{\mathrm{v}}>{0}\) is an estimation gain. Differentiating \(V_{\mathrm{v}}\) with respect to time gives

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{v}}}={e}_{\mathrm{v}}\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{e}_{\mathrm{v}}+{{\gamma }_{\mathrm{v}}}\tilde{\xi }_{\mathrm{v}}\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}\tilde{\xi }_{\mathrm{v}} \end{aligned}$$

(18)

Considering (15), (16) and (5), it can be obtained that

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{v}}}={e}_{\mathrm{v}}\left( \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{v}^{\mathrm{ref}}-{\theta _4}{(1-\delta )i}+{\theta _4}{i_{\mathrm{o}}}-\xi _{\mathrm{v}}\right) +{{\gamma }_{\mathrm{v}}}\tilde{\xi }_{\mathrm{v}}\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}\hat{\xi }_{\mathrm{v}} \end{aligned}$$

(19)

If the adaption law is chosen as [4]:

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}\hat{\xi }_{\mathrm{v}}=-{{\gamma }_{\mathrm{v}}^{-1}}e_{\mathrm{v}} \end{aligned}$$

(20)

\(\tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{v}}}\) can be reduced to

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{v}}}={e}_{\mathrm{v}}\left( \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{v}^{\mathrm{ref}}-{\theta _4}{(1-\delta )i}+{\theta _4}{i_{\mathrm{o}}}-\hat{\xi _{\mathrm{v}}}\right) \end{aligned}$$

(21)

With the following control law

$$\begin{aligned} i^{\mathrm{ref}}=(1-\delta )^{-1}\left( i_{\mathrm{o}}+\theta _4^{-1}\left\{ \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{v}^{\mathrm{ref}}-\hat{\xi _{\mathrm{v}}}+{k_{\mathrm{v}}}{e_{\mathrm{v}}}\right\} \right) \end{aligned}$$

(22)

where \({k_{\mathrm{v}}}>{0}\) is a control gain, it can be obtain that

$$\begin{aligned} \tfrac{{\mathrm{d}}}{{\mathrm{d}}t}{V_{\mathrm{v}}}=-{k_{\mathrm{v}}}{e}^2_{\mathrm{v}}<{0} \end{aligned}$$

(23)

Based on Barballat’s Lemma [26], it can be conclude that \(e_{\mathrm{v}}{\rightarrow }0\) asymptotically. While the master unit current controller follows a pre-specified reference current in the grid-connected mode, the current reference in the islanded mode of operation is determined by (22) to force the DCMG voltage to track a pre-defined trajectory. The block diagram of the proposed current and voltage controllers is shown in Fig. 3.