Predictive Control Applied to a Single-Stage, Single-Phase Bidirectional AC-DC Converter

This work aims to implement the control system of a single-phase, multi-port AC-DC converter with high-frequency isolation based on the dual active bridge (DAB) topology associated with the three-state switching cell (3SSC) applied to a distributed generation system. The converter has one ac port and two dc ports, this being a multi-input, multi-output (MIMO) system in which there is a coupling between the input and output variables. The generalized predictive control (GPC) is chosen to regulate the dc-link voltages. GPC is a well-consolidated approach in the literature, which can deal with MIMO coupled systems while presenting friendly-tuning rules. The current loop employs a traditional proportional plus resonant (P+R) controller because it has a single-input, single output (SISO) characteristic, as advanced controllers are unnecessary. Experiments are performed on a 1-kW prototype to validate the performance of the developed controller and show its advantages compared with traditional control strategies.


I. INTRODUCTION
The use of renewable energy sources has been growing more and more in recent years, meeting the increasing demand for electricity with reduced environmental impact. There are several energy sources that can be interconnected to the system in the context of distributed generation and microgrids. The most widely used renewable sources nowadays are wind turbines and photovoltaic modules and, owing to their intermittent nature, their combination with other energy sources and batteries is an interesting solution to increase the reliability of the continuous energy supply [1], [2]. Another trend in distributed generation is the use of electric vehicles (EVs) with bidirectional chargers which present grid-to-vehicle (G2V) and vehicle-to-grid (V2G) functions [3]. In such applications, the use of multi-port converters is necessary, thus allowing the interconnection and control of various energy sources simultaneously.
Aiming at greater flexibility, lower cost, and better use of a variety of renewable energy sources, in addition to the use of multi-port converters, such systems should present bidirectional power flow, and topologies with integrated power stages also become advantageous, especially in gridconnected applications, aiming at reduced losses and increased overall efficiency [4]. Unfortunately, these solutions often lead to higher complexity.
The dual active bridge (DAB) converter has interesting features for interconnecting distinct energy sources in highpower applications. It uses the leakage inductance of the transformer to control the active power flow between the isolated ports, thus allowing efficient energy processing with high-frequency isolation in a compact way [5], [6].
By presenting an integrated power stage, the actuators of multi-port converters are commanded aiming at controlling the voltages and currents in the ports simultaneously, involving a complex relationship among the control variables. In these converters, different control loops are usually designed for each output variable to deal with the different modes of operation and the cross-coupling between the control loops [2]. The k factor methodology proposed in [7] was used to tune the independent controllers in [8], [9], and [10]. Although this strategy provides satisfactory results, the simultaneous operation of the controllers causes interference between the loops, leading to unpredictable behavior during the design. Other strategies such as model predictive control (MPC) can improve the operation of these converters by presenting a fast dynamic response when compared with the classic techniques [11], thus enabling the control of multivariable processes directly [12].
MPC is widely used in industrial applications owing to its ability to work with multivariable systems, even with strong interaction between the variables [13]. The main feature of these controllers is the use of models for making future predictions on the behavior of controlled systems, aiming to perform the calculation of an optimal control law based on a particular performance criterion [13].
MPC defines the expected behavior of the current control loops over a given horizon, unlike most conventional controllers in which future implications of these actions are not taken into account, being only accounted for by the expected closed-loop dynamics [14].
Although MPC is not a new concept, its application in power electronics only became feasible with more recent advances on digital processors, which allow the operation at higher sampling frequencies and shorter data processing time [15], [16]. In the field of power electronics, predictive control was initially applied in [17], showing great potential for applications involving power converters and electric machine drives [18]. This technique could be extended to ac-ac, ac-dc, and dc-dc power conversion as in [19], [20], [11], [21], [22], [23], [15], [24] [25], and [26].
MPC algorithms have many elements in common and different options can be chosen for each solution, giving rise to distinct classes of algorithms. The common elements are the prediction model, the objective function, and the methodology to obtain the control law [27]. According to [13], a very popular MPC approach in the literature and industry is the generalized predictive control (GPC), which was proposed in [28] and [29]. It often performs well when implemented in industrial applications, in addition to being quite robust [30].
This work presents a solution for controlling the dc-link voltages of a multi-port bidirectional ac-dc converter, using a multi-input, multi-output (MIMO) GPC controller based on a state-space approach. Additionally, the traditional GPC matrix scheme is adapted to reduce both the memory allocation and computational burden associated with the algorithm embedded in a digital signal processor (DSP). This aspect is quite important because power converters are fast systems.
The remainder of the work is organized as follows. Section-II presents a review of the GPC in the context of state space, a description of the parameters for adjusting the algorithm, and the adaptation performed in the control scheme for the practical implementation. Section-III addresses the structure of the multi-port ac-dc converter adopted for the design and implementation of the proposed control. Section-IV presents the experimental results, whereas Section-V dis-cusses the main conclusions.

