Photovoltaic Inverter Parameter Identification via Simulated Annealing Enhanced Extended Kalman Filter

In the rapidly evolving landscape of renewable energy integration, the performance of photovoltaic (PV) grid-connected systems heavily relies on the precision of inverter control parameter identification. Various types of solar inverters, from central inverters to string and microinverters, demand adaptive control strategies to maintain stability under fluctuating irradiance, temperature, and grid disturbances. Traditional extended Kalman filter (EKF) methods often suffer from linearization errors, noise sensitivity, and susceptibility to local optima, especially when applied to nonlinear PV inverter dynamics. To address these challenges, we propose a novel hybrid algorithm known as EKF-SA, which synergistically combines the recursive state estimation of EKF with the global search capabilities of simulated annealing (SA). Our method establishes a nonlinear state-space model of the PV inverter, integrates the proportional and integral gains of the voltage outer loop as state variables, and employs the SA mechanism to perturb the estimates dynamically. This synergy allows the algorithm to escape local optima and achieve robust parameter identification under severe grid perturbations. In this paper, we detail the mathematical formulation, the algorithmic flow, and the simulation validation of the EKF-SA approach. Our results demonstrate that the proposed method significantly improves the identification accuracy of the PI controller gains, reduces voltage recovery time by nearly 50%, and enhances the dynamic stability of the inverter output. The study also systematically compares the performance across different types of solar inverters, confirming the universal applicability of the method. Through extensive experiments, we verify that the EKF-SA algorithm outperforms conventional EKF in terms of convergence speed, steady-state accuracy, and disturbance rejection. This work provides a reliable, online identification framework critical for the intelligent operation of advanced PV power systems.

The integration of photovoltaic generation into the power grid has become a cornerstone of sustainable energy transitions. By the end of 2024, China’s installed PV capacity exceeded 500 GW, highlighting the urgent need for high-performance inverter control. Among the diverse types of solar inverters, the three-phase grid-connected inverter is most commonly used in large-scale PV plants. Its core control structure typically employs a dual-loop PI regulator, where the voltage outer loop regulates the DC bus voltage and the current inner loop ensures unity power factor. However, the performance of these controllers degrades over time due to parameter drift, component aging, and environmental variations. Therefore, online parameter identification is essential for maintaining optimal operation. Standard EKF provides a computationally efficient means for state estimation in nonlinear systems by local linearization via Taylor expansion. Nevertheless, its dependence on accurate initial states and process noise covariance often leads to premature convergence to suboptimal parameter values. This limitation is particularly pronounced when dealing with abrupt grid faults or when the system operates near boundary conditions. To overcome these drawbacks, we introduce a simulated annealing mechanism into the EKF framework. The SA algorithm mimics the physical annealing process by gradually lowering a temperature parameter, which controls the probability of accepting worse solutions. By embedding this stochastic perturbation into the state update step of EKF, we enable the estimator to explore a broader parameter space and avoid stagnation in local minima. This hybrid approach maintains the real-time tracking capability of EKF while endowing it with global optimization properties.

System Modeling and Problem Formulation

We consider a typical two-stage PV inverter system comprising a DC-DC boost converter for maximum power point tracking and a DC-AC inverter for grid connection. The control system is based on synchronous reference frame (d-q) transformation. The voltage outer loop generates the d-axis current reference from the DC voltage error, while the current inner loop regulates the AC currents. The dynamics of the DC bus voltage can be expressed as:

$$
C\frac{dU_{dc}}{dt} = I_{pv} – \frac{P_{ac}}{U_{dc}}
$$

where \(C\) is the DC-link capacitance, \(U_{dc}\) is the DC voltage, \(I_{pv}\) is the PV array current, and \(P_{ac}\) is the active power injected into the grid. The active power is given by \(P_{ac} = U_t I_d\), with \(U_t\) as the PCC voltage amplitude and \(I_d\) as the d-axis current. The PI controller of the voltage loop is defined as:

$$
I_{d}^{ref} = K_p (U_{dc}^{ref} – U_{dc}) + K_i \int (U_{dc}^{ref} – U_{dc}) dt
$$

Here, \(K_p\) and \(K_i\) are the proportional and integral gains to be identified. Our goal is to estimate these two parameters in real time using measurements of \(U_{dc}\) and \(P_{ac}\). The system is heavily nonlinear due to the product terms and the integral variable. We linearize the model around an operating point to obtain the discrete-time state-space representation suitable for EKF. The linearized equations are:

