As a major agricultural country, the deep integration of information technology and agriculture has become an inevitable trend for the development of modern agriculture in China. Digitalized agricultural information perception, scientific management decision-making, and intelligent agricultural equipment have become important ways to improve agricultural product quality and production efficiency. Photovoltaic agriculture, as an emerging agricultural form, applies solar power generation to modern agricultural planting, breeding, irrigation, pest control, and agricultural machinery power, such as the common “power generation on the shed, planting under the shed” photovoltaic agricultural greenhouse system. In such systems, the photovoltaic array, energy storage system, and greenhouse electrical equipment form the core components, suitable for powering smart agricultural monitoring facilities and small-power agricultural equipment such as temperature control, irrigation, and lighting in agricultural planting scenarios. However, the randomness and intermittency of solar energy in practical use severely affect its utilization rate. To improve the reliability of solar power supply and enhance power quality, the concept of photovoltaic-storage DC microgrid emerged.
In the photovoltaic agricultural system, the energy storage cell plays a critical role in ensuring stable operation of the DC microgrid. Due to the irregular charging and discharging patterns, the lifespan of the energy storage cell often decays prematurely, failing to meet the planned cycle of the storage system, thereby increasing storage costs. The energy storage unit is composed of multiple lithium battery cells connected in series or parallel, and then a series of such units form the storage system. In the storage system, the State of Charge (SOC) is the main basis for judging the charging capacity of the storage station and is also one of the important parameters for the power control strategy of the photovoltaic-storage microgrid. By incorporating SOC into the control strategy, not only is the battery protected, but also the smoothing effect of output power fluctuation is achieved. Therefore, accurate estimation of the SOC of the energy storage cell is essential for rational utilization, improving the reliability and efficiency of the entire storage system.
In recent years, research on SOC estimation of energy storage cell has been carried out from two main aspects: improvement of estimation algorithms and improvement of parameter identification methods for lithium battery equivalent circuit models. The Extended Kalman Filter (EKF) and its derivative algorithms are currently hot topics. Meanwhile, the identification of model parameters is crucial. In this study, I propose a joint method using Variable Forgetting Factor Recursive Least Squares (VFFRLS) and Adaptive Extended Kalman Filter (AEKF) to estimate the SOC of the energy storage cell. The AEKF adaptively updates the process noise and observation noise covariance in real time based on the noise information covariance matching technique, thereby effectively improving the SOC estimation accuracy of the lithium battery.
Lithium Battery Equivalent Model and Parameter Identification
Second-Order RC Model
Among commonly used equivalent circuit models for lithium-ion batteries, the second-order RC circuit can better reflect the dynamic characteristics of the battery. It separates the electrochemical polarization and concentration polarization into two parts, offering higher accuracy while maintaining moderate complexity, which is suitable for SOC estimation combined with Kalman filter algorithms. The model consists of an ohmic internal resistance \(R_0\), two RC parallel networks representing electrochemical polarization (\(R_1, C_1\)) and concentration polarization (\(R_2, C_2\)), open-circuit voltage \(U_{OC}\), terminal voltage \(U_L\), and current \(I\). The equations of the model are:
$$
\begin{aligned}
i_L &= \frac{U_1}{R_1} + C_1 \frac{dU_1}{dt} \\
i_L &= \frac{U_2}{R_2} + C_2 \frac{dU_2}{dt} \\
U_L &= U_{OC} – I R_0 – U_1 – U_2
\end{aligned}
$$
SOC-OCV Characteristic Curve
Accurate acquisition of the SOC-OCV curve is a key step in SOC estimation of the energy storage cell. I conducted a constant current intermittent discharge test on a lithium iron phosphate single cell (rated capacity 24 Ah, rated voltage 3.4 V) at 0.2 C, with a discharge duration of 30 minutes and a resting period of 1 hour, until the voltage dropped to the cutoff voltage. By recording the terminal voltage after each rest period, the open-circuit voltage (OCV) at different SOC levels was obtained. A sixth-order polynomial fitting was applied to the SOC-OCV data, yielding a high coefficient of determination \(R^2 = 0.9964\). The fitted equation is:
$$
OCV = 1.225 \cdot SOC^6 + 12.21 \cdot SOC^5 – 38.51 \cdot SOC^4 + 40.69 \cdot SOC^3 – 19.38 \cdot SOC^2 + 4.264 \cdot SOC + 2.926
$$
Online Parameter Identification Using VFFRLS
To adapt to the random charging/discharging conditions of the energy storage cell in photovoltaic agricultural systems, I adopted the VFFRLS algorithm for online parameter identification. Unlike the fixed forgetting factor in traditional FFRLS, VFFRLS adjusts the forgetting factor \(\lambda_k\) based on the identification error, thereby improving accuracy. The variable forgetting factor is defined as:
$$
\lambda_k = \lambda_{\min} + (1 – \lambda_{\min}) \cdot 2^{L_k}
$$
where \(L_k = -\rho \cdot \frac{\sum_{i=k-M+1}^{k} \mathbf{e}_i^T \mathbf{e}_i}{M}\), with \(\rho\) a tuning parameter, \(M\) the window size, and \(\mathbf{e}_i\) the estimation error at time \(i\). The VFFRLS algorithm steps are:
| Step | Operation |
|---|---|
| 1 | Initialize \(\hat{\boldsymbol{\theta}}_0\), \(\boldsymbol{\varphi}_0\), \(P_0\), \(\lambda_{\min}\), \(\rho\), \(M\) |
| 2 | Compute forgetting factor: \(\mathbf{e}_k = y_k – \boldsymbol{\varphi}_k^T \hat{\boldsymbol{\theta}}_{k-1}\); \(L_k = -\rho \frac{\sum \mathbf{e}_i^T \mathbf{e}_i}{M}\); \(\lambda_k = \lambda_{\min} + (1-\lambda_{\min})2^{L_k}\) |
| 3 | Update estimate: \(\hat{\boldsymbol{\theta}}_k = \hat{\boldsymbol{\theta}}_{k-1} + K_k \mathbf{e}_{k-1}\) |
| 4 | Compute gain: \(K_k = \frac{P_{k-1} \boldsymbol{\varphi}_k}{\lambda_k + \boldsymbol{\varphi}_k^T P_{k-1} \boldsymbol{\varphi}_k}\) |
| 5 | Update covariance: \(P_k = \frac{P_{k-1} – K_k \boldsymbol{\varphi}_k^T P_{k-1}}{\lambda_k}\) |
| 6 | Repeat steps 2–5 |
To apply VFFRLS to the second-order RC model, I transformed the model into a discrete-time difference equation via bilinear transform. The transfer function in the s-domain is:
$$
G(s) = \frac{U_{OC}(s) – U_L(s)}{I(s)} = R_0 + \frac{R_1}{1+R_1 C_1 s} + \frac{R_2}{1+R_2 C_2 s}
$$
After discretization using the bilinear transform \(s = \frac{2}{T} \cdot \frac{1-z^{-1}}{1+z^{-1}}\), the discrete transfer function becomes:
$$
G(z^{-1}) = \frac{a_3 + a_4 z^{-1} + a_5 z^{-2}}{1 – a_1 z^{-1} – a_2 z^{-2}}
$$
The corresponding difference equation is:
$$
y(k) = a_1 y(k-1) + a_2 y(k-2) + a_3 I(k) + a_4 I(k-1) + a_5 I(k-2)
$$
From the coefficients \(a_1\) to \(a_5\), the model parameters (\(R_0, R_1, C_1, R_2, C_2\)) can be derived. I validated the model using a dynamic charging/discharging profile mimicking the agricultural load conditions (variable current rates and durations). The parameters identified by VFFRLS converged quickly after initial fluctuations. The variable forgetting factor \(\lambda_k\) varied between 0.991 and 0.998, demonstrating adaptive behavior. The terminal voltage predicted by the identified model matched the measured voltage with a maximum error of 25 mV and a mean absolute error of 7.8 mV, confirming the accuracy of the VFFRLS-based parameter identification.
Adaptive Extended Kalman Filter for SOC Estimation
Principles of AEKF
The conventional EKF uses fixed process noise covariance \(Q\) and measurement noise covariance \(R\), which leads to degraded accuracy under varying operating conditions. The AEKF overcomes this by employing innovation-based adaptive estimation. The innovation sequence is defined as the difference between the measured terminal voltage and the predicted voltage:
$$
\mathbf{e}_k = y_k – h(\hat{x}_k, u_k)
$$
Using a moving window of size \(M\), the innovation covariance matrix is estimated as:
$$
\mathbf{H}_k = \frac{1}{M-1} \sum_{i=k-M+1}^{k} \mathbf{e}_i \mathbf{e}_i^T
$$
Then, the process noise covariance \(Q_k\) and measurement noise covariance \(R_k\) are updated adaptively:
$$
Q_k = K_k \mathbf{H}_k K_k^T, \quad R_k = \mathbf{H}_k – C_k P_k^- C_k^T
$$
The recursive steps of AEKF are:
| Step | Operation |
|---|---|
| 1 | Initialize \(\hat{x}_0, P_0, Q_0, R_0\) |
| 2 | Prediction: \(\hat{x}_k^- = A_{k-1} \hat{x}_{k-1} + B_{k-1} u_{k-1}\); \(P_k^- = A_{k-1} P_{k-1} A_{k-1}^T + Q_{k-1}\) |
| 3 | Kalman gain: \(K_k = P_k^- C_{k-1}^T (C_{k-1} P_k^- C_{k-1}^T + R_{k-1})^{-1}\) |
| 4 | Innovation: \(\mathbf{e}_k = y_k – (C_{k-1} \hat{x}_k^- + D_{k-1} u_{k-1})\); Compute \(\mathbf{H}_k\) via moving window |
| 5 | Adaptive update: \(Q_k = K_k \mathbf{H}_k K_k^T\); \(R_k = \mathbf{H}_k – C_k P_k^- C_k^T\) |
| 6 | Correction: \(\hat{x}_k = \hat{x}_k^- + K_k \mathbf{e}_k\); \(P_k = (I – K_k C_k) P_k^-\) |
| 7 | Repeat steps 2–6 |
VFFRLS-AEKF Joint SOC Estimation
The joint estimation framework first uses VFFRLS to identify the model parameters (\(R_0, R_1, C_1, R_2, C_2\)) online from measured current and voltage. These parameters are then fed into the AEKF algorithm to estimate the SOC. The state vector for AEKF includes SOC and the polarization voltages \(U_1, U_2\). The state equation and observation equation are derived from the discrete model. The initial state noise covariance was set to \(Q = \text{diag}(10^{-100}, 10^{-100}, 10^{-10})\), and measurement noise covariance \(R = 0.01\). The moving window size was \(M = 50\).
To evaluate the performance, I compared three algorithms: traditional EKF, AEKF (without VFFRLS parameter update), and the proposed VFFRLS-AEKF. The true SOC was obtained by Ampere-hour integration. The initial SOC was set incorrectly to 0.35 to test convergence. The simulation results under dynamic cycles are summarized below.
| Algorithm | RMSE (%) |
|---|---|
| EKF (fixed parameters, fixed Q/R) | 2.78 |
| AEKF (fixed parameters, adaptive Q/R) | 1.84 |
| VFFRLS-AEKF (adaptive parameters + adaptive Q/R) | 1.18 |
The VFFRLS-AEKF algorithm achieved the lowest RMSE of 1.18%, demonstrating superior accuracy and robustness. The adaptive forgetting factor in VFFRLS ensured accurate parameter tracking even under varying current profiles, while the adaptive noise covariance in AEKF eliminated the need for manual tuning of \(Q\) and \(R\). This joint approach significantly improves the reliability of SOC estimation for the energy storage cell in photovoltaic agricultural systems.
Conclusion
In photovoltaic agricultural systems, the energy storage cell is pivotal for power quality and system stability. Accurate SOC estimation is crucial for safe and efficient operation. This study proposed a VFFRLS-AEKF joint estimation method for SOC of the energy storage cell. The second-order RC equivalent circuit model combined with OCV-SOC mapping provides a solid foundation. Online parameter identification using VFFRLS adapts to changing conditions, while AEKF dynamically updates noise covariances, enhancing estimation precision. Experimental validation under dynamic charging/discharging cycles showed that the proposed method reduces SOC estimation error to within 1.2%, outperforming traditional EKF and standard AEKF. The method exhibits fast convergence and strong robustness, making it suitable for real-time applications in photovoltaic-storage microgrids for agriculture.

