Difference between revisions of "CAN"

From Volt Garáž Wiki
Jump to navigation Jump to search
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Communication_protocols]]
 
[[Category:Communication_protocols]]
A standard automotive protocol, CAN operates on two wires as a differential signal. These are called CAM High and CAM Low. Both of these wires have some electric potential against common ground, but the ground is not involved in the connection as just the two wires are used.
+
A standard automotive protocol, CAN operates on two wires as a differential signal. These are called CAN High and CAN Low. Both of these wires have some electric potential against common ground, but the ground is not involved in the connection as just the two wires are used.
 
CAN is a bus where multiple devices are connected on the same physical line. The bus also has to be terminated by a resistor.
 
CAN is a bus where multiple devices are connected on the same physical line. The bus also has to be terminated by a resistor.
== Super Soco CAM ==
+
 
=== CPX ===
+
The bikes use the protocol to communicate between battery BMS, motor controller, dashboard and a charger.
The [[CPX]] uses 250 000 bps CAM bus terminated by the scooter or the charger. This means if direct connection to the battery is required, the used CAM interface needs terminate the bus or a 120 Ohm resistor needs to be installed manually across the two pins.
+
== CPX ==
 +
The [[CPX]] uses 250 000 bps CAN bus terminated by the scooter or the charger. This means if direct connection to the battery is required, the used CAN interface needs terminate the bus or a 120 Ohm resistor needs to be installed manually across the two pins.
  
 
Each message sent contains an ID that designates a type of the message, and 8 bytes of data.
 
Each message sent contains an ID that designates a type of the message, and 8 bytes of data.
 +
 +
Please note that a single parameter can repeat within multiple different message IDs.
 +
If a value is indicated to be contained within multiple bytes, the byte order is Little Endian, meaning the higher the byte count, the higher the significance.
 +
 +
=== Battery BMS ===
 +
Following messages are provided by the battery BMS unit when in A/B mode or charging mode.
 +
 
{| class="wikitable"
 
{| class="wikitable"
|+ Battery BMS messages
+
|+ Message types
 
|-
 
|-
 
! Message ID !! Purpose
 
! Message ID !! Purpose
Line 15: Line 23:
 
|-
 
|-
 
| 506 || Battery state and charging information
 
| 506 || Battery state and charging information
 +
|-
 +
| 540 || Battery state
 
|-
 
|-
 
| 54E || Battery parameters and information
 
| 54E || Battery parameters and information
 
|}
 
|}
Please note that many parameters repeat between different message IDs.
 
If a value is indicated to be contained within more bytes, the format is Little Endian
 
  
 
