Unscented Kalman filter for state of charge estimation.
More...
#include "soc_ukf.h"
#include <math.h>
#include "lerp_lut.h"
|
| | LERP_LUT_INIT (SOC_2_OCV, SOC_2_OCV_ENTRIES, SOC_2_OCV_SIZE) |
| |
| static void | SOC_UKF_mean_weights (const soc_ukf_t *ukf, float mean_weights[NUM_SIGMA_POINTS]) |
| |
| static void | SOC_UKF_covariance_weights (soc_ukf_t *ukf, const soc_ukf_params_t *params) |
| |
| void | SOC_UKF_init (soc_ukf_t *ukf, const soc_ukf_params_t *params, vec3_t x0, mat3_t P0) |
| | Initialize the SoC filter.
|
| |
| static void | SOC_UKF_sigma_points (const soc_ukf_t *ukf, vec3_t points[NUM_SIGMA_POINTS]) |
| |
| void | SOC_UKF_predict (soc_ukf_t *ukf, float current) |
| | Predict the next state and covariance.
|
| |
| void | SOC_UKF_update (soc_ukf_t *ukf, float voltage, float current) |
| | Correct the predicted state using measured voltage.
|
| |
Unscented Kalman filter for state of charge estimation.
- Author
- Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)
◆ LERP_LUT_INIT()
◆ SOC_UKF_covariance_weights()
◆ SOC_UKF_init()
Initialize the SoC filter.
- Parameters
-
| ukf | Filter instance to initialize |
| params | Cell model and filter parameters |
| x0 | Initial state [SoC, V1, V2] |
| P0 | Initial state covariance ! P0 must be SPD |
◆ SOC_UKF_mean_weights()
| static void SOC_UKF_mean_weights |
( |
const soc_ukf_t * | ukf, |
|
|
float | mean_weights[NUM_SIGMA_POINTS] ) |
|
static |
◆ SOC_UKF_predict()
| void SOC_UKF_predict |
( |
soc_ukf_t * | ukf, |
|
|
float | current ) |
Predict the next state and covariance.
- Parameters
-
| ukf | Filter instance |
| current | Equivalent cell current in amps. Positive current = discharge |
◆ SOC_UKF_sigma_points()
| static void SOC_UKF_sigma_points |
( |
const soc_ukf_t * | ukf, |
|
|
vec3_t | points[NUM_SIGMA_POINTS] ) |
|
static |
◆ SOC_UKF_update()
| void SOC_UKF_update |
( |
soc_ukf_t * | ukf, |
|
|
float | voltage, |
|
|
float | current ) |
Correct the predicted state using measured voltage.
- Parameters
-
| ukf | Filter instance. |
| voltage | Equivalent measured cell terminal voltage |
| current | Cell current in amps Positive current = discharge |
◆ SOC_2_OCV_ENTRIES
Initial value:= {
{0.0f, 2.811f},
{0.1f, 3.096f},
{0.2f, 3.286f},
{0.3f, 3.439f},
{0.4f, 3.570f},
{0.5f, 3.690f},
{0.6f, 3.829f},
{0.7f, 3.906f},
{0.8f, 4.040f},
{0.9f, 4.085f},
{1.0f, 4.171f}
}
◆ SOC_2_OCV_SIZE
| size_t SOC_2_OCV_SIZE = 11 |
|
staticconstexpr |