Data-Driven Modeling of a Commercial Photovoltaic Microinverter

We present a data-driven modeling (DDM) approach for static modeling of commercial photovoltaic (PV) microinverters. The proposed modeling approach handles all possible microinverter operating modes, including burst mode. No prior knowledge of internal components, structure, and control algorithm is assumed in developing the model. The approach is based on Artificial Neural Network (ANN) and Fast Fourier Transform (FFT). To generate the data used to train the model, a Power Hardware in the Loop (PHIL) approach is applied. Instantaneous inputs-outputs data are collected from the terminals of a commercial PV microinverter at time domain.Then, the collected data are converted to the frequency domain using Fast Fourier Transform (FFT). The ANNs that are the core of the DDM are developed in frequency domain. The outputs of the ANNs are then converted back to time domain for validation and use in system level simulation.The comparison betweenmeasured and simulated data validates the performance of the presented approach.


Introduction
The worldwide installed capacity of solar photovoltaic energy surpassed 303 GW at the end of 2016 [1].Such a sharp increase-about 90 GW added in two years (2014)(2015) and 75 GW only in 2016 [1]-attracted the attention and concerns of industries, utilities, and academia.The increasing penetration of photovoltaic generation imposes significant challenges related to power quality (harmonics, power factor, DC injection, and voltage flicker), reliability, protection, control, and stability of distribution grids [2].In this context, it is crucial to be able to accurately simulate the effects that photovoltaic generation has on grid operation and the interactions that may occur between interfacing converters and traditional grid regulating devices (e.g., on-load tapchanger, capacitor banks).
Considering the complexity of energy system, there is no doubt that modeling and simulation are fundamental tools to perform design and analysis in a safe and effective manner [3][4][5].Modeling, validation, and verification of interfacing converters are critical steps to perform a system level analysis of future power systems.However, developing a reliable model of a grid-connected converter requires significant background on modeling approaches (e.g., first principles versus empirical), system characteristics, and levels of model detail required.Moreover, modeling these converters is particularly critical due to the major role played by the control algorithm, especially in abnormal grid conditions.It would be unacceptably inaccurate to develop an equation based model constructed uniquely on the hardware characteristics of those devices-if it is not generated by the producer of the device itself.In the field of power electronic converters modeling, three levels of detail are generally considered depending on the analysis goals: component level, converter level, and system level [6].
Detailed component models have been developed for detailed circuit simulation purposes, for example, Insulated Gate Bipolar Transistors (IGBT), power diodes [7], inductors, and capacitors [8], but component-level modeling requires significant details about the physics of the device to be modeled, and the model execution is computationally demanding.This kind of modeling is considered a first principle model (white-box) based on fundamental physic laws.White-box models are reliable and accurate, but the amount of detail needed to obtain an accurate model limits its applicability when commercial-control driven-devices are of interest.At the same time, this approach is widely applied in commercial simulators when mainly generic models-non-vendorspecific-are used.
For converter level modeling, both white-and blackbox approaches have been used.White-box models (first principle models), which require significant knowledge of converter structure and parameters, have been developed both to capture the switching operation [9] of the converter and to represent the averaged behavior of the converter [10,11].At the same time, black-box experimental models (datadriven models) have been developed [12][13][14] using system identification approaches.Black-box models are typically also less computationally demanding.
For system level modeling, behavioral, or experimental, models are typically used.The limited computational cost and amount of information required are often between the main factors that drive the use of the behavioral model.In this context-since our goal is to model PV microinverter for system level studies-considering the device to be modeled as a black box and using a data-driven approach seem a viable alternative to an equation based model.
In [15,16], models of a PV inverter are developed at system level relying on system identification techniques.However, these models are valid only in a small range of operating conditions, and abnormal conditions as well as burst mode operation are not considered.In [17] another data-driven model of a PV inverter for system level analysis is reported.In this case, the model uses the DC side current as an input and the generated power as an output; neither the grid voltage or burst mode operation is considered in developing the model.In [18][19][20][21] detailed models of PV systems have been developed, but those models focus only on the PV panel/array stage without considering the power electronics conversion stage.
In this paper, we present a data-driven modeling (DDM) approach that considers the device (microinverter) as a black box.No prior knowledge of internal components, structure, or control algorithm is assumed in developing the model.The proposed approach models the device in the frequency domain to facilitate the modeling of harmonics and subharmonics behaviors.In this paper, the benefit of creating a static frequency domain based model of a gridconnected converter is demonstrated by including burst mode operation in the model of the considered PV inverter.Until now, burst mode operation of PV microinverter has been modeled only in [22] where a simple circuit is tuned to match collected experimental results.As mentioned in [22]-under high penetration levels-burst mode operation may result in voltage flickering and phases unbalancing problems.In this context the model developed as part of this paper will be used to evaluate how a large number of these devices may affect distribution grids.
The paper is organized into six sections.In Section 2 an introduction to PV inverters operation is reported, mainly to make the reader familiar with burst mode operation.In Section 3 we discuss the proposed data-driven approach.The laboratory setup, which includes AC grid emulation, DC (PV panel) emulation, and data acquisition, is presented in Section 4. Section 5 shows model validation and experimental results.Finally, Section 6 summarizes the main limits and advantages of the proposed approach.

