foxBMS  1.1.2
The foxBMS Battery Management System API Documentation
battery_cell_cfg.h File Reference

Configuration of the battery cell (e.g., minimum and maximum cell voltage) More...

#include "general.h"
Include dependency graph for battery_cell_cfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BC_LUT
 

Macros

#define BC_VOLTAGE_NOMINAL_mV   (2500)
 nominal cell voltage according to datasheet More...
 
#define BC_VOLTAGE_DEEP_DISCHARGE_mV   (BC_VOLTAGE_MIN_MSL_mV)
 Deep-discharge cell voltage limit. More...
 
#define BC_CAPACITY_mAh   (3500u)
 Cell capacity used for SOC calculation. More...
 
#define BC_ENERGY_Wh   (10.0f)
 
#define BC_TEMPERATURE_MAX_DISCHARGE_MSL_ddegC   (550)
 Maximum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MAX_DISCHARGE_RSL_ddegC   (500)
 Maximum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MAX_DISCHARGE_MOL_ddegC   (450)
 Maximum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MIN_DISCHARGE_MSL_ddegC   (-200)
 Minimum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MIN_DISCHARGE_RSL_ddegC   (-150)
 Minimum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MIN_DISCHARGE_MOL_ddegC   (-100)
 Minimum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MAX_CHARGE_MSL_ddegC   (450)
 Maximum temperature limit during charge. More...
 
#define BC_TEMPERATURE_MAX_CHARGE_RSL_ddegC   (400)
 Maximum temperature limit during charge. More...
 
#define BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC   (350)
 Maximum temperature limit during charge. More...
 
#define BC_TEMPERATURE_MIN_CHARGE_MSL_ddegC   (-200)
 Minimum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MIN_CHARGE_RSL_ddegC   (-150)
 Minimum temperature limit during discharge. More...
 
#define BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC   (-100)
 Minimum temperature limit during discharge. More...
 
#define BC_VOLTAGE_MAX_MSL_mV   (2800)
 Maximum cell voltage limit. More...
 
#define BC_VOLTAGE_MAX_RSL_mV   (2750)
 Maximum cell voltage limit. More...
 
#define BC_VOLTAGE_MAX_MOL_mV   (2720)
 Maximum cell voltage limit. More...
 
#define BC_VOLTAGE_MIN_MSL_mV   (1700)
 Minimum cell voltage limit. More...
 
#define BC_VOLTAGE_MIN_RSL_mV   (1750)
 Minimum cell voltage limit. More...
 
#define BC_VOLTAGE_MIN_MOL_mV   (1780)
 Minimum cell voltage limit. More...
 
#define BC_CURRENT_MAX_DISCHARGE_MSL_mA   (180000u)
 Maximum discharge current limit. More...
 
#define BC_CURRENT_MAX_DISCHARGE_RSL_mA   (175000u)
 Maximum discharge current limit. More...
 
#define BC_CURRENT_MAX_DISCHARGE_MOL_mA   (170000u)
 Maximum discharge current limit. More...
 
#define BC_CURRENT_MAX_CHARGE_MSL_mA   (180000u)
 Maximum charge current limit. More...
 
#define BC_CURRENT_MAX_CHARGE_RSL_mA   (175000u)
 Maximum charge current limit. More...
 
#define BC_CURRENT_MAX_CHARGE_MOL_mA   (170000u)
 Maximum charge current limit. More...
 

Typedefs

typedef struct BC_LUT BC_LUT_s
 

Variables

uint16_t bc_stateOfChargeLookupTableLength
 
const BC_LUT_s bc_stateOfChargeLookupTable []
 
uint16_t bc_stateOfEnergyLookupTableLength
 
const BC_LUT_s bc_stateOfEnergyLookupTable []
 

Detailed Description

Configuration of the battery cell (e.g., minimum and maximum cell voltage)

SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2017-03-14 (date of creation)
Updated
2017-03-14 (date of last update)
Prefix
BC

This files contains basic macros of the battery cell in order to derive needed inputs in other parts of the software. These macros are all depended on the hardware.

Definition in file battery_cell_cfg.h.

Macro Definition Documentation

◆ BC_CAPACITY_mAh

#define BC_CAPACITY_mAh   (3500u)

Cell capacity used for SOC calculation.

Type
int
Unit
mAh

Definition at line 220 of file battery_cell_cfg.h.

◆ BC_CURRENT_MAX_CHARGE_MOL_mA

#define BC_CURRENT_MAX_CHARGE_MOL_mA   (170000u)

Maximum charge current limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mA

Definition at line 212 of file battery_cell_cfg.h.

◆ BC_CURRENT_MAX_CHARGE_MSL_mA

#define BC_CURRENT_MAX_CHARGE_MSL_mA   (180000u)

Maximum charge current limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mA

Definition at line 210 of file battery_cell_cfg.h.

◆ BC_CURRENT_MAX_CHARGE_RSL_mA

#define BC_CURRENT_MAX_CHARGE_RSL_mA   (175000u)

Maximum charge current limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mA

Definition at line 211 of file battery_cell_cfg.h.

◆ BC_CURRENT_MAX_DISCHARGE_MOL_mA

#define BC_CURRENT_MAX_DISCHARGE_MOL_mA   (170000u)

Maximum discharge current limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mA

Definition at line 196 of file battery_cell_cfg.h.

◆ BC_CURRENT_MAX_DISCHARGE_MSL_mA

