Black-Box Large-Signal Average Modeling of DC-DC Converters Using NARX-ANNs

This paper investigates the use of non-linear autoregressive exogenous (NARX) artificial neural networks (ANNs) to achieve black-box average dynamic models of dc-dc converters capable of capturing the main converter non-linearities. Non-linearities may include, for example, dynamic behavior variations due to changes of operating point or operating mode (e.g., discontinuous conduction mode, continuous conduction mode). This paper presents design guidelines for determining the NARX-ANN architecture and the dataset to be used in the training process. Dataset definition includes the choice of the perturbations for stimulating the aimed system behaviors and optimizations for dataset size reduction. The proposed approach is first derived for a dc-dc boost converter. To verify the generality of the proposed method, the same methodology is also applied to a Ćuk converter. In both cases, the proposed NARX-ANN modeling provided accurate results, with only limited deviations observed in the time-domain responses to step variations of duty-cycle and output current. The proposed model provided accurate small-signal behavior under different operating conditions. The validity of the approach is evaluated experimentally by considering a boost converter prototype.


I. INTRODUCTION
Recently, broad interest has been growing in the application of artificial intelligence (AI) in numerous scientific and industrial fields [1], [2]. Power electronic conversion circuits and powerful digital controllers offer many compelling scenarios in which AI methods may unleash unprecedented performances, new features, and potential breakthrough applications [3].
Modern power systems, such as smart microgrids, comprise a large number of electronic power converters (EPCs) from different manufacturers. Typically, a system designer The associate editor coordinating the review of this manuscript and approving it for publication was Zhehan Yi . disposes of no or insufficient details on the converters (e.g., due to intellectual property issues), making the application of classical modeling based on the knowledge of the converter parameters impractical. This is a substantial limitation for stability assessments and faults analyses at a system level considering interactions among different converters. To overcome these issues, it is necessary to estimate the static and dynamic performance of the EPC by directly identifying its parameters or by determining an equivalent structure that can emulate its behavior [4].
Several approaches for power converters modeling are reported in the literature [5]. White-box models are derived by applying physics principles and aim at accurately representing the inner behavior of the system, under the assumption that all the parameters needed for the modeling are known. Switching models fall into this category. Grey-box methods are used when white-box modeling is only partially possible, and the final system model is completed by using data collected from the operation of the system. Notably, both approaches rely on prior knowledge about the system, which information is not always available.
Black-box modeling is instead a model-free approach that overcomes these limitations. The parameters of the black-box model do not necessarily have a physical meaning: they are defined with the sole objective of matching stimulus/response relationships. Therefore, input-output experiments can be used as a main source of data for these types of data-driven approaches.
In the literature, black-box analytical methods are classified based on the type of behavior to reproduce: linear, static non-linear, and dynamic non-linear [6]. In the linear case, models are built to replicate the small-signal behavior of the EPC at a specific operating point [7]. In the static non-linear case, the Wiener-Hammerstein approach is the most common method. The dynamic behavior of the system is described using a passive network (i.e., a combination of capacitors, inductors, and resistors), while the non-linear behavior is described using voltage or current sources controlled by non-linear functions [8], [9]. As a disadvantage of the approach, the complexity of the network that models the linear behavior increases linearly with its complexity (e.g., number of poles and zeros). In the dynamic non-linear case, polytopic functions [6] are widely used. This approach describes the behavior of non-linear systems by obtaining small-signal models at different operating points and combining them into a non-linear structure using weighting functions [10]. In order to achieve an accurate model of the EPC, including non-linear effects, a large number of transfer functions is needed, leading to an increase of model complexity.
A modern possibility described in the literature for modeling is the use of AI methods. In [11], a NARX-ANN is used to model in simulation a synchronous boost converter operating in continuous conduction mode (CCM). The modeling of a synchronous boost converter considered in the time domain that operates in CCM is reported in [12] and [13]. A different approach for modeling both the DCM and CCM operating modes of a converter using long short-term memory (LSTM) networks is presented in [14]. The dataset used in [14] consists of distinct windows, each containing a step change in the load, and the network is trained to predict the response of the converter to a specific window. The effectiveness of this architecture for the prediction of outputs considering different input signals (e.g, sinusoidal) is not discussed, and the capability of the approach of modeling frequency domain performances is left unexplored. Moreover, as a limit of LSTM-ANNs, they present a more complex structure with a greater number of parameters as compared with NARX-ANN [15].
This paper is investigates the use of ANN-based approaches for EPCs modeling. To this end, an average model of a boost converter is pursued by the use of a NARX-ANN capable of replicating the converter dynamic behavior at several different operating points. The use of NARX-ANN to model the CCM operation has already been applied with good results [11], [12], [13], while its use including the DCM operation is not reported. Furthermore, an extensive analysis of the modeling accuracy considering the small-signal response of the ANN-based model and the expected transfer functions in DCM and CCM has not been analyzed. Remarkably, the proposed model can compute the predicted output of the modeled system in response to an input signal on a sample-by-sample basis. This feature is advantageous for implementing digital twins fed by signals acquired from the physical application and operated in real-time [16].
This paper extends the studies preliminarily reported in [17] where a NARX-ANN model was employed to model a buck converter operating at 30 kHz. Specifically, this paper discusses the design guidelines for the derivation of the NARX-ANN, accesses the accuracy of the model in the time and frequency domains, demonstrates the method considering the Ćuk converter, and presents the experimental validation of the proposal. In the following, Section II outlines the main theoretical concepts of NARX-ANNs. Section III describes the boost converter used as test-case and shows the performance of the NARX-ANN varying the topology of the dataset. Information about the architecture of the ANN and how the dataset is designed is also provided. Section IV shows the effectiveness of the proposed method when applied for the modeling of a Ćuk converter. Section V describes the experimental setup used for the training of the NARX-ANN and verifies the effectiveness of the proposed solution in the time and frequency domains.