PV Microinverter Operation and Analysis
There are three main types of PV inverter architectures: central inverters, string inverters, and module integrated type inverters (referred to as microinverters) [23].Central inverters are widely used in utility-scale PV farms and are used to connect a large number of parallel strings of PV panels to the grid.Each string consists of a series of PV panels that produce high DC voltage.Although the use of a central inverter is considered a simple, reliable, efficient, and cheap option for large-scale PV plants, the central inverter approach suffers from high DC voltage and current (and so power losses), inflexible design, and poor maximum power point tracker (MPPT) performance for individual PV panels, especially under cloudy situations.
Dedicated string inverters connect a series string of PV panels directly to the grid.This approach is generally used for residential rooftop PV panels and small to medium scale PV systems.The main advantages of using string inverters are reduced DC wiring (and so power losses) and improved MPPT performance.
As the third option, microinverters are directly connected to each panel and inject the generated power into an AC or DC grid.Using microinverters, each PV panel operates independently regardless of the conditions of the other panels.Therefore, microinverters have some significant advantages over the other mentioned solutions.Using microinverters, the operating point of each PV panel can be individually optimized with significant efficiency benefits.Moreover, using microinverters higher flexibility and safer installation (no high voltage connection) are achieved.The use of microinverters also facilitates panel health monitoring and maintenance operations.However, the use of microinverter increases the overall cost of the solar installation.In this paper, we focus on the modeling of PV microinverters due to their increasing use over the last few years.Before describing the used modeling approach (next section), we want to discuss the operation of a microinverter for readers that are not familiar with microinverters.In particular, we want to describe what burst mode operation indicates.To provide some quantitative value and to make the discussion more concrete we will often refer to the particular microinverter used for this work (Enphase S280); however, the main points in the description are valid for a generic microinverter.
The behavior of a commercial grid-connected line to line PV microinverter is, as previously mentioned, largely determined by the control software that is used to comply with the IEEE 1547 standard [24].Therefore, following the IEEE 1547 standard, many initial tests have been applied to the microinverter under normal and abnormal conditions which it may face during its operation [25].
We executed abnormal voltage tests-both for overvoltage and undervoltage-to verify the maximum and minimum voltage at which the microinverter could operate.Results from the tests are reported in Figures 1 and 2 and summarized in Table 1.The table also shows the clearing time for the microinverter to cease power.Under-frequency and over-frequency tests are also executed for the microinverter to confirm the operating frequency range.Other tests, such as a DC injection test, reconnection time test (Figure 3), and anti-island test (Figure 4) are also implemented and results are reported in Table 1.
On the AC side, the microinverter can operate at voltage grid levels between 184 Vrms and 228 Vrms [25].These levels are determined according to the IEEE 1547 standard.Minimum and maximum operating voltages have been verified using an increasing ramp (100 mV/s) and decreasing ramp (100 mV/s) to determine the trip voltage levels (abnormal voltage tests) [24,25].On the DC side, the power generated by the PV panel may vary between 0 and 270 W.
The PV inverter injects a perfectly sinusoidal current in phase with the grid voltage if the injected power is more than 34% of the nominal one.If the PV panel generates less than 34% of the PV rated power, the inverter operates in what is called "burst mode."During burst mode operation, the microinverter utilizes a charging and release cycle approach.It is worth noticing that this approach can significantly  increase efficiency when operating at low light conditions, as, for example, during morning and evening hours.
To better analyze the operation in burst mode, we analyze how the number of charging cycles changes with the power generated by the PV panel, as shown in Table 2. Figure 5 shows the real current waveforms of the microinverter operating under burst mode at different PV input power levels.The microinverter charges from 1 to 5 periods and injects current for one period depending on the input power.Figure 6 shows the harmonic components of the injected grid current in correspondence to the number of charging cycles; frequency domain data are obtained performing a Fast Fourier Transform (FFT).Only frequency components with amplitude larger than 0.1% of the rated current are considered in analyzing the microinverter operation and in developing the DDM.
For one charging cycle, the output has frequency components integer multiples of 30 Hz.However, for two charging cycles, the frequency components are integer multiples of 20 Hz.For the operation consisting of three, four, and five charging cycles the frequency components are integer multiples of 15 Hz, 12 Hz, and 10 Hz, respectively.
Within the power ranges identified in Table 2, the microinjected current changes in amplitude but the ratio between on and off cycles is constant; as a consequence the harmonic components involved change in amplitude but not in frequency.For one charging cycle, Figure 7 shows the AC  11 5 grid injected current magnitudes for different values of the input power (between 26% and 33% of the inverter rating).
It is also worth observing that the output current bursts at nonzero-crossing points of the current waveform as shown at points B in Figure 7.The FFT analysis for one charging cycle at various power levels (26-33% of the rated power) is shown in Figure 8.The same behavior was observed for the other charging cycles.

