Black-Box Behavioral Modeling of Voltage and Frequency Response Characteristic for Islanded Microgrid

: The voltage and frequency response model of microgrid is signiﬁcant for its application in the design of secondary voltage frequency controller and system stability analysis. However, most models developed for this aspect are complex in structure due to the di ﬃ cult mechanism modeling process and are only suitable for o ﬄ ine identiﬁcation. To solve these problems, this paper proposes a black-box modeling method to identify the voltage and frequency response model of microgrid online. Firstly, the microgrid system is set as a two-input, two-output black-box system and can be modeled only by data sampled at the input and output ports. Therefore, the simplicity of modeling steps can be guaranteed. Meanwhile, the recursive damped least squares method is used to realize the online model identiﬁcation of the microgrid system, so that the model parameters can be adjusted with the change of the microgrid operating structure, which makes the model more adaptable. The paper analyzes the black-box modeling process of the microgrid system in detail, and the microgrid platform, including 100 kW rated power inverters, is employed to validate the analysis and experimental results.


Introduction
Since the microgrid technology can realize flexible and efficient applications of distributed power generations, more and more attention has been paid to its research [1,2]. However, as the scale of microgrid increases, its large-signal behavior becomes complex at the system level analysis. To deal with these problems, microgrid dynamic modeling is one of the most effective methods. At present, microgrid modeling methods mainly include two types: mechanism modeling and identification modeling [3]. The mechanism modeling is carried out on the premise of mastering microgrid control method and structure, and therefore the model has high precision accordingly. Using the constructed model, the small/large signal stability analysis can be performed and the high frequency response characteristics of microgrid system can be studied as well [4,5]. However, with the widespread use of commercial converters, the detailed information relating to converters' topology, parameters, and control methods is hardly to be obtained due to the commercial confidentiality and other reasons, which makes the mechanism modeling method extremely difficult to carry out. Compared with the mechanism modeling, the identification modeling method only needs to sample the input and output data to complete the identification modeling process, instead of mastering the detailed information of microgrid structure and control method. The identified model neglects to some extent the high frequency response characteristics, yet it is simple and convenient to use, thus increasing attention has been paid to it.  When studying the coordinated control of the microgrid system, usually the first step is to model 108 and analyze the DGs included in the microgrid system, which is an important part before the overall

Modeling Requirements
When studying the coordinated control of the microgrid system, usually the first step is to model and analyze the DGs included in the microgrid system, which is an important part before the overall modeling of microgrid. A rule of thumb is to use the mechanism modeling method to equivalent multiple energy storage inverters of the same type into one inverter so that the microgrid model can be greatly simplified. However, in most microgrid systems, besides the energy storage devices, there are various types of distributed power devices, which affect the system characteristics as well. These factors cannot be ignored, which lead to the model being too complex. Without the information of the internal structure of the microgrid system, the microgrid model can be equivalent to a black-box model and identification modeling method can be adopted to model the microgrid system.
According to the black-box model of microgrid as shown in Figure 2, the parameters optimization of secondary voltage and frequency controller can be carried out with less complexity. The black-box model of microgrid is considered as part of the open-loop transfer function of the overall control structure, and the corresponding root locus can be obtained according to the open-loop transfer function. Hence, the performance of microgrid system can be analyzed and the parameters of PI regulators can be optimized as well.

133
In theory, if the line impedance and the output impedance of the inverters included in the 134 microgrid system are purely inductive, the relationship between the frequency and the active power, 135 as well as the relationship between the voltage and the reactive power are completely decoupled.

136
However, in practical microgrid systems, the line impedance and the output impedance are not 137 purely inductive, so the coupling term should be considered in the black-box model. Therefore, there 138 are 4 parameters to be identified in the black-box model as shown in Equation (1): where P0total and Q0total refer to the total active and reactive power references in the microgrid

