Ling Upper/Lower Machine Communication Protocol
-
All values in this protocol are expressed uniformly in decimal or hexadecimal notation. Data prefixed with 0x are hexadecimal numbers; all other values without such a prefix are decimal numbers.
-
This protocol applies to all users who have purchased Xuanya Ling series products.
Last modified: March 6, 2026
1. Protocol Structure
The communication protocol for Ling series products consists of a frame header, command, function code, data length, data, checksum, and frame tail. The communication baud rate is 1000000.
| Field | Description | Example / Fixed Value |
|---|---|---|
| Frame Header | Start of the data frame | 0xAA (fixed) |
| Command | Control command ID corresponding to a specific control logic or data format, enabling dynamic routing during reception | Command ID |
| Function Code | Sub-function under each command; different functions correspond to different parameters | function |
| Data Length | Length of the subsequent "Data" field | length |
| Data | Joint position, velocity, acceleration, or torque data | data1 ~ dataN |
| Checksum | CRC32 checksum (lower 8 bits). Calculation rule: Check = Command ID + function + length + data1 ~ dataN | Check |
| Frame Tail | End of the data frame | 0xFF (fixed) |
1.1 Command ID and Function Description
| Command ID | Function |
|---|---|
| 0x01 | Query robot type, firmware version, hardware version, and unique identifier |
| 0x03 | Set robot zero position |
| 0x04 | Set gripper stroke |
| 0x05 | Control robot torque switch |
| 0x06 | Joint and gripper control and query |
| 0xFE | Robot self-check command |
2. Command Functions
2.1 Query Robot Information Command
Command ID is 0x01, used to query the robot's serial number, hardware version, and firmware version.
| Field | Value |
|---|---|
| Command | 0x01 |
| Function Code | 0x00 |
| Data Length | 0x01 |
| Data | 0xFE |
| Checksum | 0x23 |
Send Frame Example
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x01 | 0x00 | 0x01 | 0xFE | 0x23 | 0xFF |
Return Frame Example
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x01 | 0x00 | 0x18 | 0x41 0x44 0x4C 0x53 0x32 0x35 0x31 0x32 0x30 0x35 0x31 0x32 0x33 0x34 0x35 0x36 0x6E 0x00 0x00 0x00 0x62 0x02 0x00 0x00 | 0x92 | 0xFF |
Return Frame Data Parsing
The data field of the return frame contains 24 bytes (0x18), divided into three parts in order:
| Color | Field | Length | Corresponding Bytes |
|---|---|---|---|
| Blue | Serial Number | 16 bytes | 0x41 0x44 ... 0x35 0x36 |
| Orange | Hardware Version | 4 bytes | 0x6E 0x00 0x00 0x00 |
| Green | Firmware Version | 4 bytes | 0x62 0x02 0x00 0x00 |
Serial Number (16 bytes)
Each byte is the ASCII code of a character. The example above converts to the string: ADLS251205123456.
This represents: product identifier + manufacturing date + serial number suffix, unique to each device.
Hardware Version (4 bytes, little-endian)
The 4 bytes form a little-endian integer. In the example above: 0x6E 0x00 0x00 0x00 → decimal 110, indicating hardware version v1.10.
Conversion:
0x6E= 110 (decimal); the upper 3 bytes are all 0, so the integer value is 110. Version = 110 ÷ 100 = 1.10.
Firmware Version (4 bytes, little-endian)
Similarly, in the example above: 0x62 0x02 0x00 0x00 → decimal 610, indicating firmware version v6.10.
Conversion:
0x02× 256 +0x62= 512 + 98 = 610 (little-endian: low byte first). Version = 610 ÷ 100 = 6.10.
The checksum value of the return frame differs between devices because each device has a unique serial number; this is expected behavior.
2.2 Set Robot Zero Position Command
Command ID is 0x03, used to set the robot zero position. This command will disable the torque.
| Field | Value |
|---|---|
| Command | 0x03 |
| Function Code | 0x00 |
| Data Length | 0x01 |
| Data | 0xFE |
| Checksum | 0xA8 (when function code is 0x00) |
Function Code Description
| Function Code | Function |
|---|---|
| 0x00 | Ling series: Set zero position |
Example: Set Ling Zero Position
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x03 | 0x00 | 0x01 | 0xFE | 0xA8 | 0xFF |
2.3 Gripper Stroke Setting Command
Command ID is 0x04, used to set the gripper stroke. It also supports querying the current gripper stroke configuration.
| Field | Value |
|---|---|
| Command | 0x04 |
| Function Code | 0x00, 0x01, 0x02, 0x0E |
| Data Length | 0x01 |
| Data | 0xFE (when sending command); stroke type value (when querying) |
| Checksum | 0x7F |
Function Code Description
| Function Code | Function |
|---|---|
| 0x00 | Set gripper to 50 mm stroke |
| 0x01 | Set gripper to 75 mm stroke |
| 0x02 | Set gripper to 100 mm stroke |
| 0x0E | Query gripper stroke configuration |
Example 1: Set Gripper Stroke to 100 mm
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x04 | 0x02 | 0x01 | 0xFE | 0x7F | 0xFF |
Example 2: Query Gripper Stroke Configuration
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x04 | 0x0E | 0x01 | 0xFE | 0x7F | 0xFF |
Return Data Description
After querying the gripper stroke configuration, the returned data field contains the gripper stroke type, with the following mapping:
- 0x00: 50 mm stroke gripper
- 0x01: 75 mm stroke gripper
- 0x02: 100 mm stroke gripper
Return Frame Example (75 mm stroke)
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x04 | 0x0E | 0x01 | 0x01 | 0x7F | 0xFF |
2.4 Robot Torque Switch Command
Command ID is 0x05, used to set the robot torque switch.
| Field | Value |
|---|---|
| Command | 0x05 |
| Function Code | 0x00 |
| Data Length | 0x01 |
| Data | 0x00, 0x01 |
| Checksum | 0x6F |
Data Field Description
| Data Value | Meaning |
|---|---|
| 0x00 | Disable torque |
| 0x01 | Enable torque |
Command Frame Example
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x05 | 0x00 | 0x01 | 0x00 | 0x6F | 0xFF |
2.5 Joint and Gripper Control Command
Command ID is 0x06 for the joint and gripper control frame. This command includes multiple functions, each described below.
Get Position and Motion Status
- Function Code:
0x00 - Data:
0xFE - Data Length:
0x01
Send Frame Example:
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x00 | 0x01 | 0xFE | 0x9A | 0xFF |
Return Frame Example:
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x00 | 0x0F | 0x02 0x08 0xFB 0x07 0xFB 0x07 0x02 0x08 0xFA 0x07 0x01 0x08 0x03 0x08 0x00 | 0xA9 | 0xFF |
Data format: joint angles (2 bytes per joint) + gripper position (2 bytes) + motion status (1 byte), low byte first.
Ling series: 6 joint angles + gripper position + motion status.
Motion Status (last byte):
| Status Value | Meaning |
|---|---|
| 0x00 | Idle |
| 0x01 | Locked |
| 0x10 | Syncing |
| 0x11 | Sync + Locked |
| 0xE1 | Overheating |
| 0xE2 | Overheat Protection |
Get Temperature Data
- Function Code:
0x01 - Data:
0xFE
Send Frame Example (Alicia-DL Leader Arm has 6 servos; Follower Arm has 10):
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x01 | 0x01 | 0xFE | 0xAD | 0xFF |
Return Frame Example (Ling Leader returns 6 values; Follower returns 10):
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x01 | 0x0A | 0x23 0x24 0x23 0x26 0x23 0x26 0x23 0x25 0x24 0x24 | 0x4B | 0xFF |
Under the temperature function code, if the data is not 0xFE, it sets the maximum temperature protection threshold. Example: set maximum threshold to 100 (0x64); default value is 85:
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x01 | 0x01 | 0x64 | 0xF7 | 0xFF |
Get Velocity Data
- Function Code:
0x02 - Data:
0xFE
Send Frame Example (Alicia-DL Leader Arm has 6 servos; Follower Arm has 10):
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x02 | 0x01 | 0xFE | 0xF4 | 0xFF |
Return Frame Example (Ling Leader returns 6 values; Follower returns 10):
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x02 | 0x14 | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 | 0xE9 | 0xFF |
Joint, Gripper, and Status Control
- Function Code:
0x03 - Data Length:
0x1C - Data format: joint angles + velocity (4 bytes per joint), low byte first
- Ling series: 6 joint angles + gripper position
Example: Control each joint angle to 0°, velocity 1000, gripper half-closed (0x3E8). Maximum motion velocity is 5000; data order is position angle followed by velocity. Gripper mapping range is 0~1000, where 1000 is fully open to maximum stroke.
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0x06 | 0x03 | 0x1C | 0x00 0x08 0xE8 0x03 0x00 0x08 0xE8 0x03 0x00 0x08 0xE8 0x03 0x00 0x08 0xE8 0x03 0x00 0x08 0xE8 0x03 0x00 0x08 0xE8 0x03 0xF4 0x01 0xE8 0x03 | 0x6A | 0xFF |
2.6 Robot Self-Check Command
Command ID is 0xFE, used to detect whether each servo is functioning normally. Returns 2 bytes of data; from low to high, each bit represents the status of the servo with the corresponding ID from low to high: 1 = normal, 0 = abnormal. Ling Follower Arm uses 10 bits; Leader Arm uses 6 bits.
| Field | Value |
|---|---|
| Command | 0xFE |
| Function Code | 0x00 |
| Data Length | 0x03 |
Send Frame Example
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0xFE | 0x00 | 0x00 | 0xFE | 0x93 | 0xFF |
Return Frame Example (All Follower Arm Servos Normal)
| Frame Header | Command | Function Code | Data Length | Data | Checksum | Frame Tail |
|---|---|---|---|---|---|---|
| 0xAA | 0xFE | 0x00 | 0x02 | 0xFF 0x03 | 0x87 | 0xFF |