# Virtual Flux Control Methods for Grid-Forming Converters: A Four-Method Comparison
## 3 Control Schemes
### Model Predictive Control  
The control of a power electronic converter can be defined as the application of the appropriate control action \(S(t)\) to ensure that the control variable \(x(t)\) follows its reference value \(x^{*}(t)\) as closely as possible. To determine the optimal control action, a MPC strategy can be employed. In this case, a predictive control algorithm has been designed, similar to the one detailed in [41]. At a given time instant \(t_{k}\), the control variable is evaluated, and based on its value, one of the possible control actions \(S_{i}\) is applied. These actions correspond to a finite set of switching states that can be programmed, matching the seven vectors previously defined for the DC algorithm. To determine the optimal control action, the control variable is first predicted for each possible action using a discrete prediction function  
\[x_{pi}(t_{k+1})=f_{p}\{x(t_{k}),S_{i}\},\quad i=1,\ldots,n \tag{22}\]  
where \(n\) represents the number of possible control actions. In this case, the control variable is the virtual flux \(\psi_{v}\), obtained from the equation previously demonstrated in [57]. \[e=\frac{\mathrm{d}\psi_{v}}{\mathrm{d}t} \tag{23}\]  
Discretizing (23) for a sampling time \(T_{s}\), the following expression is obtained  
\[e_{[k+1]}=\frac{\psi_{v[k+1]}-\psi_{v[k]}}{T_{s}} \tag{24}\]  
which leads to the prediction function for the virtual flux  
\[\psi_{v[k+1]}=\psi_{v[k]}+T_{s}e_{[k+1]} \tag{25}\]  
where \(\psi_{v[k]}\) is the virtual flux measured at the current time step, and \(e_{[k+1]}\) is the converter's internal voltage applied during the sampling period. This value is determined by the switching state, as shown in Table 3.  
Once all possible virtual flux values are computed, the optimal voltage vector is selected using a cost function, which minimizes the error between the predicted control variable and its reference value. The cost function used in this case is  
\[f_{cost}=\left(\psi_{d[k]}^{*}-\psi_{vd[k+1]}\right)^{2}+\left(\psi_{q[k]}^{* }-\psi_{vq[k+1]}\right)^{2} \tag{26}\]  
where \(\psi_{vdq[k]}^{*}\) is the reference flux calculated in the RPC loop, and \(\psi_{vdq[k+1]}\) is the predicted flux for each possible control action. To obtain the \(dq\) components of both fluxes, the control  
\begin{table}
\begin{tabular}{c c c c} \hline \(S_{a}\) & \(S_{b}\) & \(S_{c}\) & \(\overline{x}\) \\ \hline
0 & 0 & 0 & \(\overline{\
u}_{0}=0\) \\ \hline
1 & 0 & 0 & \(\overline{\
u}_{1}=\frac{\psi_{c}}{3}\psi_{Ac}\) \\ \hline
1 & 1 & 0 & \(\overline{\
u}_{2}=\frac{\psi_{c}}{3}+j\frac{\overline{\
u}_{3}}{3}\psi_{Acangle \(\Theta\) obtained in the APS has been used, allowing the converter to provide inertial response. The voltage vector leading to the lowest cost is applied to the converter, resulting in the control scheme illustrated in Figure 6. This approach aims to minimize the error between the measured virtual flux and the computed reference value. The quadratic cost function is selected since it penalizes or increases the cost for large errors (>1), while it is less reactive to smaller errors (0-1). It is important to note that this predictive control method ideally assumes that there is enough time within each control period \(t=t_{k}\) to measure the variables, compute predictions, and execute the control action. However, in practical implementations, it is often challenging to complete all these tasks within a single sampling period, leading to an overlapping of computation and control execution. To address this issue, a two-step prediction approach is proposed instead of predicting only the next switching state. This concept is explained in [41] and depicted in Figure 7. Essentially, the described prediction process is first executed to determine the optimal voltage vector. Then, once this vector is selected, the control variable's future state is predicted. The entire prediction algorithm is then repeated, but this time using the estimated flux from the first step as the measured value.