II. GPC IN STATE SPACE
The GPC state-space strategy was adopted for the multiport converter under study because it is suitable for dealing with MIMO systems while presenting optimized solutions in terms of stability, robustness, among other specifications [31].
GPC aims to minimize the cost function of a defined stage over a prediction horizon, calculating a sequence of future control signals. The index to be optimized is the square of the difference between the expected output value and some predicted reference sequence over the horizon, summed to the squared variation of the control signals [13].
In a process with m inputs and n outputs, the dynamics of the i-th output y i (t) can be represented using the model known as integrated controlled auto-regressive mobile average (CARIMA) as described by (1) [28].
where q is the forward shift operator; u j (t) is the j-th input of the system at the discrete time t; e i (t) is the uncorrelated (white) noise with a zero-average value; ∆ is the differencing , and C i (q −1 ) are polynomials in the form of delays given by (2) The CARIMA model of (1) can be written as a state-space representation for each output in an observable canonical form as in (3)-(4) [32]. where: and p = max(na, nb, nc), a i,j = 0 for j > n ai , b i,k,j = 0 for j > n bi and c i,j = 0 for j > n ci . The complete state-space representation of the process model for all outputs i from 1 to n is given by the formulation of the CARIMA model for the GPC controller in the state space as follows [33]: where: The predicted vector for the n outputs y(t + i|t) over the prediction horizon, i = 1, ..., N 2 , for N 1 = 1 can be recursively computed using the state-space model of (6) [34]. Writing it in the matrix form leads to (7). where and The design of the GPC for the MIMO system addressed in this work comprises a quadratic cost index, this being similar to the cost indexes reported in [35], [31] and defined as follows: where y(t + k|t) is an optimum k step ahead prediction of the system output on data up to time t; N 1 and N 2 are the minimum and maximum prediction horizons, respectively; and w(t + k) is a future set-point or reference sequence for the output vector; Q δ and Q λ are positive-definite weighting matrices.
The index (11) can assume the following matrix form: where The difference in relation to the formulation for singleinput, single-output (SISO) systems is precisely the introduction of the weighting matrices for the terms associated with the reference tracking error (Q δ matrix) and the control effort (Q λ matrix). Besides, Q δ and Q λ are diagonal matrices of dimensions (n · N × n · N ) and (m · N u × m · N u ), respectively, with N = N 2 − N 1 . In this work, the following weighting matrices are adopted: Q δ = δI and Q λ = λI, δ being constant and unity, whereas λ is a constant used to perform adjustments.
Substituting (7) in (12) gives: (16), one can obtain: Substituting the parameters defined in (18)- (20) in (17) gives (21): It is well known that the gradient of a function of type Thus, the gradient of J is obtained as in (23).
Since M is symmetrical, one can write: Substituting (19)- (20) in (24) gives: where I is the identity matrix of dimension N = N 1 −N 2 +1. The control signal sent to the process at the next instant then corresponds to the first m terms of the vector ∆u obtained in (25): or where K contains the first m rows of matrix (G T G + λI) −1 G T . Substituting (9) in (26) gives: Expanding (28), one can obtain: Considering that the future reference is constant, that is, w = r(t) r(t) ... r(t) T , one can write (29) as: where Based on (3), (4), and (30), the GPC state-space system can be represented by the block diagram shown in Fig. 1.

