CAN Bus Messages
This section summarizes the CAN Bus messages used with the Controller. See the CAN Bus Configuration page for more information about setting up the CAN Bus interface.
Note
The examples in this section assume the Controller's CAN Bus address is 0x80 while the Host device is 0x90. Different values must be substituted if your CAN Bus network is designed differently.
Message Format
The controller sends and receives CAN Bus 2.0b messages with 29-bit identifiers. The identifiers are formatted in the J1939 style. The controller emits status messages in the PDU2 (broadcast) range, and accepts command and control messages in the PDU1 (destination specific) format.
Control Message
The Control message allows directed (addressed) command sequences to be sent to the controllers. The payload contains up to 8 bytes, which are command-specific.
A command sent from a (source) to a (target) may be followed by a response from the (target) to the (source).
For example, a control message with priority 4, sent from device 0x90 to device 0x80 would have 0x10EF8090 as its 29-bit identifier.
The response would have identifer 0x10EF9080 as its 29-bit identifier.
The first byte of the message data in a Control message request is the 'function code', which indicates what function the controller is being asked to perform.
The first byte of the response to the Control message includes the same function code. If an error occurs (eg. unknown function code, etc), the response function code will have the most significant bit set and the second byte will contain an error code.
The error codes include
Code | Meaning |
---|---|
1 | Unknown Function Code |
2 | Illegal Address |
3 | Illegal Data Value |
4 | Device Failure |
5 | Device Busy |
For example, sending (unknown) function code 0x20 to the controller:
0x10EF8090 20
The controller's response: 0x10EF9080 A0 01
, which has the first byte as 0x20 with the MSB set, and 01 as the error code.
The controller supports Control messages longer than 8 data bytes, via the J1939-TP protocol. This protocol is not explained here but is documented in J1939 literature.
PGN: 0xEF00
Data: | Byte 0 | Byte 1 - Byte 7 |
---|---|---|
Content: | {Function} | 0 or more bytes of function-specific parameters |
The Function is an enumeration:
Function | Selected Function |
---|---|
0x45 | Read Parameter(s) |
0x46 | Write Parameter(s) |
0x47 | System Commands |
0x50 | Digital Control |
Read Parameter(s) Function Code
One or more bytes of configuration or status parameters can be requested from the controller using this command. It is not normally necessary to read parameters, and any use of this command should be done in collaboration with Control Solutions, since the parameters or parameter values may change depending on controller model or software version.
A Read Parameters request consists of a 16-bit address, and the number of bytes to be returned.
Example
Read the CAN Bus ID (parameter 0x0402)
FC ADDRESS LEN
Command: 10EF8090 45 04 02 01
Response: 1CEF9080 45 80
The response indicates that the CAN Bus ID of the unit is 0x80
Write Parameter(s) Function Code
One or more bytes of configuration parameters can be written to the controller using this command. It is not normally necessary to write parameters, and any use of this command should be done in collaboration with Control Solutions, since the parameters or parameter values may change depending on controller model or software version.
Example
Write the CAN Bus ID (parameter 0x0402) to 0x81
FC ADDRESS Data
Command: 10EF8090 46 04 02 81
Response: 1CEF9080 46 00 (00=Success)
Notice that the parameter change did not take effect immediately
and the reponse is sent from the existing CAN Bus ID (0x80).
The new ID will take effect when the controller is reset or power cycled.
System Command
Example
Reset the controller
Command: 10EF8090 47 FB
Response: None
Warning
Using this command while the motor is running is not recommended. An abrupt stop to the motor could harm the equipment and/or the operator.
Digital Control
If enabled and configured, the Digital Control message provides a proportional drive level input and/or control of direction via CAN Bus. Refer to Digital Control for more details.
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 1 byte | Function | 0x50 indicates Throttle Control message |
1 | 1 byte | Digital Pot | Unsigned 0-255, indicates a proportional level. For example, to be used as a throttle value. |
2 | 1 byte | Digital Buttons | Note: bits are active low (0=Active) Bit 0: Reserved, set to 1 Bit 1: Reserved, set to 1 Bit 2: Reserved, set to 1 Bit 3: Reserved, set to 1 Bit 4: 0=Quickstop. Behavior depends on quickstop configuration Bit 5: 0=Reverse Bit 6: 0=Indoor Mode Bit 7: Reserved, set to 1 |
3 | 1 byte | Digital Mode | Bit 0: 0=Seat Empty. If the Seat Switch function is enabled, clearing this bit prevents motion Bits 1-7: Reserved, set to 1 |
Example
Set Digital throttle to 25%
(0x40 = 64 = 25% throttle)
Command: 10EF8090 50 40 FF
Set Digital throttle to zero and set buttons to run forward
(0x00 = 0 = 0% throttle)
Command: 10EF8090 50 00 FF
Set Digital throttle to 50% and set buttons to run reverse and mode to FF
(0x80 = 128 = 50% throttle)
Command: 10EF8090 50 80 DF FF
Refresh CAN Bus Timeout without changing any settings
Command: 10EF8090 50
Status Messages
Status messages are emitted by the controller at periodic intervals. Specific messages can be inhibited by configuring them. If status message are inhibited, they can be manually requested using a J1939 PGN request message using PGN 0x0nFF00.
PGN Request Example:
Request status FF01
The first data byte is the status message number 0-7. The
number must be followed by 0xFF and 0x00 with no other data bytes.
Command: 10EA8090 01 FF 00
Response: 10FF0180 0E 62 00 00 00 00 00 00
Message definitions can vary according to Controller Model. Refer to the model-specific bus definition for exact field definitions.
FF00 Motor Drive Status Message
PGN: 0xFF00
Default Priority: 6
Interval: 100ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 1 byte | Reserved | |
1 | 1 byte | Output Current | Measured output current in Amps |
2 | 1 byte | PWM Output | Unsigned 0-255. Indicates proportion of output PWM (255=100%) |
3 | 1 byte | Reserved | |
4 | 1 byte | Active current limit | Uses the same format as cur_lb and cur_ub. |
5 | 3 bytes | Reserved |
FF01 Monitor Status Message
PGN: 0xFF01
Default Priority: 6
Interval: 1000ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 1 byte | Temperature | Measured Controller temperature (C) |
1 | 1 byte | Supply Voltage | Measured supply voltage(V) multiplied by 4 |
2 | 1 byte | Reserved | |
3 | 1 byte | State Of Charge | The state of charge based on compensated voltage compared to the values of register 0x0327 and register 0x0328. A value of zero indicates the battery state of charge is at or below the Undervoltage warning threshold. A value of 100(decimal) indicates state of charge is at or above the Top Segment configured level. |
FF02 Custom Status Messages 0-7
PGN: 0xFF02
Default Priority: 6
Interval: 500ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 8 bytes | Reserved | These eight bytes can be programmed to do read any RAM or EEPROM location. The values can be read once at power up or continuously. See Custom Status Configuration for more info. |
FF03 System Status Message
PGN: 0xFF03
Default Priority: 6
Interval: 1000ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 1 byte | System State | Bitmapped state codes. See System State for more information. |
1 | 1 byte | Motor State | Enumerated state codes. See Motor State for more information. |
2 | 1 byte | Communications Alarms | Bitmapped state codes: All 0's = Normal Bit 0: CAN Bus RX errors > 127 Bit 1: CAN Bus TX errors > 127 Bit 2: Reserved Bit 3: Reserved Bit 4: Interprocessor comm error Bit 5: CAN Bus RX Silent for > 1 second Bit 6: Digital Throttle command timeout Bit 7: Incoming R/W Overload |
3 | 1 byte | Charge Mode | When a compatible charger is attached, this byte indicates what the charger is doing. 0x00 = Not Charging 0x01 = Precharge 0x02 = Bulk Charge 0x04 = Balancing 0x08 = Float 0x80 = Just changed from charge mode to drive mode. Key cycle or power cycle is required to clear this bit. |
4 | 1 byte | Fault Code | Active fault (0=None) See Faults for specific fault codes. |
5 | 1 byte | Miscellaneous Diagnostics | See Miscellaneous Diagnostics for more information. |
6 | 1 byte | PWM Limited | See PWM Diagnostics for more information. |
7 | 1 byte | Stop Cause | See Stop Diagnostics for more information. |
FF04 Throttle Status Message
PGN: 0xFF04
Default Priority: 6
Interval: 100ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 2 bytes | Throttle 1 Analog | Unsigned (LSB, MSB) value which corresponds to the measured throttle voltage. 0=0V, 65535=5V |
2 | 1 byte | Throttle 1 Command | Unsigned 0-255. Indicates proportion of scaled throttle (255=100%) |
3 | 1 byte | Reserved | |
4 | 2 bytes | ANALOG IN Voltage | Unsigned (LSB, MSB) value which corresponds to the measured throttle voltage. 0=0V, 65535=5V. Note: resolution of the measurement is 12 bits and the input is not factory calibrated. |
6 | 2 bytes | Reserved |
FF05 Speed Status Message
PGN: 0xFF05
Default Priority: 6
Interval: 250ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 2 bytes | Actual RPM | Unsigned (LSB, MSB). Measured motor speed in RPM. Only used in brushless system. |
2 | 2 bytes | Target RPM | Unsigned (LSB, MSB). Only used for Brushless motor in speed control mode, target motor speed in RPM |
4 | 4 bytes | Reserved |
FF06 Digital Control Status Message
PGN: 0xFF06
Default Priority: 6
Interval: 250ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 1 byte | Reserved | |
1 | 1 byte | Reserved | |
2 | 1 byte | Reserved | |
3 | 1 byte | Reserved | |
4 | 1 byte | Miscellaneous Status | Bit 0: Reserved Bit 1: 0=Indoor 1=Outdoor Bit 2: 1=Low Volts Bit 3: 1=Brake Release Bit 4: 1=Quick Stop. Bit 5: Seat Switch Active Bit 6: Reserved Bit 7: Reserved |
5 | 1 byte | Aux | Bit 0: Reserved Bit 1: Reserved Bit 2: Reserved Bit 3: Reserved Bit 4: Reserved Bit 5: Reserved. Bit 6: 1=Forward Bit 7: 1=Reverse |
FF07 Custom Status Messages 8-15
PGN: 0xFF07
Default Priority: 6
Interval: 500ms
Byte | Length | Parameter | Description |
---|---|---|---|
0 | 8 bytes | Reserved | These eight bytes can be programmed to do read any RAM or EEPROM location. The values can be read once at power up or continuously. See Custom Status Configuration for more info. |