The Structure of Identification Model
According to the modeling requirements discussed above, the equivalent structure of microgrid model can be obtained as shown in Figure 3. Instead of analyzing the internal structure of the microgrid, the black-box model can be directly constructed by sampling the active and reactive power references data at the input ports and the frequency and voltage amplitude data at the output ports.

133
In theory, if the line impedance and the output impedance of the inverters included in the 134 microgrid system are purely inductive, the relationship between the frequency and the active power, 135 as well as the relationship between the voltage and the reactive power are completely decoupled.

136
However, in practical microgrid systems, the line impedance and the output impedance are not 137 purely inductive, so the coupling term should be considered in the black-box model. Therefore, there 138 are 4 parameters to be identified in the black-box model as shown in Equation (1): where P0total and Q0total refer to the total active and reactive power references in the microgrid  In theory, if the line impedance and the output impedance of the inverters included in the microgrid system are purely inductive, the relationship between the frequency and the active power, as well as the relationship between the voltage and the reactive power are completely decoupled. However, in practical microgrid systems, the line impedance and the output impedance are not purely inductive, so the coupling term should be considered in the black-box model. Therefore, there are 4 parameters to be identified in the black-box model as shown in Equation (1): where P 0total and Q 0total refer to the total active and reactive power references in the microgrid respectively, and according to the power droop coefficients of each DG, MGCC assigns the total power reference values P 0total and Q 0total to each DG according to Equation (2): where m i and n i refer to the active and reactive power droop coefficients of ith inverter, P i and Q i refer to the active and reactive power references of ith inverter, and f PCC and E PCC are frequency and voltage amplitudes of PCC. G fP (s) and G EP (s) are transfer functions of the active power reference with respect to the frequency and the voltage amplitude of PCC respectively, G fQ (s) and G EQ (s) are the transfer functions of the reactive power reference with respect to the frequency and the voltage amplitude of PCC respectively. Among them, G EP (s) and G fQ (s) are added to the model specifically in order to analyze the cross-coupling effect. According to Equation (1), the microgrid system is regarded as a two-input and two-output black-box model. Without involving the characteristics of a single DG, the black-box identification model of the whole microgrid system can be obtained as shown in Figure 4.

Identification Experiments Design
Since the step experiment process is easy to realize and has good identification performance, the 159 step response experiment is adopted to identify the transfer function of the model. In order to 160 simplify the identification process of the transfer functions mentioned above, this work divides 161 modeled transfer functions into two groups. As shown in Figure   By changing the total active and reactive power references issued by MGCC and sampling the voltage and frequency response data from the smart switch, the voltage and frequency response model of microgrid can be constructed by on-line identification method.

Identification Experiments Design
Since the step experiment process is easy to realize and has good identification performance, the step response experiment is adopted to identify the transfer function of the model. In order to simplify the identification process of the transfer functions mentioned above, this work divides modeled transfer functions into two groups. As shown in Figure 5, one group carries out the step experiment by performing a step on the active power reference value, the other group carries out the step experiment by performing a step on the reactive power reference value.

Active Power Reference Step
The active power reference step experiment is applied to identify G fP (s) and G EP (s). The Q 0total is set to 0, while the total active power reference is regarded as the input of the step experiment by performing a step on P 0total . At the same time, the f PCC1 and E PCC1 are sampled at PCC as the output of the step experiment. Since the step experiment process is easy to realize and has good identification performance, the 159 step response experiment is adopted to identify the transfer function of the model. In order to experiment by performing a step on the active power reference value, the other group carries out the 163 step experiment by performing a step on the reactive power reference value.

Reactive Power Reference
Step The reactive power reference step experiment is applied to identify G fQ (s) and G EQ (s). The P 0total is set to 0, while the total reactive power reference is regarded as the input of the step experiment by performing a step on Q 0total . Meanwhile, the f PCC2 and E PCC2 are sampled at PCC as the output of the step experiment.

