78 int32_t diff_mV = voltageAfe_mV - voltageCurrentSensor_mV;
87 int16_t baseCellVoltage,
88 int16_t redundancy0CellVoltage,
89 int16_t *pCellVoltage) {
100 *pCellVoltage = (baseCellVoltage + redundancy0CellVoltage) / 2;
105 int16_t baseCelltemperature,
106 int16_t redundancy0Celltemperature,
107 int16_t *pCelltemperature) {
119 *pCelltemperature = (baseCelltemperature + redundancy0Celltemperature) / 2;
Configuration of the battery system (e.g., number of battery modules, battery cells,...
#define BS_NR_OF_CELL_BLOCKS_PER_MODULE
number of cells per module
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
#define BS_NR_OF_TEMP_SENSORS_PER_MODULE
number of temperature sensors per battery module
#define BS_NR_OF_MODULES_PER_STRING
number of modules in a string
STD_RETURN_TYPE_e DIAG_CheckEvent(STD_RETURN_TYPE_e cond, DIAG_ID_e diagId, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_CheckEvent provides a simple interface to check an event for STD_OK.
@ DIAG_ID_PLAUSIBILITY_CELL_TEMPERATURE_SPREAD
@ DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE_SPREAD
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
math library for often used math functions
#define NULL_PTR
Null pointer.
STD_RETURN_TYPE_e PL_CheckTemperatureSpread(DATA_BLOCK_CELL_TEMPERATURE_s *pCellTemperatures, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues)
Cell temperature spread plausibility check.
STD_RETURN_TYPE_e PL_CheckCelltemperature(int16_t baseCelltemperature, int16_t redundancy0Celltemperature, int16_t *pCelltemperature)
Cell temperature plausibility check between two redundant cell temperature measurement values.
STD_RETURN_TYPE_e PL_CheckStringVoltage(int32_t voltageAfe_mV, int32_t voltageCurrentSensor_mV)
Pack voltage plausibility check between LTC and current sensor values.
STD_RETURN_TYPE_e PL_CheckCellVoltage(int16_t baseCellVoltage, int16_t redundancy0CellVoltage, int16_t *pCellVoltage)
Cell voltage plausibility check between two redundant cell voltage measurement values.
STD_RETURN_TYPE_e PL_CheckVoltageSpread(DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltages, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues)
Cell voltage spread plausibility check.
plausibility checks for cell voltage and cell temperatures
#define PL_CELL_TEMPERATURE_TOLERANCE_dK
Maximum difference between redundant cell temperature measurements in deci kelvin.
#define PL_CELL_VOLTAGE_TOLERANCE_mV
Maximum difference between redundant cell voltage measurement.
#define PL_STRING_VOLTAGE_TOLERANCE_mV
Maximum difference between pack voltage measurement from AFE and current sensor.
#define PL_CELL_TEMPERATURE_SPREAD_TOLERANCE_dK
Maximum deviation between a single cell temperature measurement and the average cell temperature in d...
#define PL_CELL_VOLTAGE_SPREAD_TOLERANCE_mV
Maximum deviation between a single cell voltage measurement and the average cell voltage.
int16_t cellTemperature_ddegC[BS_NR_OF_STRINGS][BS_NR_OF_TEMP_SENSORS_PER_STRING]
uint16_t nrValidTemperatures[BS_NR_OF_STRINGS]
uint16_t invalidCellTemperature[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING]
uint64_t invalidCellVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING]
int16_t cellVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_CELL_BLOCKS_PER_STRING]
int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]
float averageTemperature_ddegC[BS_NR_OF_STRINGS]