|
foxBMS
1.0.0
The foxBMS Battery Management System API Documentation
|
Go to the documentation of this file.
113 float socMinimumValue_perc,
114 float socMaximumValue_perc,
115 float socAverageValue_perc,
116 uint8_t stringNumber);
135 float stringSoc_perc = 0.0f;
137 stringSoc_perc = 100.0f;
141 return stringSoc_perc;
147 for (uint8_t stringNumber = 0u; stringNumber <
BS_NR_OF_STRINGS; stringNumber++) {
159 float socMinimumValue_perc,
160 float socMaximumValue_perc,
161 float socAverageValue_perc,
162 uint8_t stringNumber) {
170 float ccOffset_perc =
173 #if POSITIVE_DISCHARGE_CURRENT == false
174 ccOffset_perc *= (-1.0f);
226 void SOC_Init(
bool ccPresent, uint8_t stringNumber) {
232 if (ccPresent ==
true) {
235 float scalingOffset_perc =
238 #if POSITIVE_DISCHARGE_CURRENT == false
239 scalingOffset_perc *= (-1.0f);
263 bool continueFunction =
true;
266 continueFunction =
false;
269 if (
true == continueFunction) {
277 for (uint8_t stringNumber = 0u; stringNumber <
BS_NR_OF_STRINGS; stringNumber++) {
286 if (timestep_s > 0.0f) {
289 float deltaSOC_perc =
294 #if POSITIVE_DISCHARGE_CURRENT == false
295 deltaSOC_perc *= (-1.0f);
323 #if POSITIVE_DISCHARGE_CURRENT == false
324 deltaSoc_perc *= (-1.0f);
static SOC_STATE_s soc_state
float ccScalingMinimum[BS_NR_OF_STRINGS]
float averageSoc_perc[BS_NR_OF_STRINGS]
static void SOC_RecalibrateViaLookupTable(void)
initializes database and FRAM SOC values via lookup table (average, minimum and maximum).
DATA_BLOCK_HEADER_s header
void SOC_Calculation(void)
integrates current over time to calculate SOC.
void SOC_Init(bool ccPresent, uint8_t stringNumber)
initializes startup SOC-related values like lookup from nonvolatile ram at startup
#define DATA_WRITE_DATA(...)
static void SOC_CheckDatabaseSocPercentageLimits(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber)
Check if all database SOC percentage values are within [0.0, 100.0] Limits SOC values to limit values...
bool sensorCcUsed[BS_NR_OF_STRINGS]
float SOC_GetFromVoltage(int16_t voltage_mV)
look-up table for SOC initialization (average, min and max).
uint32_t previousTimestamp[BS_NR_OF_STRINGS]
int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
int32_t current_mA[BS_NR_OF_STRINGS]
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
static DATA_BLOCK_SOX_s soc_tableSocValues
static void SOC_UpdateNvmValues(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber)
Set SOC-related values in non-volatile memory.
static float SOC_GetStringSocPercentageFromCharge(uint32_t charge_As)
calculates string SOC in percentage from passed string charge in As
#define SOC_STRING_CAPACITY_As
math library for often used math functions
static DATA_BLOCK_CURRENT_SENSOR_s soc_tableCurrentSensor
float maximumSoc_perc[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
struct SOC_STATE SOC_STATE_s
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
uint32_t timestampCurrent[BS_NR_OF_STRINGS]
int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]
float maximumSoc_perc[BS_NR_OF_STRINGS]
static void SOC_SetValue(float socMinimumValue_perc, float socMaximumValue_perc, float socAverageValue_perc, uint8_t stringNumber)
sets SOC value with a parameter between 0.0 and 100.0.
STD_RETURN_TYPE_e FRAM_Write(FRAM_BLOCK_ID_e blockId)
Writes a variable to the FRAM.
#define DATA_READ_DATA(...)
float minimumSoc_perc[BS_NR_OF_STRINGS]
int32_t currentCounter_As[BS_NR_OF_STRINGS]
#define NULL_PTR
Null pointer.
STD_RETURN_TYPE_e FRAM_Read(FRAM_BLOCK_ID_e blockId)
Reads a variable from the FRAM.
uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]
int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]
Header for SOC module, responsible for calculation of SOC.
float minimumSoc_perc[BS_NR_OF_STRINGS]
@ DATA_BLOCK_ID_CURRENT_SENSOR
float averageSoc_perc[BS_NR_OF_STRINGS]
float ccScalingMaximum[BS_NR_OF_STRINGS]
Header for the driver for the FRAM module.
float ccScalingAverage[BS_NR_OF_STRINGS]