Optimal Modulation of Triple Active Bridge Converters by an Artificial-Neural- Network Approach

Isolated multiport converters can host loads and sources at different power and voltage levels to their ports by a single topology, giving potential merits in terms of power density and efficiency. However, the higher the number of ports, the higher the number of degrees of freedom in the modulation patterns. This high number of modulation variables complicates the optimization problem, making closed-form solutions impractical. This article avoids the analytic solution to the optimization problem by proposing a data-driven solution. The presented approach is based on an artificial neural network (ANN) trained to minimize the rms value of the currents flowing through the switches and the transformer windings of a triple active bridge (TAB) converter. This minimization is achieved by determining suitable values of the duty-cycles for modulating the converter switches. The proposed ANN-based modulation is validated considering an experimental TAB prototype rated $5 \,\mathrm{k}\mathrm{W}$.


Optimal Modulation of Triple Active Bridge
Converters by an Artificial-Neural-Network Approach Ahmed A. Ibrahim , Andrea Zilio , Graduate Student Member, IEEE, Tarek Younis , Member, IEEE, Davide Biadene , Member, IEEE, Tommaso Caldognetto , Senior Member, IEEE, and Paolo Mattavelli , Fellow, IEEE Abstract-Isolated multiport converters can host loads and sources at different power and voltage levels to their ports by a single topology, giving potential merits in terms of power density and efficiency.However, the higher the number of ports, the higher the number of degrees of freedom in the modulation patterns.This high number of modulation variables complicates the optimization problem, making closed-form solutions impractical.This article avoids the analytic solution to the optimization problem by proposing a data-driven solution.The presented approach is based on an artificial neural network (ANN) trained to minimize the rms value of the currents flowing through the switches and the transformer windings of a triple active bridge (TAB) converter.This minimization is achieved by determining suitable values of the duty-cycles for modulating the converter switches.The proposed ANN-based modulation is validated considering an experimental TAB prototype rated 5 kW.
To control the power flow among the ports, phase-shift modulation (PSM), shown in Fig. 1(b), is commonly applied, as done with dual active bridge (DAB) converters [11], [12].With PSM, the three bridges generate ac voltages v 1 , v 2 , and v 3 with duty-cycle fixed at 50% and variable phase-shifts φ 2 and φ 3 .By controlling the phase-shifts magnitude and sign, it is possible to regulate the power flow intensity and direction, respectively [9].PSM is simple and allows low switching and conduction losses at moderate to high load conditions, while operating with dc voltages such that V 1 : V 2 : V 3 = n 1 : n 2 : n 3 .Differently, at lightload conditions or with significant voltage mismatches among the transformer terminals, transformer rms currents increase with the possibility of losing zero voltage switching (ZVS), dramatically increasing switching and conduction losses relative to the transferred power [13].Penta PSM schemes, shown in Fig. 1(c), overcome these drawbacks [13].By these approaches, the modulation exploits not only the phase-shifts φ 2 and φ 3 but also the duty-cycles D 1 , D 2 , D 3 .The increased number of modulation variables significantly increases the complexity; controlling five modulation parameters gives a total number of possible switching patterns in the order of hundreds [12].Tackling and analyzing each switching pattern separately to find the optimum operation, for example, in terms of losses, is time-consuming or even impossible.
The literature reports different approaches pursuing efficiency optimization of the converter utilizing penta PSM [13], [14], [15], [16], [17], [18], [19], [20], [21].Based on the current literature, following are the most critical limits: 1) the heavy mathematical analyses needed for the modeling of the TAB; 2) the inevitable mismatch among the obtained models and the actual converter operation, which impairs the results of offline searches based on converters models; 3) the use of large and complex multidimensional lookup tables; 4) the time-consuming searches, local-minima issues, and low effectiveness during transients typical of online optimization methods.In this context, data-driven approaches may overcome the mentioned limits [22].In particular, the application of artificial neural networks (ANNs) in power electronics can be found in the literature, aiming at different purposes, such as model predictive controllers [23], [24], fault diagnostic and management [25], optimal design of converters [26], [27], and efficiency-optimized modulation [28], [29], [30].According to [31], ANN approaches emerge as promising tools when considering complex problems including nonlinearities and uncertainties.Besides, ANNs can implement continuous nonlinear maps between multiple inputs and outputs.For example, in [28], an ANN model was built for an interleaved boost with coupled inductors converter, showing its merits over a lookup table from the point of view of memory usage.Such an advantage is expected to be even more appreciable with the additional degrees of freedom of a TAB.In [29], based on simulation data, an ANN was trained to provide the peak current in the high-frequency transformer of a DAB converter.Then, to minimize the peak current stress of the DAB, the optimum duty-cycles were derived through a particle swarm optimization algorithm using a map implemented by an ANN.Differently, herein, the additional complexity of the TAB converter is tackled using an ANN that directly maps the operating points into the corresponding duty-cycles that allow to minimize the total rms current of the converter.This is done by avoiding mathematical modeling and control techniques.Besides, no applications of ANN for TAB modulation were found in the literature.
In this article, an ANN approach is proposed for computing the optimum modulation parameters D 1 , D 2 , and D 3 for a TAB converter, given the operating conditions in terms of operating voltages and power flows.Optimality is measured in terms of total rms currents at the transformer ports.The ANN is trained offline by exploiting the results from a systematic search of the optimal modulation parameters.This search is performed considering a simulation model calibrated to match the operation of the actual experimental TAB prototype.
The proposed approach details, implementation, and experimental verification are discussed in the following.

