4.4. BMS Values

4.4.1. Module Files

4.4.1.1. Driver

  • src/app/application/bms/bms-values.c

  • src/app/application/bms/bms-values.h

4.4.1.2. Configuration

  • none

4.4.1.3. Unit Test

  • tests/unit/app/application/bms/test_bms-values.c

  • tests/unit/app/application/bms/test_bms-values-redundancy.c

4.4.2. Detailed Description

The BMS Values module is the data-conditioning stage between low-level measurements and the BMS state machine. Its responsibility is to provide validated and derived values that are safe to consume by control logic.

4.4.2.1. Execution context

The module is executed cyclically from the 10ms Task every 50ms via BMSVL_UpdateSystemValues(). In the same 10ms Task, BMS_Trigger() is called afterwards. This ordering ensures that the BMS state machine operates on the newest validated values.

4.4.2.2. Inputs and Outputs

The update routine reads low-level measurement entries and computes validated pack-level and statistics values.

Main input sources include:

  • DATA_BLOCK_ID_CURRENT

  • DATA_BLOCK_ID_SYSTEM_VOLTAGE_1

  • DATA_BLOCK_ID_SYSTEM_VOLTAGE_3

  • DATA_BLOCK_ID_POWER

If redundant cell-voltage and cell-temperature measurements are NOT enabled, the module reads in the base measurements from:

  • DATA_BLOCK_ID_CELL_VOLTAGE_BASE

  • DATA_BLOCK_ID_CELL_TEMPERATURE_BASE

If redundant cell-voltage and cell-temperature measurements are enabled, the redundancy module reads the base and redundant measurements from:

  • DATA_BLOCK_ID_CELL_VOLTAGE_BASE

  • DATA_BLOCK_ID_CELL_TEMPERATURE_BASE

  • DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANT

  • DATA_BLOCK_ID_CELL_TEMPERATURE_REDUNDANT

The outputs are then:

  • DATA_BLOCK_ID_PACK_VALUES (validated string/pack values and validity bits)

  • DATA_BLOCK_ID_CELL_VOLTAGE (validated cell voltage values)

  • DATA_BLOCK_ID_CELL_TEMPERATURE (validated cell temperature values)

  • DATA_BLOCK_ID_MIN_MAX (derived min/max/average values)

4.4.2.3. Processing Sequence

At each invocation, BMSVL_UpdateSystemValues() performs the following high level steps:

  1. Read required database entries for current, voltage, and power.

  2. Obtain validated cell voltage/temperature source data:

    • If redundancy support is enabled, use the redundancy module.

    • Otherwise, copy base measurements into the validated working tables.

  3. Run plausibility checks for current, string voltage, battery voltage, high-voltage bus voltage, and power.

  4. Derive min/max/average values for cell voltage and temperature.

  5. Re-run derived values where needed after spread-based invalidation.

  6. Write resulting pack and min/max values back to the database.

4.4.2.4. Interaction with Plausibility and Redundancy

The module delegates measurement validation logic to the plausibility module (see Plausibility) and, if configured, cross-checking of redundant measurements to the redundancy module (see Redundancy). Plausibility and redundancy are helper modules: they validate and qualify measurement data, but they do not control BMS states or contactors. Control authority remains in BMS, using values prepared by BMS Values. In short:

BMS values block diagram

Fig. 4.3 BMS values block diagram

BMS values calling sequence block diagram

Fig. 4.4 Detailed calling sequence of BMS values update routine

4.4.3. Further Reading