Skip to main content

Ling Upper/Lower Machine Communication Protocol

Reading Guide
  1. 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.

  2. 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.

FieldDescriptionExample / Fixed Value
Frame HeaderStart of the data frame0xAA (fixed)
CommandControl command ID corresponding to a specific control logic or data format, enabling dynamic routing during receptionCommand ID
Function CodeSub-function under each command; different functions correspond to different parametersfunction
Data LengthLength of the subsequent "Data" fieldlength
DataJoint position, velocity, acceleration, or torque datadata1 ~ dataN
ChecksumCRC32 checksum (lower 8 bits). Calculation rule: Check = Command ID + function + length + data1 ~ dataNCheck
Frame TailEnd of the data frame0xFF (fixed)

1.1 Command ID and Function Description

Command IDFunction
0x01Query robot type, firmware version, hardware version, and unique identifier
0x03Set robot zero position
0x04Set gripper stroke
0x05Control robot torque switch
0x06Joint and gripper control and query
0xFERobot 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.

FieldValue
Command0x01
Function Code0x00
Data Length0x01
Data0xFE
Checksum0x23

Send Frame Example

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x010x000x010xFE0x230xFF

Return Frame Example

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x010x000x180x41 0x44 0x4C 0x53 0x32 0x35 0x31 0x32 0x30 0x35 0x31 0x32 0x33 0x34 0x35 0x36 0x6E 0x00 0x00 0x00 0x62 0x02 0x00 0x000x920xFF

Return Frame Data Parsing

The data field of the return frame contains 24 bytes (0x18), divided into three parts in order:

ColorFieldLengthCorresponding Bytes
BlueSerial Number16 bytes0x41 0x44 ... 0x35 0x36
OrangeHardware Version4 bytes0x6E 0x00 0x00 0x00
GreenFirmware Version4 bytes0x62 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.

Note

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.

FieldValue
Command0x03
Function Code0x00
Data Length0x01
Data0xFE
Checksum0xA8 (when function code is 0x00)

Function Code Description

Function CodeFunction
0x00Ling series: Set zero position

Example: Set Ling Zero Position

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x030x000x010xFE0xA80xFF

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.

FieldValue
Command0x04
Function Code0x00, 0x01, 0x02, 0x0E
Data Length0x01
Data0xFE (when sending command); stroke type value (when querying)
Checksum0x7F

Function Code Description

Function CodeFunction
0x00Set gripper to 50 mm stroke
0x01Set gripper to 75 mm stroke
0x02Set gripper to 100 mm stroke
0x0EQuery gripper stroke configuration

Example 1: Set Gripper Stroke to 100 mm

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x040x020x010xFE0x7F0xFF

Example 2: Query Gripper Stroke Configuration

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x040x0E0x010xFE0x7F0xFF

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 HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x040x0E0x010x010x7F0xFF

2.4 Robot Torque Switch Command

Command ID is 0x05, used to set the robot torque switch.

FieldValue
Command0x05
Function Code0x00
Data Length0x01
Data0x00, 0x01
Checksum0x6F

Data Field Description

Data ValueMeaning
0x00Disable torque
0x01Enable torque

Command Frame Example

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x050x000x010x000x6F0xFF

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 HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x000x010xFE0x9A0xFF

Return Frame Example:

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x000x0F0x02 0x08 0xFB 0x07 0xFB 0x07 0x02 0x08 0xFA 0x07 0x01 0x08 0x03 0x08 0x000xA90xFF

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 ValueMeaning
0x00Idle
0x01Locked
0x10Syncing
0x11Sync + Locked
0xE1Overheating
0xE2Overheat Protection

Get Temperature Data

  • Function Code: 0x01
  • Data: 0xFE

Send Frame Example (Alicia-DL Leader Arm has 6 servos; Follower Arm has 10):

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x010x010xFE0xAD0xFF

Return Frame Example (Ling Leader returns 6 values; Follower returns 10):

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x010x0A0x23 0x24 0x23 0x26 0x23 0x26 0x23 0x25 0x24 0x240x4B0xFF

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 HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x010x010x640xF70xFF

Get Velocity Data

  • Function Code: 0x02
  • Data: 0xFE

Send Frame Example (Alicia-DL Leader Arm has 6 servos; Follower Arm has 10):

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x020x010xFE0xF40xFF

Return Frame Example (Ling Leader returns 6 values; Follower returns 10):

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x020x140x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x000xE90xFF

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 HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0x060x030x1C0x00 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 0x030x6A0xFF

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.

FieldValue
Command0xFE
Function Code0x00
Data Length0x03

Send Frame Example

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0xFE0x000x000xFE0x930xFF

Return Frame Example (All Follower Arm Servos Normal)

Frame HeaderCommandFunction CodeData LengthDataChecksumFrame Tail
0xAA0xFE0x000x020xFF 0x030x870xFF