II. PROPOSED ANN-BASED APPROACH
The proposed approach consists in training an ANN to calculate the suitable modulation parameters for achieving optimal converter operation.The function to be optimized can have different expressions, including, for example, the overall converter efficiency, the switching and conduction losses of the power semiconductors, etc. Independently of the function adopted, the proposed approach can be used.For the sake of simplicity, the function considered in the following is the rms current on the active devices, that is, the focus is on rms current minimization, pursuing reduced converter conduction losses.Specifically, the considered measurement for optimization is the total rms current defined as where r p , p = 1, . . ., 3, are the equivalent path resistances of the respective pth port.Notably, the total rms current depends on five modulation parameters, as mentioned in Section I.
Solving this complex nonconvex function to find the minimum total rms current is challenging [16].Herein, this complexity is overcome by a data-driven approach, exploiting the information collected from a simulation model to compute the optimal TAB modulation parameters for rms current reduction.
The presented ANN approach consists of the following four steps: 1) validation of the simulation model and collection of the dataset, in Section III; 2) definition of the ANN structure, in Section IV; 3) training of the ANN based on the collected data, in Section V; 4) validation on the experimental prototype of the obtained results, in Section VI.The aimed ANN has four inputs, representing the operating point of the TAB, and three outputs, which are the corresponding optimum duty-cycles D 1 , D 2 , and D 3 .The four inputs are the port-2 and port-3 dc voltages and powers, V 2 , V 3 , P 2 , and P 3 , respectively.The other modulation parameters φ 2 and φ 3 are adjusted by a couple of proportional-integral regulators to provide closed-loop control of V 2 and V 3 (see, e.g., [21]).Remarkably, given the operating point, the solution to the optimization problem associated with (1) is unique.
As a final note about the defined control scheme, the phaseshifts are used to regulate the power flow between the ports, which determines the dc output voltages across the loads connected at the ports; whilst, the duty-cycles are modulated for optimizing the converter operation.The control organization is analogous to others described in the relevant literature for the DAB [11], [12] or the TAB [13], [14], [15], [16], [17], [18], [19], [20], [21] converters.

III. DATASET GENERATION FOR ANN TRAINING
The proposed approach involves training an ANN to map the operating point to desired modulation parameters D 1 , D 2 , D 3 .The mapping is based on a dataset, which can be generated in different ways [13], [14], [15], [16], [17], [18], [19], [20], [21].Herein, the dataset was generated in simulation considering a PLECS model of the TAB converter and considering the target of minimizing rms currents, as done in [29].Remarkably, the same approach can be applied using a dataset generated considering different targets, like, for example, efficiency optimization.If efficiency optimization is considered, the dataset can even be generated online on the real converter, as done, for example, in [21].These latter works may be used to generate the dataset to be considered within the scope of Section III-B.Section III-A describes the validation of the simulation model confronted with the actual converter.Section III-B describes the collection of the dataset for the training of the ANN.

