Practical Implementation of Adaptive SRF-PLL for Three-Phase Inverters Based on Sensitivity Function and Real-Time Grid-Impedance Measurements

: Rapidly increasing demand for renewable energy has created a need for the photovoltaic and wind farms to be placed in various locations that have diverse and possibly time-variant grid conditions. A mismatch between the grid impedance and output admittance of an inverter causes impedance-based stability issues, which appear as power quality problems and poor transient performance. Grid synchronization with phase-locked loop (PLL) introduces a negative-resistance-like behavior to inverter output admittance. High control bandwidth of the PLL makes the system sensitive to impedance-based stability issues when the inverter is connected to a weak grid that has high impedance. However, very conservative tunings lead to overly damped dynamic responses in strong grids, where the control performance and power quality can be improved by applying higher PLL control bandwidths. Continuous evaluation of grid conditions makes it possible to avoid the risk of instability and poor dynamic responses, as the inverter output admittance can be re-shaped online to continuously match the grid conditions. The present work proposes method for adaptive control of the PLL based on the real-time measurements of the grid impedance, applying pseudo-random binary sequence (PRBS) injections. The method limits the PLL bandwidth in weak grids to avoid stability issues and increases the control bandwidth in strong grids to improve voltage-tracking, and thus overall control performance. The method is veriﬁed through simulations and experimental laboratory tests in a kW-scale system. The results show that optimizing the PLL bandwidth with respect to the grid conditions is highly beneﬁcial for system performance and stability.


Introduction
The increasing penetration level of the inverter-connected renewable energy has caused stability and power-quality issues in power grids [1,2].One of the main problems is the harmonic resonance triggered by the mismatch between the grid impedance and the inverter output admittance.The harmonic resonance is an indication of insufficient stability margins; it increases the system sensitivity and may even cause instability [3,4].To avoid these issues, the control system is often designed to have very conservative stability margins, leading to overly damped dynamic responses in robust systems where faster responses are desired.
The impedance-based stability of the grid-connected inverter can be assessed from a return ratio matrix of the dq-domain grid impedance and inverter output admittance [5].The grid impedance may vary over time, due to, for example, load changes [6][7][8][9] or various grid faults and clearance of these faults [10][11][12][13].As the grid impedance varies over time, online measurements performed in real-time are desirable for accurate stability assessment [14][15][16].Recent studies have presented a number of online measurement methods based on broadband injections, such as impulse [17], multitone sinewaves [18], and pseudo-random binary sequence (PRBS) [15,16,19].Particularly the PRBS has become popular, as the signal is easy to implement, it has the lowest possible crest factor, and a largely controllable spectral-energy content [20].
Grid synchronization using phase-locked loop (PLL) introduces negative-resistance-like behavior below the PLL crossover frequency [21], which causes the inverter output admittance to lose its passivity, and thus a possibility for stability issues occurs [22,23].Recent research has introduced methods to improve the PLL performance [24] and stability in weak grids [25,26].However, the PLL crossover should be limited to minimize the frequency region of the negative-resistance-like behavior to avoid impedance-based stability issues when the grid impedance increases.
Improved stability and performance of grid synchronization can be achieved by adaptive control of the PLL, where its control bandwidth is limited when the grid-impedance increases [27][28][29][30].Existing studies of the adaptive PLLs have proposed methods that improve the impedance-based stability under various grid impedances.However, a practical implementation for adaptive PLL that systematically optimizes the control performance in varying grid conditions still lacks from the literature.This paper extends the research in [28] by introducing a practical implementation of the adaptive PLL that optimizes the trade-off between the system robustness and PLL control performance based on continuous evaluation of the impedance-based sensitivity function.In this paper, the system sensitivity function is evaluated by applying real-time grid-reactance measurements based on the PRBS methods.The measurement methods can be used to rapidly detect and react the changes in grid impedance in order to ensure impedance-based stability.In the proposed methods, the PLL bandwidth is controlled so that the maximum value of the system sensitivity function is kept constant regardless of the grid conditions.This is equivalent to constant stability margins with the highest possible PLL bandwidth, satisfying the desired system robustness.Therefore, more sophisticated and systematic adaptive control of the PLL is provided that considers the optimal control performance in addition to the system stability.This results in improved power quality and overall dq-domain control performance under varying grid conditions.
The rest of this paper is organized as follows.Section 2 briefly reviews the modeling of three-phase grid-connected inverters, PLL control design, and theory behind the impedance-based stability with the use of sensitivity functions.Section 3 presents methods for continuously measuring the grid impedance using PRBS injections and presents the flowchart of the adaptive process.Section 4 presents the design of the adaptive PLL in detail for a small-scale prototype.In Section 5, the adaptive PLL is implemented in MATLAB/Simulink, where the improvements on the control performance and system stability are demonstrated.Section 6 shows the experimental implementation of the adaptive PLL controller for laboratory hardware with 2.7 kW power level, and verifies the enhanced performance.Finally, the conclusions are drawn in Section 8.

