UAVCAN Communication Protocol
This is a template page
Add content here
1. UAVCAN Protocol Overview
UAVCAN is a lightweight protocol based on the CAN 2.0B communication protocol, with a transmission rate of up to 1 Mb/s. It provides a highly reliable communication method for aerospace and robotics applications via the CAN bus. UAVCAN is a decentralized peer-to-peer network in which each peer (node) has a unique digital identifier called NODE_ID. UAVCAN nodes can communicate using any of the following communication methods:
- Message broadcasting – The primary method of data exchange with publish/subscribe semantics.
- Service invocation – A communication method for peer-to-peer request/response interactions.
UAVCAN can automatically split long data into multiple CAN frames using serialized message and service data structures, allowing nodes to exchange data structures of arbitrary size.
The protocol uses CAN 2.0B standard data frames for communication. The factory default CAN baud rate is 1 Mbps, with a configurable range of 10 kbps to 1 Mbps. The communication address (NODE_ID), CAN baud rate, and node address can be configured via the host computer software.
2. UAVCAN Command
Information Frame Command:
UAVCAN Command | UAVCAN Signature | Description | |
341(0x0155) | - | Node Status Command | Servo Heartbeat Command |
1020(0x03FC) | - | Torque Switch Command | |
2011(0x07DB) | - | Single Motor Position Control Command | |
2012(0x07DC) | 56 D7 8A D5 6C 8A 65 3A | Multi-Motor Position Control Command | |
2013(0x07DD) | E4 81 9D 8E 5B 7B 80 65 | Data Feedback Command | Auto-Report Command |
2014(0x07DE) | - | Auto-Report Start/Stop Command |
Service Frame Command:
UAVCAN Command | UAVCAN Signature | Description |
250(0xFA) | 4F A9 E7 BE A3 6E B3 EC | Parameter Read Command — Big-endian byte order (MSB first). |
251(0xFB) | 8C E7 80 A1 F9 E4 C7 68 | Parameter Write Command — Big-endian byte order (MSB first). |
252(0xFC) | - | Servo Restart Command |
Note: When transmitting data in multi-frame format, add the signature to the front of the data for CRC calculation.
2.1 Node Status Command
CAN-ID | DLC | Data | |
Rx | 18015500+NODE_ID | 8 | Frame Counter (4 bytes), Fault Code (1 byte), Status Code (2 bytes), Frame Trailer (1 byte) |
CAN-ID: Default value is 0x18015564. The NODE_ID (servo node ID) default value is 100, with a valid range of 1 to 127. It is used to identify the node status of different servos.
Frame Counter (4 bytes): Counter value ranging from 0 to (2³² - 1). The counter increments by one for each transmitted frame.
Fault Code (1 byte): Values are as follows:
- Fatal fault: 0xC0 – Magnetic encoder error, undervoltage
- Major fault: 0x40 – Overload, over-temperature
- Minor fault: 0x80 – Overvoltage
- No fault: 0x00Status Code (2 bytes): Refer to the servo status code.Frame Trailer (1 byte): C0 + Transfer_ID. The Transfer_ID ranges from 0 to 31 and automatically increments by one for each transmitted frame.
Note 1:The default auto-report frequency of the node status command is 1 Hz. The frequency can be modified via the FC software.
Note 2:The NODE_ID of each servo on the bus must be unique. It can be modified via the FC software.
2.2 Torque Switch Command
CAN-ID | DLC | Data | |
Tx | 1003FC01 | 3 | Servo Channel (1 byte), Torque Command (1 byte), Frame Trailer (1 byte) |
Servo Channel (1 byte): Range 0 to 17
Torque Command (1 byte): 0 = torque off, 1 = torque on
Frame Trailer (1 byte): C0
Note: The position command will automatically enable the servo torque. This command can be used to disable the servo torque, allowing the servo to enter a free state.
2.3 Single Motor Position Control Command
CAN-ID | DLC | Data | |
Tx | 1007DB01 | 4 | Servo Channel (1 byte), Position Data (1 byte), Frame Trailer (1 byte) |
Servo Channel (1 byte): Range 0 to 17
Position Data (2 bytes): Range -8192 to 8191, corresponding to 360 degrees. 1 LSB = sensor accuracy. Little-endian format. Negative numbers are represented in two’s complement.
Frame Trailer (1 byte): C0
Note: Default servo channel = 0. Modifiable via FC software.
2.4 Multi-Motor Position Control Command
2.4.1 Control fewer than 3 servos
CAN-ID | DLC | Data | |
Tx | 1007DC01 | 7 | Channel 0 Position (2 bytes), Channel 1 Position (2 bytes), Channel 2 Position (2 bytes), Frame Trailer (1 byte) |
Channel x Position (2 bytes): x ranges from 0 to 2. Position range: -8192 to 8191, corresponding to 360 degrees. 1 LSB = sensor accuracy. Little-endian format. Negative numbers are represented in two’s complement.
Frame Trailer (1 byte): C0
Note: The servo channel in the command can only be from 0 to 2.
2.4.2 Control more than 3 servos
CAN-ID | DLC | Data | |
Tx1 | 1007DC01 | 8 | Checksum (2 bytes), channel 0 position (2 bytes), channel 1 position (2 bytes), channel 2 position (low byte), frame tail (1 byte) |
Tx2 | 1007DC01 | 8 | channel 2 position (high byte), channel 3 position (2 bytes), channel 4 position (2 bytes), channel 5 position (2 bytes), frame tail (1 byte) |
Tx3 | 1007DC01 | 8 | channel 6 position (2 bytes), channel 7 position (2 bytes), channel 8 position (2 bytes), channel 9 position (low byte), frame tail (1 byte) |
Tx4 | 1007DC01 | 8 | channel 9 position (high byte), channel 10 position (2 bytes), channel 11 position (2 bytes), channel 12 position (2 bytes), frame tail (1 byte) |
Tx5 | 1007DC01 | 8 | channel 13 position (2 bytes), channel 14 position (2 bytes), channel 15 position (2 bytes), channel 16 position (low byte), frame tail (1 byte) |
Tx6 | 1007DC01 | 4 | channel 16 position (high byte), channel 17 position (2 bytes), frame tail (1 byte) |
Checksum (2 bytes): Refer to the checksum section.
Channel x Position (2 bytes): x ranges from 0 to 17. Position range: -8192 to 8191, corresponding to 360 degrees. 1 LSB = sensor accuracy. Little-endian format. Negative numbers are represented in two’s complement.
Frame Trailer (1 byte):
- Tx1: 0x80 – Start frame, BIT5 = 0
- Tx2: 0x20 – Intermediate frame, BIT5 toggled relative to the previous frame
- Tx3: 0x00 – Intermediate frame, BIT5 toggled relative to the previous frame
- Tx4: 0x20 – Intermediate frame, BIT5 toggled relative to the previous frame
- Tx5: 0x00 – Intermediate frame, BIT5 toggled relative to the previous frame
- Tx6: 0x60 – End frame, BIT5 toggled relative to the previous frame
Note: The above command can control up to 18 servos. In practical applications, the command can be adjusted (increased or decreased) according to the number of servo channels.
2.5 Auto-Report Data Feedback Command
CAN-ID | DLC | Data | |
Rx1 | 1807DD00+NODE_ID | 8 | Checksum (2 bytes), servo channel (1 byte), target position (2 bytes), current position (2 bytes), frame tail (1 byte) |
Rx2 | 1807DD00+NODE_ID | 8 | Servo voltage (2 bytes), servo current (2 bytes), servo PCB temperature (1 byte), servo motor temperature (1 byte), servo status (1 byte), frame tail (1 byte) |
CAN-ID: Default value is 0x1807DD64. The NODE_ID (servo node ID) default value is 100, with a valid range of 1 to 127. It can be modified via the FC software and is used to identify node feedback data from different servos.
Servo Channel (1 byte): Range 0 to 17. The default servo channel is 0 and can be modified via the FC software.
Target Position (2 bytes): Range -8192 to 8191, corresponding to 360 degrees. 1 LSB = sensor accuracy. Little-endian format. Negative numbers are represented in two’s complement.
Current Position (2 bytes): Range -8192 to 8191, corresponding to 360 degrees. 1 LSB = sensor accuracy. Little-endian format. Negative numbers are represented in two’s complement.
Servo Voltage (2 bytes): 1 LSB = 0.1 V.
Servo Current (2 bytes): 1 LSB = accuracy of the current sampling circuit.
Servo PCB Temperature (1 byte): Temperature of the MOS on the servo PCB. 1 LSB = 1°C.
Servo Motor Temperature (1 byte): 1 LSB = 1°C. This data is invalid if the servo motor does not have a temperature sensor.
Servo Status (1 byte):
- Bit 0: 0 = normal, 1 = driver operating abnormal (e.g., magnetic encoder error). Automatically recovers when normal.
- Bit 1: 0 = normal, 1 = UAVCAN command error, CRC error, invalid command, or invalid frame. Automatically recovers upon receiving a valid command.
- Bit 2: 0 = normal, 1 = motor torque disabled.
- Bit 3: 0 = normal, 1 = motor stalled or overloaded. Automatically recovers when torque returns to normal.
- Bit 4: 0 = normal, 1 = driver MOS overheated. Automatically recovers when temperature returns to normal.
- Bit 5: 0 = abnormal, 1 = motor overheated. Automatically recovers when temperature returns to normal.
- Bit 6: 0 = normal, 1 = undervoltage or overvoltage. Automatically recovers when voltage returns to normal.
Frame Trailer (1 byte):
- Rx1: 0x80 + Transfer_ID — Start frame, BIT5 = 0
- Rx2: 0x60 + Transfer_ID — End frame, BIT5 toggled relative to the previous frame
Transfer_ID ranges from 0 to 31. The Transfer_ID is the same for both frame trailers above. After every two complete frames are received, the Transfer_ID automatically increments by one.
Note 1: The default auto-report frequency of the data feedback command is 10 Hz. The frequency can be modified via the FC software.
Note 2: The NODE_ID of each servo on the bus must be unique. Servo channels can be the same; the same channel generally refers to servos that perform the same action. Both the servo NODE_ID and the servo channel can be modified via the FC software.
2.6 Auto-Report Start/Pause Command
CAN-ID | DLC | Data | |
Tx | 1007DE01 | 3 | Servo NODE_ID (1 byte), Switch Command (1 byte), Frame Trailer (1 byte) |
Servo NODE_ID (1 byte): Range 0 to 127. 0 indicates all servos.
Torque Command (1 byte): 0 = pause, 5 = start.
Frame Trailer (1 byte): C0
2.7 Parameter Write Command
CAN-ID | DLC | Data | |
Tx | 10FB8081+(NODE_ID<<8) | 4+L*2 | Parameter Address (2 bytes), Parameter Length L (1 byte), Parameter Data 1 (2 bytes) … Parameter Data L (2 bytes), Frame Trailer (1 byte) |
Rx | 10FB0180+NODE_ID | 2 | Write Status (1 byte), Frame Trailer (1 byte) |
CAN-ID:
- Tx: 0x10FB8081 + (NODE_ID << 8). Default NODE_ID is 100. Default CAN-ID is 0x10FBE481.
- Rx: 0x10FB0180 + NODE_ID. Default NODE_ID is 100. Default CAN-ID is 0x10FB01E4.
Parameter Address (2 bytes): Refer to the memory table address.
Parameter Length L (1 byte): Length of the parameter (L).
Parameter Data 1 (2 bytes): Refer to the memory table data.
Parameter Data L (2 bytes): Refer to the memory table data. L ≤ 2.
Write Status (1 byte): 0 = normal, 1 = invalid address, 2 = invalid parameter.
Frame Trailer (1 byte): C0
2.8 Parameter Read Command
CAN-ID | DLC | Data | |
Tx | 10FA8081+(NODE_ID<<8) | 4 | Parameter Address (2 bytes), Parameter Length L (1 byte), Frame Trailer (1 byte) |
Rx | 10FA0180+NODE_ID | 3+L*2 | Read Status (1 byte), Parameter Length L (1 byte), Parameter Data 1 (2 bytes) … Parameter Data L (2 bytes), Frame Trailer (1 byte) |
CAN-ID:
- Tx: 0x10FA8081 + (NODE_ID << 8). Default NODE_ID is 100. Default CAN-ID is 0x10FAE481.
- Rx: 0x10FA0180 + NODE_ID. Default NODE_ID is 100. Default CAN-ID is 0x10FA01E4.
Parameter Address (2 bytes): Refer to the memory table address.
Parameter Length L (1 byte): Length of the parameter (L).
Parameter Data (2 bytes): Refer to the memory table data.
Parameter Data L (2 bytes): Refer to the memory table data. L ≤ 2.
Write Status (1 byte): 0 = normal, 1 = invalid address, 2 = invalid parameter.
Frame Trailer (1 byte): C0
3. UAVCAN Protocol CRC Check
Note: This section applies to the checksum calculation in multi-frame commands. It can be skipped for single-frame commands.
The multi-frame data composition is as follows:
UAVCAN Data Frame 1 | UAVCAN Data Frame 2 | … | UAVCAN Data Frame N |
Byte0 ~ Byte7 | Byte0 ~ Byte7 | … | Byte0 ~ ByteX |
UAVCAN Data Frame 1: Byte 0 and Byte 1 are the CRC checksum (little-endian format). Bytes 2 to 6 are valid data. Byte 7 is the frame trailer.
UAVCAN Data Frame 2: Bytes 0 to 6 are valid data. Byte 7 is the frame trailer.
UAVCAN Data Frame N: Bytes 0 to (X-1) are valid data. Byte X is the frame trailer, where X < 8.
The data composition for CRC calculation is as follows:
UAVCAN Signature | UAVCAN Data Frame 1 | UAVCAN Data Frame 2 | … | UAVCAN Data Frame N |
Signature (8 bytes) | Byte2 ~ Byte6 | Byte2 ~ Byte6 | … | Byte0 ~ Byte(X-1) |
UAVCAN Signature: The signature varies for different commands. For detailed signature encoding, refer to the UAVCAN command documentation.
UAVCAN Data Frame 1: Bytes 2 to 6 (valid data) are included in the CRC calculation.
UAVCAN Data Frame 2: Bytes 0 to 6 (valid data) are included in the CRC calculation.
UAVCAN Data Frame N: Bytes 0 to (X-1) (valid data) are included in the CRC calculation.
The CRC check algorithm is as follows:
- CRC Format: CRC-16-CCITT-FALSE
- Initial value: 0xFFFF
- Polynomial: 0x1021
- Reflection: No
- XOR: 0
← Previous
Add link here
Next →
Add link here
On this page
- UAVCAN Communication Protocol
- 1. UAVCAN Protocol Overview
- 2. UAVCAN Command
- 2.1 Node Status Command
- 2.2 Torque Switch Command
- 2.3 Single Motor Position Control Command
- 2.4 Multi-Motor Position Control Command
- 2.4.1 Control fewer than 3 servos
- 2.4.2 Control more than 3 servos
- 2.5 Auto-Report Data Feedback Command
- 2.6 Auto-Report Start/Pause Command
- 2.7 Parameter Write Command
- 2.8 Parameter Read Command
- 3. UAVCAN Protocol CRC Check