Open nitrousnrg opened 2 years ago
Update:
Math says that precharge current will never be above 350mA, so we can set the precharge current threshold to 300mA (15% margin).
Testing showed that disconnecting precharge resistors based on the resistor temperature monitoring does not work. Temp sensing is too slow and we only have less than 100msec to handle a short circuit, so we will have to use a timeout as primary short circuit countermeasure.
@diegosarli when the AFE detects a shortcircuit, the BMS retries the connection for a few times.
Those retries should be through the precharge resistor. If we just turn on the big mosfets we are producing a huge, avoidable current inrush.
With @Pedro533 we have been working on a hardware solution that eliminates sparks upon connection.
This is the logic that we should implement behind it:
By default, when no fault is present:
When a capacitive load is connected (like a motor controller DC Link)
the MCU will get a rising edge at pin WKUP2 that shall wake it up from standby.
Upon wakeup the MCU has to monitor the precharge current at ADC1_IN1 and when that current is below PRECHARGE_CURRENT_THRESHOLD (this value is TBD, but let's start with 100mA) it shall set DSC pin ON and PRECHARGE_EN. In this state all fault handling logic (UV, OV, OT, SC, etc) would work as we outlined before. Transfer Function is TF=0.5[A/V] so 1V at the ADC represents 500mA.
If the connected load is a short circuit, the PRECHARGE_CURRENT_THRESHOLD condition will never be met so we have to monitor for resistor temperature at ADC1_IN16. If temperature goes above PRECHARGE_TEMP_MAX we set DSC=OFF and PRECHARGE_EN=OFF until the resistor cools down 20% (use PRECHARGE_TEMP_HYST to set the 20% hysteresis). Same NTC sensing as the other channels. Make sure the resistor doesn't get too hot, there will be some delay in the temperature measurement.
All this logic is luna_bms specific, so it should be handled in luna_bms.c and luna_bms.h