PER Firmware
Loading...
Searching...
No Matches
hv_soc_params.h
Go to the documentation of this file.
1
8#ifndef HV_SOC_PARAMS_H
9#define HV_SOC_PARAMS_H
10
11#include <stdint.h>
12
13#include "lerp_lut/lerp_lut.h"
14#include "soc_ukf/soc_ukf.h"
15
16// Rate the filter is tuned for, the calling task must run at this period
17static constexpr uint32_t HV_SOC_PARAMS_PERIOD_MS = 10;
18
19static constexpr size_t HV_SOC_OCV_TO_SOC_SIZE = 11;
21 {2.811f, 0.0f},
22 {3.096f, 0.1f},
23 {3.286f, 0.2f},
24 {3.439f, 0.3f},
25 {3.570f, 0.4f},
26 {3.690f, 0.5f},
27 {3.829f, 0.6f},
28 {3.906f, 0.7f},
29 {4.040f, 0.8f},
30 {4.085f, 0.9f},
31 {4.171f, 1.0f},
32};
34
35static constexpr soc_ukf_params_t HV_SOC_PARAMS = {
36 .ecm = {
37 .r0 = 0.0000100f,
38 .r1 = 0.00804391f,
39 .r2 = 0.00740416f,
40 .tau1 = 0.140246f,
41 .tau2 = 13.0688f,
42 .Q = 5.0f,
43 },
44 .prediction_dt = (float)HV_SOC_PARAMS_PERIOD_MS / 1000.0f,
45 .Q = {{
46 {4e-12f, 0.0f, 0.0f},
47 {0.0f, 4e-8f, 0.0f},
48 {0.0f, 0.0f, 4e-4f},
49 }},
50 .R = 4e-4f,
51 .alpha = 1.0f,
52 .beta = 2.0f,
53 .kappa = 0.0f,
54};
55
56static constexpr mat3_t HV_SOC_INITIAL_COVARIANCE = {{
57 {2.5e-3f, 0.0f, 0.0f},
58 {0.0f, 4e-4f, 0.0f},
59 {0.0f, 0.0f, 4e-4f},
60}};
61
62#endif // HV_SOC_PARAMS_H
static constexpr uint32_t HV_SOC_PARAMS_PERIOD_MS
Definition hv_soc_params.h:17
static constexpr soc_ukf_params_t HV_SOC_PARAMS
Definition hv_soc_params.h:35
static constexpr size_t HV_SOC_OCV_TO_SOC_SIZE
Definition hv_soc_params.h:19
static const lut_entry_t HV_SOC_OCV_TO_SOC_ENTRIES[HV_SOC_OCV_TO_SOC_SIZE]
Definition hv_soc_params.h:20
static constexpr mat3_t HV_SOC_INITIAL_COVARIANCE
Definition hv_soc_params.h:56
Linear interpolation lookup table (LUT).
#define LERP_LUT_INIT(name, _entries, _size)
Definition lerp_lut.h:23
Unscented Kalman filter for state of charge estimation.
Definition lerp_lut.h:13
Definition linear_algebra.h:19
Definition soc_ukf.h:48