1 Introduction

In the last decades several economic, technological and environmental aspects have inspired and motivated the transformation of the traditional power generation and transmission towards smaller and renewable Distributed Generation units (DGus) [1,2,3]. However, the increasing penetration of the Renewable Energy Sources (RES), such as photovoltaic arrays or wind turbines, due to the unpredictable generation, has given rise to a new challenge for operating and controlling the power network safely and efficiently [4, 5]. This challenge has been recently faced by exploiting the so-called “ microgrids”, which are clusters of DGus, loads and storage systems interconnected through power lines [6,7,8,9,10]. Moreover, they can also operate autonomously, i.e., disconnected from the main grid, in the so-called islanded operation mode [11, 12].

In this context, due to the traditional widespread use of Alternate Current (AC) electricity in the majority of industrial, commercial and residential applications, the research mainly focused on developing control solutions for AC microgrids [13,14,15,16,17]. However, the fast technological development in power electronics, and the increasing number of DC loads in several fields (e.g. automotive [18], marine, avionics [19,20,21,22]), recently moved the interest to DC microgrids [23]. More precisely, several aspects, in terms of efficiency, encourage the use of DC-based power systems: (i) RESs and fuel cells generate DC electricity, (ii) only the active power needs to be controlled, (iii) the notorious skin effect is avoided, (iv) power lossy DC–AC and AC–DC conversion stages are reduced [24, 25].

In the literature, the problem of control the voltage in DC microgrids has been studied and solved with different control approaches (see for instance [26,27,28] and the references therein). In [29,30,31] consensus algorithms are designed in order to perform power sharing between the DGus of the microgrid. A genuine fuzzy control strategy is designed in [32], while [33] uses fuzzy methodology together with gain-scheduling techniques to accomplish both current sharing and energy management. Instead in [34] a droop current controller is proposed to interface photovoltaic arrays with DC distribution power grids, and a model predictive controller is designed to track the maximum power point.

In this paper an islanded DC microgrid with DGus interconnected according to an arbitrary complex and meshed topology including rings is considered, and each DGu is interfaced with the network through a DC–DC Buck converter. The power network topology is represented by a connected and undirected graph, and the model, that takes into account the power lines dynamics, is affected by unknown load demand and unavoidable modelling uncertainties.

The proposed solution relies on the Sliding Mode (SM) control methodology. SM control belongs to the class of Variable Structure Control Systems so that it seems perfectly adequate to control the variable structure nature of DC–DC converters even in presence of unavoidable modelling uncertainties and external disturbances [35,36,37,38,39]. More precisely, a second order sliding mode control algorithm [40] could be designed to solve the aforementioned voltage control problem. However, this solution allows the switching frequency of the Buck converter to be not constant and not a priori fixed. So, the switching frequency could be very high, implying the increase of the power losses. Then, in order to avoid this problem and obtain a continuous control signal that can be used as duty cycle of the Buck converter, a third order Sliding Mode (3-SM) control [41] is proposed together with a Levant’s second order differentiator [42]. In fact, we assume that only the load voltage can be locally measured. This makes the proposed control approach decentralized and easy to implement.

Another possibility is to implement second-order sliding manifold strategies by using a high-gain control approach [43,44,45]. Making reference to [46, 47], the sliding manifold is initially “bent” so that the initial state of the controlled system lies since the beginning on the sliding surface, thus avoiding any reaching phase. The bending is controlled by an exponentially decaying term. Once the exponential action is negligible, the high gain control allows to stay close to the original, unbent, manifold thus bringing the error to small values. Robustness with respect to unknown disturbances and uncertain parameters is moreover assured by high gain control [48]. Note however that, while the sliding mode control assures finite-time reaching of the sliding surface, the high gain strategy can only guarantee asymptotic reaching. On the other side, control action is limited since the beginning with the high-gain control, while nothing can be said about the third-order sliding mode during the reaching phase.

Motivated by the above considerations, we propose in this paper a mixed strategy, employing both a third-order sliding mode controller and a high-gain controller in the reaching phase, with a fuzzy scheduler to select, or better, to combine the two strategies. Finally, the proposed solutions are theoretically analyzed and assessed in simulation.

Fig. 1
figure 1

The considered electrical diagram of a typical DC microgrid composed of two DGUs

The present paper is organized as follows: Sect. 2 introduces the microgrid model together with some basic notions on DGus, while in Sect. 3 the control problem is formulated. The proposed control scheme is presented in Sect. 4. In Sect. 5 the simulation results are illustrated and discussed. Some conclusions are gathered in Sect. 6.

