System Architecture: The Bi-Level Intelligence
1. Overview: Heterogeneous Computing
XGO adopts a heterogeneous Bi-Level Architecture that mimics biological nervous systems. Just as a human utilizes a cerebrum for reasoning and a cerebellum for motor control, XGO decouples high-level AI processing from real-time motion execution.
- Upper Computer (The Brain): Handles high-bandwidth, Soft Real-time tasks (Vision, LLMs). .
- Lower Computer (The Cerebellum): Handles low-latency, deterministic tasks (Gait, Balance).
This decoupled design ensures safety and stability: heavy AI workloads or OS freezes on the Raspberry Pi will never interfere with the robot's active balancing loop, which runs independently on the MCU.

Fig.1 Bi-Level Architecture
2. Layer 1: The Cognitive Layer (Upper Computer)
- Hardware: Raspberry Pi Compute Module 5 (CM5).
- Role: Acts as the decision-making center. It handles high-bandwidth, soft real-time tasks such as AI Computer Vision and Large Language Model (LLM) interaction.
- Why Separate? Unlike the motion control layer, AI processes have variable execution times. By isolating them on the CM5, we ensure that a momentary lag in video processing never affects the robot's physical balance.

Fig.2 Upper Computer
3. Layer 2: The Control Layer (Lower Computer)
- Hardware: ESP32-WROVER (Dual-Core 240MHz).
- OS: FreeRTOS.
- Role: Acts as the execution center. It receives "Motion Intentions" and solves the Inverse Kinematics (IK) or Dynamics Model (LQR) to calculate target angles for each actuator.
- Cycle Time: Strictly deterministic (Motion Loop @ 200Hz - 1000Hz).
- Sensor Fusion: Integrates data from the internal 6-Axis IMU (ICM-42670) and servo feedback (position/current) to maintain stability on uneven terrain.

Fig.3 Lower Computer
4. The Neural Bridge: Communication Protocol
The two layers communicate via a high-speed UART (Serial) interface.
- Protocol Safety: The protocol includes a
Header,Length,Command ID,Payload, andChecksum.