Identification Strategy and Process
By sampling the input and output data of the microgrid system, the transfer function expressions of the microgrid model shown in Figure 4 can be obtained through an identification algorithm. The existing identification algorithms usually use the recursive least squares method to identify the system on-line and keep updating the parameters in real time. However, as the covariance matrix decreases in the recursive process, the parameters are prone to explode [21]. In order to enhance the stability of the recursive process, a damping term can be added to suppress the parameter explosion. Therefore, the recursive damped least squares method is used in this paper as the identification algorithm.
Moreover, in the classical control method for discrete systems, the bilinear transformation can ensure that the continuous system and the discrete system have the same stability and the same steady-state gain [22]. Therefore, the bilinear transformation is chosen to discretize the transfer functions shown in Equations (2) and (3), and the recursive damped least squares method is used for the parameter identification.
This paper takes G fP (s) as an example and analyzes the identification process in detail, other transfer functions G EP (s), G fQ (s) and G EQ (s) can adopt the same process.

Data Preprocessing
The first task is to preprocess the sampled data P 0total and E PCC1 . It mainly includes two steps: 1.
Offset removal: The black-box model of the microgrid system includes the steady-state component and the dynamic component. But the parameters to be identified only involve the system dynamics of the system model, thus it is necessary to remove the steady-state components, i.e., the steady-state values of the input and output signals (before the step is done) respectively.

2.
Measurement prefiltering: Since the sampling data contains some ripple and noise caused by the switching frequency, prefiltering input and output data should be considered before the recursive process to avoid the identification accuracy being affected.

Model Order and Initial Value Selection
Secondly, the number of coefficients of each polynomial (transfer function order) and the initial values of parameters should be determined. The first n data to be identified (in order to reduce the computation load, the selected data should not be too much) can be selected, and the least squares algorithm can be used to test a certain transfer function order iteratively. By comparing the fitness between the model output and the measured output in different orders, the order of the transfer function G fP (s) can be determined and remains constant in the process of recursion. The fitting performance can be calculated as follows: where y(k) is the measured output of microgrid,ŷ(k) is the model output, y is the average value of the measured output. The higher the f Best fit , the better the model can reproduce the output characteristics of the microgrid port. Considering that the high model order affects the computing speed significantly, so as long as the fitness meets the requirements, choosing a lower transfer function order is recommended. Then, the order of the numerator of G fP (s) is set to 1, while that of the denominator is 2, the corresponding expression of G fP (s) can be obtained as The transfer function can be discretized by the bilinear transformation, as shown in Equation (7): where

Online Recursive Algorithm
Then the corresponding difference equation of Equation (7) is: where f PCC (k) and P 0total (k) are discrete values of f PCC and P 0total at time k. Let k = 3, 4,..., m, m is the total number of samples during the time of recursive computation. Equation (9) can be rewritten in the form of a matrix: where , P total (m), P total (m − 1), P total (m − 2)]. The idea of the recursive damped least squares method is to revise the estimated value θ recursively so that the minimum sum of squared errors between F m and F m = H m θ m can be obtained: where J( θ) is the objective function. As discussed above, adding damping to the algorithm can suppress parameter explosion, so a damping term is added on the basis of equation (11): where µ is the damping factor, which is related to the linearity of the identification model. This paper adopts the adaptive damping factor method to adjust the value of µ. Firstly, the matrix H n H T n is employed to determine the initial value of µ: where the function mean is to compute the average value of the matrix. The linearity of the microgrid black-box model can be quantitatively evaluated by the ratio of the reduction and the change of the objective function J in the iterative process [22]: where J( θ m ) is the calculated value of the objective function J at time m, J( θ m ) is the second-order Taylor series expansion of the objective function J at time m: where J is the first derivative of J, J is the second derivative of J. Therefore, the damping factor can be corrected using the value calculated in Equation (14): 1.
Under the condition of λ < 0.3, it shows that the objective function J exhibits a linearity reduction trend during the recursive process, µ is needed to increase in the subsequent recursive process to ensure better frequency and voltage identification 2.
Under the condition of 0.3 < λ < 0.7, it indicates that the objective function J has a small change in linearity during the recursive process, therefore the damping factor is close to the best value and there is no need to change it.