2 Microgrid model

In this section, for the readers’ convenience, some basic notions on DGus are discussed. Then, the dynamic model of a microgrid is presented.

$$\begin{aligned}&A= \begin{bmatrix} -L_{t}^{-1}R_{t}&-L_{t}^{-1}&0_{n \times m}\\ C_{t}^{-1}&0_{n \times n}&C_{t}^{-1}\mathcal {B}\\ 0_{m \times n}&-L^{-1}\mathcal {B}^{T}&-L^{-1}R \end{bmatrix},\quad B= \begin{bmatrix} L_{t}^{-1}\\ 0_{n \times n}\\ 0_{m \times n} \end{bmatrix},\\&B_w= \begin{bmatrix} 0_{n \times n}\\ -C_{t}^{-1}\\ 0_{m \times n} \end{bmatrix},\qquad C= \begin{bmatrix} 0_{n \times n} \quad I_{n\times n} \quad 0_{n \times m} \end{bmatrix}. \end{aligned}$$

In Fig. 1 the schematic electrical diagram of a typical microgrid composed of two DGus is reported. The renewable energy source (e.g. photovoltaic panels) of a DGu is represented by a direct current (DC) voltage source \(V_{\mathrm {DC}}\) which is interfaced with the electric DC network through a DC–DC Buck converter. The latter feeds a local DC load, which is connected to the so-called Point of Common Coupling (PCC), and it can be treated as a current disturbance W. At the output of the Buck converter, a low-pass filter \(R_t L_t C_t\) is considered, where \(R_t\) represents the filter parasitic resistance. Moreover, the DGu\(_i\) can exchange power with the DGu\(_j\) through the resistive-inductive interconnecting line \(R_{ij}\)\(L_{ij}\).

Now, the dynamic model of a microgrid composed of n DGus is presented.Footnote 1 The power network is represented by a connected and undirected graph \(\mathcal {G} = (\mathcal {V},\mathcal {E})\), where the nodes \(\mathcal {V} = \{1,\ldots ,n\}\), represent the DGus and the edges \(\mathcal {E} \subset \mathcal {V}\times \mathcal {V} = \{1,\ldots ,m\}\), represent the distribution power lines interconnecting the DGus. First, consider the model of a microgrid composed of two DGus as reported in Fig. 1. Then, by applying the Kirchhoff’s current (KCL) and voltage (KVL) laws, the differential equations that describe the dynamic of the i-th node (i.e., DGu\(_i\)) are the following

