本页目录

XGO Serial Protocol

1. Overview

This document defines the command and data interaction protocol between an external host (PC, Raspberry Pi, Arduino, etc.) and the XGO series robot drive board. It is intended for advanced developers performing secondary development on the XGO platform.

1.1 Physical Layer (Hardware Interface)

  • Interface: Standard TTL Serial

  • Baud Rate: 115200 bps

  • Data Bits: 8

  • Stop Bits: 1

  • Parity: None

1.2 Data Frame Format

XGO uses a fixed-structure data frame to ensure reliability.

Field

Header

Length

Data

Checksum

Footer

Size (Bytes)

2

1

Variable

1

2

Value

0x55 0x00

Total Frame Size

See Instruction Types

Calculated

0x00 0xAA

  • Checksum Calculation: Sum all bytes of Length and Data, take the lowest byte (LOB), then perform a bitwise NOT operation (~).

  • Timing Requirement: It is recommended to maintain at least a 1ms interval between consecutive commands to prevent packet loss.

2. Instruction Types

2.1 Write Command (0x00) - No Response

Used to modify data starting from a specific address. No feedback is returned by the robot.

Example: Set Forward Speed to Maximum

  • Address:0x30 | Value:0xFF (Max)

  • Calculation:0x09 (Len) + 0x00 (Type) + 0x30 (Addr) + 0xFF (Val) = 0x138. LOB = 0x38. Bitwise NOT = 0xC7.

  • Frame:55 00 09 00 30 FF C7 00 AA

2.2 Read Command (0x02) - With Response

Used to query a sequence of data starting from a specific address.

Example: Read 12 Servo Angles

  • Address:0x50 | Length to Read:12 (0x0C)

  • Frame:55 00 09 02 50 0C 98 00 AA

  • Response Packet:55 00 14 12 50 [12 Bytes of Data] [Checksum] 00 AA

3. Coordinate Systems & Numbering

3.1 Robot Body Coordinate System

  • Origin: Directly beneath the center of the body at default standing height.

  • X-Axis: Positive forward.

  • Y-Axis: Positive to the left.

  • Z-Axis: Positive upward.

3.2 Single Leg Coordinate System

Each of the four legs has its own local coordinate system.

  • Origin: The hip joint.

  • x-axis: Positive forward.

  • y-axis: Positive to the left.

  • z-axis: Positive downward.

3.3 Servo ID Mapping

Each leg consists of three joints: Shoulder (3), Upper Arm (2), and Lower Arm (1).

Leg Position

Shoulder (3)

Upper Arm (2)

Lower Arm (1)

Front Left (1)

13

12

11

Front Right (2)

23

22

21

Back Right (3)

33

32

31

Back Left (4)

43

42

41

4. Register Map (Memory Table)

The robot's internal state and control parameters are mapped to specific register addresses.

  • Data Range: Most values range from 0x00 to 0xFF.

  • Neutral Point: For movement and position registers, 0x80 typically represents the neutral/center position or zero offset.

4.1 System & Mode Settings

Address

Function

R/W

Initial

Description

0x00

Work Status

R

0x00

System status information.

0x01

Battery Level

R

0xff

0-100 (Linear mapping from min to max voltage).

0x03

Performance Mode

W

0x00

0x00

: Normal; 0x01

: Loop all actions; 0x02

: Loop actions (no movement).

0x04

Calibration Mode

W

0x00

0x01

: Enter Calibration; 0x00

: Exit and save.

0x05

Firmware Update

W

0x00

0x01

: Enter update mode. Controller will echo the command before flashing.

0x06

Set Origin

W

-

0x01

: Set current heading as 0°.

0x07

Firmware Version

R

-

Returns a 10-byte string.

0x09

Gait Selection

W

0x00

0x00

: TROT; 0x01

: WALK; 0x02

: HIGH WALK.

0x20

Servo Torque

R/W

0x00

0x00

: Torque ON; 0x01

: Unload all; 0x11-14

: Unload Leg 1-4.

4.2 Whole-Body Movement Control

Address

Function

R/W

Initial

Description

0x30