#define BC_CURRENT_MAX_DISCHARGE_MSL_mA   (180000u)

Maximum discharge current limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mA

Definition at line 194 of file battery_cell_cfg.h.

◆ BC_CURRENT_MAX_DISCHARGE_RSL_mA

#define BC_CURRENT_MAX_DISCHARGE_RSL_mA   (175000u)

Maximum discharge current limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mA

Definition at line 195 of file battery_cell_cfg.h.

◆ BC_ENERGY_Wh

#define BC_ENERGY_Wh   (10.0f)

Definition at line 222 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC

#define BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC   (350)

Maximum temperature limit during charge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 112 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MAX_CHARGE_MSL_ddegC

#define BC_TEMPERATURE_MAX_CHARGE_MSL_ddegC   (450)

Maximum temperature limit during charge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 110 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MAX_CHARGE_RSL_ddegC

#define BC_TEMPERATURE_MAX_CHARGE_RSL_ddegC   (400)

Maximum temperature limit during charge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 111 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MAX_DISCHARGE_MOL_ddegC

#define BC_TEMPERATURE_MAX_DISCHARGE_MOL_ddegC   (450)

Maximum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 80 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MAX_DISCHARGE_MSL_ddegC

#define BC_TEMPERATURE_MAX_DISCHARGE_MSL_ddegC   (550)

Maximum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 78 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MAX_DISCHARGE_RSL_ddegC

#define BC_TEMPERATURE_MAX_DISCHARGE_RSL_ddegC   (500)

Maximum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 79 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC

#define BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC   (-100)

Minimum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 128 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MIN_CHARGE_MSL_ddegC

#define BC_TEMPERATURE_MIN_CHARGE_MSL_ddegC   (-200)

Minimum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 126 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MIN_CHARGE_RSL_ddegC

#define BC_TEMPERATURE_MIN_CHARGE_RSL_ddegC   (-150)

Minimum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 127 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MIN_DISCHARGE_MOL_ddegC

#define BC_TEMPERATURE_MIN_DISCHARGE_MOL_ddegC   (-100)

Minimum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 96 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MIN_DISCHARGE_MSL_ddegC

#define BC_TEMPERATURE_MIN_DISCHARGE_MSL_ddegC   (-200)

Minimum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 94 of file battery_cell_cfg.h.

◆ BC_TEMPERATURE_MIN_DISCHARGE_RSL_ddegC

#define BC_TEMPERATURE_MIN_DISCHARGE_RSL_ddegC   (-150)

Minimum temperature limit during discharge.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
deci °C

Definition at line 95 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_DEEP_DISCHARGE_mV

#define BC_VOLTAGE_DEEP_DISCHARGE_mV   (BC_VOLTAGE_MIN_MSL_mV)

Deep-discharge cell voltage limit.

If this voltage limit is violated, the cell is faulty. The BMS will not allow a closing of the contactors until this cell is replaced. A replacement of the cell is confirmed by sending the respective CAN debug message

Type
int
Unit
mV

Definition at line 181 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_MAX_MOL_mV

#define BC_VOLTAGE_MAX_MOL_mV   (2720)

Maximum cell voltage limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mV

Definition at line 144 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_MAX_MSL_mV

#define BC_VOLTAGE_MAX_MSL_mV   (2800)

Maximum cell voltage limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mV

Definition at line 142 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_MAX_RSL_mV

#define BC_VOLTAGE_MAX_RSL_mV   (2750)

Maximum cell voltage limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mV

Definition at line 143 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_MIN_MOL_mV

#define BC_VOLTAGE_MIN_MOL_mV   (1780)

Minimum cell voltage limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mV

Definition at line 168 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_MIN_MSL_mV

#define BC_VOLTAGE_MIN_MSL_mV   (1700)

Minimum cell voltage limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mV

Definition at line 166 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_MIN_RSL_mV

#define BC_VOLTAGE_MIN_RSL_mV   (1750)

Minimum cell voltage limit.

When maximum safety limit (MSL) is violated, error state is requested and contactors will open. When recommended safety limit (RSL) or maximum operating limit (MOL) is violated, the respective flag will be set.

Type
int
Unit
mV

Definition at line 167 of file battery_cell_cfg.h.

◆ BC_VOLTAGE_NOMINAL_mV

#define BC_VOLTAGE_NOMINAL_mV   (2500)

nominal cell voltage according to datasheet

Type
int
Unit
mV

Definition at line 153 of file battery_cell_cfg.h.

Typedef Documentation

◆ BC_LUT_s

typedef struct BC_LUT BC_LUT_s

structure for lookup table

Variable Documentation

◆ bc_stateOfChargeLookupTable

const BC_LUT_s bc_stateOfChargeLookupTable[]
extern

SOC lookup table

Definition at line 65 of file battery_cell_cfg.c.

◆ bc_stateOfChargeLookupTableLength

uint16_t bc_stateOfChargeLookupTableLength
extern

length of the SOC lookup table

Definition at line 102 of file battery_cell_cfg.c.

◆ bc_stateOfEnergyLookupTable

const BC_LUT_s bc_stateOfEnergyLookupTable[]
extern

SOE lookup table

Definition at line 84 of file battery_cell_cfg.c.

◆ bc_stateOfEnergyLookupTableLength

uint16_t bc_stateOfEnergyLookupTableLength
extern

length of the SOE lookup table

Definition at line 103 of file battery_cell_cfg.c.