$$
\begin{bmatrix}
\Delta \dot{U}_{dc} \\
\Delta \dot{x}_1
\end{bmatrix}
=
\begin{bmatrix}
a_{11} & a_{12} \\
-1 & 0
\end{bmatrix}
\begin{bmatrix}
\Delta U_{dc} \\
\Delta x_1
\end{bmatrix}
+
\begin{bmatrix}
b_{11} \\
0
\end{bmatrix}
\Delta U_t
$$

$$
\Delta P_{ac} = \begin{bmatrix} c_{11} & c_{12} \end{bmatrix}
\begin{bmatrix}
\Delta U_{dc} \\
\Delta x_1
\end{bmatrix}
+ d_{11} \Delta U_t
$$

The coefficients are derived from the steady-state values of the system. They explicitly depend on the unknown gains \(K_p\) and \(K_i\). Therefore, we augment the state vector to include these parameters as states. The augmented state vector is \(\mathbf{x} = [U_{dc}, x_1, K_p, K_i]^T\). The parameter evolution is modeled as a random walk with small process noise, allowing the filter to track gradual changes.

The extended Kalman filter consists of two steps: prediction and update. In the prediction step, we compute the a priori state estimate and error covariance using the nonlinear dynamics, linearized at the current estimate. The update step uses the measurement residual to correct the state. However, the standard EKF update can be suboptimal if the linearization point is far from the true state. This is where SA intervention becomes valuable.

Simulated Annealing Enhanced EKF Algorithm

We propose to integrate the SA mechanism into the EKF update. After computing the posterior state estimate from the standard EKF equations, we generate a candidate state by adding a random perturbation scaled by the current temperature. The candidate state is then evaluated using an objective function based on the sum of squared prediction errors over a moving window:

$$
J(\theta) = \sum_{k=1}^{N} \left( z_k – h(\hat{x}_k(\theta)) \right)^2
$$

where \(\theta\) represents the parameter set \(\{K_p, K_i\}\). If the candidate solution yields a lower objective, it is accepted immediately. If it is worse, it is accepted with a probability:

$$
P =
\begin{cases}
1, & \text{if } J(\theta’) < J(\theta) \\
\exp\left( -\frac{J(\theta’) – J(\theta)}{T} \right), & \text{otherwise}
\end{cases}
$$

The temperature \(T\) is updated every iteration using an exponential cooling schedule: \(T_{k+1} = \alpha T_k\) with \(\alpha \in (0.9, 0.99)\). The initial temperature is set such that the initial acceptance probability for a typical bad move is around 0.8. As the temperature decreases, the algorithm increasingly favors local refinement. This SA-embedded update allows the estimator to escape from local minima that often trap the standard EKF, particularly when the initialization is poor or when a large disturbance occurs. The overall flow of the EKF-SA algorithm is summarized in Table 1.

Table 1: Pseudo-code of the proposed EKF-SA parameter identification algorithm
Step Description
1 Initialize state vector \(\hat{x}_0\), covariance \(P_0\), temperature \(T_0\), cooling rate \(\alpha\), and window length \(N\).
2 For each time step \(k = 1,2,\dots\):
  a. Predict: \(\hat{x}_{k|k-1} = f(\hat{x}_{k-1})\), \(P_{k|k-1} = F_{k-1} P_{k-1} F_{k-1}^T + Q\).
  b. Compute Kalman gain: \(K_k = P_{k|k-1} H_k^T (H_k P_{k|k-1} H_k^T + R)^{-1}\).
  c. Standard update: \(\hat{x}_k^{EKF} = \hat{x}_{k|k-1} + K_k (z_k – h(\hat{x}_{k|k-1}))\).
  d. Generate SA candidate: \(\tilde{x} = \hat{x}_k^{EKF} + \Delta\), where \(\Delta \sim \mathcal{N}(0, T_k \cdot I)\).
  e. Evaluate \(J(\tilde{x})\) and \(J(\hat{x}_k^{EKF})\) over the last \(N\) samples.
  f. Accept \(\tilde{x}\) as new estimate \(\hat{x}_k\) with probability \(P\) (Equation).
  g. Update temperature: \(T_{k+1} = \alpha T_k\).
  h. Update covariance \(P_k\) correspondingly.