Impedance-Based Stability Analysis and System Sensitivity
Small-signal stability at point of common coupling (PCC) of interconnected systems can be assessed by applying impedance-based stability analysis [3].The analysis is performed in synchronous reference frame (dq domain) in this paper.In the dq domain, the three-phase variables are represented as two equivalent DC signals, and the impedance can be considered as two components (dd and qq) with cross-couplings (dq and qd) between them.Due to the cross-couplings, the components cannot be analyzed separately and the generalized Nyquist stability criterion (GNC) for multi-input multi-output (MIMO) systems has to be applied [5,31].
Figure 1a shows an equivalent small-signal circuit of source-load interconnection, representing the inverter as a source and the grid as a load at their PCC.The grid impedance and inverter output admittance matrices can be defined as Figure 1b illustrates the control system equivalent for the interconnected subsystems, as the current equation resembles a negative feedback system.Therefore, the stability analysis can be simplified to observe only the eigenvalues of the return-ratio matrix L s (s) = Y o (s)Z g (s) as: The stability of the PCC is preserved if the return-ratio matrix satisfies the Nyquist criterion [5].Power quality issues may occur even in stable systems, if the stability margins are low.Insufficient stability margins can be identified by using a sensitivity function as presented in [32] for DC systems.The system sensitivity function is based on the Nyquist stability criterion and can be considered as an inverse of the Nyquist eigenloci's distance to the critical point (−1, 0).Similar analysis applies for MIMO systems but they require the use of generalized Nyquist criterion (GNC) of the return-ratio matrix [33].Thus, robustness of the MIMO systems can be analyzed by observing a system sensitivity function, which can be given as The sensitivity function appears in closed-loop transfer functions of the system seen from the PCC.Thus, the control performance and power quality can be estimated from S(s) as it also describes the transfer function from external disturbances to the output currents [34].
The maximum absolute value of S(s) is denoted as a sensitivity peak: The sensitivity peak rises to infinity when the system approaches instability.Low values for S peak are desired to avoid harmonics and stability issues.However, to achieve a low sensitivity peak in weak grids, the inverter control bandwidths must be modified.

Small-Signal Modeling of Three-Phase Inverter with PLL
Figure 2 shows the studied photovoltaic (PV) inverter, and Figure 3 shows a block diagram representing the inverter dynamics.The multivariable small-signal model of such a three-phase grid-connected inverter in the dq domain has already been introduced in [35], so the present paper only considers the PLL and its optimal control tunings in more detail.The synchronous-reference-frame PLL (SRF-PLL) synchronizes the dq-control frame to the grid waveforms (grid reference frame) by regulating the sensed output voltage q component to zero.Because only the voltage q component is regulated, the PLL loop gain can be given as a scalar transfer function: where G c-PLL is the internal PI-type controller of the PLL.
! " Three-phase inverter connected to ideal grid.The PLL plant consists of an integrator with a constant gain (V od ), which makes it possible to provide simple control-tuning procedure, where the PLL loop gain's phase margin (Θ PM ) and crossover frequency ( f co ) can be fixed.The procedure considers the loop characteristics at f co , where the loop magnification is 0 dB and s = j2π f co .This yields the following equation group, where the desired phase margin Θ PM determines the ratio between the imaginary and real parts of the PLL loop gain, whereas the final control gains set the loop magnification (0 dB) at f co .By solving the equation group, the controller gains can given as The complete PLL transfer matrix is solved as which affects the admittance qq and dq components through D, I L , and sensing gain H PLL .
The derivation and related transfer functions of the impedance model are given in the Appendix A.