A. APPLICATION OF GPC IN STATE SPACE
In order to develop the GPC controller in practice using a microcontroller or a DSP, it is necessary obtain the equivalent state-space representation of the control loop. This approach reduces the number of arrays to be loaded into the microcontroller memory, thus minimizing the memory allocation and simplifying the operations to be performed, also decreasing the time required to perform calculations on each interruption.
One can rewrite (31) as follows: One can also define the following matrices: The controller feedback output is defined as y p according to (35): which can be rewritten in the matrix form: Thus, it is possible to define the following matrices: Therefore, the state-space representation of the control loop can be given by (39) and (40). Fig. 2 shows the block diagram of the MIMO GPC control system corresponding to the state-space representation of the control loop. A saturator is responsible for limiting the control signals, preventing a very high current to flow through the semiconductors and avoiding damage. In addition, an anti-windup block prevents the saturation of control signals.

B. DESIGN PARAMETERS OF THE GPC CONTROLLER
According to [36], the performance of the GPC controller depends on the values of the horizon parameters, namely N 1 , N 2 , N u and λ presented in (11). Such parameters determine the amount of information that must be added to the plant model in order to predict its future behavior. Thus, one must pay attention to the choice of these parameters, because little or much information can result in undesirable behavior in terms of instability and excessive oscillations.
The minimum prediction horizon (N 1 ) is normally equal to 1, but for processes with transport delay, it must be greater than or equal to the delay [28].
The maximum prediction horizon (N 2 ) is chosen to be longer than the plant rise time so that the whole dynamic behavior is incorporated into the representation [28]. For most stable open-loop processes, the closed-loop dynamics becomes faster with the decrease of this parameter. On the other hand, its increase implies an increase of the system robustness to the presence of non-modeled dynamics, but it also increases the computational burden [37].
The use of high control horizon values (N u ) increases the effectiveness of the control action, with a direct impact on the computational burden. For stable open-loop systems only, N u = 1 often gives acceptable control performance. In practice, this value should be as low as possible to provide satisfactory results. A high value of N u is more suitable for complex systems in which good control performance is achieved when N u is at least equal to the number of unstable or poorly-damped poles [28].
The control weighting constant (λ) causes the magnitude of the control signal to be taken into account by the cost function to be minimized. With the increase of λ, there is less control effort and the smaller this parameter, the greater the magnitude of the control signal. It is worth mentioning that λ must be greater than zero so as to improve the conditioning of the control matrix, thus allowing its inversion. In addition, it provides the system with increased robustness when subjected to modeling uncertainties [37] [38].
Besides the aforementioned parameters, when the coefficients of polynomial C(q −1 ) are not estimated, they can be chosen as the design parameters of the controller. With regard to the estimation process, this polynomial can behave as a low-pass filter that reduces the effect of high-frequency dynamics on the estimator, increasing its robustness. With regard to the controller, polynomial C(q −1 ) is used as an observer polynomial capable of improving the noise rejection of the closed-loop system, without significant changes in the regulation characteristic of the controller [39].

III. MULTIPORT AC-DC CONVERTER
In a microgeneration system, a multi-port converter is quite important for integrating different energy sources and loads, as well as processing and controlling the energy flow between them. The multi-port single-phase ac-dc converter assessed in this work is shown in Fig. 3 and it was formerly presented in [40] and [41]. This topology is based on the three-phase topology described in [42]. It uses the interleaving technique and the three-state switching cell (3SSC) introduced in [43], which allow reducing the current stresses on the semiconductor and increasing the operating frequency of the filter elements. This converter was formely suggested for EV applications comprising on-board battery chargers (OBCs). However, it can also be used in distributed generation for integrating two dc sources and one ac source.
As illustrated in Fig. 3, port 1 presents an ac connection with the power grid, whereas ports 2 and 3 are dc links. According to the configuration reported in [40], port 1 is connected to the ac grid. Port 3 is used to connect a dc source and a dc load, whereas port 2 is controlled to keep the reactive power flow through the transformers as low as possible. The converter is composed of four H Bridges identified by a, b, c, and d. Owing to the bidirectional power flow characteristic, the bridges can operate in rectifier or inverter mode.
In the primary side, the sinusoidal pulse width modulation (SPWM) technique is used as associated with triangular carriers. Adopting bridge a as a reference, its respective modulation signal m a is at 0º, whereas the signal of bridge b (m b ) is shifted by 180º, so that the relationship between them is given by (41). Thus, one can obtain the duty cycle D applied to the upper-side switches. The carrier associated with legs a1 and a2 are at 0º and 180°, respectively, whereas those associated with legs b1 and b2 are at 90º and 270º, respectively. The secondary side is formed by H bridges c and d, considering that their modulation and carriers signals are similar to those of bridges a and b, respectively. The switches that belong to a same leg in the primary and secondary sides are driven in a complementary way. The 14 different switching combinations are shown in Table 1, as well the respective voltages on the primary and secondary sides. Fig. 4 shows the equivalent circuit of the primary side for each switching combination. The analysis of Table 1 evidences that, during one grid cycle, the duty cycle of the 16 switches varies between 0 and 100%, resulting in three-level voltage waveforms V a and V b on the primary side (0, V pri , and −V pri ), three-level voltage waveforms V c and V d on the secondary side (0, V sec , and −V sec ), and five-level voltage waveforms between the bridges of the primary side (V xy ).   5 illustrates the main operating waveforms of the converter for a duty ratio less than 25% during two switching periods. Initially, the triangular carriers for all upper-side switches are presented along with the instantaneous values of the modulators and the resulting logical states for each switch. The resulting voltages on the primary (V a and V b ) and secondary (V c and V d ) sides of the transformers are represented as well, in addition to the resulting multilevel voltage across the ac link (V xy ). Considering the adopted condition in which m a is less than 25%, it is observed that the value of V xy varies between −V pri and −V pri /2. The remaining voltage levels of V xy for different values of m a are summarized in Table 2.