A. Model Validation
First, the simulation model has been calibrated and validated, considering parameters including transformer leakage inductance, switching frequency, deadtime, etc.The process aims at matching the simulation models with the experimental prototype in terms of transformer rms currents and instantaneous current and voltage waveforms, at various test points.Fig. 2   matching between simulation and experimental waveforms of transformer currents i 2 and i 3 , while Fig. 3 shows the rms current deviation for the test cases, all presenting maximum deviation below 10%.

B. Data Collection
Second, a systematic, brute-force (BF) search (i.e., grid search) is run on the duty-cycles D 1 , D 2 , and D 3 , changing each duty-cycle from 0.15 to 0.50 with a fixed step of 0.05.Finer duty-cycles steps may be used for higher resolution datasets; on the other hand, this would increase the number of required simulations.An advantage of using the BF search, applied in simulation or experimentally, is that it is not affected by local minima, which may be a potential issue in the solution of the nonconvex problem of minimizing (1).Fig. 4 illustrates the BF search simulation results with a step size of 0.05 and 0.01.The maximum deviation between the obtained rms currents with the two different step sizes is below 1.5%.The difference between the two currents is negligible, but the use of a finer resolution, from 0.05 to 0.01, implies a number of simulations that increases from 512 to 46 656 points, for each power and voltage set point.Considering a reasonable number of simulations for each set point, 0.05 duty-cycles step is used in the BF search.Phase-shifts φ 2 and φ 3 are adjusted by employing two separate linear regulators.The BF search, which finds duty-cycles giving minimum total rms current, is repeated for about 15 000 set-points of different ports voltages and powers.Those points cover the power range from 1% to 100% of the rated power at port-2 and 3, with voltage levels spanning the range 80%-120% of the rated ports voltages.The 15 000 records collected from the BF search constitute the dataset eventually used to train the ANN, as shown next.

IV. ANN BASICS AND DESIGN
Among various kinds of ANNs [22], the multilayer perceptron neural networks (MLP-NNs) are considered in this work.In MLP-NNs, the neurons are divided into layers that are typically fully connected.When the relationship between inputs and outputs is a nonlinear static function, the MLP-NN is the most suitable architecture of ANN [32].The essential elements in an MLP-NN are as follows [33]: 1) the number of layers; 2) the number of neurons in each layer; 3) the activation function of each layer; 4) the algorithm used during the training process.There are at least three layers in between: 1) the input, 2) the output, and 3) the hidden layers.Commonly, the higher the problem's complexity (i.e., the complexity of the function to be estimated), the higher the number of neurons and hidden layers required.
Fig. 5 displays a standard configuration of MLP-NN, with n inputs, q hidden layers with p neurons each, and m outputs.The linear combination of the inputs of a neuron is processed through a so-called activation function, giving the neuron's output.The ability of an ANN to fit nonlinear problems is provided by the use of nonlinear activation functions.Among different types of activation functions [34], in this work, the sigmoid activation function is used for all the layers.A comprehensive evaluation of various activation functions commonly utilized in MLP-NNs, including sigmoid, rectified linear unit (ReLU), and hyperbolic tangent (tanh), was carried out too.The sigmoid function for all the layers of the ANN provided the lowest error values during the ANN development described in Section V.The development of an ANN aims to find the hyperparameters.In machine learning, the hyperparameters are the variables that determine the network structure (e.g., number of layers and neurons, activation function) and its training procedure (e.g., learning rate).Hyperparameters are set before training and they need to be adapted if performance, in terms of estimation error, is insufficient.
The development of an ANN is divided into the following three stages.

V. ANN DEVELOPMENT FOR OPTIMAL MODULATION
Several deep learning frameworks and libraries are available, like, for example, Matlab Deep Learning, TensorFlow, PyTorch, etc. Herein, the ANN is developed on Keras TensorFlow 2.6 on an Intel i9-12900KF CPU with 32 GB of RAM.With this setup, the average training time is less than 20 s.
(c) Percentile of the test cases against rms current deviation.