PLL Design Based on System Sensitivity Function
The PLL dominates the qq component of the inverter output-admittance below the control bandwidth of L PLL .Below the PLL bandwidth, phase response of the output admittance stays at 180 degrees with constant magnitude.The effect is usually referred as the negative resistance, which dominates the inverter output admittance at low frequencies [21].When the interfaced grid is inductive, the impedance is mainly reactance and the phase is close to 90 degrees.This results in maximal phase difference to the inverter output impedance.The PLL dominates the qq component of the inverter output-admittance below the control bandwidth of L PLL .Below the PLL bandwidth, phase response of the output admittance stays at 180 degrees with constant magnitude.The effect is usually referred as the negative resistance, which dominates the inverter output admittance at low frequencies [21].When the interfaced grid is inductive, the impedance is mainly reactance and the phase is close to 90 degrees.This results in maximal phase difference to the inverter output impedance.
Figure 4 illustrates the impact of the inductive grid reactance (a), grid resistance (b), and the PLL bandwidth (c) to the system sensitivity function (3) below 300 Hz.The grid reactance and resistance are increased in the same proportion with the X/R ratio of 5, which is typical for example for the impedance of grid-interfacing transformers.When the inverter control system is kept constant, higher grid reactance clearly increases the sensitivity peak (maximum of the function), but the resistance has a negligibly small effect that actually slightly decrease the sensitivity peak.Additionally, the higher PLL bandwidth in constant grid conditions increases the sensitivity peak.The increased PLL bandwidth improves directly the voltage-tracking performance, and thus, the entire dq-domain control performance.However, high PLL bandwidth and increased grid reactance decrease the system robustness which can be seen from the increased sensitivity functions.The trade-off between the robustness and control performance should be optimized by limiting the system sensitivity peak, but at the same time, overly conservative PLL tunings should be avoided.From this, it is evident that the PLL bandwidth has to be decreased when grid reactance increases.On the other hand, higher bandwidths are allowed when grid reactance is decreased.

Maximum-Length Binary Sequence
Recent studies have presented methods based on Fourier techniques and broadband perturbations for measuring the grid impedance in real-time [15].In the methods, the impedance was measured by the inverter itself: the inverter injects a perturbation current on top of the reference d or q current, measures the resulting responses in the grid voltage, and applies Fourier analysis to extract the corresponding frequency components in both the voltage and current.The grid impedance is then determined by the ratio between the perturbation voltage and current.The signal sampling process can be implemented without any additional data-acquisition units as the output voltages and current are sensed anyway.
A maximum-length binary sequence (MLBS) is the most common form of the PRBS signals, and has been applied as a perturbation in many previous studies.The MLBS is a widely used periodic sequence that is easy to generate with a shift register and XOR feedback [36].The MLBS is a wide-band sequence that exists for N = 2 n − 1, where n is the applied number of stages in the shift register.The frequency resolution of the sequence is f res = f gen /N, where f gen is the generation frequency [19].The required time for the measurement is given as T cycle = PN/ f gen , where P denotes the number of averaged periods.The binary sequences also have the lowest possible peak factor, so a relatively low injection amplitude can be used when applying such sequences [20].

Grid-Reactance Estimation
The inverter control system is configured to continuously inject the small-amplitude MLBS on top of the current reference d component, and responses from grid-side voltage and current are gathered.The responses are transformed to the frequency domain and the grid impedance is calculated in real-time as a ratio of grid current to voltage, as Z g (ω) = r + jX(ω) = U g (ω)./I g (ω) where r is the resistance and X(ω) the reactance.The d component is measured because the measurements of the q component are deteriorated inside the PLL bandwidth [37].
The adverse interactions between the negative-resistance-like behavior of inverter impedance (induced by PLL) and grid impedance can be evaluated by examining the grid reactance.The reactance represents the imaginary part of the grid impedance, which is frequency-dependent.Thus, to compare stiffness of different grids, the grid reactance is given at the fundamental frequency X g = X(60 Hz).The grid impedance typically resembles inductive characteristics below 400 Hz [6].Thus, the grid reactance is assumed mainly inductive, which is proportional to frequency and the grid inductance.Thus, X g can be estimated from the broadband grid-impedance measurement, performed for example by the MLBS-based methods.The fundamental-frequency grid reactance can be computed from the measured grid impedance by where the Im[Z g (ω)] is the imaginary part (reactance) of the measured grid impedance, ω is the angular frequency, and ω g is the fundamental frequency (2π60 Hz).A 31 bit long MLBS, generated at 1 kHz, provides a frequency resolution of 32.3 Hz.From the measured grid impedance, X g is estimated from five different frequencies, so they all can be considered as different estimates and are not polluted by the same disturbance such as the oscillation after the transient.The frequencies, applied in the grid-reactance estimation should be chosen so that they are not affected by the system's most dominating periodic distortions, which in the dq domain are the grid-voltage unbalance and harmonics [38].In the dq domain, the unbalanced grid voltages appear as oscillations at 120 Hz, the third (in-phase) harmonic occur only in zero component, not affecting the measured d component, and the fifth harmonic appears at 360 Hz.Thus, the five frequencies for the grid-reactance estimation are chosen as 193.5 Hz, 225.8 Hz, 258.1 Hz, 290.3 Hz, and 322.6 Hz.These frequencies are below 400 Hz, and are not significantly polluted by neither 120 Hz nor 360 Hz oscillations.The final X g value is given as a median of these five estimates.By taking the median from the five estimates, the measurement errors are significantly reduced and the measurement time is not increased as is the case when using a conventional averaging over many measurement cycles.

