## 3 Controller Design and Genetic Algorithm Optimization Approach
### Model Predictive Control  
MPC is a model predictive control method that calculates control inputs by predicting the future states of the system and updates the control inputs at each sampling instant. Specifically, MPC models the system as a discrete-time dynamic model and uses this model to predict the future system states. Then, based on these predictions, an optimization  
Figure 3: Control block diagram of DAB sliding mode control.  
problem is solved to determine the optimal control inputs that drive the system states towards the desired target states within a future time horizon.  
According to Equation (3), we have:  
\[C_{\text{o}}\frac{\text{d}V_{\text{o}}}{\text{d}t}=i_{2}-i_{\text{o}} \tag{22}\]  
Using forward approximation, we can obtain:  
\[V_{\text{o}}[k+1]=\frac{i_{2}[k]-i_{\text{o}}[k]}{C_{\text{o}}f_{\text{s}}}+V_{ \text{o}}[k] \tag{23}\]  
Assuming \(i_{\text{o}}[k]=i_{\text{o}}[k+1]\), substituting Equation (23) into the output voltage at time step \(k+2\), we can derive the discrete average model of DAB as:  
\[V_{\text{o}}[k+2]=V_{\text{o}}[k]+\frac{i_{2}[k+1]+i_{2}[k]-2i_{\text{o}}[k]}{ C_{\text{o}}f_{\text{s}}} \tag{24}\]  
Considering the cost function as [27]:  
\[cost=\alpha_{1}G_{1}+\alpha_{2}G_{2} \tag{25}\]  
\[\left\{\begin{aligned} G_{1}&=\left(V_{\text{o}}{}^{* }-V_{\text{o}}[k+2]\right)^{2}\\ G_{2}&=\left(V_{\text{o}}[k+2]-V_{\text{o}}[k]\right)^{2 }\end{aligned}\right. \tag{26}\]  
\(G_{1}\) and \(G_{2}\) are two components in the controller. \(G_{1}\) is responsible for regulating output voltage \(V_{\text{o}}\) to the reference value \(V_{\text{o}}{}^{*}\), while \(G_{2}\) is responsible for reducing the voltage deviation. When \(V_{\text{o}}\) deviates significantly from \(V_{\text{o}}{}^{*}\), \(G_{1}\) dominates the cost function. However, when \(V_{\text{o}}\) approaches \(V_{\text{o}}{}^{*}\), \(G_{2}\) starts to play a role. \(G_{2}\) limits the voltage variation, effectively suppressing the voltage ripple caused by analog-to-digital sampling noise and ensuring system stability [14].  
Within one sampling period, three points are evaluated, centered around the previous operating point \"a\", as shown in Figure 4.  
Figure 4: DAB model predictive control working principle diagram.  
\(\Delta f=f_{\rm c}/f_{\rm s}\) is defined as the finest achievable phase-shift value in the digital control platform, where \(f_{\rm c}\) is the peripheral clock of the microprocessor. The current discrete control set is \(d\ e\ [a-\Delta f,a,a+\Delta f]\). The value \(a+\Delta f\) minimizes the cost function, and thus, it is used at time step \(k+1\). The same overshooting is repeated in the next sampling period. An adaptive step size is employed instead of the minimum search step size \(\Delta f\), defined as [28]:  
\[V^{\prime}=\left\{\begin{array}{ll}{|{V_{\rm o}}^{*}-{V_{\rm o}}[k]|},&{|{V_{ \rm o}}^{*}-{V_{\rm o}}[k]|}<{V_{\rm m}}\\ {V_{\rm m}},&{|{V_{\rm o}}^{*}-{V_{\rm o}}[k]|}>{V_{\rm m}}\end{array}\right. \tag{27}\]  
\[\Delta a=\Delta f(1+\lambda V^{\prime}) \tag{28}\]  
where \(V^{\prime}\) represents the voltage deviation, \(V_{\rm m}\) is the saturation voltage, and \(\lambda\) is a coefficient to be determined based on transient performance. Based on this adaptive step size, Figure 4 illustrates the working principle of DAB model predictive control. The next instant's phase-shift duty cycle is calculated using the evaluation process shown in Figure 5, and this value is then transmitted to DAB for operation. The control block diagram of DAB model predictive control is depicted in Figure 6.  
Figure 5: DAB model predictive control algorithm flowchart.