108 int16_t minimumCellVoltage_mV,
109 int16_t maximumCellVoltage_mV,
124 int16_t minimumCellTemperature_ddegC,
125 int16_t maximumCellTemperature_ddegC,
192 int16_t minimumCellVoltage_mV,
193 int16_t maximumCellVoltage_mV,
204 if (minimumCellVoltage_mV <= pConfigLimitValues->limitLowerCellVoltage_mV) {
208 if (minimumCellVoltage_mV <= pConfigLimitValues->cutoffLowerCellVoltage_mV) {
237 int16_t minimumCellTemperature_ddegC,
238 int16_t maximumCellTemperature_ddegC,
250 if (minimumCellTemperature_ddegC <= pConfigLimitValues->limitLowTemperatureDischarge_ddegC) {
254 if (minimumCellTemperature_ddegC <= pConfigLimitValues->cutoffLowTemperatureDischarge_ddegC) {
267 if (minimumCellTemperature_ddegC <= pConfigLimitValues->limitLowTemperatureCharge_ddegC) {
271 if (minimumCellTemperature_ddegC <= pConfigLimitValues->cutoffLowTemperatureCharge_ddegC) {
366 uint8_t nrClosedStrings = 0;
367 float_t minDischarge_mA = FLT_MAX;
368 float_t minCharge_mA = FLT_MAX;
384 &temperatureBasedSof,
437 #ifdef UNITY_UNIT_TEST
438 extern void TEST_SOF_CalculateCurves(
const SOF_CONFIG_s *pConfigurationValues,
SOF_CURVE_s *pCalculatedSofCurveValues) {
441 extern void TEST_SOF_CalculateVoltageBasedCurrentLimit(
442 int16_t minimumCellVoltage_mV,
443 int16_t maximumCellVoltage_mV,
448 minimumCellVoltage_mV,
449 maximumCellVoltage_mV,
450 pAllowedVoltageBasedCurrent,
452 pCalculatedSofCurves);
454 extern void TEST_SOF_CalculateTemperatureBasedCurrentLimit(
455 int16_t minimumCellTemperature_ddegC,
456 int16_t maximumCellTemperature_ddegC,
461 minimumCellTemperature_ddegC,
462 maximumCellTemperature_ddegC,
463 pAllowedTemperatureBasedCurrent,
465 pCalculatedSofCurves);
Configuration of the battery cell (e.g., minimum and maximum cell voltage)
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_IsTransitionToErrorStateActive(void)
Check if transition in to error state is active.
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_t MATH_MinimumOfTwoFloats(const float_t value1, const float_t value2)
Returns the minimum of the passed float values.
math library for often used math functions
#define NULL_PTR
Null pointer.
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
static DATA_BLOCK_SOF_s sof_tableSofValues
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_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
Header for state-estimation module responsible for the estimation of state-of-charge (SOC),...
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_t recommendedPeakPackChargeCurrent_mA
float_t recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]
float_t recommendedContinuousChargeCurrent_mA[BS_NR_OF_STRINGS]
float_t recommendedContinuousDischargeCurrent_mA[BS_NR_OF_STRINGS]
float_t recommendedContinuousPackChargeCurrent_mA
DATA_BLOCK_HEADER_s header
float_t recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]
float_t recommendedContinuousPackDischargeCurrent_mA
float_t recommendedPeakPackDischargeCurrent_mA
float_t maximumChargeCurrent_mA
float_t limpHomeCurrent_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
float_t maximumDischargeCurrent_mA
int16_t limitHighTemperatureDischarge_ddegC
int16_t limitLowTemperatureDischarge_ddegC
int16_t cutoffLowTemperatureCharge_ddegC
int16_t cutoffLowTemperatureDischarge_ddegC
int16_t cutoffUpperCellVoltage_mV
float_t peakChargeCurrent_mA
float_t continuousChargeCurrent_mA
float_t continuousDischargeCurrent_mA
float_t peakDischargeCurrent_mA
float_t offsetHighTemperatureCharge
float_t slopeHighTemperatureCharge
float_t offsetLowTemperatureCharge
float_t offsetLowTemperatureDischarge
float_t offsetLowerCellVoltage
float_t offsetHighTemperatureDischarge
float_t slopeLowTemperatureCharge
float_t slopeHighTemperatureDischarge
float_t slopeUpperCellVoltage
float_t offsetUpperCellVoltage
float_t slopeLowTemperatureDischarge
float_t slopeLowerCellVoltage