Modulation value
Multilevel voltage value 0 < m(t) < 0.25 Vxy = −Vpri or Vxy = −Vpri/2 0.25 < m(t) < 0.5 Vxy = −Vpri/2 or Vxy = 0 0.5 < m(t) < 0.75 Vxy = 0 or Vxy = Vpri/2 0.75 < m(t) < 1 Vxy = Vpri/2 or Vxy = Vpri The H bridges of the secondary side are coupled to those of the primary side through high-frequency transformers T1 and T2. As a result, there are two interleaved dc-dc topologies operating as DAB converters [5], whereas the pulse width of the transformer voltages varies over the grid cycle. Power transfer occurs using the same principle of the DAB converter, where a phase-shift angle ϕ is applied to the secondary-side voltages to define the direction and the magnitude of the power flow [44]. It is worth mentioning that T1a and T1b are autotransformers with unity turns ratio, corresponding to two 3SSCs.

A. CONTROLLER SYNTHESIS
The adopted control strategy is shown in Fig. 6. The synchronism with the ac grid is achieved using a phase-locked loop (PLL) technique to detect the grid phase angle, whereas the circuit is based on q-PLL [45]. It is possible to control the ac current (i in ) using a controller represented by block C1, which provides the modulation signals (m a /m c and m b /m d ). One can control the dc-link voltages with the proposed GPC controller, which provides the peak ac current reference to regulate the voltage on the primary side and the phaseshift angle ϕ to control the voltage on the secondary side. The modulation signals of the secondary side are the same as those of the primary side. The phase shift angle ϕ is associated with the phase angle of the carriers. Therefore, the resulting switching pattern is similar to that of the primary side, but with a phase shift that allows controlling the power flow. To validate the adopted strategy, an experimental prototype rated at 1 kW was used, whose specifications are shown in Table 3. According to Fig. 7, the ac current controller employs the output value of the GPC controller as a reference signal, this being multiplied by a sinusoidal signal whose phase angle is defined by the PLL. In this way, the peak value and shape of the resulting current can be controlled through the duty cycle of the switches. Its transfer function can be approximated to the same equation of the classical boost converter, which is given by: Similarly to [40], a proportional plus resonant (P+R) controller was used because the input current is sinusoidal [46]. The poles are allocated at 0.9998 ± 0.0038i, whereas the zeros are allocated at 0.9670 ± 0.0326i, resulting in a gain margin of -15.57 dB, phase margin of 65.57º, and unitygain crossover frequency of 3.27 kHz. The resulting transfer function of the controller is given by: 2) Desing of the MIMO GPC controller: To design the MIMO GPC controller, it is initially necessary to define the inputs and outputs of the plant. In this case, the inputs are the reference ac current (I in−ref ) and the phaseshift angle (ϕ). The outputs correspond to the primary-side VOLUME 4, 2022 dc-link voltage (V pri ) and the secondary-side dc-link voltage (V sec ). As a design requirement for the GPC, it is necessary to obtain the plant model. For this purpose, a simulation of the open-loop plant was performed using PSIM software. The current controller designed in the previous section is incorporated into the plant, but there is no voltage controller because the system operates in open-loop condition.
From the data obtained in this simulation, a script was implemented in Matlab software to obtain the plant model. An optimization methodology was used to minimize differences between the model and the plant. Comparative plots between the simulated signals and the ones obtained from the model associated with the optimization algorithm are shown in Fig.  8. The plant model can be characterized by (44): where y 1 (t) and y 2 (t) correspond to the output voltages of the primary and secondary sides, respectively; u 1 (t) and u 2 (t) represent the reference ac current (I in−ref ) and the phase-shift angle (ϕ), respectively. The model obtained from the script is presented in (45). First-order transfer functions have been derived to reduce the memory allocation in the DSP.
The next step consists in obtaining the equivalent digital model using the zero-order hold (ZOH) technique with a sampling rate of 5 kHz.
For the implementation of the controller in the DSP, matrices equivalent to the state-space model of the GPC controller were calculated according to (33), (34), (37), and (38).

