WST CANBus Specification V4 5
WST CANBus Specification V4 5
Intro
This specification outlines new functionality, that has been added to our firmware. Please enquire with us to learn
which firmware version you need for your battery, to enable the new features.
The new functionality is an addition to the existing protocol, so we maintain backwards compatibility.
The new functionality will be referred to as Protocol 2, while the old functionality will be referred to as Protocol 1.
Please notice that the BMS will sleep to conserve power. The time before sleep varies with different firmware’s
usually 2-5 min.
Therefore, before doing any communication with the batteries, please ensure to “wake” them up by transmitting a
frame like this:
Description ID Data
MASTER Wake up batteries 0x004 [0x00]
If this id is used by other nodes on the bus, another one can be chosen. Please use an ID that is not used for
anything else on bus.
250kb/s is the default bitrate, we use 11bit frame ID’s and we do not use remote frames.
Big endian
Unless specified, all multi-byte values are packed in big-endian.
Protocol 1
Get realtime data
The following data is available over CANBus and can be retrieved by sending a frame with the ID’s seen below.
The ID’s can be changed by flashing the appropriate firmware or using protocol 2, if it is available. Assigning
node_id’s is relevant if communication with multiple packs on the same bus is desired.
Data
# Frame ID Data Description Offset Unit Min value Max value
Length
Frame Data
# Data Description Offset Unit Min value Max value
ID Length
A 0x20A N/A
Multiple
F 0x20F frames – 8 Retrieve Log
byte each See further down for specifications
SoC
The SoC is the ratio between remaining capacity and the full-capacity.
The BMS uses two different methods for calculating the State of charge. If it has had time to gather enough data
via the internal shunt, it will use this to calculate the SoC. If not, a simple voltage estimation will be used.
Remaining Capacity
The remaining capacity, or rem-cap, is the expected remaining capacity in the battery before UV protection kicks
in. See SoC above.
SoH
SoH is calculated as full-cap/design-cap.
Design-cap is hardcoded, and full-cap is the current maximum capacity. The batteries will degrade over time,
and this is reflected in full-cap. If the BMS sees that it is charged up to OV protection turns on and then
discharged down to UV protection turns on, then it concludes that it has seen the new full-cap. on the battery and
therefore updates this value.
Subsequently, full-cap is downgraded by 0.00025% for each cycle performed. It does not matter if the battery is
repeatedly charged/discharged for only a fraction of its capacity – a cycle will be registered when the total
discharged capacity since last cycle, is the same as the current full-cap. This compensates if the battery is never
discharged and charged completely.
If the full-cap is never updated by a full charge and discharge cycle, then after 1000 cycles there will be: (1-
0,00025) ^ 1000 = 0.779... = 78% SoH remaining. This is a slightly larger loss than we see in our cycle tests, but
we feel it is better to be on the conservative side, when we do estimations.
If a full cycle, up to OV and down to UV, is again seen, then the full-cap will be updated.
The following frame will be sent as the last frame, to show the complete log has been sent:
Frame
# Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
Data
Length
END SOI (0xEA) CID (0xD1) ADR (0x01) (0x04) 0xFF 0xFE Checksum 0xF5
The checksum for this frame is calculated like this: Byte3^Byte 4^Byte5 (Bitwise XOR)
Datalog description
Please refer to the description of the data bytes 0-31 in protocol 2, as they are the same in the
two protocols.
Get serials
First send an empty 0x001 frame to wake up the BUS.
Then we can get the serial numbers from all the attached batteries like below.
Description ID Data
MASTER Get Serials frame 0x00E [0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
BATTERY #1 Serial Response 0x00D [0x02, 0x06, 0x00, 0x11, 0x22, 0xFF, 0xFF, 0xFF]
BATTERY #2 Serial Response 0x00D [0x02, 0x06, 0x11, 0x22, 0x33, 0xFF, 0xFF, 0xFF]
Where [B0 = cmd, B1 = length of serial number (hex chars/nibble), B2 to B4 = Serial number, B5-B7 = N/A]
The BATTERY’s will send their response within 1000ms, at a random delay as to prevent collisions on the BUS.
The MASTER is expected to know how many batteries are attached.
Description ID Data
MASTER Assign NODE_ID 10 to BATTERY #1 0x00E [0x03, 0x0A, 0x06, 0x00, 0x11, 0x22, 0xFF, 0xFF]
MASTER Assign NODE_ID 20 to BATTERY #2 0x00E [0x03, 0x14, 0x06, 0x11, 0x22, 0x33, 0xFF, 0xFF]
Where [B0 = cmd, B1 = NODE_ID, B2 = length of serial (max. 10 hex chars), B3 to B7 = serial number]
BMS’s will reply with a confirmation, when a node_id is successfully assigned:
Notice that NODE_ID 2-7 are treated specially. When a battery has a one of these NODE_ID’s, it will also reply to
the old 0x201 style frames from protocol 1.
E.g. If the NODE_ID is 7, you can get status from the battery on frame id’s in the range 0x701 - 0x70F.
When a NODE_ID has been programmed, it will persist in the battery until changed.
Get status
When a battery has had a NODE_ID assigned, we can begin sending commands to it.
To get the status from BATTERY #1, which has NODE_ID 10, we send the following:
Description ID Data
MASTER Request status from NODE_ID=10 0x00E [0x01, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]
Where [B0 = standard-cmd-family, B1 = NODE_ID, B2 to B5 = N/A, B6 + B7 = Get status cmd]
Description ID Data
BATTERY #1 Multi frame response 0x00D See Below for explanation
Data
Data Min Max
Data Description Unit Additional information
Byte # value value
0-1 Pack Voltage 0.1V 0 65535
2-3 Charge-Current 0.1A 0 65535
4-5 Discharge-Current 0.1A 0 65535
6 SOC 1% 0 100
7 Remaining Time to Full-Charge 0.1h 0 255
8-9 Remaining Capacity 1mAh If design capacity > 65000mAh the unit changes to 10mAh 0 65535
10 SOH 1% 0 100
255
11 Firmware Version 0.1 0 (25.5)
12-13 Full Capacity 1mah If design capacity > 65000mAh the unit changes to 10mAh 0 65535
14-15 Cycle Count 1 Cycle 0 65535
16-17 BMS Status Bit flags, multiple can happen at the same time
0x0001 discharge (bit 0)
0x0002 charge (bit 1)
0x0004 OV (bit 2)
0x0008 UV (bit 3)
0x0010 COC(bit 4)
0x0020 DOC (bit 5)
0x0040 DOT (bit 6)
0x0080 DUT (bit 7)
0x0200 SC (bit 9)
0x0400 COT(bit 10)
0x0800 CUT (bit 11)
18 BMS Temperature 1℃ 1 is 1°C; 0 is 0°C; 255 is -1°C (default cell 1) -40℃ 120℃
19 BMS Temperature (default cell 2)
20-21 N/A
22 BMS Temperature (default FETS)
23 BMS Temperature (default ambient)
24-25 Cell 1 Voltage 1mv 0 4500
26-71 Cell 2 to 24 cell voltages 1mv 0 4500
72-77 N/A
78 N/A
79 N/A
80 Serial number length # Single Hex chars 1 10
Relation to Protocol 1
Protocol 1 frame ID byte 0 byte 1 byte 2 byte 3 byte 4 byte 5 byte 6 byte 7
0 0x201 data 0 data 1 data 2 data 3 data 4 data 5 data 6 data 7
1 0x202 data 8 data 9 data 10 data 11 data 12 data 13 data 14 data 15
2 0x203 data 16 data 17 data 18 data 19 data 20 data 21 data 22 data 23
3 0x204 data 24 data 25 data 26 data 27 data 28 data 29 data 30 data 31
4 0x205 data 32 data 33 data 34 data 35 data 36 data 37 data 38 data 39
5 0x206 data 40 data 41 data 42 data 43 data 44 data 45 data 46 data 47
6 0x207 data 48 data 49 data 50 data 51 data 52 data 53 data 54 data 55
7 0x208 data 56 data 57 data 58 data 59 data 60 data 61 data 62 data 63
8 0x209 data 64 data 65 data 66 data 67 data 68 data 69 data 70 data 71
9 0x20A data 72 data 73 data 74 data 75 data 76 data 77 data 78 data 79
10 0x20B data 80 data 81 data 82 data 83 data 84 data 85 data 86 data 87
11 Reserved data 88 data 89 data 90 data 91 data 92 data 93 data 94 data 95
Get Log
Like in the old protocol 1, we can retrieve the internal log from the battery over CANbus using the new protocol.
To do this we send the following frame,
Description ID Data
MASTER Request log from NODE_ID=10 0x00E [0x04, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01]
Where [B0 = log-cmd-family, B1 = NODE_ID, B2 to B5 = N/A, B6 + B7 = Get log cmd]
When a battery with the appropriate NODE_ID, gets this frame, it will respond by transmitting all the records in
the log, where each record is split into 8 frames.
Please note that the DATA bytes are identical to the data that can be retrieved with the old protocol 1.
Below is a legend of the data, events and states
Event Description
0x03 UV Shutdown
0x04 Power Up
0x06 Full charge capacity update
0x07 Cycle count update
0x08 D-FET OFF
0x09 C-FET OFF
0x0A D-FET ON
0x0B C-FET ON
0x0C Parameter Update
0x0D Charge-Current Calibration
0x0E Discharge-Current Calibration
0x0F Voltage Calibration
0x20 Voltage Failure