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 feedback: the controller combines the installed IMU and actuator feedback for motion control. Hardware revisions may use a 6-axis ICM-42670 or 9-axis ICM-20948; check the actual board specification.

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.
Luwu-OS software layers
On the upper computer, the Qt C++ launcher starts PySide6 applications and forwards button events. Linux drivers and system services own hardware interfaces. The CM5 communicates with the ESP32 motion controller over UART; application code uses xgolib. See Development: System Architecture for processes, services and IPC.