Modeling Approach
Data-driven modeling approaches are typically classified as direct or indirect.Direct methods use the raw collected data to create the input-output mapping while indirect methods need to extract features from data to build the model.Concentrating on operating conditions for which the generated power is different from zero, the output current (AC side) of the microinverter is a sinusoid waveform-as long as the inverter is not operating in burst mode-and depends on the grid voltage (184 Vrms to 228 Vrms) and the output current of the PV panel (2.54-7.17A).On the contrary, as discussed in the previous section, Figures 5 and 8 show how the current injected by the microinverter is characterized by strong subharmonic components when operating in burst mode.Given this broad variation, the creation of a time domain steady-state model is very challenging.For this reason, we decide to use an indirect approach to the creation of the data-driven model.The model is created by extracting RMS data from the PV side current and the grid voltage ( DC ,  grid ) as features of the input side and extracting frequency components (magnitude, phase) of the grid current ( AC ) as a feature on the output side.The workflow for the proposed creation of the DDM is shown in Figure 9.It illustrates the two preprocess steps for preparing the data, the DDM creation using an ANN algorithm, and the conversion of the DDM outputs back to time domain.
The collected data are modified through two steps before proceeding with the training.We refer to this two steps as postinput and preoutput.In the postinput stage, the input time domain instantaneous value data are converted to RMS values.In the preoutput stage, the output data are converted to the frequency domain (amplitude, phase).FFT is used to calculate amplitude and phase of each frequency components; only frequency components with amplitude higher than 0.1% of the rated current are considered in the modeling of DDM.Once the data is prepared, the DDM is created using an Artificial Neural Network.The outputs of the DDM are then converted back from the frequency domain to the time domain.

Data-Driven Model Development.
In machine learning and computational intelligence, the most common algorithms for the development of data-driven models are Artificial Neural Networks (ANN), Fuzzy Rule-Based Systems (FRBS), and Genetic Algorithms (GA).To develop the model of the microinverter of interest we used an ANN algorithm based on a two-layer feedforward network with nonlinear activating nodes (sigmoid hidden neurons) in the hidden layer and a linear activating output node in the output layer.We decided to use ANN due to their good capability to learn nonlinear relations and due to the parallel and straightforward execution structure that facilitates the implementation of the derived DDM into traditional power system simulation software, in addition to real-time execution.Three ANNs are created to cover the whole operating range of the microinverter.The inputs of the ANNs are the grid voltage (RMS) and the PV current; the outputs are the amplitude and phase of the frequency components of the grid current.The ANN used to model nonburst mode operation is based on two sigmoid neurons in the single hidden layer used and on two linear neurons in the linear output layer.For burst mode operation, two ANN are used-one for the phase and one for the amplitude.Both ANNs are based on six sigmoid neurons in the hidden layer, and 42 linear neurons are used in the linear output layer.As described in more detail in Section 5.1, 42 samples are used for training the ANN used for nonburst mode, and 93 samples are used for validation.For burst mode operation, the ANNs are trained using 23 samples, and they are validated using 30 samples.

Overall Model Structure.
In this section, we describe how a single model has been created to cover all possible operating conditions so that it could be used in system level simulation.As mentioned in the previous sections, three different ANNs Output of components of ANN when input power is 10% of rated power (e) Figure 5: Current output waveforms of the microinverter during burst mode ((a-e) 26%, 17%, 14%, 12%, and 10%).
have been created, one for nonburst mode operation and two for burst mode operation; a block diagram description of the model is presented in Figure 10.The model is composed of the three ANNs, of an output selector and of a conversion module.All three ANNs are constantly operated in parallel under all grid and irradiance conditions, and they all receive the same inputs ( DC and  grid ).The output selector receives the value of  DC and  grid and determines which ANN outputs should be used, distinguishing between nonburst mode and burst mode operations.Finally, the conversion module converts the data-amplitude(s) and phase(s)-received by the output selector back to the time domain.It is worth mentioning once more that the outputs of the model are the instantaneous values of the grid current ( AC ).

