Skip to main content

XuanYa Agile Upper and Lower Computer Communication Protocol

Reading Guide
  1. The "XuanYa Agile/Exceed Upper and Lower Computer Communication Protocol" is continuously being optimized and iterated. If you find any version inconsistencies with this protocol during actual use, please contact us, and we will provide the required technical support immediately;

  2. All values in this protocol are uniformly represented in decimal or hexadecimal, where data marked with 0x is hexadecimal, and unmarked data is decimal;

  3. This protocol applies to all users who have purchased XuanYa Agile series products.

Last modified: May 23, 2025

1. Basic Composition of XuanYa Communication Protocol

The "XuanYa Agile Upper and Lower Computer Communication Protocol" is a data transmission protocol suitable for various communication methods, adopting a fixed frame format design to ensure stability and parsability during data transmission. The protocol data frame consists of the following fields: Frame Header, Command ID, Command Length, Control Command, Checksum, Frame Footer, with a communication baud rate of 921600:

1.1 Frame Header

  • Length: 1 Byte;

  • Value: Fixed at 0xAA;

  • Function: Marks the starting position of the data frame.

1.2 Command ID

  • Length: 1 Byte;

  • Value: Depends on actual protocol design (see Chapter 2), can represent controlling the robotic arm, reading robotic arm data, etc.;

  • Function: Each command ID corresponds to a specific control logic or data format, facilitating dynamic matching of processing flows during reception.

1.3 Command Length

  • Length: 1 Byte;

  • Value: An unsigned hexadecimal integer value, ranging from 0x00 to 0xFF;

  • Function: Specifies the length of the control command field, used to determine the boundary of control data in the data frame.

1.4 Control Command

  • Length: Determined by the command length field, i.e., [Command Length] Bytes;

  • Value: Specific control data, the parsing method of this part is determined by the Command ID field mentioned in 1.2;

  • Function: Carries the data content that needs to be executed or transmitted.

1.5 Checksum

  • Length: 1 Byte;

  • Value: Sum all bytes in the control command field, modulo 2 (i.e., sum(payload) % 2);

  • Function: Used for simple error detection of data packets, if verification fails, the receiver can reject the data frame.

  • Length: 1 Byte;

  • Value: Fixed at 0xFF;

  • Function: Marks the ending position of the data frame.

2. Command ID Reference Table

This chapter will explain different command IDs and their corresponding command lengths and control command definitions.

2.1 Command ID = 0x02 (Gripper Control and Feedback)

2.1.1 Send Frame

FieldValue and Description
Command ID and Function0x02 (Execute gripper travel control and travel feedback)
Command Length0x03
Control Command<Kit Identifier><Gripper Send Range Value 1><Gripper Send Range Value 2>

1. Kit Identifier:

  • <Kit Identifier>: Generally <0x01>.

2. Gripper Send Range Value:

  • <Gripper Send Range Value 1><Gripper Send Range Value 2>: Jointly control the gripper servo's opening and closing action, value range from <0x00><0x08> (gripper servo fully open) to <0xDA><0x0C> (gripper servo fully closed), i.e., decimal 2048 (gripper servo fully open) to 3290 (gripper servo fully closed);

  • <Gripper Send Range Value 1>: Lower 8 bits of the overall send value;

  • <Gripper Send Range Value 2>: Upper 8 bits of the overall send value.

2.1.2 Response Frame

FieldValue and Description
Command ID and Function0x02 (Execute gripper travel control and travel feedback)
Command Length0x07
Control Command<Kit Identifier><Gripper Response Range Value 1><Gripper Response Range Value 2><Potentiometer Response Range Value 1><Potentiometer Response Range Value 2><Sync Button><Pose Button>

1. Kit Identifier

  • <Kit Identifier>: Generally <0x01>.

2. Gripper Response Range Value

  • <Gripper Response Range Value 1><Gripper Response Range Value 2>: Represents the range value corresponding to the current position of the gripper servo;

  • <Gripper Response Range Value 1>: Generally equals <Gripper Send Range Value 1>, but may have slight deviations during actual operation;

  • <Gripper Response Range Value 2>: Generally equals <Gripper Send Range Value 2>, but may have slight deviations during actual operation.

3. Potentiometer Response Range Value

  • <Potentiometer Response Range Value 1><Potentiometer Response Range Value 2>: Represents the range value corresponding to the current position of the leader arm handle potentiometer;

  • <Potentiometer Response Range Value 1>: Equals <Gripper Response Range Value 1> in leader arm → follower arm sync state, but may have slight deviations during actual operation; may be a free value in non-sync state;

  • <Potentiometer Response Range Value 2>: Equals <Gripper Response Range Value 2> in leader arm → follower arm sync state, but may have slight deviations during actual operation; may be a free value in non-sync state.

4. Sync Button

  • <Sync Button>: Used to determine if synchronization between leader arm → follower arm is active, value <0x00> indicates sync button not pressed; value <0x01> indicates sync button pressed.

5. Pose Button

  • <Pose Button>: Used to determine if the leader arm's control pose is locked, value <0x00> indicates control pose button not pressed; value <0x01> indicates control pose button pressed.
Example: Operation to Fully Close the Gripper

In this scenario, the user needs to set the gripper's send range value to hexadecimal 0x0CDA (corresponding to decimal value 3290, indicating fully closed gripper state), therefore:

(1) Send Frame

| 0xAA | 0x02 | 0x03 | 0x01 | 0xDA | 0x0C | 0x00 | 0xFF |

From left to right:

0xAA: Frame header;

0x02: Command ID;

0x03: Data length, indicates sending 3 bytes of data;

0x01: Kit identifier, number 1;

0xDA: Lower eight bits of gripper send range value, i.e., DA of 0x0CDA;

0x0C: Upper eight bits of gripper send range value, i.e., 0C of 0x0CDA;

0x00: Checksum;

0xFF: Frame footer.

(2) Response Frame

| 0xAA | 0x02 | 0x07 | 0x01 | 0xDA | 0x0C | 0xDA| 0x0C | 0x01 | 0x01 | 0x01 | 0xFF |

From left to right:

0xAA: Frame header;

0x02: Command ID;

0x07: Data length, indicates responding with 7 bytes of data;

0x01: Kit identifier, number 1;

0xDA: Lower eight bits of gripper response range value, should be same as lower eight bits of gripper send range value in this scenario;

0x0C: Upper eight bits of gripper response range value, should be same as upper eight bits of gripper send range value in this scenario;

0xDA: Lower eight bits of potentiometer response range value, should be same as lower eight bits of gripper response range value in this scenario;

0X0C: Upper eight bits of potentiometer response range value, should be same as upper eight bits of gripper response range value in this scenario;

0X01: Sync button state is 0, indicating button is pressed;

0X01: Pose button state is 1, indicating button is pressed;

0x01: Checksum;

0xFF: Frame footer.

2.2 Command ID = 0x03 (Robotic Arm Zeroing)

FieldValue and Description
Command ID and Function0x03 (Set current position as zero point for robotic arm)
Command Length0x01 (Fixed at 1 byte length)