TABLE I HYPERPARAMETERS USED FOR TRAINING
Being not possible to determine a priori the number of hidden layers or neurons needed in each layer, a systematic, BF exploration is adopted.As a design choice, the maximum number of layers q max was set to 4 and the number of neurons per layer constrained between p min = 5 and p max = 40.Table I lists the used hyperparameters.The initial weights of the network are chosen randomly, and the entire training process (i.e., data splitting, training, and computation errors) is repeated three times to avoid nonoptimal solutions resulting from specific unfavorable initial conditions.To compare the different ANN architectures, the metrics mean absolute percentage error (MAPE) is used where D k,i is the estimated ith duty-cycle, Dk,i is the ith true duty-cycle, with i ∈ {1, 2, 3}, and K is the dimension of the test-set.The metric is computed on the test dataset.Other metrics including the root mean square error (RMSE), and mean absolute error (MAE) were also considered during the process, bringing equivalent conclusions in the comparison.The best results were obtained with an ANN with q = 4 layers and 40, 40, 30, 10 neurons, respectively, providing an MAPE of 2.64%; this solution involves 2283 parameters for its implementation.A suboptimal solution, whose performance in terms of MAPE displayed in Fig. 6, was obtained with q = 3 and 20, 20, and 15 neurons, respectively.This last solution sports an MAPE of 2.85% and involves 883 parameters for its implementation.On this basis, this last, smaller network is deemed to provide the most convenient tradeoff between accuracy and complexity and was chosen for deployment.Fig. 7 shows the performance of the developed ANN.In Fig. 7(a), P 3 is constant at 500 W and P 2 varies from zero to nominal power; in Fig. 7(b), P 2 is constant and P 3 varies; voltages V 2 and V 3 are fixed.Solid lines represent the ANN output; dashed lines, the results from the BF search.These latter present values on a discrete set because the BF search was performed with a duty-cycle quantization of 0.05.Remarkably, Fig. 7-displaying in (a)-(b) the duty-cycles as a function of the power at one port while keeping the other variables composing the operating point constant-shows seemingly linear relations.Still, the overall relationship between the operating points V 2 , V 3 , P 2 , P 3 and the duty-cycles is highly nonlinear, as illustrated in Fig. 8 .
The duty-cycle quantization in the BF search may cause sharp variations in the optimum parameters D 1 , D 2 , and D 3 because the optimization problem is nonconvex with multiple local minima [16].An example is visible in Fig. 7(b) around P 3 = 2 kW.Such abrupt variations with positive and negative slopes may originate detrimental effects in closed-loop control, like limit-cycle oscillations, and should be avoided.Instead, the ANN with the used sigmoid activation function inherently smooths the input-output relation, with a negligible impact on Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.the resulting rms currents.To show this, PLECS simulations were run for the same points reported in Fig. 7(a) and (b) to evaluate the difference in terms of obtained rms currents by the duty-cycles from the BF search and the ANN.Fig. 7(c) shows that the difference is less than 5% for 95% of the test cases.
Fig. 8 shows a 3-D surface of the optimum three duty-cycles under the same voltage levels; this representation highlights better the complexity of the problem tackled by the ANN approach.
The performance of the ANN model are now evaluated in terms of MAPE as a function of the number of data points composing the dataset.The initial dataset of 15 000 operating points is gradually reduced by removing random points, finally leaving only 750 points for ANN development, that is, 5% of its initial size.The ANN architecture and the partitioning of the dataset into training, validation, and testing subsets are kept unchanged.The error at each decimation level is obtained by  averaging the resulting MAPE over ten independent tests to limit the variability due to the random choices in the decimation and in the training.Fig. 9 displays the obtained results.Notably, the measured MAPE shows only small increments up to a decimation of ≈ 60% of the initial size.

A. Experimental Setup
The proposed ANN-based approach has been verified experimentally using the laboratory prototype displayed in Fig. 10, whose parameters are listed in Table II.The leakage inductances were designed to provide the nominal power at about 35°phase shift [13], [35]; the phase-shifts were constrained to limit the values of peak and rms currents through the components (e.g., switches) [11], [35].Fig. 11 illustrates the converter prototype structure, where port-1 of the TAB converter is connected to a