3.
Under the condition of λ > 0.7, a smaller damping factor µ should be chosen.
In order to achieve the adaptive correction of damping factor during the identification process, Proportional coefficient η is employed, whose value is generally between 2 and 10, as shown below: when µ is needed to be increased, µ can be taken as Energies 2019, 12, 2049 9 of 16 on the contrary, when µ is needed to be decreased, µ can be taken as According to the extremum principle, the minimum value of J can be obtained by taking the differentiation to the right part of Equation (12). Through combing Equations (10)- (12), the recursive equation based on recursive damped least square method is derived as below: Ever since a set of observation data ϕ m is added, P m andθ m are revised once, therefore new estimation values of parameters are derived and on-line identification of parameters are realized. The identification procedure is shown in Figure 6. Where ε is the allowable range of precision error, N is the total number of samples at the current moment. When the recursive algorithm compute to the sampling moment or the parameters estimation does not change, the recursive process is terminated until the new sampling data arrives. After obtaining the parameters of the transfer function G fP (z), the bilinear inverse transformation can be carried out to convert the transfer function from discrete domain to continuous domain.
Ever since a set of observation data m is added, Pm and m are revised once, therefore

Experiments and Model Validation
In this paper, a series of model identification experiments are carried out on a microgrid test platform to verify the accuracy of the proposed modeling method. The controllers of the two inverters integrated into the microgrid use MCU (TMS320F28335, Texas Instruments, Inc, Dallas, TX, USA), the pulse width modulation (PWM) carrier frequency of each controller is set to 6 kHz, and the integrated three-phase resistive load is configured to 30 kW. Both inverters operate in P-f droop control mode. Active and reactive power droop coefficients are chosen as 4 × 10 −6 and 4 × 10 −4 respectively. Under the normal operation of the experimental platform, the input and output data are sampled by the Yokogawa recorder. All devices are connected to the AC Bus and communication lines, the structure of the microgrid test platform is shown in Figure 7.

Identification Experiments of G fP (s) and G EP (s)
To carry out the identification experiments of G fP (s) and G EP (s), parallel inverters and the three-phase active load are integrated into the microgrid. After the system reaches a steady state, the active and reactive power references are set to 0 by MGCC at first. Then the active power reference is changed to 80 kW at 9 s, and set to 0 again at 15.7 s. During this experiment, the reactive power reference remains at 0. Figure 8 shows the identification data P 0total , E PCC1 , and f PCC1 sampled by the waveform recorder at PCC.
According to the identification process shown in Figure 6, the sampled data P 0total and f PCC1 can be used to identify the model transfer function G fP (s). G f P (s) = 4.229 · 10 −8 s 2 − 0.001s + 5.0184 s 2 + 945.97s + 2.5172 · 10 5 By applying the same input on both the model and the microgrid system, the fitting performance can be obtained as shown in Figure 9. Since only the dynamic component is analyzed, the steady-state component contained in each measurement has to be removed. As it can be seen, the model output matches the microgrid output properly, and f Best fit reaches 95.36.

288
According to the identification process shown in Figure 6, the sampled data P0total and fPCC1 289 can be used to identify the model transfer function GfP(s).  Similarly, using the sampled data P 0total and E PCC1 , the transfer function G EP (s) can be obtained: G EP (s) = 0.06107s 2 + 64.24s + 152.9 s 3 + 1249s 2 + 3.95 · 10 5 s + 4.933 · 10 8 (21)

Identification Experiments of G fQ (s) and G EQ (s)
To carry out the identification experiments of G fQ (s) and G EQ (s), parallel inverters and the three-phase reactive load are integrated into the microgrid. After the system reaches a steady state, Energies 2019, 12, 2049 12 of 16 the active and reactive power references are set to 0 by MGCC at first. Then the reactive power reference is changed to 80 kVar at 9 s, and set to 0 again after 5.6 s. During this experiment, the active power reference remains at 0. Figure 10 shows the identification data Q 0total , E PCC2 , and f PCC2 sampled by the waveform recorder at PCC.