3) Robustness analysis of the GPC MIMO controller
The GPC MIMO controller must be designed to keep the closed-loop system stable while ensuring a desired degree of robustness against uncertainty. In SISO systems, this aspect can be properly quantifie by means of the gain and phase margins, for instance. As for MIMO systems, this approach is not suitable. Therefore, it is necessary to use the singular value analysis to quantify the robustness of MIMO systems. From well-defined concepts of additive uncertainty and singular value analysis, one can assess the robustness of the controller.
To analyze the robustness of a closed-loop system, let us employ the definition of additive uncertainty given by: where P (z) should include the modeling errors of the voltage gains, time constants, and delays; P n (z) denotes the nominal model of the plant; and ∆P (z) = W 1 (z)∆(z)W 2 (z), ||∆(z)|| ∞ < 1. For simplicity, as suggested in [33] , the parameters for the robust stability condition can be defined as W 1 (z) = I and W 2 (z) = P (z) − P n (z). The term ∆P (z) is used to describe the structured uncertainty in an additive format. The controller structure in Fig. 1 can be represented in the M-∆ form as in Fig. 9, where M is defined according to (48). where and Then, robust closed-loop stability is given by the condition: , z = e jwTs , ∀w = [0, π/T s ] (51) whereσ(.) is the maximum singular value function. The robust stability analysis for the GPC controller designed in section III-A2 is shown in Fig. 10. It can be seen that robust stability is guaranteed because the robustness margin (10 0 ) is not exceeded.