TABLE II EXPERIMENTAL PROTOTYPE PARAMETERS
fixed dc power supply at rated voltage V 1 = 400 V, and port-2 and port-3 are connected to corresponding dc electronic loads.The ANN model and the converter control and modulation are deployed on an Imperix B-Box RCP controller driving six Imperix PEB8032-A half-bridges.Fig. 11 shows the clocking logic in the digital controller.The analog-to-digital conversion, PI control, and modulators are executed at the switching frequency (i.e., 40 kHz).The ANN, which performs a secondary optimization process, can be run at a slower pace to conserve computational resources.Herein, the ANN is executed at a rate of 10 kHz.Antialiasing low-pass filters (LPF) are used at the interface with the ANN inputs.
The optimum five modulation variables corresponding to the actual operating point are generated as follows.The ANN computes the duty-cycles D 1 , D 2 , and D 3 based on the operating Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.point V 2 , V 3 , P 2 , P 3 , given as input to the ANN.The dutycycles are expected to bring to minimum rms current through the converter ports.Instead, the phase-shifts φ 2 and φ 3 are set by proportional-integrative regulators followed by a decoupling matrix, as done in [13].

B. Considerations on the Digital Implementation
To evaluate the impact in terms of computation-burden of the designed ANN in a common low-cost microcontroller, the deployment on an STM32F334R8 of the same ANN has been considered.Operatively, the ANN developed in TensorFlow, with three layers and 20, 20, and 15 neurons, has been converted into C-language and deployed as a library on the microcontroller.The conversion was performed by exploiting the toolbox STM32Cube.AI provided by STMicroelectronics.
The deployment of the ANN, which involves a total of 883 parameters, implies the allocation of about 3.45 kB of read-only memory (ROM) and 188 B of random-access memory (RAM), of which 16 B are due to the input layer, 12 B to the output layer, and 160 B to the activation functions.The network complexity is measured in terms of multiply-and-accumulate (MAC) operations.In the considered case, the number of MAC operations involved is 1463.Further details are reported in Table III, layer-by-layer.Finally, the measured average computation time of the ANN is 127.43µs.Negligible deviations due to numerical errors of the digital implementation were recorded.

C. Results and Discussion
Eleven power and voltage setpoints are tested, covering a wide range of transferred power across TAB converter ports starting from low to high power levels and characterized by significant dc voltage mismatch between the converter ports.A comparison between the proposed ANN-based modulation, BF search, and PSM is shown for the test cases.The comparison with PSM is included for reference, demonstrating the operation performance compared to a common, standard, and simple test case often referred to in related literature and highlighting the advantage of applying duty-cycles optimization [15], [16], [17], [21].The test cases present voltage levels V 1 = 400 V, V 2 = 320 V, and V 3 = 480 V, with port-2 power fixed at P 2 = 350 W, and port-3 power P 3 varying in the range from 200 W to 3650 W.
Fig. 12(a) shows the optimum duty-cycles computed by the ANN approach compared to the results by the BF search on the experimental prototype; BF results are deemed the true optimal values.Overall, a slight deviation between the ANN and BF search is noticed.In fact, Fig. 12(b) shows a deviation below 2% in the measured rms current, with a reduction in the total rms current of up to 60% at low power levels with respect to the PSM.Fig. 13 shows the percentage of measured reduction of converter total losses compared to PSM.
Figs. 14 and 15 show steady-state transformer voltage and current waveforms of the PSM and the proposed ANN-based modulation for two test cases, with P 3 = 200 W and P 3 = 1400 W, representing low and high power operation, respectively.Fig. 14 shows that the total rms current reduces from about 8.3 A using PSM to about 3.9 A using the proposed ANN-based modulation, that is, a total rms current reduction of about 53%.The total rms current reduction in Fig. 15 is about 19%, because at high power levels the optimum operating point is located nearby the full duty modulation.
To demonstrate the dynamic performance of the ANN approach, a step change from P 2 = 200 W to P 2 = 800 W of the load at port-2 shown in Fig. 16.Fig. 16(b) shows the response of the ANN, which updates the computed optimum duty-cycles within a few switching cycles immediately after the transient.Fig. 16(c) shows the response of the PI regulators adapting the phase-shifts to keep the output voltage constant as the operating conditions evolve.Notably, the ANN response is almost instantaneous, which is a distinctive merit of the proposed approach compared to alternative solutions based on iterative or online search methods.
Figs. 17 and 18 display the current and voltage waveforms, respectively, of the transformer across the transition considered above.In particular, Fig. 17    Remarkably, the ANN is capable of promptly and automatically adapting the duty-cycles to the actual operating conditions within about four switching cycles.