II. BASICS OF NARX-ANN
To model the EPC dynamics, an ANN with memory should be considered, in analogy with the state equation of classical state-space models. NARX-ANNs belong to the class of recursive neural networks (RNNs), allowing this property, commonly exploited for time series predictions [18].
NARX-ANNs can be used to model a wide variety of non-linear dynamic systems and they have been applied in various applications, including time-series modeling [19], [20]. Unlike other types of RNNs, such as the LSTM-ANNs, where the memory effect is implemented directly by the neurons, NARX-ANNs are composed of two blocks, as shown in Fig. 1. A multilayer perceptron artificial neural network (MLP-ANN) is used to implement an internal static input-output relation F(·). The basic elements of an MLP-ANN are i) the number of layers, ii) the number of neurons in each layer, iii) the activation function of each layer, iv) the algorithm used during the training process [21]. MLP-ANNs are constitute of the input, the output, and the shallow layers. Additional internal layers, called hidden layers, can be included between the input and the output layers. Commonly, the higher the complexity of the relation F(·), the higher the number of neurons and hidden layers required. Each neuron returns its output via a non-linear function, called activation function [22], that processes the linear combination of its inputs with a bias added. In this work, the sigmoid activation function and the rectified linear unit (ReLU) function are used for the hidden layers and the output layer, respectively.
In the following, the NARX-ANN is adopted to obtain the outputŷ, prediction of the actual output y of the system to be modeled, in response to the exogenous input u. The MLP-ANN inputs are composed of the exogenous inputs plus the outputs of the modeled system. The modeled system outputs given as input to the MLP-ANN can either be the actual ones y or their predicted versionŷ, depending on whether the NARX-ANN is operated in open-loop or closedloop, respectively [23]. This latter is displayed in Fig. 1 and considered herein.
The static input-output relation describing the behavior of the NARX-ANN in open-loop iŝ (1) whereŷ(k) is the predicted vector of the outputs at the k-th instant, u(·) and y(·) are the input and output vectors, respectively, n and m are the input and output delays, respectively, and F(·) is the non-linear function implemented by the MLP-ANN. The equation that describes the behavior of the NARX-ANN in closed-loop operation iŝ where the predicted outputŷ(k) is a function of the input vector u(·) and its own predicted outputsŷ, ignoring the previous outputs of the system y(·). Remarkably, the non-linear mapping function F(·) is initially unknown and is approximated during the training process.
In the methodology proposed here, the open-loop configuration is considered during the training processes fed by the inputs u(·) and the actual outputs y(·). Then, the error obtained from the comparison between the actual output and the predicted one is used to update the network weights. After the training of the ANN in the open-loop configuration, the predicted output is fed back to the ANN, thus forming a closed-loop architecture.

III. TEST CASE: BOOST CONVERTER
The approach outlined in the previous section is now demonstrated considering the modeling of a boost converter, displayed in Fig. 2. In the presented theoretical framework the load current is modeled using a current source. This choice preserves the generality of the presented results, as the NARX-ANN is trained to discern the relationship between the inputs and the outputs. In fact, the proposed methodology was also successfully verified and validated considering a variable resistive load at the converter output.