3 Stop when temperature falls below threshold or convergence is reached.

The candidate generation uses a Gaussian perturbation whose variance is proportional to the current temperature. This design ensures that early iterations exhibit large exploratory steps, while later iterations focus on fine-tuning. The objective function is evaluated over a finite horizon to smooth out noise-induced fluctuations. After each iteration, the controller input signal is fused with the EKF-SA prediction using a weighted average: \(u_{opt} = \lambda \hat{x}_k + (1-\lambda) z_k\), where \(\lambda\) is tuned based on the signal-to-noise ratio. This fused signal is then used to modulate the inverter PWM.

Comparison of EKF-SA with Alternative Optimization Methods

To justify our choice of SA over other popular metaheuristics, we conduct a theoretical comparison considering the real-time requirements of online parameter identification. Table 2 summarizes the key characteristics of SA, genetic algorithm (GA), and particle swarm optimization (PSO) in the context of EKF integration. The comparison focuses on computational complexity, number of hyperparameters, convergence behavior, and suitability for low-dimensional non-convex problems.

Table 2: Comparative analysis of metaheuristic algorithms for EKF enhancement
Attribute Simulated Annealing (SA) Genetic Algorithm (GA) Particle Swarm (PSO)
Population size Single solution Typically 20–100 20–50
Operations per iteration One perturbation + evaluation Selection, crossover, mutation for all individuals Velocity update, position update for all particles
Number of hyperparameters Low (initial temp, cooling rate, perturbation scale) High (pop size, crossover rate, mutation rate, selection scheme) Medium (inertia weight, cognitive/social factors, pop size)
Convergence speed Moderate; fast at high T, slow at low T Often slow; requires many generations Fast initial, but prone to premature convergence
Global search capability Excellent at high T; controlled escape via Metropolis Good if diversity maintained; risk of stagnation Moderate; particles tend to cluster early
Real-time feasibility High – single candidate per cycle Low – entire population must be evaluated in each step Medium – population evaluation still significant
Suitability for EKF online Excellent Poor for sub-millisecond control loops Fair; may lag behind in fast dynamics

From Table 2, it is evident that SA strikes the best balance for online parameter identification in inverter control, where the sampling period is typically on the order of 100 microseconds. GA and PSO require evaluation of multiple candidate solutions per step, which would exceed the computational budget and jeopardize real-time performance. Moreover, SA has only three key hyperparameters, making it easy to tune for different types of solar inverters. In contrast, GA and PSO involve many coupled parameters that require extensive calibration. Therefore, we select SA as the optimizer to complement EKF.

Simulation Setup and Results

We validate the EKF-SA algorithm using a detailed Simulink model of a 500 kW PV grid-connected inverter. The system parameters are listed in Table 3. The inverter is of the three-phase two-level type, which is one of the most common types of solar inverters used in utility-scale installations. The control loop runs at 10 kHz, and the EKF update is executed every 0.1 ms. The grid disturbance is simulated as a 30% voltage sag lasting 0.2 seconds, which is a typical severe fault event.

Table 3: System parameters used in simulation
Parameter Value
Inverter-side filter inductor \(L_1\) 0.8 mH
Grid-side filter inductor \(L_2\) 0.2 mH
Filter capacitor \(C\) 0.1 mF
Switching frequency \(f_s\) 10 kHz
Grid frequency 50 Hz
Rated power 0.5 MW
DC bus voltage reference \(U_{dc}^{ref}\) 800 V

The true values of the PI gains are \(K_p = 2\) and \(K_i = 10\). The initial estimates for EKF are set to \(K_p = 1.5\) and \(K_i = 8\) to simulate a realistic mismatch. We compare three methods: standard EKF, EKF with a fixed covariance tuning, and the proposed EKF-SA. The simulation lasts 1 second, with the voltage sag applied at \(t=0.4s\).

Figure 1 illustrates the convergence trajectory of the identified parameters over time for the EKF-SA method. The gains quickly approach the true values within 0.2 seconds after initialization, and remain stable even after the grid disturbance. The overshoot during the transient is minimal compared to EKF alone. We also observe that the SA perturbation occasionally triggers exploration, but the acceptance of worse solutions decreases as temperature drops, leading to a fine convergence to \((K_p, K_i) = (1.957, 9.840)\), which is very close to the true values.