IV. EXPERIMENTAL RESULTS
The experimental prototype used in the tests is shown in Fig.  11, which was developed based on the parameters presented in Table 2, which are the same used in [41]. The main elements that compose the power circuit are: four silicon carbide (SiC) three-phase transistor modules (Cree -CCS0220M12CM2 1200V 20A); four isolated drivers (Cree -CGD15FB45P); two power transformers; two autotransformers corresponding to the 3SSC; two power inductors; and one filter inductor connected to the ac port. The converter control was implemented using a development board based on a dual-core microcontroller model TMS320F28379D by Texas Instruments.
For all performed tests, the GPC algorithm was configured with a sampling rate of 5 kHz considering the following parameters: N 1 = 1, N 2 = 20, N u = 10, and λ = 50.
The first experimental test was carried out to verify the operation of the converter in rectifier mode at the rated load. The experimental waveforms of v g , V pri , V sec , and i in are shown in Fig. 12. Using oscilloscope model MSO5034 by Tektronix, it was possible to measure some power quality indices. The harmonic components of i in and the comparison with the limits defined by the IEC 61000-3-2 standard are shown in Fig. 13a. Fig.13b presents the quantities measured with the oscilloscope, where the current T HD is 4.41% and the P F is 0.9965. Under these conditions, the overall efficiency is 92.5%. Fig. 14 presents the efficiency curve obtained experimentally.
Then, comparative tests involving the dynamic response of the converter submitted to a positive load step applied in   the secondary-side dc port were performed considering the proposed approach based on GPC and using decentralized controllers as in [41]. The latter work adopts a type-2 PI controller with a unity-gain crossover frequency of 36 Hz and phase margin of 60º for the primary-side dc-link voltage (V pri ), as well as a conventional PI controller for the secondary-side dc-link voltage (V sec ). Initially, the converter operates at 50% of the rated power, as a sudden increase to 100% of the rated power occurs. Considering the test using the GPC controller, Fig.15a shows the load current, as well as the control signals of the primary-side and secondary-side dc links. Fig. 15b presents the waveforms of v g , V pri , V sec , and i in . The ac current has a fast response to the load step without significant distortions in its sinusoidal shape. With regard to the dc-link voltages, there are no significant changes in the average voltage on the primary-side, with an undershoot of 10% in the secondary side associated with a settling time of about 40 ms. Figs. 16a and 16b present the same signals, but using a conventional control approach. In the latter case, an VOLUME 4, 2022 H. A. de Oliveira et al.: Predictive Control Applied to a Single-Stage, Single-Phase Bidirectional AC-DC Converter undershoot of 5% and 10% occurs in the primary-side and secondary-side dc-link voltages, respectively, resulting in a settling time of about 80 ms in either case.  The following tests were carried out for the case of a inversion of the power flow direction. Initially, the converter operates in inverter mode supplying 60% of the rated power to the grid. Suddenly, it starts operating in rectifier mode at 100% of the rated power. Considering the test with the proposed GPC controller, Fig. 17a shows the current through the dc source connected to the secondary-side dc link, as well the control signals of the primary-side and secondaryside dc links. Fig. 17b represents the resulting waveforms of v g , V pri , V sec , and i in . The ac current presents a fast response to the change in the power flow direction without significant distortion in its shape. There is an undershoot of 5% and 17% in the primary-side and secondary-side dc-link voltages, respectively, with a settling time of about 60 ms in either case. Figs. 18a and 18b present the same signals, but using a conventional control technique. The resulting undershoot is 10% and 28% for the primary-side and secondary-side dclink voltages, respectively, with a settling time of about 120 ms in either case.  Based on the analysis of Figs. 15-18, a comprehensive comparison between the proposed MIMO GPC con-trol scheme and the traditional decentralized control scheme based on linear controllers associated with the dc-link voltage loops is presented. Table 4 summarizes the maximum changes in the dc-link voltages (∆V pri , ∆V sec ) and the settling times (T s ). It is observed that the settling time is always shorter when the GPC-based solution is used. The dc-link voltages vary only slightly when using the proposed controller unlike the solution based on conventional controllers. This work has presented the development of a state-space GPC controller for regulating the output voltages of a multiport ac-dc converter based on two DAB converters. A change was made to the former state-space GPC topology to decrease the number of arrays, which resulted in lower memory consumption and lower computational burden. It has been demonstrated experimentally that this predictivecontrol-based solution presents satisfactory results in both steady-state and dynamic conditions. Comparing the proposed controller with a conventional decentralized control solution in steady state, it is reasonable to state that the results are nearly the same. The T HD of the ac current through the port connected to the power grid was 4.41%, resulting in a P F of 99.65% and strict compliance with the limits imposed by IEC 61000-3-2 standard. The measured efficiency of the converter was about 92.5%. Regarding the dynamic response of the converter, the MIMO GPC controller proves to be faster than the conventional decentralized solution based on linear controllers. He is a researcher with the Automation, Control, and Robotics Research Group of the Federal University of Ceará, collaborating with the Energy Processing and Control Group at this same institution. He is currently pursuing the Ph.D. degree in electrical engineering. He works mainly on the following topics: process control, predictive controllers, neural networks and pattern recognition. He is interested in renewable energy sources and power electronics. He is currently an associate professor with the Federal University of Ceará, Fortaleza, Brazil. He is associated to the Graduate Program in Electrical Engineering of this same institution, supervising masters and doctoral students, coordinating research projects, and publishing on several national and international conferences and journals. He has expertise in control and automation engineering, with emphasis on process control, acting on the following topics: robust predictive control applied to industrial processes and control of time-delay systems. She is a researcher with the Group of Power Processing and Control (GPEC) at the Federal University of Ceará, where she is currently pursuing the Ph.D. degree in electrical engineering. Her research interests include power electronic converters, soft switching, and electric vehicle applications.