123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478 |
- //##############################################################################
- //
- // FILE: BMS_Defines.h
- //
- // TITLE: Global Defines
- //
- //
- //##############################################################################
- //
- //==============================================================================
- // Change History:
- //==============================================================================
- // Datum: | Name | Version:| Change / Cause: | No
- //------------------------------------------------------------------------------
- // | | | | 002
- //------------------------------------------------------------------------------
- // | | | | 001
- //------------------------------------------------------------------------------
- // 05.07.13 | VR | 1.0 | New Build | 000
- //==============================================================================
- //==============================================================================
- // Comment Change / Cause:
- //==============================================================================
- // Change: 003 // 003
- //----------------------
- //
- //
- //==============================================================================
- // Change: 002 // 002
- //----------------------
- //
- //
- //==============================================================================
- // Change: 001 // 001
- //----------------------
- //
- //
- //==============================================================================
- #ifndef __BMS_DEFINES_H__
- #define __BMS_DEFINES_H__
- // **** general ******
- #define TRUE 1
- #define FALSE 0
- // ***** CAN0 FSM **********
- #define CAN0_NR_OF_TELEGRAMS 8
- #define CAN0_NR_OF_SLAVES 6
- #define CAN0_TIMEOUT_MS 4
- #define CAN0_RASTER_MS 10
- #define CAN0_COMM_CYCLE_MS 250
- #define CAN0_MAX_NR_OF_SLAVES 16
- #define CAN0_MAX_NR_OF_TIMEOUTS 3
- #define CAN0_MAX_NR_OF_FAILED_COM 4
- #define CAN0_ALL_TELEGRAMS_REC 0xff
- #define BMS_ERROR_STACK_SIZE 32
- // ***** CAN1 *************
- #define CAN1_NR_OF_WAIT_CYCLES 6
- #define CAN1_TX_TIMEOUT 3
- #define BMS_SOC_NR_OF_CHARGE_AREAS 6
- #define BMS_SOC_NR_OF_DISCARGE_AREAS 6
- #define BMS_SOC_NR_OF_REST_AREAS 6
- #define BMS_SOC_NR_OF_RI_POINTS 2
- #define BMS_SOC_MIN_CURRENT_MA 100 // 100mA minimal Charge or discharge current, prevents discharge due to long phases of non doing
- #define BMS_MAX_CURRENT_INCONSITENCY_MA 1000 // maximum difference between current measurend by UI and Inverter = 1000mA
- // ***** CAN= Modes *********
- #define BMS_NIGHT_MODE_SOC 0.45// Threshold for going into night mode
- #define BMS_WINTER_MODE_SOC 0.4// Threshold for going into winter mode
- #define BMS_WINTER_MODE_TIMEOUT 10000// Time before TURNOFF in Winter mode
- #define BMS_WINTER_MODE_RECOVER_PWR 20// minimum power from inverter to start recovering from Winter Mode
- // startup FRAM States
- #define BMS_STARTUP_FIRST_RUN 0x0001
- #define BMS_STARTUP_WINTER_MODE 0x0002
- #define BMS_STARTUP_ERROR_MODE_1 0x0004
- #define BMS_STARTUP_ERROR_MODE_2 0x0008
- #define BMS_STARTUP_ERROR_MODE_3 0x0010
- #define BMS_STARTUP_UPGRADE_SYSTEM 0x0020
- #define BMS_STARTUP_TEST_MODE 0x0040 // has to be removed in final version
- // FRAM ADDRESS
- #define BMS_STARTUP_MODE_ADDR 0x20
- #define BMS_STARTUP_SOC 0x22
- #define BMS_SLAVE_CAN_ID_VALID 0x24 // uint16_t Slave_Can_Id_valid => 2 Byte => till 0x26 occupied
- #define BMS_SLAVE_ANZ 0x26 // uint16_t Slave_Anz => 2 Byte => till 0x28 occupied
- #define BMS_SERNR 0x28 // uint8_t SerNr[17][8] => 136 Byte => till 0xB0 occupied
- #define BMS_SLAVE_CAN_ID_END 0xB0
- //#define BMS_ERROR_BUFFER1_OFFSET 0x200;
- //#define BMS_ERROR_BUFFER2_OFFSET 0x300;
- //#define BMS_ERROR_BUFFER3_OFFSET 0x400;
- //+ **** BMS TX Value IDs *****
- #define CAN1_TX_MAX_BATTERY_CHARGE_CURRENT_ID 0x1E5FCA70
- #define CAN1_TX_MAX_BATTERY_CHARGE_VOLTAGE_ID 0x6E491B50
- #define CAN1_TX_MAX_BATTERY_DISCHARGE_CURRENT_ID 0xDF0A735C
- #define CAN1_TX_MIN_BATTERY_DISCHARGE_VOLTAGE_ID 0xB0EBE75A
- #define CAN1_TX_BATTERY_CURRENT_ID 0x21961B58
- #define CAN1_TX_BATTERY_VOLTAGE_ID 0x65EED11B
- #define CAN1_TX_BATTERY_SOC_TARGET_ID 0x8B9FF008
- #define CAN1_TX_BATTERY_SOC_ID 0x959930BF
- #define CAN1_TX_BATTERY_CAPACITY 0xB57B59BD
- #define CAN1_TX_REQUESTED_VALUE_ID_ID 0x69AA598A
- #define CAN1_TX_BATTERY_TEMPERATURE 0x902AFAFB
- #define CAN1_TX_BATTERY_SOH 0x381B8BF9
- #define CAN1_TX_BATTERY_STATUS 0x71765BD8
- #define CAN1_TX_CELL_STATUS 0xD143A391
- #define CAN1_TX_BATTERY_MODE 0x11111111
- #define CAN1_TX_BATTERY_STATUS_EXTRA 0x0DE3D20D
- // ***** BMS RX VALUE IDS
- #define CAN1_RX_ACTUAL_AC_POWER_ID 0xDB2D69AE
- #define CAN1_RX_PHASE_L1_VOLTAGE 0xCF053085
- #define CAN1_RX_PHASE_L2_VOLTAGE 0x54B4684E
- #define CAN1_RX_PHASE_L3_VOLTAGE 0x2545E22D
- #define CAN1_RX_DC_INPUT_A_VOLTAGE 0xB298395D
- #define CAN1_RX_DC_INPUT_B_VOLTAGE 0x5BB8075A
- #define CAN1_RX_ISLAND_MODE 0x3623D82A
- #define CAN1_RX_DC_INPUT_A_POWER 0xDB11855B
- #define CAN1_RX_DC_INPUT_B_POWER 0x0CB5D21B
- #define CAN1_RX_TOTAL_DC_PWR 0xE31F8B17
- #define CAN1_RX_BATTERY_CURRENT 0x0AFDD6CF
- #define CAN1_RX_BATTERY_VOLTAGE 0x97E3A6F2
- #define CAN1_NR_OF_REQUEST_TELEGRAMS 4
- // ***** SLAVE OPERATION MODE
- #define BMS_SLAVE_STAND_BY 0x1
- #define BMS_SLAVE_CAL_Test 0x2
- #define BMS_SLAVE_RUN 0x4
- #define BMS_SLAVE_ERROR 0x8
- #define BMS_SLAVE_RESET 0x10
- #define BMS_SLAVE_DATA_OK 0x0
- #define BMS_SALVE_DATA_ERROR_ALIVE_CNT 0x1
- #define BMS_SLAVE_DATA_ERROR_ALIVE_TIMEOUT 0x2
- #define BMS_SLAVE_DATA_ERROR_VOLTAGE_LIMIT 0x4
- #define BMS_SLAVE_DATA_ERROR_TEMP_LIMIT 0x8
- #define BMS_SLAVE_DATA_ERROR_HEAT_SINK_LIMIT 0x10
- #define BMS_SLAVE_DATA_ERROR_BOARD_ELECTRONIC 0x20
- #define BMS_SLAVE_DATA_ERROR_OVER_VOLTAGE 0x40
- #define BMS_SLAVE_DATA_ERROR_UNDER_VOLTAGE 0x80
- // ******** BMS Error Stack *********** //
- #define BMS_ERROR_STACK_DATA_OK 0
- #define BMS_ERROR_STACK_SLAVE_OVER_VOLTAGE 0x001
- #define BMS_ERROR_STACK_SLAVE_UNDER_VOLTAGE 0x002
- #define BMS_ERROR_STACK_SLAVE_OVER_TEMP_CHARGE 0x004
- #define BMS_ERROR_STACK_SLAVE_UNDER_TEMP_CHARGE 0x008
- #define BMS_ERROR_STACK_SLAVE_OVER_TEMP_DISCHARGE 0x010
- #define BMS_ERROR_STACK_SLAVE_UNDER_TEMP_DISCHARGE 0x020
- #define BMS_ERROR_STACK_SLAVE_TEMP_DIFFERENCE 0x040
- #define BMS_ERROR_STACK_SLAVE_TEMP_BOARD 0x080
- #define BMS_ERROR_STACK_SLAVE_SPI_ERROR 0x100
- #define BMS_ERROR_STACK_SLAVE_LTC_TIMING 0x200
- #define BMS_ERROR_STACK_SLAVE_LTC_SELF_TEST 0x400
- #define BMS_ERROR_STACK_SLAVE_CAN_ERROR 0x800
- #define BMS_ERROR_STACK_UI_OK 0
- #define BMS_ERROR_STACK_UI_CAN_ERROR 0x01
- #define BMS_ERROR_STACK_UI_OVER_CURRENT 0x02
- #define BMS_ERROR_STACK_UI_CURRENT_INCONSIST 0x04
- #define BMS_ERROR_STACK_UI_VOLTAGE_INCONSIST 0x08
- #define BMS_ERROR_STACK_UI_OVER_VOLTAGE 0x10
- #define BMS_ERROR_STACK_UI_SUPPLY_VOLTAGE 0x20
- #define BMS_ERROR_STACK_UI_OFFSET_ERROR 0x40
- #define BMS_ERROR_STACK_UI_RELAY_OPEN 0x80
- #define BMS_ERROR_STACK_MASTER_OK 0
- #define BMS_ERROR_STACK_MASTER_VCC_12V 0x001
- #define BMS_ERROR_STACK_MASTER_VCC_3V3 0x002
- #define BMS_ERROR_STACK_MASTER_UMIN_1 0x004
- #define BMS_ERROR_STACK_MASTER_UMIN_2 0x008
- #define BMS_ERROR_STACK_MASTER_UMIN_3 0x010
- #define BMS_ERROR_STACK_MASTER_UMAX_1 0x020
- #define BMS_ERROR_STACK_MASTER_UMAX_2 0x040
- #define BMS_ERROR_STACK_MASTER_UMAX_SYSTEM 0x080
- #define BMS_ERROR_STACK_MASTER_VOLTAGE_INCONSIT 0x100
- #define BMS_ERROR_STACK_MASTER_EXTERN_CAN_ERROR 0x200
- #define BMS_ERROR_STACK_MASTER_FLASH 0x400
- #define BMS_ERROR_STACK_MASTER_I_MAX_DISCHARGE_OP 0x800
- #define BMS_ERROR_STACK_MASTER_I_MAX_CHARGE_OP 0x1000
- #define BMS_ERROR_STACK_MASTER_UMAX_3 0x2000
- #define BMS_ERROR_STACK_MASTER_INVERTER_CONNECT_SHORT_CIRCUIT 0x4000
- #define BMS_ERROR_STACK_MASTER_INVERTER_CONNECT_LS_STUCK 0x8000
- // BMS ERROR HANDLING
- #define BMS_ERROR_ERROR_STACK_SIZE 32 // 32 Error Entries possible
- #define BMS_ERROR_BUFFER1_OFFSET 0x200;
- #define BMS_ERROR_BUFFER2_OFFSET 0x300;
- #define BMS_ERROR_BUFFER3_OFFSET 0x400;
- #define BMS_ERROR_CLASS_1 1
- #define BMS_ERROR_CLASS_2 2
- #define BMS_ERROR_CLASS_3 3
- #define BMS_ERROR_UI_ID 15
- #define BMS_ERROR_MASTER_ID 16
- #define BMS_ERROR_FSM_ES2_TIMEOUT 300000 // 30s timeout at error state 2
- #define BMS_ERROR_FSM_ES3_TIMEOUT 300000 // 30s min timeout at error state 3
- #define BMS_ERROR_RESTORE_TIMEOUT 300000 // 5 Minutes for Inverter to clear Error
- #define BMS_SOC_LOW_MARK 0.1
- #define BMS_SOC_UMIN_1_DERATE 3000
- #define BMS_SOC_UMIN_1 2975
- #define BMS_SOC_UMIN_2 2900
- #define BMS_SOC_UMIN_3 2800
- #define BMS_SOC_UMAX_1 3500
- #define BMS_SOC_UMAX_2 3550
- #define BMS_SOC_UMAX_3 3600
- #define BMS_ERROR_THRESHOLD_UMAX_SYSTEM 610000 // Umax System = 610V
- #define BMS_ERROR_THRESHOLD_T_DISCHARGE_MIN -10
- #define BMS_ERROR_THRESHOLD_T_DISCHARGE_MAX 60
- #define BMS_ERROR_THRESHOLD_T_HEATSINK_MIN -20
- #define BMS_ERROR_THRESHOLD_T_HEATSINK_MAX 80
- #define BMS_CAN_ID_INIT_RETURN_RUNNING 0
- #define BMS_CAN_ID_INIT_RETURN_COMPLETE 1
- #define BMS_CAN_ID_INIT_RETURN_ERROR 2
- #define BMS_CONNECT_VOLTAGE_EQUAL_MARGIN 0.05 // 5% Voltage difference is ok
- #define BMS_CONNECT_VOLTAGE_TEST_MARGIN_MV 10000 // 10V difference is ok
- // ********* ERROR STATES *****************
- // ****** min max operatrion borders ******
- #define BMS_SLAVE_MAX_TEMP 45
- #define BMS_SLAVE_MIN_TEMP 5
- #define BMS_SLAVE_MAX_CELL_VOLTAGE 3600
- #define BMS_SLAVE_MIN_CELL_VOLTAGE 2800
- #define BMS_SLAVE_MAX_CURRENT 25000
- #define BMS_SLAVE_BATTERY_CHARGE_THERESOLD -50
- #define BMS_SLAVE_MAX_BALANCE_VOLTAGE 3400
- #define BMS_SLAVE_MIN_BALANCE_SOC 0.8 // start balancing at 80% SoC
- #define BMS_SLAVE_MAX_BALANCE_HEATSINK_TEMP 45 // Balance to maximum board Temperature of 45 deg celcius
- // ******* SOC ESTIMATOR CONSTANTS *********
- #define BMS_SOC_SMOOTH_APPROACH_THRESHOLD 0.01 // one percent
- #define BMS_SOC_DERATE_CHARGE_THRESHOLD_SOC 0.9 // start disrating at 90% SoC
- #define BMS_SOC_DERATE_CHARGE_THRESHOLD_VOLTAGE 3450 // start dreating at 3450mV
- #define BMS_SOC_DERATE_DISCHARGE_THRESHOLD_SOC 0.1 // start disrating at 10% SoC
- #define BMS_SOC_DERATE_DISCHARGE_THRESHOLD_VOLTAGE 3000 // start dreating at 3000mV
- #define BMS_SOC_CHARGE_MAX_CURRENT BMS_SLAVE_MAX_CURRENT/1000
- #define BMS_SLAVE_MAX_CURRENT_A BMS_SLAVE_MAX_CURRENT/1000.0
- #define BMS_SOC_NR_OF_AREAS 5
- #define BMS_SOC_FLAG_SOC_100 0x0001
- #define BMS_SOC_FLAG_SOC_HIGH 0x0002
- #define BMS_SOC_FLAG_SOC_0 0x0004
- #define BMS_SOC_FLAG_SOC_LOW 0x0008
- #define BMS_SOC_CHARGE_SMOOTH_99 0x0001 // SoC at 99%
- #define BMS_SOC_CHARGE_SMOOTH_OVERSHOOT 0x0002 // Coulumb counting too fast
- #define BMS_SOC_CHARGE_SMOOTH_UNDERSHOOT 0x0004 // Coulumb counting too slow
- #define BMS_SOC_DISCHARGE_SMOOTH_01 0x0008 // SoC at 1%
- #define BMS_SOC_DISCHARGE_SMOOTH_OVERSHOOT 0x0010 // Coulumb counting too fast
- #define BMS_SOC_DISCHARGE_SMOOTH_UNDERSHOOT 0x0020 // Coulumb counting too slow
- // ***** FSM *******************************************************************
- #define EV__ERROR 0x0001
- #define EV__STAND_BY 0x0004
- #define EV__INITIALISE 0x0008
- #define EV__DRIVE_START_1 0x0010
- #define EV__DRIVE_START_2 0x0020
- #define EV__DRIVE_START_3 0x0040
- #define EV__DRIVE_START_4 0x0080
- #define EV__DRIVE 0x0100
- #define EV__DRIVE_DELAY 0x0200
- #define EV__SHUT_DOWN_DRIVE 0x0400
- #define EV__CHARGE 0x0800
- #define EV__CHARGE_CC 0x1000
- #define EV__CHARGE_CV 0x2000
- #define EV__CHARGE_DELAY 0x4000
- #define EV__SHUT_DOWN_CHARGE 0x8000
- // ***** Error FSM *************************************************************
- #define EEV__NO_ERROR 0x0000
- #define EEV__SHUT_DOWN_EMERGENCY 0x0001
- #define EEV__ALL_OFF 0x0002
- #define EEV__SHUT_DOWN_CHARGE 0x0004
- #define EEV__CHARGE_OFF 0x0008
- #define EEV__DEGRADATION 0x0010
- #define EEV__DEGRADATION_ON 0x0020
- // ***** MODE REQUEST 6 FEEDBACK ***********************************************
- #define MF__STANDBY 0x0000
- #define MF__DRIVE 0x0001
- #define MF__CHARGE 0x0002
- #define MF__ERROR 0x0008
- #define MF__END_OF_CHARGE 0X0004
- #define MR__STANDBY MF__STANDBY
- #define MR__DRIVE MF__DRIVE
- #define MR__CHARGE MF__CHARGE
- // ***** Slave *****************************************************************
- #define MAX_CELLS 120
- #define MAX_SLAVE_CELLS 24
- #define MAX_SLAVES MAX_CELLS / MAX_SLAVE_CELLS
- #define MAX_SLAVES_INDEX MAX_SLAVES -1
- #define LOOP_TIME 9000
-
- #define CYCLE_TIME_BALANCER 20
- #define CYCLE_TIME_VOLTAGE 30
- #define CYCLE_TIME_STATUS 100
- #define CYCLE_TIME_UI 100
- #define CYCLE_TIME_TEMPERATURE 1000
-
- #define MAX_COUNT_VOLTAGE LOOP_TIME / CYCLE_TIME_VOLTAGE
- #define MAX_COUNT_STATUS LOOP_TIME / CYCLE_TIME_STATUS
- #define MAX_COUNT_UI LOOP_TIME / CYCLE_TIME_UI
- #define MAX_COUNT_TEMPERATURE LOOP_TIME / CYCLE_TIME_TEMPERATURE
- #define MAX_COUNT_BALANCER 100
- #define MIN_COUNT_BALANCER 5 // dV = 12mV
- #define SLAVE_BALANCE_MIN_DELTA_U_MV 20 // dV_min = 10mV
-
- #define UI_VOLTAGE_FIFO_SIZE 60 // one minute of Voltage values
- #define UI_CURRENT_FIFO_SIZE 60 // one minute of Current values
- #define SOC_SMOOTH_FIFO_SIZE 10
- #define INVERTER_VOLTAGE_FIFO_SIZE 200 // approximatlely 1 minute of Battery voltage measured by Inverter
- #define INVERTER_CURRENT_FIFO_SIZE 200 // approximately 1 minute of Battery current measured by Inverter
- // ***** Relais ****************************************************************
- #define RELAIS_ON 1
- #define RELAIS_OFF 0
- #define HS_RELAIS 5
- #define LS_RELAIS 0
- #define PRE_CHARGE_RELAIS 6
- #define PWR_SUPPLY 8
- #define VBAT_RELAIS 7
-
- // **** Inverter Connect Constants ***
- #define UI_VOLTAGE_STABILITY_CHECK 20 // nr of voltages to be checked for stability (5 seconds)
- #define UI_VOLTAGE_STABILITY_MAX_DEVIATION 3 // 3V min max
- #define CONNECT_INVERTER_MIN_WAIT_TIME_MS 5000 // 5s minimum wartezeit
- #define CONNECT_INVERTER_MAX_WAIT_TIME_MS 10000 // 10s maximum waittime
- #define CONNECT_INVERTER_WAIT_FOR_HS_TO_CLOSE_MS 2000 // 2s for HS relay to be closed
- #define CONNECT_INVERTER_SHORT_CIRCUIT_TEST_VOLTAGE 100000.0 // 100000mV
- // ***** Cell Errors ***********************************************************
- #define ERROR_MAX_CELL_VOLTAGE 0x0001
- #define ERROR_MIN_CELL_VOLTAGE 0x0002
- #define ERROR_DELTA_CELL_VOLTAGE 0x0004
- #define ERROR_MAX_CELL_TEMPERATURE 0x0008
- #define ERROR_MIN_CELL_TEMPERATURE 0x0010
- #define ERROR_DELTA_CELL_TEMPERATURE 0x0020
- #define ERROR_MAX_LOAD_CELL_VOLTAGE 0x0040
- #define ERROR_PRE_CELL_LOW_VOLTAGE 0x0080
- #define ERROR_PRE_CELL_OVERHEAT 0x0100
- #define MAX_COUNT_MSG_VOLTAGE 0x3FFFFFFF // 5 Slaves x 6 MSG -> BitMask = 2^(30-1)
- #define MAX_COUNT_MSG_TEMPERATURE 0x00007FFF // 5 Slaves x 3 MSG -> BitMask = 2^(15-1)
- #define MAX_COUNT_MSG_STATUS 0x0000001F // 5 Slaves x 1 MSG -> BitMask = 2^( 5-1)
- // ***** Slave Errors **********************************************************
- #define ERROR_SLAVE_CAN 0x0001
- #define ERROR_MAX_LTC_TEMP 0x0002
- #define ERROR_MIN_LTC_TEMP 0x0004
- #define ERROR_MAX_HEATSINK_TEMPERATURE 0x0008
- #define ERROR_SLAVE_PEC 0x0010
- #define ERROR_SLAVE_SELFTEST 0x0020
-
- // ***** UI Errors *************************************************************
- #define ERROR_MAX_UI_VOLTAGE 0x0001
- #define ERROR_MIN_UI_VOLTAGE 0x0002
- #define ERROR_MAX_UI_CURRENT 0x0004
- #define ERROR_MIN_UI_CURRENT 0x0008
- #define ERROR_UI_PEC_NOK 0x0010
- #define ERROR_VOLTAGE_FRAME_LOST 0x0020
- #define ERROR_STATUS_FRAME_LOST 0x0040
- #define ERROR_TEMPERATURE_FRAME_LOST 0x0080
- #define ERROR_UI_FRAME_LOST 0x0100
- #define ERROR_ISO_GENERAL 0x0200
- #define ERROR_ISO_BAD 0x0400
- #define ERROR_ISO_LOW 0x0800
- // ***** Slave Boarders ********************************************************
- #define MAX_CELL_VOLTAGE 4201
- #define MAX_CELL_VOLTAGE_TEST MAX_CELL_VOLTAGE + 50
- #define PRE_CELL_LOW_VOLTAGE 3100
- #define MIN_CELL_VOLTAGE 2999
- #define MIN_CELL_VOLTAGE_TEST MIN_CELL_VOLTAGE - 50
- #define DELTA_CELL_VOLTAGE 500
- #define DELTA_CELL_VOLTAGE_TEST DELTA_CELL_VOLTAGE + 50
- #define MAX_LOAD_CELL_VOLTAGE 4150
- #define MIN_LOAD_CELL_CURRENT 400 // 4A
- #define MAX_SOC 144000000 // 40Ah (x3600sec x 10(=>mA))
- #define MAX_UI_VOLTAGE 5040
- #define MAX_UI_VOLTAGE_TEST MAX_UI_VOLTAGE + 10
- #define MIN_UI_VOLTAGE 3600
- #define MIN_UI_VOLTAGE_TEST MIN_UI_VOLTAGE - 10
- #define MAX_UI_DRIVE_CURRENT 12000
- #define MIN_UI_LOAD_CURRENT -4000
- #define MAX_CELL_TEMPERATURE 60
- #define MAX_CELL_TEMPERATURE_TEST MAX_CELL_TEMPERATURE + 1
- #define PRE_CELL_OVERHEAT 50
- #define MIN_CELL_TEMPERATURE -30
- #define MIN_CELL_TEMPERATURE_TEST MIN_CELL_TEMPERATURE - 1
- #define DELTA_CELL_TEMPERATURE 5
- #define DELTA_CELL_TEMPERATURE_TEST DELTA_CELL_TEMPERATURE + 1
- #define MAX_HEATSINK_TEMPERATURE 70
- #define MAX_HEATSINK_TEMPERATURE_TEST MAX_HEATSINK_TEMPERATURE + 1
- #define MIN_ISO_R 20 // kOhm
- #define MIN_ISO_R_TEST MIN_ISO_R - 1 // kOhm
-
- #define MAX_AVE 4
- #define MAX_AVE_SHIFT 2 // >> 2 = / 4
- #define MAX_PRECHARGE_VOLTAGE 50 // 5V
- #define MIN_SHUTDOWN_VOLTAGE 600 // 60V
- #define RELAIS_SETTLING_TIME 19 // 19ms
- #define START_RETRY_DELAY 60000 // 1min
- #define STOP_VOLTAGE_DECLINE_DELAY 50 // 50ms
- #define DELAY_START 10000 // 1000ms
- // ***** CAN0 Telegram *********************************************************
- #define CAN0_VOLTAGE_TELEGRAM_SIZE 6
- #define CAN0_TEMPERATURE_TELEGRAM_SIZE 3
- #define CAN0_STATUS_TELEGRAM_SIZE 1
- #define CAN0_BALANCING_TELEGRAM_SIZE 1
- #define CAN0_UI_TELEGRAM_SIZE 1
- // ***** CAN1 BRUSA ************************************************************
- #define NLG5_MAINS_CURRENT 500 // 50A
- #define NLG5_OUTPUT_VOLTAGE 5000 // 500V
- #define NLG5_OUTPUT_CURRENT 400 // 40A
- #endif /* ifndef*/
|