Adaptive PLL
The design of the adaptive PLL in the work is based on the system sensitivity function.The sensitivity function can be applied as an indicator for the robustness, and in this case also for the control performance.By adaptively adjusting the PLL bandwidth based on changes in the grid impedance, the sensitivity peak can be kept at a constant value which should be chosen as a good trade-off between the control performance and robustness.
The applied design method is based on continuous functions from the measured grid reactance to the internal PI-controller parameters of the PLL. Figure 5 shows a flowchart of the design process and application of the adaptive PLL.The design process begins by modeling the inverter output admittance over a wide range of PLL bandwidths and the grid impedance over wide range of the inductive reactance values.The sensitivity peak is computed for each pair of the PLL bandwidth and grid-reactance value.Next, the value for maximum-peak criterion (MPC) is chosen.The MPC determines the desired sensitivity peak and operates as a design rule for the adaptive PLL.Based on the chosen MPC, the optimal PLL bandwidth for each grid-reactance value is selected from the computed sensitivity peaks so that the MPC is satisfied.In the last step of the design process, a continuous function is fitted to the discrete pairs of the PLL bandwidth and grid-reactance values.In the application, the PLL parameters can be adaptively tuned based on the real-time grid-reactance measurement.

PLL bandwidths
Set bandwidth so that the MPC is satisfied for every grid-reactance value