Laboratory Setup
To generate the data needed in the modeling phase, a Power Hardware in the Loop approach is used.A comprehensive summary of PHIL is presented in [26], and a couple of examples of the recent use of PHIL are provided in [27,28].A representation of the laboratory setup used is depicted in Figure 11.The setup is divided into three sections: AC grid emulation, PV panel emulation, and data acquisition.To emulate the AC grid, the microinverter is connected to two AE Techron 7548 amplifiers controlled by a realtime simulator (Opal-RT).To emulate the PV panel, a BK Precision PVS600085-controlled by a host computer-is used.The same host computer also performs data acquisition through a National Instruments (NI) data acquisition board using LabVIEW.Custom circuit boards containing current and voltage transducers are used to acquire the needed measurements and to provide feedback measurements to Opal-RT.Below a detailed description of the laboratory setup is reported.

Real-Time AC Grid Emulation.
In this section, we describe the setup used to emulate the grid under the considered operating conditions.The AC grid is emulated utilizing two AE Techron 7548 four-quadrant linear power amplifiers and a real-time simulator (Opal-RT).The AC grids' behavior is simulated in Opal-RT using MATLAB/Simulink (R2011b).Analog outputs (±16 Volt) from Opal-RT are used to provide the calculated reference values (grid voltages) to the AE Techron amplifiers.Analog signals are also used to provide Opal-RT the needed measured values (injected currents) used in the simulation.
The amplifiers can operate both as a source and as a load to absorb the energy generated by the microinverter (four-quadrant operation).In sinking mode, the amplifiers   Figure 6: FFT magnitude for output current waveforms of microinverter during burst mode ((a-e) 26%, 17%, 14%, 12%, and 10%).can absorb up to 25-35% of their rated output power.If the sinking capability is presumed to be exceeded, then an external resistive load could be connected to the output of the amplifier to absorb the excess energy.For the tests presented

PV Emulation.
In order to create a microinverter model under various weather conditions (irradiation and temperature) in a laboratory environment, a traditional DC power supply will not be adequate.For this reason, we use a socalled PV emulator, specifically the BK Precision PVS60085.The PVS60085 is a high voltage (600 Vdc) power supply that is designed to be used with Solar Array Simulator (SAS) software, through LabVIEW drivers.The voltage and current levels are such that the whole operating range of the Enphase S280 microinverter can be tested.The SAS software is compatible with various standards (i.e., EN50530, Sandia, NB/T32004), but it is also possible to define custom - curves so as to emulate specific PV panels, on the base of power capability and maximum power points ( maxpower and  maxpower ).Using the SAS software, it is also possible to specify irradiation levels and temperatures' profiles so as to change the output power with a controlled time-step or rate.

Data Acquisition
System.Data acquisition is performed using a setup based on a National Instruments acquisition system and custom transducer boards.
The custom transducer boards are based on two galvanically isolated Hall-effect sensors (LEM LV 25-P and LEM LA 55-P).The transducers are such that voltage up to 500 V (DC-25 kHz) and current up to 50 A (DC-200 kHz) can be measured.To reach a maximum resolution within the voltage and current range of interest, appropriate resistor values and number of turns are selected.A proper conditioning circuit for antialiasing filtering and voltage level translation is used; all circuit components are chosen to provide high precision and low noise.The NI data acquisition system is based on the PCIe-6363 acquisition board (32-channel, 16bit analog inputs with an aggregate sampling rate of 2 MS/s).A dedicated LabVIEW application has been developed so that analog data can be acquired at a constant rate or using an event-driven (triggered) approach so as to provide synchronous operation with other devices or software.

