Periodic BMS reset - dalathegreat/Battery-Emulator GitHub Wiki
Why is Period Reset needed?
Some EV batteries are not able to operate 24/7 nonstop under all conditions. Over time the SOC% will become less and less accurate, and in some integrations like the Nissan LEAF, even the GIDS (Wh remaining) becomes confused (see Issue 86). Balancing also becomes a problem on some packs.
Batteries that benefit from Periodic Reset
- Nissan LEAF
Taking it into use
The solution is to periodically reset the 12V power going into the BMS. This can be automated by using the PERIODIC_BMS_RESET
feature available in USER_SETTINGS. When this is enabled, a GPIO pin (See the HAL file for your hardware to see which pin), will be toggled ON upon start, and after 24 hours it will turn off for 30s. When the power is cut to this pin, the emulator is put into Paused state, meaning no CAN messages will be sent towards the battery, and the charge/discharge limits will go to 0W. After the 30 seconds have passed, power is turned back on to the pin, and the emulator is unpaused. This 3.3V pin can be used to control the 12V power going into the BMS via an SSR or other type of relay.
This makes it possible to use the problematic BMS (like Nissan LEAF batteries) continuously, without any worry of SOC% drifting overtime.
Periodic reset at specific time intervals
By default the PERIODIC_BMS_RESET feature will reset 24h after the Battery-Emulator was last powercycled. For a more refined reset, for instance in the middle of the night when no sun is shining and you can afford the small downtime, you can use the PERIODIC_BMS_RESET_AT
feature.
To use this functionality, the Battery-Emulator needs to be connected to a Wifi network to get a NTP timeserver. Failure to read time at startup will trigger an event, letting you know that establishing accurate time via NTP failed.
Successful startup:
For instance, setting the following configuration:
#define PERIODIC_BMS_RESET_AT 525
Will make the BMS reset everyday at 05:25
[!NOTE]
Exposing the Battery-Emulator to the internet can be harmful. If cybersecurity is a concern, consider using just the normal PERIODIC_BMS_RESET feature