Diagnostic
info
- Only BMS1 have RTC clock. Use
sync_time.cmdcommand to synchronize the time between PC and BMS. (Avaliable in cmd folder in the SWTools) - You can set the time also for BMS3, but the internal oscilator is not as precise as the RTC clock and the time will drift.
Print debug information
To print debug information, you can use the wtf command in the term. The command will print the debug information in the terminal, this is example output:
BMS#>wtf
== BMS info ==
Error: 0
State: STBY
== Baterry info ==
Voltage: 50.26 [V]
Current: -0.02 [A]
Cell min voltage: 3614 [mV]
Cell max voltage: 3625 [mV]
Cell diff voltage: 11 [mV]
Temperature batt: 22.5 [C]
Temperature BMS: 28.5 [C]
= Best state =
SOC: 31 [%]
= Balancer state =
NONE
= Switch state =
Ports: 0
= Limiter state =
Cell voltage MIN
= Wake source log =
1 - CAN
1 - CAN
4096 - BTN
= Protect/uv/ov source log =
2 - Shortcut
2 - Shortcut
2 - Shortcut
= Fail/error source log =
0 - NONE
0 - NONE
0 - NONE
= MCU reset reason =
SWrst
tip
If you call wtf 6, you will print the debug information for 6 logs in the past. There are 20 logs stored in the BMS.
Understanding the wtf output
| Section | Meaning |
|---|---|
| BMS info | Current error code (hw_error, see hardware status) and current state (short printed name) |
| Battery info | Pack voltage/current and min/max cell voltages, battery and BMS temperatures |
| Best state | State of charge estimation |
| Balancer state | Decoded balState - see balancing states |
| Switch state | State of the ports (bit 1: DSC on, bit 2: CHG on) |
| Limiter state | Decoded limit word - what is currently limiting the current, see limitation |
| Wake source log | Decoded wakeSources history - see sleep and wake |
| Protect/uv/ov source log | Decoded protectLog permanent - why the BMS entered the PROTECT/UV/OV state, see PROTECT state |
| Fail/error source log | Decoded errorLog permanent - why the BMS entered the FAIL/ERROR state, see FAIL/ERROR state |
| MCU reset reason | Decoded RCC_CSR state - why the MCU was last reset (SWrst: software reset, POR/PDR: power-on reset, IWDG/WWDG: watchdog, NRST: reset pin, Low-power) |
BMS Log Messages
This is description of the log messages. The messages are printed in the terminal when they happen. You can also see the log messages by
|2022-02-16 12:03:47 IDLE Shortcut| [err| drv: 0, bal: 0] [44% 51.8600V 0.0A, min: 3723mV 21C, max: 3742mV 21C]
The log line contains the following fields:
| Field | Example | Meaning |
|---|---|---|
| Timestamp | 2022-02-16 12:03:47 | Time of the event (see the RTC note above) |
| State | IDLE | State of the BMS at the moment of the event (short name) |
| Event | Shortcut | What happened - a decoded protect/error reason or a named event |
drv | drv: 0 | Driver error code at the time of the event |
bal | bal: 0 | Balancer error code at the time of the event |
| SOC, voltage, current | 44% 51.8600V 0.0A | State of charge, pack voltage and pack current |
min / max | min: 3723mV 21C | Lowest/highest cell voltage and battery temperature at the time of the event |