Model Validation and Experimental Results
The DDM has been developed using MATLAB/Simulink R2011b.The collected data, as described in Section 3.1, are divided into two groups: one used for training the ANN and the other for validating the ANN.However, to better appreciate the performance of the model, the DDM is also executed in real-time using Opal-RT.The results obtained from the model operating in real-time are compared with the results obtained from the actual operation of the microinverter.To evaluate the accuracy of the developed model, the error, between the DDM and the real microinverter, is calculated using (1)  Considering, for example, the results of Figure 12, the error is evaluated by setting the grid voltage at 190 V and by changing the input power levels.The same process is repeated for grid voltages equal to 207.8 V and 215 V.The average error is determined for each input power level over the considered grid voltage levels (190 V, 207.8 V, and 215 V).We initially proceed by testing the model at training points (the same grid voltage levels: 190 V, 207.8 V, and 215 V; the same power levels: 35% and 100% at 5% increments) as shown by the blue points in Figure 12.Then, we proceed testing the model at nontraining points (different voltage and power levels) to validate its performance better.First, the model is tested at the same grid voltage levels (190, 207.8, and 215 V) used in training, but different input power levels (38-98%) are considered.Results are shown by the red points at Figure 12.The average error is less than 0.7%.Second, the model is tested at the same power levels used in the training, but at voltage levels (200 V, 220 V) different from the one used in the training.The average error, in this case, is shown by the blue points of Figure 13.The red points in Figure 13 indicate the average error at nontraining grid voltage levels (200 V and 220 V) and nontraining power levels (38-98%).
The first result is somehow surprising because it would be legitimate to expect little to no error when the model operates under the same conditions used for training.The obtained error-still small-is due to the measurement noise and the truncation introduced when selecting the harmonic components to be included.From the testing of the DDM of the microinverter at nontraining operating conditions-as shown in Figures 12 and 13-it can be observed that the maximum average error is less than 0.9%.

Response of the DDM during
Burst Mode: 0-33% of Rated Power.In this section, we discuss the accuracy of the obtained model for burst mode operation.Figures 14  and 15 show the average error-of the magnitude and phase components-between the current measured on the inverter and the data obtained from the model.Tests are performed at different operating conditions, both under the same conditions used for ANN training and under nontraining conditions.The average is obtained considering the different harmonics components.For training points, the maximum average error for the magnitude is equal to 0.6% (0.008 A) and for the phase angle is equal to 0.66 degrees.For nontraining points, the maximum average error of the magnitude is less  than 1.2% (0.015 A), and the average error of the phase angle is less than 0.9 degrees except that for 2.2% of the PV rated power; in this case, the error is equal to 3.5 degrees.This high value is due to the low power level; at this power level measurements accuracy and noise became more significant and degrade the model performance.To evaluate the model accuracy once the time domain signal is reconstructed, the outputs of the ANN, which were amplitudes and phases, are converted to time domain by reconstructing the original current signals.In Figure 16 the AC current waveform obtained by the model is compared to the waveform obtained by the real device, a nontraining point is used for this comparison.

Conclusion
In this paper, a DDM approach is proposed for modeling a commercial PV microinverter without any prior knowledge of internal components, structure, or control algorithms.In general, there are two major challenges in developing a data-driven model of a PV microinverter.First of all, including the effect of grid voltage variations in the model requires the development of a multi-input model; this significantly increases the complexity of the model, if compared to SISO models developed in literature, for example, [17].Second, the model needs to be able to capture burst mode operation; at the actual stage only another approach has been proposed to model this type of operation [22].Thanks to the approach proposed in this paper the microinverter has been considered as a black box and a DDM has been created based on ANN and FFT; the obtained model covers both normal mode and burst mode operation taking also into consideration grid voltage variations.The model results are validated through a large set of operating conditions and in general show good accuracy.
The obtained model can be integrated into a commercial tool for power system simulation.The models obtained with the proposed approach require very little resource usage, and in fact, we successfully used them for real-time simulation.In further studies, we will analyze how those devices affect, especially during burst mode operation, LV distribution networks power quality.

Disclosure
An earlier version of this work was presented as a poster at DistribuTECH Conference and Exhibition 2018.

Figure 3 :
Figure 3: The output current of microinverter under reconnected time test.

Figure 7 :
Figure 7: Output current waveforms of microinverter during burst mode (1 charging cycle) at different inputs.

Figure 8 :30
Figure 8: FFT magnitude for output current waveforms of microinverter during burst mode (1 charging cycle) at different inputs.

Figure 10 :
Figure 10: The simplified structure of DDM network.

Figure 11 :
Figure 11: Laboratory setup for PHIL testing of the Enphase S280 microinverter.

Figure 12 :
Figure 12: The average error between DDM and real measurement at training point and nontraining point for grid voltage equal to 190, 207.8, and 215 V.

Figure 14 :
Figure 14: Average error magnitudes of output current components between the real microinverter and the DDM during burst mode at training and nontraining points.

Figure 15 :
Figure 15: Average phase angles error of output current components between the real microinverter and the DDM during burst mode at training and nontraining points.

Figure 16 :
Figure 16: Output current waveforms of the microinverter and DDM during burst mode at the nontraining point.

Table 2 :
Charging cycles by power level.