A. DESIGN OF THE NARX-ANN
In a black-box modeling approach, only the input and output terminals of a system are available for observation; in this case, they are i IN , V IN , i O , and v O . Furthermore, when the converter operates in an open-loop configuration, there is also a control terminal, usually represented by the duty-cycle δ. In the following, the input voltage V IN is considered fixed while the duty-cycle and the output current i O are considered as inputs. The duty-cycle allows the control of the converter output, while the output current accounts for a variable external load. Finally, the considered outputs are the input current (i.e., the inductor current i L for the considered topology) and output voltage v O . If needed, the model can be easily extended to include the input voltage V IN as an additional input variable.
The input to the MLP-ANN, that is, the argument of F(·), is composed of the elements while the MLP-ANN gives as output The complexity of a NARX-ANN, in addition to the number of layers and neurons, is also given by the number of delays applied to the exogenous inputs and the outputs, that is, the sum of (n + 1) · N u with m · N y , respectively. Considering a second-order system, it can be described by a state update equation that includes state variables delayed up to two steps and input variables delayed up to one. On this basis, considering a second-order system to be modeled, m is set equal to 2 while n is set to 1, to retain and feed the MLP-ANN with the information related to all the produced outputs and exogenous inputs and their potentially relevant past values. Additional tests were carried out to verify the operation of the network with a greater number of delays, but no significant improvements were recorded.
The NARX-ANN is developed using the library Tensorflow 2.8 on Python, and the training phase is carried out in an NVIDIA GeForce RTX 3070 Ti.
Accuracy evaluations of the proposed method are performed, on the test-set, by calculating the normalized root mean square error (RMSE) and reported as a percentage using

B. DATASET DEFINITION
The validity of the proposed solution is first verified by simulation. The boost converter shown in Fig. 2 is implemented in Matlab/Simulink and exploited to generate the required dataset. Aiming at an average model, the switching frequency components on i L , v O , and i O can be disregarded by using, for example, a moving average filter with window-length T ma multiple of the switching period T sw . In our case, T ma is 100 µs and the sampling frequency is 10 kHz. Converter's parameters are listed in Table 1.
To address the problem analyzed in this paper, the dataset must be designed to include information on both static and dynamic conditions in several operating conditions. For linear systems, the ac-sweep test is a commonly used identification method in power electronics. For example, a method for measuring the loop gain frequency response experimentally through an ac-sweep test is presented in [24]. In [25], the small-signal frequency response is obtained by applying Fourier analysis on the impulse response using a pseudo-random binary signal as an approximation of the white noise. Using this method, the required time for characterization is drastically reduced in comparison to the conventional ac-sweep. Another method for fast characterization of the control-to-output frequency response is the use of a multi-sine excitation in combination with Fourier analysis [26].
Nevertheless, EPCs are non-linear systems as the relationships between input and output variables, in general, vary with the operating point. When the model is aimed to describe the converter over its whole operating range, it is necessary to consider that classical small-signal analysis is not sufficient, because its validity is only local, at a specific operating point. Therefore, previous approaches are in general valid for linear or linearised systems at a specific operating point but not for large-signal analyses.
To address these issues, a systematic analysis of the type of dataset to be used for the training is carried out in order to evaluate the impact on the ANN performance. The signal employed to construct the dataset is sourced from the signal presented in [27], which has been previously utilized for the identification of non-linear dynamic systems as described in [20]. The signal used for constructing the dataset is composed of a sequence of square waves, which enables the identification of the system's behavior in steady state and, due to the step changes in the input signal, also allows for the examination of the dynamic behavior between different operating points. The number of operating points used to train the network depends on the problem at hand and the accuracy required. For the design of the dataset, 100 random duty-cycle δ values and 750 for the output current i O were chosen, generating a dataset with a total number of 75,000 operating conditions. Afterward, they were divided into training (80%), validation (10%), and testing (10%).
The characteristics of the datasets are reported as follows: i.
Step signals: The system is stimulated by staircase waves. Each operating point is applied for a fixed amount of time that depends on the dynamic of the systems, in this case 2 ms. ii.
Step signals with superimposed chirp waves: In addition to the staircase stimulus, a chirp signal with a frequency spanning from 1 to 5 kHz and an amplitude between 1% and 4% for the δ and 80 mA and 120 mA for the i O is applied to the system. The staircase waves are applied for a longer amount of time, equal to 10 ms. iii.
Step signals with white noise: The white noise is added to the input staircase waves using a Simulink block named Band-Limited white noise with a power spectrum density of −92 dB for the δ and −57 dB for the i O with a sampling frequency of 50 kHz. Each operating point is applied for 2 ms. The contribution of the white noise to the i O and v O spectra is shown in Fig. 3. Notably, the spectrum at high frequencies is richer, with a negligible effect at low frequencies. The hyperparameters of the NARX-ANN are chosen using a manual research algorithm, aiming at a trade-off between accuracy and amount of time required for the training. The parameters used are reported in Table 2. During the development phase, a thorough examination of several activation functions frequently used in ANN models was conducted. The activation functions evaluated included sigmoid, ReLU, and hyperbolic tangent. The examination revealed that the use of sigmoid activation function for the inner layers of the NARX-ANN results in optimal performance in terms of error and they are reported in Table 3.
The architecture of the ANN is kept constant for the three tests in order to avoid biases given by different combinations of hyperparameters. The performances of each dataset are evaluated in both time and frequency domains. In the time domain, the accuracy is computed using (5). Instead, for the frequency domain, the RMSE and the standard deviation of the magnitude of selected representative transfer functions are evaluated in four cases:     The obtained results are summarized in Table 4 and Table 5, for the time and the frequency domain, respectively.
Notably, the dataset with step signals shows the best overall performances in time domain for both the output signals. It was observed that the ANN fails to predict the output of the system when it is exposed to fast variations in the input signals during the steady-state phase. This issue is more pronounced in the dataset that utilizes chirp signals, as opposed to the dataset that utilizes noise, thus explaining the lower error observed in the latter dataset.
Instead, in the frequency domain, the dataset with a richer spectrum shows best performances in terms of RMSE and standard deviation. The errors at operating point 1 are  generally higher than at other points because the converter operates in DCM and, therefore, has a transfer function that varies significantly depending on the operating point, which is not the case in CCM. Additionally, as the operating point is highly dependent on the value of the output current i O , even small variations in i O result in fluctuations in the operating point, leading to a more complex identification process.
Since negligible differences are observed by the use of the three different datasets in the frequency domain, the dataset with step signals is used for the next evaluations.

