|
7 | 7 | #define FEB_NUM_ICPBANK 1 |
8 | 8 |
|
9 | 9 | // Number of banks in the system |
10 | | -#define FEB_NBANKS 1 |
| 10 | +#define FEB_NBANKS 10 |
11 | 11 |
|
12 | 12 | // Total number of ICs in the daisy chain |
13 | 13 | #define FEB_NUM_IC (FEB_NUM_ICPBANK * FEB_NBANKS) |
|
80 | 80 | // Cell temperature limits (in deci-Celsius, 1 dC = 0.1°C) |
81 | 81 | #define FEB_CELL_MAX_TEMP_DC 600 // 60.0°C maximum cell temperature |
82 | 82 | #define FEB_CELL_MIN_TEMP_DC -200 // -20.0°C minimum cell temperature |
83 | | -#define FEB_CONFIG_CELL_SOFT_MAX_TEMP_dC 550 // 55.0°C soft limit for charging |
| 83 | +#define FEB_CONFIG_CELL_SOFT_MAX_TEMP_dC 400 // 40.0°C soft limit (stop charging; also gates balancing) |
84 | 84 |
|
85 | 85 | // Error thresholds (consecutive violations before triggering fault) |
86 | 86 | #define FEB_VOLTAGE_ERROR_THRESH 3 // Trigger fault after 3 consecutive voltage violations |
87 | | -#define FEB_TEMP_ERROR_THRESH 5 // Trigger fault after 5 consecutive temp violations |
| 87 | +// Per-sensor consecutive out-of-range scans before latching a temp fault. This |
| 88 | +// is checked PER SENSOR against the uint8_t temp_violations[] counter, so it |
| 89 | +// must stay small: ANY single cell over/under limit must fault — we never wait |
| 90 | +// for a fraction of the pack to overheat. (A pack-wide 0.8*N aggregate here was |
| 91 | +// both wrong semantically and unreachable: 0.8*42*10=336 > uint8_t max.) |
| 92 | +#define FEB_TEMP_ERROR_THRESH 3 // Trigger fault after 3 consecutive temp violations |
| 93 | + |
| 94 | +// Temperature scan cadence and FSAE fault-timing budget. |
| 95 | +// The temp scan (FEB_ADBMS_Temperature_Process) is gated to this period in |
| 96 | +// FEB_Task_ADBMS.c. FSAE requires the AMS to open the shutdown circuit within |
| 97 | +// ~1 s of an out-of-range cell temperature (and within 1 s of a temp sense-wire |
| 98 | +// disconnect). The per-sensor debounce above latches in at most |
| 99 | +// (FEB_TEMP_ERROR_THRESH + 1) scans; the static assertion proves that stays |
| 100 | +// under budget, so it cannot silently regress if the period or threshold changes. |
| 101 | +#define FEB_TEMP_SCAN_PERIOD_MS 100 // temperature scan cadence (10 Hz) |
| 102 | +#define FEB_TEMP_FAULT_BUDGET_MS 900 // margin under the 1 s FSAE temperature window |
| 103 | +_Static_assert((FEB_TEMP_ERROR_THRESH + 1) * FEB_TEMP_SCAN_PERIOD_MS <= FEB_TEMP_FAULT_BUDGET_MS, |
| 104 | + "Over/under-temp fault must latch within the FSAE temperature window"); |
| 105 | + |
| 106 | +// Temperature-telemetry-loss fail-safe (FSAE: a disconnected temperature sense |
| 107 | +// wire must open the shutdown circuit within 1 s). If fewer than |
| 108 | +// FEB_TEMP_MIN_VALID_FRACTION of the POPULATED sensors read in-range for longer |
| 109 | +// than FEB_TEMP_TELEMETRY_TIMEOUT_MS, validate_temps() latches a sensor fault. |
| 110 | +// NOTE: *_POPULATED_PER_BANK is a HARDWARE FACT — set it to the number of |
| 111 | +// thermistors actually wired per bank. The array holds FEB_NUM_TEMP_SENSORS=42, |
| 112 | +// but index 39 (MUX6[4]) is unconnected by design, so 41 are expected. A wrong |
| 113 | +// value here either false-trips or under-protects. |
| 114 | +#define FEB_TEMP_SENSORS_POPULATED_PER_BANK 41 // VERIFY against the harness |
| 115 | +#define FEB_TEMP_MIN_VALID_FRACTION 0.50f // TUNE: fault below this fraction valid |
| 116 | +#define FEB_TEMP_TELEMETRY_TIMEOUT_MS 800 // sustained low reads this long -> fault (< 1 s) |
88 | 117 |
|
89 | 118 | // ********************************** Charging Limits (SN4-derived) ************** |
90 | 119 | // Used by FEB_CAN_Charging_Status(). Soft limit -> stop charging and return to |
91 | 120 | // BATTERY_FREE; hard limit -> FAULT_CHARGING. SN5 values (do not copy SN4's |
92 | 121 | // pack-specific thermal numbers verbatim). |
93 | 122 | #define FEB_CONFIG_CELL_HARD_MAX_VOLTAGE_mV 4200 // Hard cell over-voltage -> FAULT_CHARGING |
94 | 123 | #define FEB_CONFIG_CELL_SOFT_MAX_VOLTAGE_mV 4180 // TUNE: soft target -> stop charge |
95 | | -#define FEB_CONFIG_CELL_HARD_MAX_TEMP_dC 600 // 60.0C hard over-temp -> FAULT_CHARGING |
96 | | -// (soft charge temp limit FEB_CONFIG_CELL_SOFT_MAX_TEMP_dC defined above = 550) |
| 124 | +#define FEB_CONFIG_CELL_HARD_MAX_TEMP_dC 450 // 45.0C hard charge over-temp -> FAULT_CHARGING |
| 125 | +// Charge thermal limits are stricter than the 60.0C discharge ceiling |
| 126 | +// (FEB_CELL_MAX_TEMP_DC): Li-ion charge accept tops out ~45C. Soft limit |
| 127 | +// (FEB_CONFIG_CELL_SOFT_MAX_TEMP_dC, 40.0C above) stops charge with margin |
| 128 | +// before this hard fault. |
97 | 129 |
|
98 | 130 | // Pack hard-max voltage in VOLTS (compared against pack/IVT voltage in volts). |
99 | 131 | #define FEB_CONFIG_PACK_HARD_MAX_VOLTAGE_V \ |
|
189 | 221 | // readings and diagnostics remain visible; only enforcement is suppressed. |
190 | 222 | // Logs warnings at boot while enabled. NEVER enable with a real pack. |
191 | 223 | #ifndef FEB_BMS_DISABLE_ADBMS_CHECKS |
192 | | -#define FEB_BMS_DISABLE_ADBMS_CHECKS 1 |
| 224 | +#define FEB_BMS_DISABLE_ADBMS_CHECKS 0 |
193 | 225 | #endif |
194 | 226 |
|
195 | 227 | #if FEB_BMS_DISABLE_ADBMS_CHECKS |
|
0 commit comments