The Message IDs specified here apply when using the battery in A-mode or Charging mode. When using with B-mode, the IDs are +1 higher. Please see [[Battery connector#Gen 2]] for modes description.
 
The Message IDs specified here apply when using the battery in A-mode or Charging mode. When using with B-mode, the IDs are +1 higher. Please see [[Battery connector#Gen 2]] for modes description.
Line 28: Line 36:
 
! Byte !! Value || Unit
 
! Byte !! Value || Unit
 
|-
 
|-
| 00, 01 || Unknown || Speculation: discharge current?
+
| 00, 01 || Unknown || Only observed 0
 
|-
 
|-
 
| 02, 03 || Battery Voltage || Volts * 10
 
| 02, 03 || Battery Voltage || Volts * 10
 
|-
 
|-
| 04, 05 || Charging Current || Amps * 10
+
| 04, 05 || Flowing Current || Amps * 10, signed short<br/>positive = charging, negative = riding
 
|-
 
|-
| 06 || Unknown || Only observed 0x00
+
| 06 || Unknown || Only observed 0
 
|-
 
|-
| 07 || Unknown flag || 0x95 during charging, 0x00 otherwise
+
| 07 || Unknown || 0x95 during charging, 0x15 when charger finishes, 0x0 otherwise
 
|}
 
|}
  
Line 44: Line 52:
 
! Byte !! Value || Unit
 
! Byte !! Value || Unit
 
|-
 
|-
| 00 || Battery state bitmask || Bits from lst. sig.: 0 = charging mode, 1 = voltage on pins, 3 = initialized after connection
+
| 00 || Battery state bitmask || Bits from least sig.:<br/>0 = charging mode<br/>1 = voltage on pins<br/>3 = initialized after connection
 
|-
 
|-
| 01 || Battery state bitmask || Bits from lst. sig.: 0 = charging mode, 4 = charging in progress
+
| 01 || Battery state bitmask || Bits from least sig.:<br/>0 = charging mode<br/>4 = charging in progress
 
|-
 
|-
| 02, 03 || Charging current || Amps * 10
+
| 02, 03 || Charging Current || Amps * 10
 
|-
 
|-
 
| 04, 05 || Voltage per cell (avg? max? min?) || Volts * 1000
 
| 04, 05 || Voltage per cell (avg? max? min?) || Volts * 1000
 
|-
 
|-
| 06 || Unknown || Only observed 0x00
+
| 06 || Unknown || Only observed 0
 
|-
 
|-
 
| 07 || Battery mode || 0x10 = charging mode, 0x20 = riding mode
 
| 07 || Battery mode || 0x10 = charging mode, 0x20 = riding mode
 
|}
 
|}
  
 +
{| class="wikitable"
 +
|+ 540 data
 +
|-
 +
! Byte !! Value || Unit
 +
|-
 +
| 00 || State of Charge || Percents
 +
|-
 +
| 01 || Unknown || Always 0
 +
|-
 +
| 02 || Unknown || 255 when not charging<br/>decreasing once started
 +
|-
 +
| 03, 04, 05, 06 || Temperature<br/>(four different values) || Celsius
 +
|-
 +
| 07 || Unknown || Always 255
 +
|}
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 63: Line 86:
 
! Byte !! Value || Unit
 
! Byte !! Value || Unit
 
|-
 
|-
| 00, 01 || Battery Maximum Voltage || Volts * 10
+
| 00, 01 || Battery Maximum Voltage || Volts * 10<br/>Observed 71.4V even during charging on original 70.5V charger<br/>(This fits 4.2V * 17 cells in series)
 
|-
 
|-
| 02, 03 || Battery Maximum Charge Current || Amps * 10, 0 when charged
+
| 02, 03 || Battery Maximum Charge Current || Amps * 10<br/>Observed 15A, 10A when charging 0A when charged
 
|-
 
|-
 
| 04 || State of Charge || Percents
 
| 04 || State of Charge || Percents
Line 72: Line 95:
 
|-
 
|-
 
| 07 || Unknown flag || 0x30 during charging, 0x00 otherwise
 
| 07 || Unknown flag || 0x30 during charging, 0x00 otherwise
 +
|}
 +
 +
=== Charger ===
 +
Following messages are provided by the charger.
 +
 +
{| class="wikitable"
 +
|+ Message types
 +
|-
 +
! Message ID !! Purpose
 +
|-
 +
| 508 || All-zero header<br/>Possible future usage
 +
|-
 +
| 580 || Charging status
 +
|-
 +
| 581 || Charging status
 +
|}
 +
 +
{| class="wikitable"
 +
|+ 580 data
 +
|-
 +
! Byte !! Value || Unit
 +
|-
 +
| 00 || Charging state || 1 = charging, 2 = finished
 +
|-
 +
| 01, 02 || Battery Voltage || Volts * 10
 +
|-
 +
| 03, 04 || Related: Charging Current || Unknown, looks like current + 10
 +
|-
 +
| 05, 06 || Related: Charging Power || Unknown
 +
|-
 +
| 07 || Unknown || Only observed 0
 +
|}
 +
 +
{| class="wikitable"
 +
|+ 581 data
 +
|-
 +
! Byte !! Value || Unit
 +
|-
 +
| 00 || Charging state || 2 = charging, 1 = finished
 +
|-
 +
| 01 || Unknown || Always 0
 +
|-
 +
| 02, 03 || Related: Charging Current || Unknown
 +
|-
 +
| 04, 05 || Unknown || 0x30 during charging, 0x00 otherwise
 +
|-
 +
| 06 || Unknown || Always 1
 +
|-
 +
| 07 || Supplied Charging Current || Amps * 10 (related to 54Eb2,3?)
 
|}
 