C. DATASET REDUCTION
This section discusses the performance of the NARX-ANN, in terms of normalized RMSE computed in the test-set, depending on the number of points in the dataset.
The starting dataset of 75,000 points of operation is gradually reduced, to 10% (i.e., 7,500 points) of its initial size, by removing points by random choices. The ANN architecture and the partition of the dataset into training, validation, and testing are kept unchanged (see Table 2). The calculation of errors is done on the test-sets produced after each reduction step.
The findings presented in Fig. 4 indicate that the reduction of operating points within the dataset has a notable impact on the error of i L and v O . However, it is noteworthy that up to a reduction rate of 60%, the error in these parameters remains almost constant. Therefore, it can be inferred from the results that there is no definitive dataset size, but rather the appropriate size is contingent upon the desired level of accuracy in accordance with the specific application at hand.

D. SIMULATION RESULTS
The NARX-ANN is evaluated in the time domain first. To visualize the performance of the model, the normalized RMSE is computed on the test-set obtaining an error of 0.77% for the current i L and 0.18% for the voltage v O .
Furthermore, in order to demonstrate the performance of the ANN in estimating the behavior of the boost converter in both DCM and CCM operation, a small set of operating points in DCM and CCM are chosen from the test-set and evaluated in Fig. 5(a) for DCM operation and in Fig. 5(b) for CCM operation.
As visible in Fig. 5, the ANN is able to accurately estimate the inductor current i L and the output voltage v O in both converter operating modes, even during transitions between two working points, as shown in Fig. 6. The obtained results show  comparable accuracy with those obtained by the black-box modeling in [6], discussed in Section I. To further improve the accuracy of the network and fit the requirements of specific applications, the dataset may be adjusted as mentioned in Section III-D.
In order to verify the stability of the NARX-ANN model performance throughout the operation domain, an additional analysis is conducted in Fig. 7. Within the training region, 50 values are defined for duty-cycle and current, which, combined, result in 2,500 operating points. Each operating point is applied to the simulation model and the NARX-ANN in order to evaluate the error during the steady-state phase. Then, a step change of the input variables, equal to 10% of the initial value, is applied to assess the behavior of the NARX-ANN during the transient phase.
Two metrics are employed to evaluate the model performance: the maximum absolute value of the error with respect to the nominal current i nom O , in Fig. 7(a)-(b), and the normalized RMSE, in Fig. 7(c)-(d). For better legibility, errors greater than 4% are saturated. The maximum recorded error is 14%. As illustrated, the proposed model exhibits a limited and consistent error throughout the operation domain, with errors comparable with those computed in the test-set. The most challenging operating point is represented by the minimum current and maximum duty-cycle values. This is a limited part of the DCM operating region and, due to the step changes in the input signals, the converter operates with output voltages higher than the maximum value for which the ANN is trained.
To show the performance of the NARX-ANN in modeling the small-signal behavior of an EPC, a transfer function for each operating mode is shown in Fig. 8. The transfer functions are obtained over a total of 20 points between 3 Hz and the Nyquist frequency of 5 kHz.
In general, the small-signal analysis obtained by NARX-ANN shows a good correlation with the expected results and an error that increases as the Nyquist frequency is approached. The increased deviation observed approaching the Nyquist frequency can be attributed to the nature of the signals utilized to generate the dataset. As the dataset is constituted of a sequence of stepped signals, the power of these signals decreases inversely proportional to the frequency, resulting in a lower energy contribution of the signals at the Nyquist frequency.
NARX-ANN also presents similar results for other working points that have not been reported in Fig. 8.