Longitudinal Velocity

R/W

0x80

X-axis speed: 0x00

(Back) to 0xFF

(Forward).

0x31

Lateral Velocity

R/W

0x80

Y-axis speed: 0x00

(Right) to 0xFF

(Left).

0x32

Rotational Velocity

R/W

0x80

Yaw speed: 0x00

(CW) to 0xFF

(CCW).

0x33

Body X-Translation

R/W

0x80

Body shift along X-axis (feet fixed).

0x34

Body Y-Translation

R/W

0x80

Body shift along Y-axis (feet fixed).

0x35

Body Height

R/W

0x80

Body height (Z-axis).

0x36

Body Roll Angle

R/W

0x80

Rotation around X-axis.

0x37

Body Pitch Angle

R/W

0x80

Rotation around Y-axis.

0x38

Body Yaw Angle

R/W

0x80

Rotation around Z-axis.

0x3C

Mark Time (Stepping)

R/W

0x00

0x01-0xFF

: Min to Max stepping height.

0x3D

Speed Profile

R/W

0x00

0x00

: Normal; 0x01

: Slow; 0x02

: High Speed.

0x3E

Action Command

W

0x00

Trigger Action ID (see Action Table). 255

: Reset Pose.

4.3 Inverse Kinematics (IK) - Single Leg Mode

Address

Function

R/W

Address

Function

R/W

0x40

Leg 1 (FL) - X

R/W

0x46

Leg 3 (BR) - X

R/W

0x41

Leg 1 (FL) - Y

R/W

0x47

Leg 3 (BR) - Y

R/W

0x42

Leg 1 (FL) - Z

R/W

0x48

Leg 3 (BR) - Z

R/W

0x43

Leg 2 (FR) - X

R/W

0x49

Leg 4 (BL) - X

R/W

0x44

Leg 2 (FR) - Y

R/W

0x4A

Leg 4 (BL) - Y

R/W

0x45

Leg 2 (FR) - Z

R/W

0x4B

Leg 4 (BL) - Z

R/W

4.4 Servo Direct Control

Address

Servo ID

Description

Address

Servo ID

Description

0x50

11

FL Lower Arm

0x56

31

BR Lower Arm

0x51

12

FL Upper Arm

0x57

32

BR Upper Arm

0x52

13

FL Shoulder

0x58

33

BR Shoulder

0x5C

Speed

Global Servo Speed (Servo Mode only)

0x5D/E

52/53

Robotic Arm Servos

4.5 IMU & Robotic Arm

Address

Function

R/W

Description

0x60

YAW Calibration

W

Write 0x01

while static to calibrate (approx. 5s).

0x61

IMU Stabilization

R/W

0x00

: OFF; 0x01

: Self-stabilization mode.

0x62-64

IMU Angles (Float)

R

Read Roll, Pitch, Yaw in Float format.

0x66-68

IMU Angles (Short)

R

Read Roll, Pitch, Yaw in Int16 format.

0x71

Gripper Status

W

0x00

to 0xFF

(Fully Open to Fully Closed).

0x73/74

Gripper X / Z

W

Coordinate control for the end-effector.

4.6 Peripherals (LED & IO)

Address

Function

R/W

Description

0x69

LED 1 Color

W

Write 3 bytes [R, G, B]. Range: 0-255.

0x6A

LED 2 Color

W

Same as above.

0x6B

LED 3 Color

W

Same as above.

0x90

2-Pin 5V Out

W

0

: OFF; 1

: ON (High level).

0x91

Digital IO Out

W

0

: OFF; 1

: ON (Solenoid valve control).

0x92

Analog Read

R

Returns 1-byte value (0-255).

0x93

Digital Read

R

Returns 1-byte value (0 or 1).

5. Built-in Action Library (Preset Motions)

The robot features a library of pre-programmed actions. These motions can be interrupted by sending new movement or position commands.

  • Feedback: The robot does not send an "action complete" signal. It is recommended to implement a manual delay in your code based on the "Duration" column before sending the next comman

5.1 Basic Postures & Movements

ID (Dec)

Action Name

Duration (s)

Description

1

