105 int16_t minimumCellVoltage_mV,
106 int16_t maximumCellVoltage_mV,
121 int16_t minimumCellTemperature_ddegC,
122 int16_t maximumCellTemperature_ddegC,
189 int16_t minimumCellVoltage_mV,
190 int16_t maximumCellVoltage_mV,
201 if (minimumCellVoltage_mV <= pConfigLimitValues->limitLowerCellVoltage_mV) {
205 if (minimumCellVoltage_mV <= pConfigLimitValues->cutoffLowerCellVoltage_mV) {
234 int16_t minimumCellTemperature_ddegC,
235 int16_t maximumCellTemperature_ddegC,
247 if (minimumCellTemperature_ddegC <= pConfigLimitValues->limitLowTemperatureDischarge_ddegC) {
251 if (minimumCellTemperature_ddegC <= pConfigLimitValues->cutoffLowTemperatureDischarge_ddegC) {
264 if (minimumCellTemperature_ddegC <= pConfigLimitValues->limitLowTemperatureCharge_ddegC) {
268 if (minimumCellTemperature_ddegC <= pConfigLimitValues->cutoffLowTemperatureCharge_ddegC) {
363 uint8_t nrClosedStrings = 0;
364 float minDischarge_mA = FLT_MAX;
365 float minCharge_mA = FLT_MAX;
381 &temperatureBasedSof,
434 #ifdef UNITY_UNIT_TEST
435 extern void TEST_SOF_CalculateCurves(
const SOF_CONFIG_s *pConfigurationValues,
SOF_CURVE_s *pCalculatedSofCurveValues) {
438 extern void TEST_SOF_CalculateVoltageBasedCurrentLimit(
439 int16_t minimumCellVoltage_mV,
440 int16_t maximumCellVoltage_mV,
445 minimumCellVoltage_mV,
446 maximumCellVoltage_mV,
447 pAllowedVoltageBasedCurrent,
449 pCalculatedSofCurves);
451 extern void TEST_SOF_CalculateTemperatureBasedCurrentLimit(
452 int16_t minimumCellTemperature_ddegC,
453 int16_t maximumCellTemperature_ddegC,
458 minimumCellTemperature_ddegC,
459 maximumCellTemperature_ddegC,
460 pAllowedTemperatureBasedCurrent,
462 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 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 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 recommendedPeakPackChargeCurrent_mA
float recommendedPeakPackDischargeCurrent_mA
float recommendedContinuousPackChargeCurrent_mA
float recommendedContinuousChargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedContinuousPackDischargeCurrent_mA
DATA_BLOCK_HEADER_s header
float recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedContinuousDischargeCurrent_mA[BS_NR_OF_STRINGS]
float recommendedPeakChargeCurrent_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