SLAAEF5B March   2024  – June 2025 MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3506 , MSPM0G3507 , MSPM0H3216 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Algorithm Introduction
    1. 2.1 Battery Basic Knowledge Introduction
    2. 2.2 Different SOCs and Used Technologies
      1. 2.2.1 NomAbsSoc Calculation
        1. 2.2.1.1 Coulometer With OCV Calibration
        2. 2.2.1.2 Data Fusion
        3. 2.2.1.3 Battery Model Filter
      2. 2.2.2 CusRltSoc Calculation
        1. 2.2.2.1 EmptySoc and FullSoc
        2. 2.2.2.2 Core Temperature Evaluation
      3. 2.2.3 SmoothRltSoc Calculation
    3. 2.3 Algorithm Overview
      1. 2.3.1 Voltage Gauge Introduction
      2. 2.3.2 Current Gauge Introduction
      3. 2.3.3 Capacity Learn Introduction
      4. 2.3.4 Mixing Introduction
  6. 3Gauge GUI Introduction
    1. 3.1 MCU COM Tool
    2. 3.2 SM COM Tool
    3. 3.3 Data Analysis Tool
  7. 4MSPM0 Gauge Evaluation Steps
    1. 4.1 Step 1: Hardware Preparation
    2. 4.2 Step 2: Get a Battery Model
      1. 4.2.1 Battery Test Pattern
      2. 4.2.2 Battery Model Generation
    3. 4.3 Step 3: Input Customized Configuration
    4. 4.4 Step 4: Evaluation
      1. 4.4.1 Detection Data Input Mode
      2. 4.4.2 Communication Data Input Mode
    5. 4.5 Step 5: Gauge Performance Check
      1. 4.5.1 Learning Cycles
      2. 4.5.2 SOC and SOH Accuracy Evaluation
  8. 5MSPM0 Gauge Solutions
    1. 5.1 MSPM0L1306 and 1 LiCO2 Battery
      1. 5.1.1 Hardware Setup Introduction
      2. 5.1.2 Software and Evaluation Introduction
      3. 5.1.3 Battery Test Cases
        1. 5.1.3.1 Performance Test
        2. 5.1.3.2 Current Consumption Test
    2. 5.2 MSPM0G3507, BQ76952 and 4 LiFePO4 Batteries
      1. 5.2.1 Hardware Setup Introduction
      2. 5.2.2 Software and Evaluation Introduction
      3. 5.2.3 Battery Test Cases
        1. 5.2.3.1 Performance Test 1 (Pulse Discharge)
        2. 5.2.3.2 Performance Test 2 (Load Change)
    3. 5.3 MSPM0L1306 and BQ76905
  9. 6Summary
  10. 7References
  11. 8Revision History

Step 3: Input Customized Configuration

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.

 Gaugge_UserConfig.h Setting Figure 4-7 Gaugge_UserConfig.h Setting

The explanation of these parameters is shown in Table 4-2.

Table 4-2 System Configuration Parameters
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.

 Data Structure Figure 4-8 Data Structure

The most important data structure is tBattParamsConfig as shown in Figure 4-9. This contains all the battery parameter settings and algorithm settings.

 tBattParamsConfig Structure Figure 4-9 tBattParamsConfig Structure

For 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.

Table 4-3 General Configuration 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.
Table 4-4 Mixing Algorithm Related Parameters
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.
Table 4-5 Capacity Learn Algorithm Related Parameters
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).
Table 4-6 VGauge Algorithm Related Parameters
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.
Table 4-7 IGauge Algorithm Related Parameters
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.