# Research of Adaptive Extended Kalman Filter-Based SOC Estimator for Frequency Regulation ESS
## 3 Performance Verification of SOC Estimation Using Adaptive Extended Kalman Filter
### Extended Kalman Filter Algorithm Design
\tag{11}\]  
\[\mathbf{B}=\left[\begin{array}{cc}\frac{\Delta\mathrm{T}}{C_{\mathrm{bat}}} \frac{-\Delta\mathrm{T}}{\mathrm{P}_{1}}\\ \mathrm{R}_{1}(1-\mathrm{e}^{\frac  
The value **R** is used for the calculation of the Kalman gain, as in Equation (13), and if **R** is large, the Kalman gain becomes small. Then, the influence of the predicted value, \(\hat{\kappa}_{\text{k}}^{-}\), is greater than the measured value, and the calculated estimated value, \(\hat{\kappa}_{\text{k}}\), has a gentle shape. However, if **R** is large, the influence of the predicted value is small, and the influence on the measured value becomes large; the estimated value is then calculated in the form of severe change [36]. This is the opposite to **Q**, and when these features are considered during the algorithm design, the desired result can be obtained. In the EKF, \(\text{h}(\hat{\kappa}_{\text{k}}^{-})\) applying the diffusion voltage calculated as the predicted value, \(\hat{\kappa}_{\text{k}}^{-}\), to the linearized system model can be expressed as in Equation (16).  
\[\text{h}\big{(}\hat{\kappa}_{\text{k}}^{-}\big{)}=\text{OCV}_{\text{k}}(\text {SOC}_{\text{k}})+\text{I}_{\text{k}}\text{R}_{0}+\text{V}_{\text{diff}}. \tag{16}\]  
Here, \(\text{OCV}_{\text{k}}\) is the OCV considering the SOC estimated by the algorithm based on the SOC-OCV data obtained in the experiment. The voltage estimated by the EKF is calculated using the above steps, and the Kalman gain is multiplied by the measured data, \(\text{z}_{\text{k}}\), as shown in Equation (17). The calculated value is added to the estimated value, \(\hat{\kappa}_{\text{k}}^{-}\), to calculate the estimated value, \(\hat{\kappa}_{\text{k}}\). \[\hat{\kappa}_{\text{k}}=\hat{\kappa}_{\text{k}}^{-}+\text{K}_{\text{k}}(\text {z}_{\text{k}}-\text{h}\big{(}\hat{\kappa}_{\text{k}}^{-}\big{)}). \tag{17}\]  
\[\text{P}_{\text{k}}=\text{P}_{\text{k}}^{-}+\text{K}_{\text{k}}\text{HP}_{ \text{k}}^{-}. \tag{18}\]  
The Kalman gain Figure 4 shows the result of the SOC estimation by the EKF algorithm in the DCIR test in which OCV and equivalent circuit model parameters were extracted by applying a discharge pulse 5% from SOC 100% to SOC 0%. The initial SOC given as the input of the algorithm is set to 30% to confirm whether the SOC is correctly estimated, even if the initial SOC is different from the actual SOC. The estimated SOC can be seen in Figure 4a. Figure 4b shows the SOC estimation error, which shows a large error owing to the error of the initial SOC, but the error is immediately reduced by the EKF algorithm. During the SOC estimation, the algorithm showed an SOC error within 5%. Figure 4c shows the variation of the Kalman gain during the SOC estimation process. As mentioned above, as the Kalman gain increases, the weight of the measured value increases in the calculation of the estimated value, and as the Kalman gain decreases, the weight of the predicted value increases [36]. Based on the variation in the Kalman gain, the Kalman gain is large in the area in which the SOC estimation error is also large. If the estimated value shows an error compared to the measured value, the algorithm automatically increases the Kalman gain of the next time step in order to increase the specific gravity of the measured value and to reduce the estimated error. The error generated during the estimation is corrected for each time step, and the algorithm has an excellent estimation performance. Figure 5 shows the voltage estimation results obtained for the DCIR test. As the initial SOC input to the algorithm was 30%, the voltage starts with the voltage that matches the SOC, and the error is immediately corrected because it shows an error compared with the measured voltage. As a result of the voltage estimation, the estimation error within 0.1 V is shown as a whole, and the Kalman gain can be confirmed to be close to 0, except for the initial error.