*2.2. Control Design*

The main feature of the model predictive control (MPC) is its capability to predict the future behavior of the desired control variables [39]. In other words, it is an optimization technique that computes the next control action by minimizing the cost function, which is the difference between the predicted variable and the specified reference. The MPC is also characterized by a straight-forward implementation, it has no issue with the stability, and the quality of the response depends on the control design. In MPC, the future predicted state path is called the prediction horizon. The latter is the number of samples *Ts* over which a prediction of the plant states/outputs is evaluated. According to Figure 2, the future values of output variables at the samples *k* + 1, *k* + 2, etc., are predicted using the dynamic model of the process (*X*(*k*)) and current measurements. Furthermore, according to this figure, it is noticed that the control actions are based on both future predictions and current measurements. The manipulated control variables *u*(*k*) at the *k*-th sampling time are computed such that the objective function *J* is minimized. These control variables will be implemented as a control signal to the process.

**Figure 2.** Basic concept for model predictive control (MPC).

Figure 3 illustrates the scheme of the proposed MPC approach for power electronic converters, where *iL*(*k*), *Vstack*(*k*) and *Vout*(*k*) are the measured variables used in the model to compute the predictions *iL*(*k* + 1) of the controlled variables. The model used for the prediction is a discrete time state-space model, which can provide predictive capability for the MPC controller [40]. The design of the MPC control for a high step-up power electronic converter (boost converter) can be done using the following steps [39]:


**Figure 3.** MPC scheme for power electronic converters.

According to [3], the equations of the boost converter for the open and close switch case are, respectively, given in Equations (1)–(5), where the state-space model is presented in Equation (5).

$$\frac{dI\_L}{dt}(t) = \frac{1}{L}(V\_{stack}(t) - V\_{out}(t))\tag{1}$$

$$\frac{dV\_{out}}{dt}(t) = \frac{1}{C}(I\_L(t) - V\_{out}(t))\tag{2}$$

$$\frac{dI\_L}{dt}(t) = \frac{1}{L}(V\_{stack}(t))\tag{3}$$

$$\frac{dV\_{out}(t)}{dt} = \frac{1}{RC}(-V\_{out}(t))\tag{4}$$

$$
\begin{bmatrix}
\frac{dI\_L(t)}{dt} \\
\frac{dV\_{out}(t)}{dt}
\end{bmatrix} = \begin{bmatrix}
0 & \frac{-(1-D(t))}{L} \\
\frac{(1-D(t))}{C} & -\frac{1}{RC}
\end{bmatrix} \cdot \begin{bmatrix}
I\_L(t) \\
V\_{out}(t)
\end{bmatrix} + \begin{bmatrix}
\frac{1}{L} \\
0
\end{bmatrix} V\_{stack}(t) \tag{5}
$$

According to [27,30,31], and by using the sampling time *Ts*, the discretized equations of the boost converter can be given as (6) and (7) for the open switch case, and (8) and (9) for the close switch case.

Open switch:

$$I\_L(k+1) = I\_L(k) - \frac{T\_s}{L}V\_{out}(k) + \frac{T\_s}{L}V\_{stack}(k) \tag{6}$$

$$V\_{\rm out}(k+1) = V\_{\rm out}(k) - \frac{T\_s}{RC}V\_{\rm out}(k) + \frac{T\_s}{C}I\_L(k) \tag{7}$$

Close switch:

$$I\_L(k+1) = I\_L(k) + \frac{T\_s}{L} V\_{stack}(k) \tag{8}$$

$$V\_{out}(k+1) = V\_{out}(k) - \frac{T\_s}{RC}V\_{out}(k)\tag{9}$$

Using the descritized equations given in Equations (6)–(9), or by using the the forward Euler approximation [41] given in Equation (10), the discrete-time state-space model of the boost converter can be written as Equation (11):

$$\mathbf{x}(k+1) = (I + T\_s A)\mathbf{x}(k) + T\_s B d(k) \tag{10}$$

$$
\begin{bmatrix} I\_L(k+1) \\ V\_{\rm out}(k+1) \end{bmatrix} = \begin{bmatrix} 1 & -(1 - D(k)) \frac{T\_L}{L} \\ (1 - D(k)) \frac{T\_L}{C} & 1 - \frac{T\_L}{RC} \end{bmatrix} \begin{bmatrix} I\_L(k) \\ V\_{\rm out}(k) \end{bmatrix} + \begin{bmatrix} \frac{T\_L}{L} \\ 0 \end{bmatrix} V\_{\rm stack}(k) \tag{11}
$$

The control objective is to make the stack current *IL*(*k*) as close as possible to the reference current *Iref*(*k*). This could be obtained by minimizing the cost function *J*, which is defined as the error between the predicted value and the desired reference value. The expression of the cost function can be written as Equation (12). Hence, if the used prediction horizon is equal to one *h* = 1, then once the values of the controlled variables are obtained at the next sample time and for both switching states, *s* = 0 and *s* = 1, the cost function *J* will be evaluated. The block scheme of the proposed MPC technique is shown in Figure 4.

$$J\_{s=n}^{n=0,1} = |I\_{L,s=n(k+1)} - I\_{ref}| \tag{12}$$

