107 int16_t minimumCellVoltage_mV,
108 int16_t maximumCellVoltage_mV,
123 int16_t minimumCellTemperature_ddegC,
124 int16_t maximumCellTemperature_ddegC,
191 int16_t minimumCellVoltage_mV,
192 int16_t maximumCellVoltage_mV,
203 if (minimumCellVoltage_mV <= pConfigLimitValues->limitLowerCellVoltage_mV) {
207 if (minimumCellVoltage_mV <= pConfigLimitValues->cutoffLowerCellVoltage_mV) {
236 int16_t minimumCellTemperature_ddegC,
237 int16_t maximumCellTemperature_ddegC,
249 if (minimumCellTemperature_ddegC <= pConfigLimitValues->limitLowTemperatureDischarge_ddegC) {
253 if (minimumCellTemperature_ddegC <= pConfigLimitValues->cutoffLowTemperatureDischarge_ddegC) {
266 if (minimumCellTemperature_ddegC <= pConfigLimitValues->limitLowTemperatureCharge_ddegC) {
270 if (minimumCellTemperature_ddegC <= pConfigLimitValues->cutoffLowTemperatureCharge_ddegC) {
353 #if BMS_CHECK_SOF_CURRENT_LIMITS == true
376 uint8_t nrClosedStrings = 0;
377 float minDischarge_mA = FLT_MAX;
378 float minCharge_mA = FLT_MAX;
394 &temperatureBasedSof,
419 #if BMS_CHECK_SOF_CURRENT_LIMITS == true
430 &temperatureBasedSof,
449 &temperatureBasedSof,
468 &temperatureBasedSof,
511 #ifdef UNITY_UNIT_TEST
516 int16_t minimumCellVoltage_mV,
517 int16_t maximumCellVoltage_mV,
522 minimumCellVoltage_mV,
523 maximumCellVoltage_mV,
524 pAllowedVoltageBasedCurrent,
526 pCalculatedSofCurves);
529 int16_t minimumCellTemperature_ddegC,
530 int16_t maximumCellTemperature_ddegC,
535 minimumCellTemperature_ddegC,
536 maximumCellTemperature_ddegC,
537 pAllowedTemperatureBasedCurrent,
539 pCalculatedSofCurves);
Configuration of the battery cell (e.g., minimum and maximum cell voltage)
#define BC_CURRENT_MAX_CHARGE_RSL_mA
Maximum charge current limit.
#define BC_CURRENT_MAX_DISCHARGE_MOL_mA
Maximum discharge current limit.
#define BC_CURRENT_MAX_DISCHARGE_MSL_mA
Maximum discharge current limit.
#define BC_CURRENT_MAX_DISCHARGE_RSL_mA
Maximum discharge current limit.
#define BC_CURRENT_MAX_CHARGE_MSL_mA
Maximum charge current limit.
#define BC_CURRENT_MAX_CHARGE_MOL_mA
Maximum charge current limit.
Configuration of the battery system (e.g., number of battery modules, battery cells,...
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
#define BS_MAXIMUM_STRING_CURRENT_mA
Maximum string current limit in mA that is used in the SOA module to check for string overcurrent.
bool BMS_IsStringClosed(uint8_t stringNumber)
Returns string state (closed or open)
#define DATA_READ_DATA(...)
#define DATA_WRITE_DATA(...)
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
float MATH_MinimumOfTwoFloats(const float value1, const float value2)
Returns the minimum of the passed float values.
math library for often used math functions
#define NULL_PTR
Null pointer.
static SOF_CURVE_s sof_curveMol
static void SOF_CalculateTemperatureBasedCurrentLimit(int16_t minimumCellTemperature_ddegC, int16_t maximumCellTemperature_ddegC, SOF_CURRENT_LIMITS_s *pAllowedTemperatureBasedCurrent, const SOF_CONFIG_s *pConfigLimitValues, SOF_CURVE_s *pCalculatedSofCurves)
calculates the SoF from temperature data (i.e., minimum and maximum temperature of cells)
void SOF_Calculation(void)
triggers SOF calculation
void TEST_SOF_CalculateVoltageBasedCurrentLimit(int16_t minimumCellVoltage_mV, int16_t maximumCellVoltage_mV, SOF_CURRENT_LIMITS_s *pAllowedVoltageBasedCurrent, const SOF_CONFIG_s *pConfigLimitValues, SOF_CURVE_s *pCalculatedSofCurves)
void TEST_SOF_CalculateTemperatureBasedCurrentLimit(int16_t minimumCellTemperature_ddegC, int16_t maximumCellTemperature_ddegC, SOF_CURRENT_LIMITS_s *pAllowedTemperatureBasedCurrent, const SOF_CONFIG_s *pConfigLimitValues, SOF_CURVE_s *pCalculatedSofCurves)
static DATA_BLOCK_SOF_s sof_tableSofValues
void TEST_SOF_CalculateCurves(const SOF_CONFIG_s *pConfigurationValues, SOF_CURVE_s *pCalculatedSofCurveValues)
static SOF_CURVE_s sof_curveRsl
static DATA_BLOCK_MIN_MAX_s sof_tableMinimumMaximumValues
static void SOF_CalculateVoltageBasedCurrentLimit(int16_t minimumCellVoltage_mV, int16_t maximumCellVoltage_mV, SOF_CURRENT_LIMITS_s *pAllowedVoltageBasedCurrent, const SOF_CONFIG_s *pConfigLimitValues, SOF_CURVE_s *pCalculatedSofCurves)
calculates the SoF from voltage data (i.e., minimum and maximum voltage)
static void SOF_CalculateCurves(const SOF_CONFIG_s *pConfigurationValues, SOF_CURVE_s *pCalculatedSofCurveValues)
calculate SOF curve depending on configured configuration values
static SOF_CURVE_s sof_curveMsl
SOF_CURRENT_LIMITS_s TEST_SOF_MinimumOfTwoSofValues(SOF_CURRENT_LIMITS_s voltageBasedLimits, SOF_CURRENT_LIMITS_s temperatureBasedLimits)
static SOF_CURRENT_LIMITS_s SOF_MinimumOfTwoSofValues(SOF_CURRENT_LIMITS_s voltageBasedLimits, SOF_CURRENT_LIMITS_s temperatureBasedLimits)
get the minimum current values of all variants of SoF calculation
static SOF_CURVE_s sof_curveRecommendedOperatingCurrent
void SOF_Init(void)
initializes the area for SOF (where derating starts and is fully active).
Header for SOX module, responsible for current derating calculation.
const SOF_CONFIG_s sof_recommendedCurrent
const SOF_CONFIG_s sof_recommendedSafetyLimit
const SOF_CONFIG_s sof_configMaximumSafetyLimit
const SOF_CONFIG_s sof_maximumOperatingLimit
int16_t minimumTemperature_ddegC[BS_NR_OF_STRINGS]
int16_t maximumTemperature_ddegC[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]
int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]
float continuousMslChargeCurrent_mA[BS_NR_OF_STRINGS]
float continuousRslDischargeCurrent_mA[BS_NR_OF_STRINGS]
float peakMslDischargeCurrent_mA[BS_NR_OF_STRINGS]
float peakRslDischargeCurrent_mA[BS_NR_OF_STRINGS]
float continuousMolChargeCurrent_mA[BS_NR_OF_STRINGS]
float continuousMolDischargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedPeakPackChargeCurrent_mA
float recommendedPeakPackDischargeCurrent_mA
float recommendedContinuousPackChargeCurrent_mA
float recommendedContinuousChargeCurrent_mA[BS_NR_OF_STRINGS]
float peakMolChargeCurrent_mA[BS_NR_OF_STRINGS]
float continuousMslDischargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedContinuousPackDischargeCurrent_mA
DATA_BLOCK_HEADER_s header
float continuousRslChargeCurrent_mA[BS_NR_OF_STRINGS]
float peakRslChargeCurrent_mA[BS_NR_OF_STRINGS]
float peakMslChargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedContinuousDischargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]
float peakMolDischargeCurrent_mA[BS_NR_OF_STRINGS]
float maximumDischargeCurrent_mA
float maximumChargeCurrent_mA
int16_t limitLowTemperatureCharge_ddegC
int16_t limitLowerCellVoltage_mV
int16_t limitUpperCellVoltage_mV
int16_t cutoffHighTemperatureDischarge_ddegC
int16_t cutoffHighTemperatureCharge_ddegC
int16_t limitHighTemperatureCharge_ddegC
int16_t cutoffLowerCellVoltage_mV
int16_t limitHighTemperatureDischarge_ddegC
int16_t limitLowTemperatureDischarge_ddegC
int16_t cutoffLowTemperatureCharge_ddegC
int16_t cutoffLowTemperatureDischarge_ddegC
int16_t cutoffUpperCellVoltage_mV
float continuousDischargeCurrent_mA
float peakChargeCurrent_mA
float peakDischargeCurrent_mA
float continuousChargeCurrent_mA
float offsetLowTemperatureDischarge
float offsetHighTemperatureCharge
float slopeHighTemperatureDischarge
float offsetHighTemperatureDischarge
float offsetUpperCellVoltage
float slopeHighTemperatureCharge
float slopeUpperCellVoltage
float offsetLowerCellVoltage
float slopeLowerCellVoltage
float offsetLowTemperatureCharge
float slopeLowTemperatureDischarge
float slopeLowTemperatureCharge