60 #ifndef FOXBMS__BATTERY_SYSTEM_CFG_H_
61 #define FOXBMS__BATTERY_SYSTEM_CFG_H_
83 #define POSITIVE_DISCHARGE_CURRENT (true)
96 #define BS_NR_OF_STRINGS (1u)
99 #if (BS_NR_OF_STRINGS > GEN_REPEAT_MAXIMUM_REPETITIONS)
100 #error "Too large number of strings, please check implementation of GEN_REPEAT_U()."
110 #define BS_NR_OF_MODULES_PER_STRING (1u)
121 #define BS_NR_OF_CELL_BLOCKS_PER_MODULE (14u)
131 #define BS_NR_OF_PARALLEL_CELLS_PER_MODULE (1u)
133 #if BS_NR_OF_CELL_BLOCKS_PER_MODULE <= 12u
134 #define BS_MAX_SUPPORTED_CELLS (12u)
135 #elif BS_NR_OF_CELL_BLOCKS_PER_MODULE <= 14u
136 #define BS_MAX_SUPPORTED_CELLS (14u)
137 #elif BS_NR_OF_CELL_BLOCKS_PER_MODULE <= 15u
138 #define BS_MAX_SUPPORTED_CELLS (15u)
139 #elif BS_NR_OF_CELL_BLOCKS_PER_MODULE <= 16u
140 #define BS_MAX_SUPPORTED_CELLS (16u)
141 #elif BS_NR_OF_CELL_BLOCKS_PER_MODULE <= 18u
142 #define BS_MAX_SUPPORTED_CELLS (18u)
143 #elif BS_NR_OF_CELL_BLOCKS_PER_MODULE == 36u
144 #define BS_MAX_SUPPORTED_CELLS (36u)
146 #error "Unsupported number of cells per module, higher than 18 and not 36"
155 #define BS_BALANCING_RESISTANCE_ohm (100.0)
163 #if BS_MAX_SUPPORTED_CELLS == 12u
164 #define BS_NR_OF_GPIOS_PER_MODULE (5u)
165 #elif BS_MAX_SUPPORTED_CELLS == 14u
166 #define BS_NR_OF_GPIOS_PER_MODULE (8u)
168 #define BS_NR_OF_GPIOS_PER_MODULE (9u)
176 #define BS_NR_OF_TEMP_SENSORS_PER_MODULE (8u)
179 #define BS_NR_OF_CELL_BLOCKS_PER_STRING (BS_NR_OF_MODULES_PER_STRING * BS_NR_OF_CELL_BLOCKS_PER_MODULE)
181 #define BS_NR_OF_TEMP_SENSORS_PER_STRING (BS_NR_OF_MODULES_PER_STRING * BS_NR_OF_TEMP_SENSORS_PER_MODULE)
183 #define BS_NR_OF_TEMP_SENSORS (BS_NR_OF_TEMP_SENSORS_PER_STRING * BS_NR_OF_STRINGS)
186 #define BS_NR_OF_TEMP_SENSORS_ON_SADC0 (3u)
188 #define BS_NR_OF_TEMP_SENSORS_ON_SADC1 (3u)
197 #define CURRENT_SENSOR_PRESENT (false)
199 #if CURRENT_SENSOR_PRESENT == true
203 #define CURRENT_SENSOR_ISABELLENHUETTE_CYCLIC
207 #define BS_CURRENT_MEASUREMENT_RESPONSE_TIMEOUT_MS (200u)
210 #define BS_COULOMB_COUNTING_MEASUREMENT_RESPONSE_TIMEOUT_MS (2000u)
213 #define BS_ENERGY_COUNTING_MEASUREMENT_RESPONSE_TIMEOUT_MS (2000u)
227 #define BS_MAIN_CONTACTORS_MAXIMUM_BREAK_CURRENT_mA (500000)
237 #define BS_MAIN_FUSE_MAXIMUM_TRIGGER_DURATION_ms (30000u)
245 #define BS_MAXIMUM_STRING_CURRENT_mA (10000u)
253 #define BS_MAXIMUM_PACK_CURRENT_mA (10000u * BS_NR_OF_STRINGS)
261 #define BS_IGNORE_INTERLOCK_FEEDBACK (false)
268 #define CHECK_CAN_TIMING (true)
275 #define BALANCING_DEFAULT_INACTIVE (true)
283 #define BMS_OPEN_CONTACTORS_ON_INSULATION_ERROR (false)
291 #define BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR (3u)
298 #define BS_NR_OF_VOLTAGES_FROM_MCU_ADC (2)
301 #define BS_NR_OF_CONTACTORS_OUTSIDE_STRINGS (1u)
306 #define BS_NR_OF_CONTACTORS ((2u * BS_NR_OF_STRINGS) + BS_NR_OF_CONTACTORS_OUTSIDE_STRINGS)
312 #define BS_REST_CURRENT_mA (200)
318 #define BS_RELAXATION_PERIOD_10ms (60000u)
324 #define BS_CS_THRESHOLD_NO_CURRENT_mA (200u)
337 #define BS_MAX_VOLTAGE_DROP_OVER_FUSE_mV (500)
350 #define BS_CHECK_FUSE_PLACED_IN_NORMAL_PATH (true)
363 #define BS_CHECK_FUSE_PLACED_IN_CHARGE_PATH (false)
376 #define BS_STANDBY_PERIODIC_OPEN_WIRE_CHECK (false)
379 #define BS_STANDBY_OPEN_WIRE_PERIOD_ms (600000)
382 #define BS_NORMAL_PERIODIC_OPEN_WIRE_CHECK (false)
385 #define BS_NORMAL_OPEN_WIRE_PERIOD_ms (600000)
388 #define BS_CHARGE_PERIODIC_OPEN_WIRE_CHECK (false)
391 #define BS_CHARGE_OPEN_WIRE_PERIOD_ms (600000)
394 #define BS_ERROR_OPEN_WIRE_PERIOD_ms (30000)
FAS_STATIC_ASSERT((BS_NR_OF_STRINGS<=(uint8_t) UINT8_MAX), "This code assumes BS_NR_OF_STRINGS fits into uint8_t")
BS_STRING_PRECHARGE_PRESENT_e bs_stringsWithPrecharge[BS_NR_OF_STRINGS]
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
BS_STRING_PRECHARGE_PRESENT_e
@ BS_STRING_WITHOUT_PRECHARGE
@ BS_STRING_WITH_PRECHARGE
General macros and definitions for the whole platform.