|
foxBMS
1.0.0
The foxBMS Battery Management System API Documentation
|
Go to the documentation of this file.
81 .errorRequestCounter = 0,
85 .balancingAllowed =
true,
86 .balancingGlobalAllowed =
false,
122 float cellBalancingCurrent = 0.0f;
123 uint32_t difference = 0;
208 bool activateBalancing =
true;
231 activateBalancing =
false;
241 if (activateBalancing ==
true) {
262 uint16_t voltageMin = 0;
263 uint16_t minVoltageIndex = 0;
286 if (c != minVoltageIndex) {
365 #ifdef UNITY_UNIT_TEST
372 #ifdef UNITY_UNIT_TEST
377 extern BAL_STATE_s *TEST_BAL_GetBalancingState(
void) {
Implementation of the tasks used by the system, headers.
int32_t balancingThreshold
bool balancingGlobalAllowed
#define BS_NR_OF_BAT_CELLS
#define BS_BALANCING_RESISTANCE_ohm
BAL_STATE_REQUEST_e BAL_TransferStateRequest(BAL_STATE_s *currentState)
transfers the current state request to the state machine.
int16_t maximumTemperature_ddegC[BS_NR_OF_STRINGS]
Header for the history-based balancing strategy module.
STD_RETURN_TYPE_e BAL_GetInitializationState(void)
gets the initialization state.
static bool BAL_CheckImbalances(void)
DATA_BLOCK_HEADER_s header
enum BAL_STATEMACH BAL_STATEMACH_e
static void BAL_Deactivate(void)
Deactivates history based balancing.
static void BAL_ActivateBalancing(void)
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
#define BAL_LOWER_VOLTAGE_LIMIT_mV
#define DATA_WRITE_DATA(...)
static DATA_BLOCK_CELL_VOLTAGE_s bal_cellvoltage
@ BAL_STATEMACH_CHECK_BALANCING
float SOC_GetFromVoltage(int16_t voltage_mV)
look-up table for SOC initialization (average, min and max).
uint8_t BAL_CheckReEntrance(BAL_STATE_s *currentState)
re-entrance check of BAL state machine trigger function
@ BAL_STATEMACH_INITIALIZATION
static DATA_BLOCK_BALANCING_CONTROL_s bal_balancing
void BAL_ProcessStateInitialization(BAL_STATE_s *currentState)
State machine subfunction to initialize the balancing state machine.
void BAL_ProcessStateInitialized(BAL_STATE_s *currentState)
State machine subfunction to transfer from an initalized state to "running" states of th state machin...
BAL_RETURN_TYPE_e BAL_SetStateRequest(BAL_STATE_REQUEST_e stateRequest)
sets the current state request of the state variable bal_state.
DATA_BLOCK_HEADER_s header
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
STD_RETURN_TYPE_e initializationFinished
uint32_t deltaCharge_mAs[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
@ BAL_STATEMACH_UNINITIALIZED
#define BAL_UPPER_TEMPERATURE_LIMIT_ddegC
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Header for state-estimation module responsible for the estimation of state-of-charge (SOC),...
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
Configuration of the battery cell (e.g., minimum and maximum cell voltage)
int16_t cellVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
STD_RETURN_TYPE_e BAL_Init(DATA_BLOCK_BALANCING_CONTROL_s *pControl)
Generic initialization function for the balancing module.
@ DATA_BLOCK_ID_BALANCING_CONTROL
uint8_t balancingState[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
void BAL_Trigger(void)
trigger function for the BAL driver state machine.
#define DATA_READ_DATA(...)
static void BAL_ProcessStateBalancing(void)
enum BAL_RETURN_TYPE BAL_RETURN_TYPE_e
void BAL_SaveLastStates(BAL_STATE_s *pBalancingState)
Saves the last state and the last substate.
#define BC_CAPACITY_mAh
Cell capacity used for SOC calculation.
static void BAL_ComputeImbalances(void)
#define BAL_STATEMACH_SHORTTIME_100ms
@ BAL_STATEMACH_INITIALIZED
@ DATA_BLOCK_ID_CELL_VOLTAGE
static void BAL_ProcessStateCheckBalancing(void)
State machine subfunction to check if balancing is allowed.
BAL_STATEMACH_SUB_e substate
int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]
BAL_RETURN_TYPE_e BAL_CheckStateRequest(BAL_STATE_s *pCurrentState, BAL_STATE_REQUEST_e stateRequest)
checks the state requests that are made.
BAL_STATE_REQUEST_e stateRequest
enum BAL_STATEMACH_SUB BAL_STATEMACH_SUB_e
enum BAL_STATE_REQUEST BAL_STATE_REQUEST_e
#define BAL_HYSTERESIS_mV
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
DATA_BLOCK_HEADER_s header
void BAL_ProcessStateUninitalized(BAL_STATE_s *pCurrentState, BAL_STATE_REQUEST_e stateRequest)
Substate handling function for BAL_Trigger()
#define BAL_STATEMACH_BALANCINGTIME_100ms
static BAL_STATE_s bal_state