|}

Latest revision as of 22:36, 27 April 2021

A standard automotive protocol, CAN operates on two wires as a differential signal. These are called CAN High and CAN Low. Both of these wires have some electric potential against common ground, but the ground is not involved in the connection as just the two wires are used. CAN is a bus where multiple devices are connected on the same physical line. The bus also has to be terminated by a resistor.

The bikes use the protocol to communicate between battery BMS, motor controller, dashboard and a charger.

CPX

The CPX uses 250 000 bps CAN bus terminated by the scooter or the charger. This means if direct connection to the battery is required, the used CAN interface needs terminate the bus or a 120 Ohm resistor needs to be installed manually across the two pins.

Each message sent contains an ID that designates a type of the message, and 8 bytes of data.

Please note that a single parameter can repeat within multiple different message IDs. If a value is indicated to be contained within multiple bytes, the byte order is Little Endian, meaning the higher the byte count, the higher the significance.

Battery BMS

Following messages are provided by the battery BMS unit when in A/B mode or charging mode.

Message types
Message ID Purpose
504 Charging information
506 Battery state and charging information
540 Battery state
54E Battery parameters and information

The Message IDs specified here apply when using the battery in A-mode or Charging mode. When using with B-mode, the IDs are +1 higher. Please see Battery connector#Gen 2 for modes description.

504 data
Byte Value Unit
00, 01 Unknown Only observed 0
02, 03 Battery Voltage Volts * 10
04, 05 Flowing Current Amps * 10, signed short
positive = charging, negative = riding
06 Unknown Only observed 0
07 Unknown 0x95 during charging, 0x15 when charger finishes, 0x0 otherwise
506 data
Byte Value Unit
00 Battery state bitmask Bits from least sig.:
0 = charging mode
1 = voltage on pins
3 = initialized after connection
01 Battery state bitmask Bits from least sig.:
0 = charging mode
4 = charging in progress
02, 03 Charging Current Amps * 10
04, 05 Voltage per cell (avg? max? min?) Volts * 1000
06 Unknown Only observed 0
07 Battery mode 0x10 = charging mode, 0x20 = riding mode
540 data
Byte Value Unit
00 State of Charge Percents
01 Unknown Always 0
02 Unknown 255 when not charging
decreasing once started
03, 04, 05, 06 Temperature
(four different values)
Celsius
07 Unknown Always 255
54E data
Byte Value Unit
00, 01 Battery Maximum Voltage Volts * 10
Observed 71.4V even during charging on original 70.5V charger
(This fits 4.2V * 17 cells in series)
02, 03 Battery Maximum Charge Current Amps * 10
Observed 15A, 10A when charging 0A when charged
04 State of Charge Percents
05, 06 Battery Voltage Volts * 10
07 Unknown flag 0x30 during charging, 0x00 otherwise

Charger

Following messages are provided by the charger.

Message types
Message ID Purpose
508 All-zero header
Possible future usage
580 Charging status
581 Charging status
580 data
Byte Value Unit
00 Charging state 1 = charging, 2 = finished
01, 02 Battery Voltage Volts * 10
03, 04 Related: Charging Current Unknown, looks like current + 10
05, 06 Related: Charging Power Unknown
07 Unknown Only observed 0
581 data
Byte Value Unit
00 Charging state 2 = charging, 1 = finished
01 Unknown Always 0
02, 03 Related: Charging Current Unknown
04, 05 Unknown 0x30 during charging, 0x00 otherwise
06 Unknown Always 1
07 Supplied Charging Current Amps * 10 (related to 54Eb2,3?)