Implementation of Adaptive PLL Design
In this section, the adaptive PLL is implemented for a small-scale (2.7 kVA) prototype of a grid-connected inverter.The control-design procedure (7) is applied to provide a continuous function from the PLL bandwidth (considered here as f co ) to the controller gains, so that the phase margin of the PLL loop gain remains at 65 degrees for every bandwidth.The inverter is connected to the 120 V grid.Therefore, substituting Θ PM = 65 • and V od = √ 2 × 120V into (7), the controller gain can be computed as where the proportional gain (K p-PLL ) is linearly depended on the desired crossover frequency, whereas the integral gain (K i-PLL ) has squared dependency.Next, the function from the grid reactance to the PLL bandwidth is determined based on the system sensitivity function.The inverter output admittance is modeled with the PLL tunings from work in (10) with crossover resolution of 1 Hz, and it is denoted as Y o-c ( f co ).Other model parameters are given in Tables 1 and 2. The grid impedance Z g (X g ) is modeled for the small-scale prototype (120 V, 2.7 kVA), where the grid reactance is varied from 0.038 to 4.0 Ω with a resolution of 0.038 Ω and the grid resistance (r g = 0.1 Ω) is kept constant due to its negligibly small impact to the sensitivity.The grid-impedance model is given in the Appendix A. The grid-reactance is varied in the model by ranging the grid inductance (L g ) from 0.1 to 10.6 mH, with a resolution of 0.1 mH.The equivalent short-circuit ratio (SCR) range is from 150 to 4, which approximately corresponds to a reactance range of 0.29 to 10.8 mΩ for a large-scale 1 MW inverter (in low voltage level).For every grid-reactance value, the f co that satisfies the chosen MPC is computed from (4). Figure 6 shows the PLL bandwidths that satisfy most accurately the MPC limits of two (red line) and three (blue line), with varying grid reactances from 0.038 to 4.0 Ω.
Here, the MPC = 3 is applied as the design rule, representing blue line in Figure 6 to which the continuous function is fitted.The least-square regression is applied in the curve fitting process.A third-order function is fitted into modeled grids (with 106 different reactance values) and corresponding PLL bandwidths that satisfy the MPC = 3 most accurately.Figure 7 shows the fitted third-order function (black dashed line).
which accurately follows the individually adjusted pairs of the X g and the optimal PLL crossover frequency.For the final implementation, the PLL bandwidth is limited to reasonable range, which can be chosen arbitrarily.Black line includes the used upper (180 Hz) and lower (1 Hz) limits for the PLL bandwidth.With the chosen bandwidth limitations, pure adaptive characteristics occur in grid reactance ranging from 0.68 Ω to 3.4 Ω.In that range, the system sensitivity peak can be kept constant (S peak = 3).The system becomes more robust (S peak < 3) when grid reactance lies below 0.68 Ω.With grid reactances higher than 3.4 Ω, the sensitivity peak starts to increase but small-signal instability will be avoided also in extremely weak (SCR < 2, translates here to X g > 8 Ω) grids [26].
The final controller gains are generated by substituting ( 11) into (10) as K p-PLL = 0.0336(−13.43X Real-time measurement of the grid reactance is required for the adaptive control.In the implementation, the applied MLBS amplitude is 0.1 A (< 1 % of the nominal current), the reactance value is refreshed every 31 ms.The grid-reactance measurement is filtered through a first-order low-pass filter with a time constant of 1 s, to reduce the undesired fluctuations of the PLL bandwidth at the steady state.However, a rapid change in grid impedance may destabilize the system relatively fast.To tackle this challenge, an auxiliary trigger is implemented to the adaptive controller.If the measured grid reactance (prior filtering) is 0.6 Ω greater than the filter output, the control interprets this as an rapid grid-impedance change, and injects an impulse-like signal to the measured grid reactance.This decreases the PLL bandwidth within tens of ms, so that the stability is preserved even in drastic grid impedance changes, such as grid faults.In this work, the impulse-like signal is generated by multiplying the latest reactance-estimation value by a factor of ten, so long that an overshoot into the filter output is produced, which, in a sense, bypasses the slow time-domain filtering.

Simulations
The presented approach for adaptive control of the PLL is validated by implementing the method in MATLAB/Simulink.Figure 8 shows a three-phase inverter with the adaptive PLL structure and real-time grid-reactance measurement system, which are implemented to a 2.7 kW three-phase inverter that is connected into the 120 V/60 Hz grid.The model parameters are given in Table 1, which replicates the experimental small-scale set-up.The inverter control parameters are given in Table 2.The performance of the adaptive PLL is illustrated in changing grid conditions, where rapid changes are made to the grid impedance or grid voltage phase angle.

Adaptive PLL in Varying Grid Conditions
The adaptive adjustment of the PLL control parameters is based on the real-time measurements of the grid reactance.Figure 9 illustrates the basic operation of the adaptive control in significantly varying grid conditions.The inverter is placed in a remote location, where two equal transmission lines (inductive, X TL = 3.0 Ω) are used for a connection to the main grid.Thus, the transmission lines mainly characterize the grid impedance.As two equal lines are occur, the grid-impedance is half (X g = 1.5 Ω) of the individual line impedance.At 0 s, the inverter is connected this grid, and the grid reactance is measured during the inverter start-up.From the grid-reactance measurement, the PLL bandwidth is computed as in 11 and the controller gains as in 12.The PLL bandwidth is adaptively set to 72 Hz after the start-up process.Suddenly at 10 s, the second transmission line is disconnected due to, for example, grid fault or maintenance.The rapid increase in the grid impedance triggers the impulse to the filter and overshoot in the measurement appears.Due to the filter overshoot, the PLL bandwidth is decreased close to 1 Hz, and the possible stability issues are avoided.Once the adaptive system is recovered from the drastic change in grid impedance, approximately 1 s after the transient, the PLL bandwidth is set 15 Hz.At 20 s, the second transmission line is reconnected, and the PLL bandwidth is increased back to 72 Hz.

Performance in Weak Grid
In this simulation, a comparison between the conventional PLL and the adaptive implementation in weakening grid conditions is performed.Figure 10 shows phase currents, current q components, and bandwidths of the compared PLLs.The SCR decreases from 11.5 to 5.1 at 0.02 s, which translates to grid-reactance values of 1.4 and 3.2 Ω, respectively.The conventional PLL is optimized to 1.4 Ω grid (constant 80 Hz bandwidth is applied) in which the inverter is connected in the beginning of the test run.When the constant 80 Hz PLL is applied during the grid-impedance transient, oscillations around 130 Hz appear in currents.This is an indication of insufficient stability margins.Figure 11 shows the analytical sensitivity function for the inverter (80 Hz PLL) connected to the weak (X g = 3.2 Ω) grid and the Fourier-transformed I oq during the oscillations.The analytical sensitivity peak rises close to 100 at 130 Hz, thus accurately predicting poor stability margins and oscillations around the peak frequency.These impedance-based stability issues between high PLL bandwidth and weak grids can be avoided by the adaptive control of the PLL.The rapid increase in the grid impedance is noticed approximately 8 ms after the transient, and the PLL bandwidth is decreased from 80 Hz to 10 Hz.This readjustment mitigates the oscillations in the currents and significantly improves system stability margins.

Experimental Set-Up
A power hardware-in-the-loop (PHIL) set-up for the three-phase grid-connected PV inverter is used to test the adaptive control system in downscaled conditions with relatively high amount of background harmonics and distortions.The PHIL setup includes a three-phase grid emulator, a PV emulator, a three-phase inverter, and an isolation transformer.A real-time simulator (dSPACE) runs the control system of the inverter, which enables testing of the proposed control schemes to the real hardware.The inverter operating point and control system are equivalent to the simulations, given in Tables 1 and 2. The grid-side impedance is changed by switching on or off the bypass relays of the additional inductor located between the inverter and the grid emulator.

Adaptive Control during Grid Transients
Figure 12 illustrates the operation of the adaptive control.The upper part shows the grid-reactance measurement and the lower part shows the adaptively adjusted PLL bandwidth.The system is connected to a relatively strong grid, as grid-reactance measurement is settled around 1.7 Ω (SCR ≈ 9.4) and the PLL bandwidth is adaptively adjusted approximately to 57 Hz.At 2 s, a sudden increase in grid impedance occurs that triggers the impulse to the measurement filter.The grid-reactance measurement settles around the 2.3 Ω (SCR ≈ 6.9) after an overshoot that decreases the PLL bandwidth rapidly.Next, the PLL bandwidth is adaptively set to 29 Hz.The grid reactance decreases back to 1.7 Ω at 6.5 s, and the original steady-state bandwidth (57 Hz) is obtained after two seconds.

Performance Comparison in Weak Grids
Figure 13 shows the performance comparison between the constant and adaptive PLLs.First, the grid is stronger, with approximately 2.0 Ω grid reactance (SCR ≈ 8.0) where the PLL bandwidth is adaptively adjusted approximately to 40 Hz.The conventional PLLs with constant bandwidths (40 and 50 Hz) are applied as a comparison to the adaptive implementation.In the experiments, the grid reactance is suddenly increased to approximately 3.4 Ω (SCR ≈ 4.7) at 0.1 s, where the adaptive control proposes 1 Hz PLL bandwidth.The rapid increase in the grid impedance is noticed 50 ms after the transient, and the adaptive implementation (blue lines) decreases the bandwidth from 40 Hz to 1 Hz.With this adaptive readjustment, the oscillations in I oq and V q (blue lines) are effectively mitigated.With a constant 40 Hz PLL (red lines), the voltages and currents remain oscillating after the transient, which indicates insufficient stability margins.The inverter with a constant 50 Hz PLL (gray lines) becomes unstable (or marginally stable) after the transient, extremely high oscillations appear in the waveforms, and the system cannot recover from the grid-impedance transient.

PLL Performance during Phase Jump
Voltage-tracking performance of the PLL decreases when low bandwidths are applied.However, too high PLL bandwidth produces oscillating responses or even unstable operations especially in the weak grids.Here, this clear trade-off is optimized by using the sensitivity-function-based analysis.Figure 14 shows the transient response in V q during a 30 degree phase jump in grid voltages.Different PLL bandwidths are compared in a grid with approximately 2.1 Ω grid reactance (SCR ≈ 7.6).The adaptive control proposes approximately 38 Hz PLL bandwidth, to provide the sensitivity-peak value of 3 under the present grid impedance.The adaptive PLL is compared to higher (50 and 70 Hz) and lower (1, 10, and 20 Hz) bandwidths.As shown in the figure, oscillations are magnified when higher PLL bandwidths are applied.This indicates increased value for the sensitivity functions, and thus, insufficient stability margins.The oscillations are mitigated by using a lower PLL bandwidth.However, a lower bandwidth decreases the voltage-tracking performance as the settling time of V q is increased.Here, the non-zero V q means a momentary loss of the optimal grid synchronization that affects the whole dq-domain control performance of the inverter.Therefore, a good trade-off between high and low bandwidths can be achieved by considering the desired value of the system sensitivity peak.

Discussion
The grid impedance changes are chosen to demonstrate the performance of the proposed adaptive optimization of the PLL bandwidth.Consequently, this work does not consider any specific fault types, but instead, demonstrates the behavior of the proposed adaptive PLL in more general level.The presented work is a proof-of-concept for the adaptively tuned PLL based on real-time grid impedance measurements, and more specific case studies with certain grid-fault types remain a future topic.
In this work, the grid estimation algorithm for the adaptive control assumes the connection to be mainly resisitive-inductive, which typically is the case for remote PV inverters, where the grid impedance consists of mainly transmission lines and transformers.However, the applied reactance estimation also takes into account the capacitive characteristics of the grid, but a thorough analysis of the operation in LC-resonant grids is not included in the scope of this paper.For example, poorly damped low-frequency LC resonances may deteriorate the estimation and adaptation process.However, in normal systems these resonances rarely take place below 400 Hz, where the grid estimation takes place.

Conclusions
This paper has presented a method to adaptively adjust the PLL parameters of grid connected inverters based on real-time measurements of the grid impedance.To optimize the PLL controller parameters to match current grid conditions, a continuous function from the measured grid impedance to the optimal PLL bandwidth is created.In the method, the PLL control system is continuously readjusted by considering the optimal sensitivity peak of the system.A maximum-length binary sequence (MLBS) perturbation is applied to obtain the grid-impedance estimates in real time.Based on the measurements, the PLL parameters were readjusted to the current operating conditions, thus avoiding instability, excessive system sensitivity to external disturbances, and overly conservative control tunings.Simulation results and experiments based on power hardware-in-the-loop tests of a three-phase photovoltaic inverter show significant improvements in the PLL and overall control performance under varying grid conditions.Adaptive control of the PLL also increases fault ride-through capability as the inverter disconnection can be avoided during drastic grid transients and faults.Adjusting the PLL parameters to match the grid conditions ensures both good control performance in strong grids, and robust operation in weak grids.

State-space matrices:
The decoupling matrix: The decoupled current-control loop gain and the loop: The closed-loop output dynamics: The input dynamics: The resistive-inductive grid impedance in dq domain:

Figure 3 .
Figure 3. Inverter dynamics including (a) phase-locked loop (PLL) and current-control loops, and (b) closed-loop transfer functions and DC-voltage control loop.

Figure 5 .
Figure 5. Flowchart of adaptive PLL design process and application.

Figure 9 .
Figure 9. Real-time measurement (blue) of grid reactance, its known value (black dashed), and adaptively adjusted PLL parameters.

Figure 10 .
Figure 10.Performance comparison of adaptive and 80 Hz PLL in weakening grid conditions.

Figure 11 .
Figure 11.Predicted sensitivity function and produced distortions during grid transient.

Figure 12 .
Figure 12.Adaptive control during changes in grid impedance.

Figure 13 .
Figure 13.Performance comparison of adaptive PLL and conventional high-bandwidth PLLs in weak grid.

Figure 14 .
Figure 14.Performance comparison of different PLLs during phase jump in grid voltages.
upper letters denote the steady-state values.Applying Y(s) = C(sI − A) −1 B U(s), the 2 × 2 transfer matrices from input to output are collected together as -oThe DC-voltage control loop gain:L DC = G cc refi G c-in H inThe transfer matrices related to the PLL effect:D = 0 −D q 0 D d , I L = 0 I Lq 0 −I Ld , H PLL = 0 0 0 1The inverter output admittance:Y o-c = Y cc o + G cc refo G c-in H in (I + L DC ) −1 T cc oiwhere the PLL transfer matrix (8) is included to Y cc o and T cc oi .The expanded form of the inverter output admittance:Y o-c = (I + L CC ) −1 Y o-o + (L CC I L − G co-o D)

Table 1 .
Parameters of small-scale prototype.