$$\begin{aligned} {\left\{ \begin{array}{ll} \dot{I}_{t_i} = -\frac{R_{t_i}}{L_{t_i}} I_{t_i} - \frac{1}{L_{t_i}} V_i + \frac{1}{L_{t_i}}U_i \\ \dot{V_i} = \frac{1}{C_{t_i}} I_{t_i} - \frac{1}{C_{t_i}}W_i - \frac{1}{C_{t_i}} { \sum _{j \in \mathcal {N}_i}^{}I_{ij}}, \end{array}\right. } \end{aligned}$$
(1)

where \(\mathcal {N}_i\) is the set of nodes (i.e., DGus) connected to the i-th node by distribution lines. Moreover, for each \(j \in \mathcal {N}_i\), the line dynamics can be expressed as

$$\begin{aligned} \begin{array}{lll} \dot{I}_{ij}= & {} \frac{1}{L_{ij}}(V_i - V_j) - \frac{R_{ij}}{L_{ij}} I_{ij} \end{array}. \end{aligned}$$
(2)

Now, we represent the network topology by its corresponding incidence matrix \(\mathcal {B} \in \mathbb {R}^{n \times m}\). In particular, one has that

$$\begin{aligned} \mathcal {B}_{ik}= {\left\{ \begin{array}{ll} +1 &{}\quad \text {if }I_k \text { entering into DGu}_i\text { is assumed positive}\\ -1 &{}\quad \text {if }I_k\text { exiting from DGu}_i\text { is assumed positive}\\ 0 &{}\quad \text {if }k\text { is not connected to }i, \end{array}\right. } \end{aligned}$$

\(I_k = I_{ij}\) being the current exchanged through the edge k (i.e., the line \(R_{ij}L_{ij}\,\)) of the graph \(\mathcal {G}\). To study now the overall microgrid we write system (1) and the distribution lines dynamics (2) in a compact way for all the nodes \(i \in \mathcal {V}\) as

$$\begin{aligned} {\left\{ \begin{array}{ll} \dot{I}_{t} = -L_t^{-1}R_t I_{t} - L_t^{-1}V + L_t^{-1}U\\ \dot{V} = C_t^{-1}I_{t} + C_t^{-1}\mathcal {B}I - C_t^{-1}W\\ \dot{I} = -L^{-1}\mathcal {B}^T V - L^{-1}RI, \end{array}\right. } \end{aligned}$$
(3)

where \(V \in \mathbb {R}^{n}\), \(I_t \in \mathbb {R}^{n}\), \(W \in \mathbb {R}^{n}\), \(I \in \mathbb {R}^{m}\), and \(U \in \mathbb {R}^{n}\) represent, respectively, the following signals: the load voltages, the currents generated by the DGus, the unknown currents demanded by the loads, the currents along the lines, and the Buck converters output voltages. Moreover \(C_t, L_t\) and \(R_t\) are \(n \times n\) diagonal matrices, while L and R are \(m \times m\) diagonal matrices, e.g. \(R_t = {\text {diag}}\{R_{t_1}, \dots , R_{t_n}\}\) and \(R = {\text {diag}}\{R_{1}, \dots , R_{m}\}\), with \(R_k=R_{ij}\).

3 Problem formulation

Let \(x_{[S]}\) denote the vector \([S_1, \dots , S_n]^{T}\) with \(S \in \{V, I_{t}\}\), and \(x_{[I]}\) denote the vector \([I_1, \dots , I_m]^{T}\), with \(I_k = I_{ij}\). Then, system (3) can be written in the so-called state-space representation, i.e.,

$$\begin{aligned} {\left\{ \begin{array}{ll} \dot{x}_{[I_{t}]} = -L_t^{-1}R_t x_{[I_{t}]} - L_t^{-1}x_{[V]} + L_t^{-1}u\\ \dot{x}_{[V]} = C_t^{-1}x_{[I_{t}]} + C_t^{-1}\mathcal {B}x_{[I]} - C_t^{-1}w\\ \dot{x}_{[I]} = -L^{-1}\mathcal {B}^T x_{[V]} - L^{-1}Rx_{[I]} \\ y = x_{[V]}, \end{array}\right. } \end{aligned}$$
(4)

where \(x =\left[ x^T_{[I_{t}]}\, x^T_{[V]}\, x^T_{[I]} \right] ^T\in \mathbb {R}^{2n+m}\) is the state vector, \(u = U \in \mathbb {R}^{n}\) is the control vector, \(w = W \in \mathbb {R}^{n}\) is the disturbance vector, and \(y= x_{[V]} \in \mathbb {R}^{n}\) is the output vector. Then, the previous system can be written in a compact way as

$$\begin{aligned} {\left\{ \begin{array}{ll} \dot{x} = Ax+Bu+B_w w\\ y = Cx, \end{array}\right. } \end{aligned}$$
(5)

where \(A\in \mathbb {R}^{(2n+m)\times (2n+m)}\) is the dynamics matrix of the microgrid, \(B\in \mathbb {R}^{(2n+m)\times n}\), and \(B_w\in \mathbb {R}^{(2n+m)\times n}\), and \(C\in \mathbb {R}^{n\times (2n+m)}\), as reported above.

To permit the controller design in the next section, the following assumption is required on the state and the disturbance.

Assumption 1

The load voltage \(V_i\) is locally available at DGu\(_i\). The disturbance \(W_i\) is unknown but bounded and smooth up to the second derivative.

The control problem is now formulated. Let Assumption 1 hold. Given system (1)–(5), design a decentralized control scheme capable of guaranteeing that the tracking error between any controlled variable and the corresponding reference is steered to zero in finite time even in presence of the uncertainties.

4 Proposed control scheme

In this section, a 3-SM control algorithm and a high-gain controller are proposed together with a fuzzy scheduling to solve the aforementioned voltage control problem.

4.1 Third order sliding mode (3-SM) controller

Consider system (5) and select the sliding surface as

$$\begin{aligned} \sigma = y - y^{\star }, \end{aligned}$$
(6)

where \(\sigma \in \mathbb {R}^n,\) and \(y^{\star }=x^{\star }_{[V]} \in \mathbb {R}^n\) is the vector of reference values, such that the following assumption is verified.

Assumption 2

Let the references \(y^{\star }_i, \, i=1,\dots ,n,\) to have continuous derivative up to order 3.

Moreover, with reference to (6), it appears that the relative degreeFootnote 2 is \(\rho =\) 2, so that a SOSM control naturally applies [40]. In real applications, the discontinuous control can be directly used to open and close the switches of the Buck converters. However, the Insulated Gate Bipolar Transistors (IGBTs) switching frequency cannot be fixed, and then it could be very high, implying the increase of the power losses. Usually, in order to achieve a constant IGBTs switching frequency, Buck converters are controlled by implementing the so-called Pulse Width Modulation (PWM) technique. To do this, a continuous control signal that represents the so-called duty cycle of the Buck converter is required. In order to generate a continuous control signal, as suggested in [40], the system relative degree can be artificially increased. Therefore, by defining the auxiliary variables \(\xi _{1}=\sigma \), \(\xi _{2}=\dot{\sigma }\) and \(\xi _{3}=\ddot{\sigma }\), the auxiliary system can be expressed as

$$\begin{aligned} {\left\{ \begin{array}{ll} \dot{\xi }_{1} = \xi _{2}\\ \dot{\xi }_{2} = \xi _{3}\\ \dot{\xi }_{3} = \phi + \varGamma h\\ \dot{u} = h, \end{array}\right. } \end{aligned}$$
(7)

where \(\xi _{2}\) and \(\xi _{3}\) are unmeasurable and

$$\begin{aligned} \phi&= +\,C_t^{-1} \left( L_t^{-1}R_tL_t^{-1}+\mathcal {B}L^{-1}RL^{-1}\mathcal {B}^T\right) x_{[V]}\nonumber \\&\quad +\,C_t^{-1}\left[ L_t^{-1}R_tL_t^{-1}R_t-\left( L_t^{-1}+\mathcal {B}L^{-1}\mathcal {B}^T\right) C_t^{-1}\right] x_{[I_t]}\nonumber \\&\quad +\,C_t^{-1}\left[ \mathcal {B}L^{-1}RL^{-1}R-\left( L_t^{-1}+\mathcal {B}L^{-1}\mathcal {B}^T\right) C_t^{-1}\mathcal {B}\right] x_{[I]}\nonumber \\&\quad -\,C_t^{-1}L_t^{-1}R_tL_t^{-1}u+C_t^{-1}\left( L_t^{-1}+\mathcal {B}L^{-1}\mathcal {B}^T\right) C_t^{-1}w\nonumber \\&\quad -\,C_t^{-1}\ddot{w}-{x}^{\star (3)}_{[V]},\nonumber \\ \varGamma&= C_t^{-1}L_t^{-1} \end{aligned}$$
(8)

are uncertain with bounds

$$\begin{aligned} {{|}\phi _{i}{|}} \le \varPhi _{i} , \quad \varGamma _{\min _{i}}\le \varGamma _{ii} \le \varGamma _{\max _{i}}, \quad i=1, \dots , n, \end{aligned}$$
(9)

\(\varPhi _{i}\), \(\varGamma _{\min _{i}}\) and \(\varGamma _{\max _{i}}\) being known positive constants.

Now, the third order Sliding Mode (3-SM) control law proposed in [41] can be used to steer \(\xi _{1_i}\), \(\xi _{2_i}\) and \(\xi _{3_i}, \, i{=}1, \dots , n\), to zero in finite time in spite of the uncertainties, i.e.,

$$\begin{aligned} h_{i}=-\alpha _{i} \left\{ \begin{array}{@{}l@{}} \begin{array}{ll} h_{1_i} = {\text {sgn}}(\ddot{\sigma }_{i}), &{}\quad \bar{\sigma }_{i} \in M_{1_i}/M_{0_i}\\ h_{2_i} = {\text {sgn}}\biggl (\dot{\sigma }_{i}+\frac{\ddot{\sigma }_{i}^2h_{1_i}}{2\alpha _{r_i}}\biggr ), &{}\quad \bar{\sigma }_{i} \in M_{2_i}/M_{1_i}\\ h_{3_i} = {\text {sgn}}(s_{i}(\bar{\sigma }_{i})), &{}\quad \text {else}, \end{array} \end{array}\right. \end{aligned}$$
(10)

with \(\bar{\sigma }_{i} = [\sigma _i, \dot{\sigma }_i, \ddot{\sigma }_i]^T\) and

$$\begin{aligned} s_i(\bar{\sigma }_i) = \sigma _i + \frac{\ddot{\sigma }_{i}^3}{3\alpha ^{2}_{r_i}} + h_{2_i}\biggl [ \frac{1}{\sqrt{\alpha _{r_i}}}\biggl (h_{2_i}\dot{\sigma }_i + \frac{\ddot{\sigma }_{i}^2}{2\alpha _{r_i}}\biggr )^{\frac{3}{2}}+\frac{\dot{\sigma }_{i}\ddot{\sigma }_i}{\alpha _{r_i}}\biggr ], \end{aligned}$$

with

$$\begin{aligned} \alpha _{r_i} = \alpha _i\varGamma _{\min _i}-\varPhi _i > 0 . \end{aligned}$$
(11)

In (10) the manifolds \(M_{0_i}\), \(M_{1_i}\), \(M_{2_i}\) are defined as

$$\begin{aligned} \begin{array}{lll} M_{0_i} &{}= &{}\bigl \{ \bar{\sigma }_i \in \mathbb {R}^3 : \sigma _i=\dot{\sigma }_i=\ddot{\sigma }_i=0 \bigr \}\\ M_{1_i} &{}= &{}\bigl \{ \bar{\sigma }_i \in \mathbb {R}^3 : \sigma _i-\frac{\ddot{\sigma }_{i}^3}{6\alpha _{r_i}^2}=0, \dot{\sigma }_i+\frac{\ddot{\sigma }_{i}|\ddot{\sigma }_i|}{2\alpha _{r_i}}=0 \bigr \}\\ M_{2_i} &{}= &{}\bigl \{ \bar{\sigma }_i \in \mathbb {R}^3 : s_i(\bar{\sigma }_i)=0 \bigr \}. \end{array} \end{aligned}$$
(12)

Note that, in (10) the only parameter to tune is the control amplitude \(\alpha _i\), which is selected according to (11). Moreover, from (7) one can observe that the control signal \(h_i = \dot{u}_i\) is discontinuous and affects only \(\sigma _i^{(3)}\), while the control actually fed into the plant \(u_i\) is continuous. Note that the 3-SM control algorithm is not used to reduce the chattering phenomenon, which is intrinsically generated by the switch of the power converter. The 3-SM control algorithm is applied in order to use the continuous control input \(u_i\) as duty cycle of the switch of the i-th Buck converter.

From (10), one can also observe that the controller of DGu\(_i\) requires not only \(\sigma _i\), but also \(\dot{\sigma }_i\) and \(\ddot{\sigma }_i\). Yet, according to Assumption 1, only the load voltage \(V_i\) is measurable at DGu\(_i\). Then, one can rely on Levant’s second-order differentiator [42] to retrieve \(\dot{\sigma }_i\) and \(\ddot{\sigma }_i\) in finite time. With reference to system (7), for \(i=1,\dots ,n,\) one has

$$\begin{aligned} {\left\{ \begin{array}{ll} \dot{\hat{\xi }}_{1_i} = -\lambda _{0_i} \left| {\hat{\xi }}_{1_i}-\xi _{1_i}\right| ^{\frac{2}{3}}{\text {sgn}}\left( {\hat{\xi }}_{1_i}-\xi _{1_i}\right) + {\hat{\xi }}_{2_i}\\ \dot{\hat{\xi }}_{2_i} = -\lambda _{1_i}\left| {\hat{\xi }}_{2_i}-\dot{\hat{\xi }}_{1_i}\right| ^{\frac{1}{2}}{\text {sgn}}\left( {\hat{\xi }}_{2_i}-\dot{\hat{\xi }}_{1_i}\right) + {\hat{\xi }}_{3_i}\\ \dot{\hat{\xi }}_{3_i} = -\lambda _{2_i} {\text {sgn}}\left( {\hat{\xi }}_{3_i}-\dot{\hat{\xi }}_{2_i}\right) , \end{array}\right. } \end{aligned}$$
(13)

where \({\hat{\xi }}_{1_i}, \, {\hat{\xi }}_{2_i}, \, {\hat{\xi }}_{3_i}\) are the estimated values of \(\xi _{1_i}, \xi _{2_i}, \xi _{3_i},\) respectively, and \(\lambda _{0_i}=3 \varLambda _i^{1/3}, \, \lambda _{1_i}=1.5\varLambda _i^{1/2}, \, \lambda _{2_i}=1.1\varLambda _i, \, \varLambda _i>0,\) is a possible choice of the differentiator parameters suggested in [42]. Stability of 3-SM control law (10)–(12) has been shown in [27].

4.2 High-gain controller

The 3-SM controlled presented in Sect. 4.1 has satisfactory performance, including finite-time reaching and strong robustness when the sliding phase is achieved. However, during the reaching phase, especially at the beginning, it is hard to impose limits on the control, hence large control peaks may be necessary. For this reason, in the initial phase it makes sense to use a strategy that limits the control overshoot, like the one proposed in [49]. The following is based on the control strategy presented in [43] and particularized to the case of relative degree two. Preliminarily, the sliding function has to be modified as follows

$$\begin{aligned} \tilde{\sigma }=\eta -\sigma ,\quad \eta =e^{\varSigma \, t} (c_0+c_1t), \end{aligned}$$
(14)

where \(\varSigma \) is a Hurwitz \(n\times n\) real matrix to be suitably selected, while \(c_0\), \(c_1\) are real vectors given by

$$\begin{aligned} c_0= & {} {y}(0)-{y^\star }(0),\\ c_1= & {} \dot{y}(0)-{\dot{y}^\star }(0)-c_0,\nonumber \end{aligned}$$
(15)

\(y(0), y^\star (0), \dot{y}(0), \dot{y}^\star (0)\) being the initial conditions of the system output (desired trajectory) and its time derivatives, respectively. Let the control law be defined by the differential equation

$$\begin{aligned}&\epsilon ^{\nu } D_\nu u^{(\nu )}+\epsilon ^{\nu -1} D_{\nu -1}u^{(\nu -1)}+\cdots + \epsilon D_1 \dot{u}\nonumber \\&\quad =N_2\ddot{\tilde{\sigma }}+N_1 \dot{\tilde{\sigma }} +N_0\tilde{\sigma }, \end{aligned}$$
(16)

where \(\epsilon >0\) is a “ small” real constant, and \(D_i, i=1,\ldots ,\nu \), \(\nu \ge 2\), and \(N_i, i=0,1,2\) are real constant \(n\times n\) matrices to be selected as follows:

(i):

the matrices \(N_1\), \(N_2\) are such that the algebraic equations

$$\begin{aligned}&N_1 H_1+N_2H_2= M \end{aligned}$$
(17)
$$\begin{aligned}&N_2 H_1=0 \end{aligned}$$
(18)

are satisfied with M invertible \(n\times n\) real matrix;

(ii):

the polynomial

$$\begin{aligned} \det \left( D_\nu s^{\nu }+D_{\nu -1}s^{\nu -1}+\cdots +D_1s+M\right) \end{aligned}$$
(19)

is strictly Hurwitz;

(iii):

the polynomial

$$\begin{aligned} \det \left( N_2 s^2+N_1s+N_0\right) \end{aligned}$$
(20)

is strictly Hurwitz;

iv):

the matrix \(\varSigma \) is Hurwitz stable.

Then in this assumptions the stability of control law is guaranteed [43, Theorem 1].

Remark 1

Note that by simple algebraic computations one can show that \(H_1=0\), \(H_2=(L_tC_t)^{-1}\), hence condition (i) trivially holds with \(N_2=I\), condition (ii) holds for any diagonal matrices \(D_1\) and \(D_2\) with positive entries, condition (iii) holds for any diagonal matrices \(N_2\), \(N_1\), \(N_0\) with positive entries and any Hurwitz matrix satisfies (iv).

Fig. 2
figure 2

Simulink scheme of controlled DC microgrid

4.3 Fuzzy scheduling

In the previous sections two controllers have been presented. The 3-SM sliding mode controller has satisfactory robustness properties and guarantees sliding mode in finite time. However, in the reaching phase the controlled state may have high overshoot, since there is no focus on the control action limitation. On the contrary, the high-gain controller focuses on the initial transient, thus producing better performances during the reaching phase.

In this section we propose to exploit both strategies, using a fuzzy scheduling of the controllers. The objective is to use the high-gain control during the transient and the 3-SM when the state is closer to the steady-state. The logic we follow is very simple: when the tracking error (i.e., the sliding variable \(\sigma \)) is “ small” we use the 3-SM controller, while when the error is “ large” the high-gain controller is used. Since the approach to be used in the selection of the appropriate control strategy is simply described in linguistic terms (e.g., steady-state, selection of the “stronger” control action during transient) a natural candidate scheduler is a fuzzy one. This approach has the added value of producing simply an overall control action that is continuous. The idea of using fuzzy inference systems (FIS) as scheduler among different controllers is not new [50,51,52]. As it is well-known, the advantage of using a fuzzy scheduling strategy (as opposite to any other switching strategy) is that fuzzy scheduler produces smooth signals.

A Sugeno FIS has been designed, with the tracking error as input and the selected control as output. The set of membership functions (MFs) we use is very simple: just three MFs, namely, transient-NEG and transient-POS for transient negative or positive error, respectively, and Steadystate, when the state can be considered in steady state (i.e., when the tracking error is “ small”).

Relying on the above MFs, a preliminary version of the switching strategy, employing only two simple rules, is formulated.

  • if (\(\sigma \) is transient-NEG) or (\(\sigma \) is transient-POS) then \(u=u_{hg}\),

  • if (\(\sigma \) is Steadystate) then \(u =u_{s} \),

where \(u_{hg}\) and \(u_{s}\) are the control actions generated by the high-gain and by the 3-SM controllers, respectively.

The above strategy is very simple, and assumes that the control will start with the high-gain strategy, ending with the sliding mode control. However, a corrective action is in order. During the initial transient the actual control follows the high-gain strategy although the SM controller is active (but ineffective in controlling the system, since the SM control is overrun by the fuzzy scheduler). Then the sliding mode controller “sees” a discrepancy between its commanded action and the plant evolution. This discrepancy is obviously interpreted as a disturbance, thus the sliding mode controller can produce large control values to compensate for this fictitious disturbance. This makes no harm until the high gain strategy is selected. However, when the tracking error is reduced, the control goes towards the values required by the sliding controller, that can be now very large, thus an overshoot could occur in the control. The phenomenon is in some sense similar to the well-known “wind-up” of the integral controllers. In order to avoid this phenomenon, it is possible to add two rules such that if the absolute value of the control generated by the sliding mode action is larger than the one required by the high-gain, then the control must follow the sliding mode control law.

Fig. 3
figure 3

Simulink scheme of a DGu

Fig. 4
figure 4

Simulink scheme of the considered microgrid

Combining together the rules, the following rule-base is obtained.

  • if (\(\sigma \) is transient-NEG) or (\(\sigma \) is transient-POS) then \(u =u_{hg} \),

  • if (\(\sigma \) is Steadystate) then \(u =u_{s} \),

  • if (\(\delta _u\) is POS) then \(u =u_{s} \),

  • if (\(\delta _u\) is NEG) then \(u =u_{hg} \),

where \(\delta _u ={{|}u_{s}{|}}-{{|}u_{hg}{|}}\), and NEG, POS are two MFs expressing “ negative” and “ positive”, respectively. Note that the third and the fourth rule in some sense contradict the first two, since they select the largest control action. One of the advantages of the use of fuzzy logic-based scheduling controllers is exactly the possibility to use rules in apparent contradiction, since the true “firing strength” of each rule depends nonlinearly on the system behaviour. In other words, by suitably choosing the fuzzy scheduler parameters it is possible that the first two rules will dominate at the beginning (during the reaching phase), while the effect of the last two rules will be apparent in a proximity of the sliding manifold.

Fig. 5
figure 5

Membership function of \(\delta _u\)

Fig. 6
figure 6

Membership function for identification of transient or steady state

Table 1 Rules of fuzzy block
Fig. 7
figure 7

Block diagram of the connections of DGus. The arrows indicate the positive direction of the currents through the power network

Table 2 Buck filter parameters
Table 3 Line parameters
Table 4 Loads and voltage references
Fig. 8
figure 8

Load voltages

Fig. 9
figure 9

Generated currents (at the output of the \(L_t C_t\) filter of the converter)

Fig. 10
figure 10

The currents through the distribution lines

Fig. 11
figure 11

Controlled buck converter output voltage

Fig. 12
figure 12

Comparison between the controllers \(K_{s}\), \(K_{hg}\) of DGu\(_1\) without fuzzy control, and the selected control with fuzzy scheduling

Fig. 13
figure 13

Comparison between \(K_{s}\), \(K_{hg}\) of DGu\(_1\) w/o fuzzy control, and the selected control with fuzzy scheduling, step-wise changing loads

Fig. 14
figure 14

Comparison of the effect of different controllers on the first load voltage, step-wise changing loads

The tuning of the five MFs has been done heuristically, but it is possible also to use nonlinear optimization algorithms in order to automate the tuning procedure.

5 Simulation results

In order to test the proposed strategy a MATLAB/Simulink/SimPowerSystem simulator has been implemented as shown in Fig. 2. Each DGu has been implemented with a Buck converter, as shown in Fig. 3. The block (blue) Microgrid is a realistic network of 5 DGus as shown in Fig. 4. In the green blocks there are

  • Third order sliding mode controller (\(K_{s}\)) in (10)–(12).

  • High gain controller (\(K_{hg}\)) in (16).

  • Fuzzy controller logic, that switch between the controllers \(K_{s}\) and \(K_{hg}\) according with the membership functions in Figs. 5 and 6, and rules in Table 1.

The MF parameters have been initially selected heuristically, and then a fine-tuning of the parameters has been carried out by using a Genetic Optimiser on a simplified version of the simulator (simplified removing the switching behaviour and replacing the model with an average model). In order to simplify computation, symmetry of the MFs around zero has been imposed, and only 20 generations have been used, since any increase in the number of generations has produced no meaningful improvement.

The microgrid connection can be described by a Block Diagram, as depicted in Fig. 7, and using the following incidence matrix \(\mathcal {B} \in \mathbb {R}^{5 \times 7}\)

$$\begin{aligned} \mathcal {B}= \begin{bmatrix} -1&-1&0&0&0&0&1\\ 1&0&-1&-1&0&0&0\\ 0&0&1&0&-1&0&0\\ 0&1&0&1&1&-1&0\\ 0&0&0&0&0&1&-1\\ \end{bmatrix}. \end{aligned}$$

The electrical parameters considered in simulation are given in Tables 2 and 3. For the high gain controller note that, by using (4), the parameters in (16) are \(H_1=0\) and \(H_2=(L_tC_t)^{-1}\), hence (18) trivially holds, while by selecting, for the sake of simplicity, \(N_i\) and \(D_i\) as diagonal matrices with positive entries all the hypothesis of Sect. 4.2 hold. The control parameters of \(K_{s}\) and \(K_{hg}\) are \(\alpha =2.5\cdot 10^3\), \(\varSigma = 1000 I\), \(\nu =2\), \(\epsilon = 0.001\), \(D_1= I\), \(D_2= I\), \(N_0=I\), \(N_1=2I\)\(N_2=1.1 I\) (I being the \(5\times 5\) identity matrix). In order to test the proposed control scheme, the loads and the voltage references change according to Table 4.

Note that the variations are such that the Assumptions 1 and 2 are verified. Figure 8 shows the time evolution of the load voltages, and one can note that the proposed controllers track very well the voltage references of all DGus. Moreover, in Figs. 9 and 10 the generated currents and the currents through the distribution lines are reported, respectively. Finally, Fig. 11 shows the time evolution of the control inputs \(u_i\), with \(i=1,\ldots , 5\). In particular, Fig. 12 puts into evidence the output control signal generated by \(K_{s}\), \(K_{hg}\) and Fuzzy Logic, respectively. Before 0.2 s the fuzzy chooses the high gain controller, instead when the control of \(K_{s}\) is higher, it instantly changes control strategy.

Up to now, we have supposed Assumptions 1 and 2 to hold. Although it is reasonable to consider the load to change smoothly, a critical situation can happen if the variation of some loads is very fast. In order to face this issue, we assume the worst-case scenario considering stepwise changing loads. The numerical values for the loads are still those in Table 4. In this case the 3-SM controller is unable to keep the system state on the manifold after the commutation, and a new reaching phase would take place. At this point the fuzzy scheduler commutes again to the HG controller, as at the very initial phase. This is apparent in Fig. 13, that is basically the same as Fig. 12, but it is clear that in case of abrupt load commutation the control is a fuzzy mixture of HG and 3-SM controllers.

The key points of the proposed strategy are illustrated in Fig. 14, where the usage of different control strategies on the voltage \(V_1\) is shown. Specifically, it is apparent that the fuzzy controller alleviates the initial generator stress (and actually the generator stress at any sudden load change). On the other side, the fuzzy controller inherits a finite-time convergence capability from the 3-SM controller. Finally, if the load is seen as a disturbance, the strong disturbance rejection property of the HG approach reflects into the fuzzy controller.

6 Conclusions

In this paper a decentralized control scheme based on Sliding Mode control strategies is designed to regulate the voltage in islanded buck-based DC microgrids with arbitrary complex topology. The model of a DC buck-based microgrid composed of several interconnected Distributed Generation Units through power lines is introduced by using a connected and undirected graph to represent power network. In particular, a mixed strategy, employing both a third-order sliding mode control algorithm and a high gain control strategy with a fuzzy scheduling. The chattering alleviation performed by the 3-SM control algorithm allows one to obtain a continuous control signal that can be used in PWM technique as duty cycle of the switch of the Buck converter in order to attain a constant switching frequency. The asymptotic stability of the whole system is proved, and the performance of the proposed decentralized control approach is evaluated in simulation considering a DC microgrid composed of five DGus arranged in a meshed topology including loops. Moreover the mixed approach allows to have a less generator stress, a finite time convergence and a more robustness. Finally a simulation scenario is presented to show the effectiveness and the advantage of the proposed strategy. The future works will address on a supervisory strategy rathen than a fuzzy approach, in order to understand the best methology to use both controllers. Moreover, the experimental results will be an important point to improve the importance of this mixed control.