SLAAEF5B March 2024 – June 2025 MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3506 , MSPM0G3507 , MSPM0H3216 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1
First, users need to make system changes based on the applications in Gauge_UserConfig.h. The commonly changed parameters are shown in Figure 4-7.
Figure 4-7 Gaugge_UserConfig.h SettingThe explanation of these parameters is shown in Table 4-2.
| Parameters | Comment |
|---|---|
| DETECTION_MODE | Affects the algorithm data input source and described in Section 4.4. |
| OUTPUT_MODE | Controls whether to output tested data to GUI and described in Section 4.4. |
| PACK_DATA_RECOVER | If this parameter is defined, then the pack data recover function is enabled. This is reserved for the data saving requirement when MCU is shut down. For data saving and data loading functions, users need to do the development. |
| CELL_NUMBER | The cell numbers for the battery pack. |
| CIRCUIT_TABLE_LENGTH | circuitParamsTable length. |
Second, users need to fulfill the data structure configuration in Gauge_UserConfig.c. A brief introduction to the used data structure in this gauge implementation is shown in Figure 4-8.
tGaugeApplication represents the battery pack. All the pack related results are saved in tBattPackParams. tbattGlobalParams[] represents every battery cell in the battery pack. All the algorithm data structures are all underneath.
Figure 4-8 Data StructureThe most important data structure is tBattParamsConfig as shown in Figure 4-9. This contains all the battery parameter settings and algorithm settings.
Figure 4-9 tBattParamsConfig StructureFor easy evaluation, users only need to change the general configuration parameters. These parameters are divided into five parts. A short description is provided for all these related parameters.
| Parameters | Comment |
|---|---|
| battModelUse | This enables a thermal model to evaluate the core temperature iq15EvlCoreTemp_C, which is only used to update and search emptySoc and fullSoc. When a module is used, the suggested iq15Tcell_C temperature resolution is 0.1℃. With 1℃ resolution, the iq15EvlCoreTemp_C error is added with about ±1.5℃. When no module used, surface temperature is used as battery core temperature. |
| u16battWeight_g | Battery weight used for core temperature evaluation. For example, 18650: 49g; 21700: 60g; 26650: 96g. |
| u16DesignCap_mAh | Design capacity. The input the standard capacity of battery or the tested one through battery parameter generation test. |
| u16MinBattVoltThd_mV /
u16MaxBattVoltThd_mV i16MaxChgCurtThd_mA / i16MinDhgCurtThd_mA i8MaxChgTempThd_C / i8MinChgTempThd_C i8MaxDhgTempThd_C / i8MinDhgTempThd_C |
Battery Vcell, Icell and Tcell threshold. These are reserved to control warning flags when the battery situation is above these parameters. These do not influence the gauge performance. |
| u16MinFullChgVoltThd_mV u16MaxFullChgVoltThd_mVi16FullChgCurtThd_mA |
Battery full related setting. The battery charge voltage is in this range. u16MinFullChgVoltThd_mV helps to judge when the battery is full. u16MaxFullChgVoltThd_mV is used as default Full OCV after MCU power on. When the current is below than i16FullChgCurtThd_mA and the voltage is above u16MinFullChgVoltThd_mV, treat the battery as full. |
| u16EmptyDhgVoltThd_mV | When the voltage reaches this value, battery as empty. |
| u8AvgBattParamsUpdateCount | The average data is obtained after the settled cycles. |
| Parameters | Comment |
|---|---|
| u16ConvergeStartVolt_mV | When the run-time voltage is below than this parameter, the converging algorithm starts to work to compensate for the emptySoc. |
| i8TempThd_C[] i16CurtThd_mA[] |
Used to find an excellent emptySoc and fullSoc in iq15AbsEmptySocMatrix[] and iq15AbsFullSocMatrix[] according to the current and temperature thresholds. For more details, refer to Section 2.3.4. |
| u16EmptyOcvMatrix[] | Used to calculate the
related emptySoc for iq15AbsEmptySocMatrix[]. If all is 0, then
u16EmptyDhgVoltThd_mV is used as the empty OCV to calculate a related emptySoc.
Then, this is automatically learned after cycling. If users want to get better gauge performance in learning cycles, then users can test the OCVs in the related ranges and input into the matrix. |
| u16FullOcvMatrix[] | Used to calculate the
relatedfulSoc for iq15AbsFullSocMatrix[]. If all is 0, then u16MaxFullChgVoltThd_mV
is used as the full OCV to calculate a related fullSoc. Then, this is automatically
learned after cycling. If users want to get better gauge performance in learning cycles, then users can test the OCVs in the related ranges and input into the matrix. |
| Parameters | Comment |
|---|---|
| i16UnloadCurtLowThd_mA i16UnloadCurtHighThd_mA |
If the current is between
this range, then the battery is treated as rest. Consider the noise of current detection. Otherwise, the rest detection has problems. |
| u8SOHCalcCycleThd | The battery discharge cycle threshold to do SOH calculation. |
| iq15DefaultSOH_DEC | Battery default SOH value. |
| u8NomFullCapIIRLevel | Used to control the IIR filter level for NomFullCap. freq_cut = Freq_sample/(2*pi*2^ui8Beta). |
| Parameters | Comment |
|---|---|
| u8CircuitTableLength | Circuit table length. |
| u8CircuitTableTestTemp_C iq15RcellNegTshift_R iq15RcellPosTshift_R |
These parameters are used to evaluate the Rcell under different temperatures. This does not affect the performance too much. Users can keep them to be same. |
| Parameters | Comment |
|---|---|
| i16AvgLeckageCurt_mA | Internal leakage current compensation. This means the evaluated current that can't be measured by shunt resistor, consumed by MCU or battery internal leakage current. |
| i16EqualizationCurt_mA | This means the equalization current, users need to handle the battery equalization by themselves. |