Open kasparsd opened 1 month ago
Used the https://www.csselectronics.com/pages/dbc-editor-can-bus-database tool to create a DBC file for the "Controller Speed/Current/Voltage/Temperature" message at 02F83201
:
Decoding example: 02F83201 8 C4 09 E8 03 E2 14 32 3C
ID: 02F83201
Numbers Byte: 8
Speed Byte 1/0 : C4 09 -> 0x09C4 = 2500 => 25.00km/h
Current Byte 3/2 : E8 03 -> 0x03E8 = 1000 => 10.00A
Voltage Byte 5/4 : E2 14 -> 0x14E2 = 5346 => 53.46V
Temp. Control. Byte 6 : 32 -> 0x32 = 50 -> 50 - 40 = 10 => 10°C
Temp. Motor Byte 7 : 3C -> 0x3C = 60 -> 60 - 40 = 20 => 20°C
with the following field definition:
BO_ 2197303809 ControllerState: 8 Vector__XXX
SG_ Speed : 0|16@1+ (0.01,0) [0|100] "km/h" Vector__XXX
SG_ Current : 16|16@1+ (0.01,0) [0|0] "A" Vector__XXX
SG_ Voltage : 32|16@1+ (0.01,0) [0|100] "V" Vector__XXX
SG_ TemperatureController : 48|8@1+ (1,-40) [0|200] "C" Vector__XXX
SG_ TemperatureMotor : 56|8@1+ (0.1,0) [0|200] "C" Vector__XXX
Most of the CAN parsers support DBC files for describing the CAN frames and their message payload, see https://www.csselectronics.com/pages/can-dbc-file-database-intro
Create a DBC file for all supported Bafang payloads.
Here is a reference DBC for Tesla Model 3 https://github.com/joshwardell/model3dbc/blob/c56c113c353d09b1a5dd57677461f02fe8b7c6ca/Model3CAN.dbc