IV. TEST CASE: ĆUK CONVERTER
To verify the generality of the proposed approach, a fourthorder Ćuk converter is considered in this section. The Ćuk parameters are reported in Table 6 and the schematic in Fig. 9.
Aiming at black-box modeling, only the input and output variables are assumed to be available. Also in this case, the duty-cycle δ and the output current i O are excited using staircase waves. The output variables are the input current i IN and the output voltage v O .
The features of the dataset and the architecture of the ANN are the same considered in the previous sections, with   unchanged assumptions for the normalization. Each operating point is applied for 10 ms, the moving average is performed over a window of 50 µs and the sampling frequency is 20 kHz.   Since the Ćuk converter is a fourth-order system, the number of delays for the inputs is set to n = 3 while for the outputs it is set to m = 4.
The resulting ANN has 1,767 parameters, the training time is 10,800 s and the normalized RMSE computed on the test-set is 0.8% for the current i IN and 0.69% for the output voltage v O . The simulation results in the time domain are shown in Fig. 10 in DCM and CCM, while in Fig. 11, the performance of the NARX-ANN is verified in frequency domain only in a CCM operating point between 3 Hz and the Nyquist frequency of 10 kHz. Similar results are obtained for different working points.

V. EXPERIMENTAL RESULTS
To verify the performance of the proposed approach using experimental data, the prototype of Fig. 12 is used. The  converter has the same parameters used in the simulation model and reported in Table 1.  The output current source in Fig. 2 is replaced with a current-controlled half-bridge converter switching at 50 kHz connected to an active load in a constant-voltage mode at V DC = 380 V. In this case, each of the 75,000 operating points is applied for 10 ms. This time is longer than the one adopted in the simulation verification to cope with the settling time of the current-controlled load. Both power converters are implemented on a laboratory rapid prototyping system embedding an Imperix B-Board as digital controller.
As shown in Fig. 12(a), four variables are acquired using the cRIO FPGA environment by National Instruments, with a sampling frequency of 10 kHz. The filtering and acquisition of variables are carried out using the same methodology as described in the simulation part.
The hyperparameters of the ANN are the same used for the experimental results shown in Table 2. In this case, the time required by the training phase is 8,500 s for a number of epochs equal to 3,201.
In Fig. 13 the response of the NARX-ANN, trained with the experimental dataset, is evaluated versus the true output of the system. While Fig. 14 shows a zoom-in of Fig. 13 during the change of operating point for current i L and voltage v O in CCM.
As for the simulation tests, the comparison between the experimental frequency response and the one obtained using the ANN model is provided in Fig. 15. Despite of the noise present in the experimental measurements, the conclusions drawn considering the simulation tests keep valid. The normalized RMSE on the experimental test-set is 2.46% for i L and 0.65% for v O .

VI. CONCLUSION
An approach based on the application of a NARX-ANN for the black-box average modeling of open-loop dc-dc converters is presented. The paper addresses several challenges and design criteria for model derivation, including i) NARX-ANN design, ii) derivation of the dataset, iii) model verification. The proposed modeling has been demonstrated considering a boost converter and a Ćuk converter. In both cases, the results showed good accuracy in the time domain, considering input step variations, and in the frequency domain, considering small-signal transfer functions. Experimental results were presented for the dc-dc boost converters to verify the validity of the proposed approach. Several challenges have been outlined; the main ones can be summarized as i) need of a large number of operating conditions, ii) need of applying a heuristic tuning of some parameters during the ANN training, iii) presence of noise in the experimental setup. Prospective future research developments may include the modeling of digitally controlled systems, the modeling of dc/ac converters like grid-tied inverters, and the exploration of other potentially valuable AI methods, like recursive networks, for the modeling of dynamic non-linear systems.