59 #ifndef FOXBMS__BATTERY_SYSTEM_CFG_H_
60 #define FOXBMS__BATTERY_SYSTEM_CFG_H_
86 #define POSITIVE_DISCHARGE_CURRENT (true)
89 #define BS_NR_OF_STRINGS (3u)
92 #if (BS_NR_OF_STRINGS > REPEAT_MAXIMUM_REPETITIONS)
93 #error "Too large number of strings, please check implementation of REPEAT_U()."
101 #define BS_NR_OF_MODULES (1u)
109 #define BS_NR_OF_CELLS_PER_MODULE (18u)
117 #define BS_NR_OF_PARALLEL_CELLS_PER_MODULE (1u)
119 #if BS_NR_OF_CELLS_PER_MODULE <= 12u
120 #define BS_MAX_SUPPORTED_CELLS (12u)
121 #elif BS_NR_OF_CELLS_PER_MODULE <= 15u
122 #define BS_MAX_SUPPORTED_CELLS (15u)
123 #elif BS_NR_OF_CELLS_PER_MODULE <= 16u
124 #define BS_MAX_SUPPORTED_CELLS (16u)
125 #elif BS_NR_OF_CELLS_PER_MODULE <= 18u
126 #define BS_MAX_SUPPORTED_CELLS (18u)
127 #elif BS_NR_OF_CELLS_PER_MODULE == 36u
128 #define BS_MAX_SUPPORTED_CELLS (36u)
130 #error "Unsupported number of cells per module, higher than 18 and not 36"
139 #define BS_BALANCING_RESISTANCE_ohm (100.0)
147 #if BS_MAX_SUPPORTED_CELLS == 12u
148 #define BS_NR_OF_GPIOS_PER_MODULE (5u)
150 #define BS_NR_OF_GPIOS_PER_MODULE (9u)
158 #define BS_NR_OF_TEMP_SENSORS_PER_MODULE (8u)
161 #define BS_NR_OF_BAT_CELLS (BS_NR_OF_MODULES * BS_NR_OF_CELLS_PER_MODULE)
163 #define BS_NR_OF_TEMP_SENSORS_PER_STRING (BS_NR_OF_MODULES * BS_NR_OF_TEMP_SENSORS_PER_MODULE)
165 #define BS_NR_OF_TEMP_SENSORS (BS_NR_OF_TEMP_SENSORS_PER_STRING * BS_NR_OF_STRINGS)
168 #define BS_NR_OF_TEMP_SENSORS_ON_ADC0 (3u)
170 #define BS_NR_OF_TEMP_SENSORS_ON_ADC1 (3u)
179 #define CURRENT_SENSOR_PRESENT (false)
181 #if CURRENT_SENSOR_PRESENT == true
185 #define CURRENT_SENSOR_ISABELLENHUETTE_CYCLIC
189 #define BS_CURRENT_MEASUREMENT_RESPONSE_TIMEOUT_MS (200u)
192 #define BS_COULOMB_COUNTING_MEASUREMENT_RESPONSE_TIMEOUT_MS (2000u)
195 #define BS_ENERGY_COUNTING_MEASUREMENT_RESPONSE_TIMEOUT_MS (2000u)
205 #define BS_MAXIMUM_STRING_CURRENT_mA (10000u)
213 #define BS_MAXIMUM_PACK_CURRENT_mA (10000u * BS_NR_OF_STRINGS)
220 #define CHECK_CAN_TIMING (true)
227 #define BALANCING_DEFAULT_INACTIVE (true)
244 #define BMS_CHECK_SOF_CURRENT_LIMITS (true)
252 #define BMS_OPEN_CONTACTORS_ON_INSULATION_ERROR (false)
260 #define BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR (3u)
267 #define BS_NR_OF_VOLTAGES_FROM_MCU_ADC (2)
270 #define BS_NR_OF_CONTACTORS_OUTSIDE_STRINGS (1U)
273 #define BS_NR_OF_CONTACTORS ((2U * BS_NR_OF_STRINGS) + BS_NR_OF_CONTACTORS_OUTSIDE_STRINGS)
280 #define BS_SEPARATE_POWERLINES (1)
282 #if (BS_NR_OF_CONTACTORS > 3) && (BS_SEPARATE_POWERLINES == 0)
283 #error "Configuration mismatch: Can't use only one powerline with more than 3 contactors"
286 #if (BS_NR_OF_CONTACTORS < 4) && (BS_SEPARATE_POWERLINES == 1)
287 #error "Configuration mismatch: Can't use separate powerlines with less than 4 contactors"
294 #define BS_REST_CURRENT_mA (200)
300 #define BS_RELAXATION_PERIOD_10ms (60000u)
306 #define BS_CS_THRESHOLD_NO_CURRENT_mA (200u)
319 #define BS_MAX_VOLTAGE_DROP_OVER_FUSE_mV (500)
332 #define BS_CHECK_FUSE_PLACED_IN_NORMAL_PATH (true)
345 #define BS_CHECK_FUSE_PLACED_IN_CHARGE_PATH (false)
BS_STRING_PRECHARGE_PRESENT_e bs_stringsWithPrecharge[BS_NR_OF_STRINGS]
enum BS_STRING_PRECHARGE_PRESENT BS_STRING_PRECHARGE_PRESENT_e
enum BS_STRING_ID BS_STRING_ID_e
BS_STRING_PRECHARGE_PRESENT
@ BS_STRING_WITHOUT_PRECHARGE
@ BS_STRING_WITH_PRECHARGE
General macros and definitions for the whole platform.