VII. CONCLUSION
An ANN approach for achieving reduced RMS operation of TAB converters was proposed and verified in this article.A multilayer perceptron neural network was designed and trained in order to estimate the optimal modulation parameters of the TAB, aiming at converter operation with minimum total rms currents.The ANN was trained based on a dataset generated by means of a simulation model.The simulation model was preliminarily calibrated to accurately describe the actual TAB prototype.The approach featured ease of data generation for ANN training, and deployability in real converter hardware, and allowed significant improvements in terms of total rms current circulation compared to the classical phase-shift approach.The proposed ANN approach showed other potential benefits with respect to the use of a lookup table for the modulation of the converter, including smooth operation under different operating points, lower memory requirements, extension to converters with multiple ports, the possibility of tuning the model with a reasonably limited number of samples of operating points, and the potential advantage of providing solutions in conditions not included in the training dataset.Finally, the presented approach can be used to generate a pretrained ANN input/output map that can be adapted/refined by online learning techniques, thus speeding up and facilitating the online training.This possibility and the extension to converters with additional ports may be considered as future research directions.
received 2 September 2022; revised 3 February 2023 and 21 March 2023; accepted 16 April 2023.Date of publication 1 May 2023; date of current version 14 September 2023.This work was supported in part by the project Multiport-Grid "Cross-Sectoral Energy Control through Interconnected Microgrids by Multiport Converter" funded within the call "ERA-Net Smart Energy Systems RegSys Joint Call 2018" and in part by the project "Interdisciplinary Strategy for the Development of Advanced Mechatronics Technologies (SISTEMA)," DTG, University of Padova, project code CUP-C36C18000400001. (Corresponding author: Tommaso Caldognetto.)

Fig. 5 .
Fig. 5. MLP-NN with n inputs, q hidden layers p neurons each, and m outputs.

Fig. 6 .
Fig. 6.Errors as a function of number of neurons in HL 1 and HL 2 , in (a) with two hidden layers and in (b) with 15 neurons on the third hidden layer.

1 ) 3 )
Preliminary operations: The given dataset is split into portions for training ( 80 %), validation ( 10 %), and test ( 10 %).The dataset is partitioned randomly to guarantee homogeneity between the different portions.Training data are used for the learning phase, validation data are used for testing the generalization capability of the network during the training process, and the test data are used for performance assessment.The dataset is commonly normalized; in our case, between 0 and 1. 2) Training: The backpropagation algorithm for updating the network weights and biases is applied n times, with n the number of epochs.The training ends when the loss function, the mean squared error (MSE) herein, stops decreasing.The validation dataset is used to detect over/underfitting.Performance evaluation: The test-set is evaluated and the obtained output is compared with the dataset output.If the performances of the ANN, in terms of error, are not sufficient, the ANN hyperparameters should be updated.

Fig. 9 .
Fig. 9. Effect on the MAPE as a function of the dataset size.

Fig. 13 .
Fig. 13.Percentage reduction in the TAB overall losses using the proposed ANN-based modulation compared to PSM.
(a)  shows the step-change of current i 2 due to the corresponding change of power at port-2.A zoomed-in view of this detail is provided in Fig.

17
(c).Fig.17 (b) and (d) shows the steady-state current waveforms before and after, respectively, the applied step-change transient.The corresponding voltage waveforms are provided in Fig. 18(b) and in Fig. 18(c), after and before the transient, respectively.

TABLE III ANN
DEPLOYMENT ON AN STM32 MICROCONTROLLER