$$\begin{array}{|c|c|}\hline \hline \{\text{Start}\)\\ \hline \\ \{\text{Inputs:}\,V\_{\text{stect}(k),V}\_{\text{out}(k),V},l\_{L(k)},l\_{ref(k)}\} \\\hline \\ \hline \\ l\_{i,s=0(k+1)} = i\_{i(0)} - \frac{T\_s}{L} \, V\_{\text{out}(0)} + \frac{T\_s}{L} \, V\_{\text{total}(0)} \\\hline \\ V\_{\text{out},s=0(k+1)} = \left(1 - \frac{T\_s}{RC}\right) V\_{\text{out}(0)} + \frac{T\_s}{L} \, l\_{L(k)} \\\ \qquad l\_{i,s=1(k+1)} = l\_{i(0)} + \frac{T\_s}{L} \, V\_{\text{total}(k)} \\\hline \\ V\_{\text{out},s=1(k+1)} = \left(1 - \frac{T\_s}{RC}\right) V\_{\text{out}(k)} \\\hline \\ l\_{i,s=0} = \left| i\_{i,s=0(k+1)} - i\_{ref} \right| \\\hline \\ l\_{i,s=1} = \left| i\_{i,s=1(k+1)} - i\_{ref} \right| \\\hline \\ \text{Yes} \\\ \begin{array}{|c|}\hline \\ l\_{i,s=0} < l\_{i,s=1} & \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \hline \\ \end{array}$$

**Figure 4.** Block scheme of the proposed MPC technique.

By evaluating the cost function *J* for both states, it selects the one at which the next predicted value is closer to the value of the desired reference current *iref* . It should be noted that the MPC approach has the capability of predicting the next n-samples of the prediction horizon, which means that the cost function at the future n-step can be calculated. The discrete-time system that provides the n-samples of the future prediction horizon can be written as Equations (13) and (14).

$$I\_L(k+n+1) = I\_L(k+n) - (1 - D(k+n))\frac{T\_s}{L}V\_{out}(k+n) + \frac{T\_s}{L}V\_{stack}(k+n) \tag{13}$$

$$V\_{out}(k+n+1) = (1 - D(k+n))\frac{T\_s}{C}I\_L(k+n) + (1 - \frac{T\_s}{RC})V\_{out}(k+n) \tag{14}$$

In this work, an MPC with a prediction horizon equal to two *h* = 2 is used. To this end, the calculation of the controlled variable *IL* at time *tk*<sup>+</sup><sup>2</sup> is necessary. However, this could be an easy task by using Equations (13) and (14). The process of the proposed MPC technique with a prediction horizon *h* = 2 is depicted in Figure 5. According to this figure, to calculate the value of the predicted controlled variable *IL*(*k*+2), the calculation of the system variables at time *tk*<sup>+</sup><sup>1</sup> is required.

**Figure 5.** Schematic diagram of the proposed MPC process with a 2-step prediction horizon.

Figure 6 illustrates the operating principle of the proposed MPC technique. Hence, by observing the system behavior for the future two-step horizon and by evaluating the cost function at each step, it will be possible to select the best switching state at which the cost function has the lowest value. All the possible sets of switching states that could be evaluated for *h* = 2 are given in Equation (15).

$$\begin{cases} \begin{array}{ll} S\_{(k+1)} = 0 \quad \text{and} \quad S\_{(k+2)} = 0 \\\\ S\_{(k+1)} = 0 \quad \text{and} \quad S\_{(k+2)} = 1 \\\\ S\_{(k+1)} = 1 \quad \text{and} \quad S\_{(k+2)} = 0 \\\\ S\_{(k+1)} = 1 \quad \text{and} \quad S\_{(k+2)} = 1 \end{array} \tag{15}$$

**Figure 6.** Schematic diagram of the proposed MPC operating principle.

It should be noted that there are two strategies that could be used to calculate the predicted state *X*(*k* + 2):


$$|I\_{s=m}^{n=0,1:m=0,1} = |I\_{L,s=m(k+2)} - I\_{ref}| + |I\_{s=n} \tag{16}$$

The evaluation of the four cost functions *J*00, *J*01, *J*<sup>10</sup> and *J*11, for the two-step horizon is presented in Figure 7. The combination with the lower cost function value for the twostep prediction horizon is represented by the black color, where faded colors were used for the combinations with higher cost function values. According to these combinations, if the first method of prediction is used, the preferred cost function belongs to Combination 3 since *S*<sup>1</sup> < *S*<sup>0</sup> and *S*<sup>10</sup> < *S*11. If we only consider the evaluation of the cost function for the one-step (Equation (12)), the preferred cost function belongs to Combination 3 or 4 since *S*<sup>1</sup> < *S*0. If we only consider the evaluation of the cost function for the two-step (*J <sup>m</sup>*=0,1 *<sup>s</sup>*=*<sup>m</sup>* ), the preferred cost function belongs to Combination 2 since *<sup>S</sup>*<sup>01</sup> is lower than *<sup>S</sup>*00, *<sup>S</sup>*<sup>10</sup> and *S*11. However, although this evaluation gives the same result as the proposed method for the example presented in Figure 7, it may not be the most appropriate for other examples.

Therefore, a combined cost function involving the two steps, as defined in Equation (16), can provide the best switching condition for tracking the desired reference.

**Figure 7.** Schematic diagram of the switching condition combinations for the 2-step horizon and the evaluation of the respective cost functions.