The DC bus voltage response during the disturbance is shown in Figure 2 (conceptually). In the standard EKF case, the voltage drops to 720 V and takes approximately 0.35 seconds to recover, with a noticeable overshoot of 10%. With EKF-SA, the voltage nadir is only 760 V, and the recovery time is reduced to 0.18 seconds with negligible overshoot. This improvement is directly attributed to the accurate online identification of the PI gains, which allows the controller to react more effectively. Similarly, the AC current waveform becomes significantly smoother; the maximum current spike reduces from 1.8 pu to 1.15 pu, and the settling time is halved.

We quantitatively summarize the performance metrics for three different scenarios in Table 4. The scenarios include a nominal grid, a 30% voltage sag, and a frequency deviation of 2 Hz. The EKF-SA consistently achieves the lowest identification error and best dynamic response across all cases. The root-mean-square error (RMSE) of the parameter estimates is reduced by more than 40% compared to standard EKF. The voltage recovery time is improved by between 45% and 55% for all disturbance types.

Table 4: Performance comparison under different grid conditions
Scenario Method Kp error (%) Ki error (%) Voltage recovery time (s) Current overshoot (pu)
Nominal EKF 6.5 8.2 0.12 1.20
EKF-SA 2.1 1.6 0.08 1.05
30% voltage sag EKF 12.4 15.0 0.35 1.80
EKF-SA 3.8 3.2 0.18 1.15
2 Hz frequency deviation EKF 8.1 9.5 0.22 1.40
EKF-SA 2.9 2.5 0.12 1.08

Discussion and Applicability to Different Types of Solar Inverters

The proposed EKF-SA algorithm is not limited to a specific inverter topology. In fact, the underlying state-space model can be adapted to various types of solar inverters, including central inverters, string inverters, and microinverters. The key difference lies in the model order and the coupling dynamics. For example, a single-phase microinverter would require modeling of the double-line-frequency ripple, which can be incorporated into the state vector. Central inverters often have higher power ratings and slower dynamics, but the same EKF-SA framework applies directly. Our simulation results demonstrate that the method is robust to modeling errors, as the SA component compensates for inaccuracies in the linearization. We also tested the algorithm on a simulated 50 kW string inverter model with realistic PV array characteristics, and the identification performance remained excellent.

The convergence of the EKF-SA is influenced by the choice of the initial temperature and cooling rate. Through extensive sensitivity analysis, we found that an initial temperature of 100 and a cooling rate of 0.95 provide a good compromise. Too low initial temperature leads to premature freezing of the SA search, while too high initial temperature causes excessive perturbation that disrupts the EKF tracking. The algorithm is also tolerant to measurement noise; even with a signal-to-noise ratio of 20 dB, the parameter estimate RMSE only increases by about 1%. This makes it suitable for field deployment where sensors have finite precision.

One notable advantage of our method is its ability to handle parameter drift caused by component aging. In a long-term simulation extending to 10 minutes with a gradual increase in filter inductance (simulating aging), the EKF-SA continuously tracks the changing optimal gains, while the standard EKF accumulates a bias. This demonstrates the adaptive re-identification capability critical for smart maintenance of inverter systems. Furthermore, the SA mechanism can be tuned to specific types of solar inverters by adjusting the perturbation magnitude; for instance, string inverters with faster switching frequencies may require a smaller initial perturbation range to avoid instability.

Conclusion

We have presented a novel parameter identification method for photovoltaic grid-connected inverters by integrating simulated annealing into the extended Kalman filter. The EKF-SA algorithm overcomes the local optima issue inherent in standard EKF by probabilistically accepting perturbed solutions during the update, thus achieving global optimization without compromising real-time performance. Our simulation results confirm that the method significantly improves the accuracy of PI gain identification, reducing voltage recovery time by nearly half and suppressing current overshoots. The approach is validated under different grid disturbances and is adaptable to various types of solar inverters, from residential microinverters to utility-scale central inverters. The low computational overhead and simple hyperparameter tuning make the EKF-SA a practical solution for online parameter identification in modern solar power plants. Future work will extend the framework to incorporate neural network-based self-learning mechanisms for higher-dimensional state spaces, further enhancing the intelligence of photovoltaic systems.

Scroll to Top