## 3 Two-Level Control Design  
### Lower-Level Pseudo-Sliding Mode Control  
The lower-level, pseudo-sliding mode control presented in the following is developed analogously to [11], where this control technique was selected for its superior dynamic performance, robustness, and simplicity. Consider the configuration reported in Figure 2a first and refer to the same figure for symbols. The sliding function (inductance flux error) \(\lambda\) can be defined according to:  
\[\lambda=L(i-i^{*}). \tag{1}\]  
Let \(f_{sw}\) be the switching frequency and, consequently, \(T_{sw}=1/f_{sw}\) be the designed switching period. In addition, assume, as is common for power converter sliding mode control design, that: (a) \(v_{D}{}^{+}>0\) and \(v_{D}{}^{-}<0\); (b) negligible resistive terms on high-frequency ripple (\(R<2\pi f_{sw}L\)); and (c) \(v_{D}{}^{+}\) and \(v_{D}{}^{-}\), \(v\) and \(i^{*}\) being suitable, Lipschitz-continuous functions with spectra are limited to frequencies much lower than the switching frequency \(f_{sw}\). Figure 2: Modules for: AC ports (**a**); equilibrators (**b**); and DC ports (**c**). Referring to Figure 2a and considering the inductor constitutive equation, the relation between the sliding function \(\lambda\) and the ideal switched voltage \(e_{H}\) is then formulated as:  
\[\frac{d\lambda}{dt}=e_{H}-u_{eq}, \tag{2}\]  
where the ideal switched voltage \(e_{H}\) possible instantaneous values are \(v_{D}{}^{+}\) and \(v_{D}{}^{-}\). The equivalent voltage is expressed according to:  
\[u_{eq}=v+L\frac{di^{*}}{dt}+Ri^{*}. \tag{3}\]  
and represents the equivalent voltage, defined as the ideal continuous value of the discontinuous control variable \(e_{H}\) necessary to perform the desired control action [64], equal to the mean value of the switched voltage \(e_{H}\) in a sliding condition. The controllability condition under which a sliding mode can be enforced is determined by considering that, to maintain sliding condition, it is necessary to be able to enforce a positive and negative derivative (2) on the sliding function \(\lambda\), which results in:  
\[v_{D}^{-}<u_{eq}<v_{D}^{+}. \tag{4}\]  
The modulation algorithm used to enforce a sliding mode is based on a dynamic set of slanted thresholds [64], conceived to enforce a sliding mode with a fixed converter switching frequency. This is obtained considering a set of equally spaced time intervals \(T_{k}\), such that:  
\[T_{k+1}=T_{k}+\frac{T_{sw}}{2}. \tag{5}\]  
In each time interval \(t\in[T_{k-1},\,T_{k+1}]\), the resulting control law is  
\[e_{H}=\left\{ \begin{array}{lcl}v_{D}^{+}&\quad if\ \lambda<\big{(}v_{D}^{+}-u_{ eq}\big{)}(t-T_{k})\\ v_{D}^{-}&\quad if\ \lambda>\big{(}v_{D}^{-}-u_{ eq}\big{)}(t-T_{k})\end{array} \right., \tag{6}\]  
which realizes the system of slanted thresholds proposed in [64]. Considering now the DC port configuration reported in Figure 2b, and referring to the same figure for symbols, proceeding analogously, the sliding functions (inductance flux error) \(\lambda^{+}\), \(\lambda^{-}\) can be defined as  
\[\lambda^{+}=L\Big{(}i^{+}-i^{+*}\Big{)},\ \ \lambda^{-}=L\Big{(}i^{-}-i^{-*} \Big{)}, \tag{7}\]  
and the relation between the sliding functions \(\lambda^{+}\), \(\lambda^{-}\) and the ideal switched voltage \(e_{H}{}^{+}\), \(e_{H}{}^{-}\) is formulated as  
\[\frac{d\lambda^{+}}{dt}=e_{H}^{+}-u_{eq}^{+},\ \ \frac{d\lambda^{-}}{dt}=e_{H}^{-}-u_{ eq}^{-}. \tag{8}\]  
The ideal switched voltage \(e_{H}{}^{+}\) possible instantaneous values are 0 and \(v_{D}{}^{+}\), while the ideal switched voltage \(e_{H}{}^{-}\) possible instantaneous values are 0 and \(v_{D}{}^{-}\). The equivalent voltages are expressed according to:  
\[u_{eq}^{+}=v^{+}+L\frac{di^{+*}}{dt}+Ri^{+*},\ \ u_{eq}^{-}=v^{-}+L\frac{di^{-*} }{dt}+Ri^{-*}. \tag{9}\]  
Consequently, controllability conditions, separately for each half of the module, result in  
\[0<u_{eq}^{+}<v_{D}^{+},\ \ v_{D}^{-}<u_{eq}^{-}<0, \tag{10}\]and, in each time interval, the resulting control law is:  
\[