Lie Down

3

Robot transitions to a prone position.

2

Stand Up

3

Robot returns to the default standing pose.

3

Crawl

5

Low-profile forward movement.

4

Turn Around

5

Robot performs a 360-degree rotation.

6

Squat

4

Vertical up-and-down squatting motion.

144

Climb Stairs

12

Optimized gait for ascending/descending stairs.

255

Reset Pose

1

Immediate recovery to default neutral stance.

5.2 Body Rotation & Articulation

ID (Dec)

Action Name

Duration (s)

Description

7

Roll Rotation

4

Dynamic rotation around the X-axis.

8

Pitch Rotation

4

Dynamic rotation around the Y-axis.

9

Yaw Rotation

4

Dynamic rotation around the Z-axis.

10

3-Axis Rotation

7

Combined rotation of Roll, Pitch, and Yaw.

5.3 Interactive & Life-like Behaviors

ID (Dec)

Action Name

Duration (s)

ID (Dec)

Action Name

Duration (s)

11

Mark Territory (Pee)

7

18

Search for Food

6

12

Sit

5

19

Handshake

10

13

Wave Hand

7

20

Chicken Head

9

14

Stretch

10

21

Push-ups

8

15

Body Wave

6

22

Look Around

7

16

Swing Side-to-Side

6

23

Dance

6

17

Beg for Food

4

24

Naughty/Playful

7

5.4 Robotic Arm Actions (For Arm-Equipped Models)

ID (Dec)

Action Name

Duration (s)

Description

128

High Grab

10

Targeted grab at a high elevation.

129

Mid Grab

10

Targeted grab at a medium elevation.

130

Low Grab

10

Targeted grab at ground level.

6 XGO Rider (Bipedal-Wheel) Specific Register Map

The Rider series utilizes a specialized memory map to handle balancing, wheel odometry, and unique bipedal behaviors.

6.1 System & Communication Settings

Address

Function

R/W

Initial

Description

0x0A

Static Heading Lock

W

0x01

0x01

: Enable (Maintains current orientation when pushed).

0x30

Longitudinal Speed

W

0x80

0x00

(Reverse) to 0xFF

(Forward).

0x32

Rotational Speed

W

0x80

0x00

(CW) to 0xFF

(CCW).

0x35

Chassis Height

W

0x80

Adjusts the height of the bipedal legs.

0x61

Roll Balance Mode

W

0x00

0x00

: OFF; 0x01

: Self-Stabilization enabled.

6.2 Telemetry & IMU Data (6-Axis)

Address

Function

R/W

Format

Description

0x62-64

Euler Angles (Float)

R

Float

Roll, Pitch, and Yaw in floating point.

0x65

IMU 6-Axis Data

R

Float*6

24-byte packet containing raw IMU data.

0x66-68

Euler Angles (Short)

R

Int16

Roll, Pitch, and Yaw in 16-bit integer format.

6.3 Periodic Motions & Indicators

Address

Function

R/W

Initial

Description

0x39

Periodic Roll Swing

W

0x00

0x01-0xFF

: Cycle speed for side-to-side body sway.

0x82

Periodic Z-Translation

W

0x00

0x01-0xFF

: Cycle speed for up-and-down "bounce" motion.

0x3E

Action Command

W

0x00

Trigger preset Rider actions (see Rider Action Table).

0x69-6C

LED Colors (1-4)

W

[0,0,0]

Write 3 bytes [R, G, B] per LED to set colors.

6.4 XGO Rider Action Library (Preset Motions)

ID (Dec)

Action Name (English)

Description

1

Side-to-Side Sway

The robot oscillates its body laterally while maintaining balance.

2

Rhythmic Undulation

A vertical "up-and-down" motion resembling waves.

3

Forward-Backward Tilt

Controlled pitching motion moving the body front and back.

4

Square S-Curve

A complex "snake-like" movement following a square-wave path.

5

Rising Rotation

The robot changes its height while simultaneously spinning.

6

Circular Orbit

The body performs a circular "hula" or orbital shaking motion.

255

Reset Pose

Stops the current action and returns to the default balance state.