298
To carry out the identification experiments of GfQ(s) and GEQ(s), parallel inverters and the three-phase 299 reactive load are integrated into the microgrid. After the system reaches a steady state, the active and 300 reactive power references are set to 0 by MGCC at first. Then the reactive power reference is changed to 301 80 kVar at 9 s, and set to 0 again after 5.6 s. During this experiment, the active power reference remains at 302 0. Figure 10 shows the identification data Q0total, EPCC2, and fPCC2 sampled by the waveform recorder at PCC.

306
According to the identification process shown in Figure 6, the sampled data Q0total and EPCC2 can 307 be used to identify the model transfer function GEQ(s). performance can be obtained as shown in Figure 11. Clearly, the model output also matches the microgrid output, and fBest fit reaches 90.72.  Table 1.

Recursive Model Validation
According to the power references step experiments, the voltage frequency response model is obtained under the certain microgrid structure. Furthermore, in order to verify the adaptability of the recursive damped least squares method applied in the model identification, that is, the online identification effect during the period of microgrid structure changing, several adjustments have been made: active power droop coefficients of two inverters are changed to 4 × 10 −6 and 8 × 10 −6 respectively; reactive power droop coefficients are changed to 2 × 10 −4 and 4 × 10 −4 respectively; the PV inverter which is supplied by Chroma solar PV array simulators is added to the microgrid structure, and the maximum output power of the PV inverter is set to 4 kW. During the power references step experiment, the number of inverters connected to the microgrid are changed, the active and reactive loads are set to different parameters, as listed in Table 1. The input and output data during the experiment are recorded by the waveform recorder, as shown in Figure 12.
Meanwhile, the same experimental processes as shown in Table 1 are carried out on a corresponding simulation model under the MATLAB/Simulink environment (2014a, The MathWorks, Inc, Natick, MA, USA), which is constructed according to the black-box equivalent model shown in Figure 4. Initial values of P andθ can be figured out according to the transfer function parameters obtained in Sections 3.2 and 4.1. The frequency and voltage output of the simulation model can be obtained by using the recursive damped least squares method for online identification.
The experimental and simulation results are compared with each other, as shown in Figure 13. It can be seen that the simulation model is able to reproduce the system responses of the microgrid system during the experiment, especially when the frequency and voltage responses of the microgrid have step changes, the output of the simulation model tracks the changes accurately. Hence, the identification algorithm implemented in the simulation model is validated.

333
Meanwhile, the same experimental processes as shown in Table 1

340
The experimental and simulation results are compared with each other, as shown in Figure 13.

341
It can be seen that the simulation model is able to reproduce the system responses of the microgrid

Conclusions
In this paper, the black-box modeling technique of voltage frequency response model of microgrid system has been studied. In terms of the parameter identification algorithm of the recursive damped least squares, the model can be identified and is suitable for performing simulations of microgrid system on system level, especially when the internal information of a microgrid cannot be accessed. The procedure of constructing the black-box model of microgrid is analyzed emphatically. Compared with the traditional method of mechanism modeling, this method greatly simplifies the modeling steps and provides a general idea for microgrid system modeling.
The output data obtained from the simulation model has been compared with the measured output under the conditions of changing the microgrid structure. Depending on the recursive algorithm, the identification model can reproduce the frequency and voltage characteristics of the microgrid port accurately in all cases, which indicates that the black-box identification modeling method has a wide range of adaptability to realize on-line identification of the microgrid system.
In future, in order to improve the identification accuracy, the influence of different communication delays on the proposed identification strategy needs to be further studied. In addition to this, how to apply the proposed identification model to a secondary frequency and voltage regulation control system, so as to optimize parameters of secondary voltage and frequency controllers, are also set as the future research directions.