## 5 Implementation of the Adaptive SMC and Detailed Circuital Simulations
### Comparison with a Classical Controller  
This subsection presents the design of a cascade structure based on PI controllers to provide a comparison with a classical solution. The first step is to obtain the small-signal model of the power stage as \(\dot{\mathbf{X}}=\mathbf{A_{m}}\times\mathbf{X}+\mathbf{B_{m}}\times\mathbf{U_ {x}}\), where \(\mathbf{X}=[i_{L1}\;i_{L2}\;v_{C1}\;v_{C2}]^{T}\) is the state vector, \(\mathbf{U_{x}}=[d\;v_{b}]^{T}\) is the input vector, \(\mathbf{A_{m}}\) is the state Jacobian and \(\mathbf{B_{m}}\) is the input Jacobian. This process is performed by deriving the differential equations given in (14)-(17), as described in [40], obtaining the following Jacobian matrices:  
Figure 10: Response of the digital implementation to fast load transients. \[\mathbf{A_{m}}=\left[ \begin{array}{ccc}0&0&-\frac{1-d}{L_{1}}&\frac{d}{L_{1}}\\ 0&0&\frac{d}{L_{2}}&\frac{d}{L_{2}}\\ \frac{1-d}{C_{1}}&-\frac{d}{C_{1}}&0&0\\ -\frac{d}{C_{2}}&-\frac{d}{C_{2}}&0&0\end{array} \right]\quad\wedge\quad\mathbf{ B_{m}}=\left[ \begin{array}{ccc}\frac{v_{C1}+v_{C2}}{L_{1}}&0\\ \frac{v_{C1}+v_{C2}}{L_{2}}&-\frac{1}{L_{2}}\\ -\frac{i_{1}+i_{12}}{L_{1}}&0\\ -\frac{i_{1}+i_{12}}{C_{2}}&0\end{array} \right] \tag{59}\]  
The output of the small-signal model is calculated from \(\mathbf{Y}=\mathbf{C_{m}}\times\mathbf{X}+\mathbf{D_{m}}\times\mathbf{U_{x}}\), where \(\mathbf{C_{m}}\) and \(\mathbf{D_{m}}\) relate the output with the states and the inputs, respectively. The output of the small-signal model is \(\mathbf{Y}=[i_{l2}]\) because \(i_{l2}\) must be regulated to follow the \(i_{R}\) value provided by the high-pass filter; hence, \(\mathbf{C_{m}}=[0\ 1\ 0\ 0]\) and \(\mathbf{D_{m}}=[0\ 0]\). The steady-state values of \(d\), \(i_{l1}\), \(i_{l2}\), \(v_{C1}\) and \(v_{C2}\) are calculated from Equations (18)-(20) and replaced into Jacobians (59), and such a numerical small-signal model is introduced into the isotopol function of Matlab to design a PI controller; in [40], such a design is implemented using the classical root-locus technique. The design of that PI controller considers a damping ratio equal to \(0.707\) and a closed-loop bandwidth equal to \(F_{\mathrm{s}\mathrm{u}\mathrm{v}}/10\), which are standard criteria for linearized models; the resulting controller was \(G_{PI,\mathcal{L}}=\frac{0.1616\cdot\left(s+4.125\times 10^{4}\right)}{s}\). Finally, this \(G_{PI}\) controller processes the error between \(i_{R}\) and \(i_{l2}\) to produce the duty cycle of an additional PWM circuit used to generate the MOSFET signals; Figure 11 shows the structure of this inner current loop. The \(v_{C2}\) voltage is also regulated with a PI controller named \(G_{PI,\mathcal{L}}\). Such a second PI controller processes the error between \(v_{C2}\) and the reference \(v_{R}\) to produce the additional changes on \(i_{l2}\) needed to regulate \(v_{C2}\) with the desired settling time. This cascade controller requires a closed-loop model of the inner current loop. Equation (17) describes the dynamic behavior of \(v_{C2}\) with respect to the inductor currents, where the inner current loop guarantees the current relation given in Equation (20); hence, the resulting closed-loop model is given in both time domain (60) and Laplace domain (61). \[\frac{dv_{C2}}{dt}=-\frac{d}{1-d}\ \cdot\frac{i_{l2}}{C_{2}} \tag{60}\] \[\frac{v_{C2}}{i_{l2}}=-\frac{d}{1-d}\ \cdot\frac{1}{C_{2}\cdot s} \tag{61}\]  
The design of the voltage PI controller (\(G_{PI,\mathcal{L}}\)) was performed using Equation (61) for a unitary damping ratio to avoid any voltage oscillation and to request a slow current profile to the battery, thus avoiding high-frequency transients. In addition, the controller was designed to impose the desired settling time \(t_{s,C2}=100\) ms, which results in the controller \(G_{PI,\mathcal{L}}=\frac{-0.055\cdot\left(s+29.412\right)}{s}\) designed with the sistool function of Matlab.