Wiznet makers

matthew

Published January 26, 2026 ©

128 UCC

9 WCC

38 VAR

0 Contests

0 Followers

1 Following

Original Link

Controlling Xiaomi CyberGear via CAN with M5Stack — A Practical Robotics Control Reference

cybergear_m5 shows CAN-based control of Xiaomi CyberGear with M5Stack, with optional W5500 Ethernet + PoE for remote monitoring and system integration.

COMPONENTS
PROJECT DESCRIPTION

 

Thunmbnail Image Source: https://github.com/project-sternbergia/cybergear_m5 

 

cybergear_m5

Controlling Xiaomi CyberGear Actuators with M5Stack — CAN-Based Robotics Control with Optional W5500 Ethernet & PoE


Introduction

cybergear_m5 is an open-source project that demonstrates how to control Xiaomi CyberGear smart actuators using M5Stack (ESP32) as a controller. The project focuses on CAN-based motion control, providing practical example code to initialize the actuator, read its state, and send motion commands.

What makes this project particularly interesting is that the hardware configuration explicitly supports two communication options:

a direct CAN transceiver unit, and

a LAN Module based on WIZnet W5500 with PoE,

allowing the same controller design to be used either as a standalone CAN controller or as a network-connected actuator node.


Quick background: What is Xiaomi CyberGear?

Xiaomi CyberGear is a compact smart actuator developed by Xiaomi Robotics Lab. It integrates a motor, driver, and encoder into a single unit and communicates over CAN, making it well suited for:

small robots and robotic arms,

research and educational platforms,

rapid prototyping in mechatronics projects.

Compared to traditional industrial servos, CyberGear offers a lower barrier to entry while still supporting precise motion control.


What this project is

 

Source: https://github.com/project-sternbergia/cybergear_m5 

Source: https://github.com/project-sternbergia/cybergear_m5 

 

The goal of cybergear_m5 is to provide a minimal but practical control stack for CyberGear actuators:

M5Stack (ESP32) acts as the main controller.

CyberGear actuators are connected on a CAN bus.

The firmware handles:

actuator initialization,

control-mode selection (position / velocity / torque),

periodic state reading (position, speed, torque, temperature),

command transmission via CAN frames.

Rather than being a finished product, this repository serves as a hands-on reference implementation for developers who want to start working with CyberGear hardware.


Hardware components (from README)

The README lists the following hardware components:

Xiaomi CyberGear

M5Stack Basic V2.7 (ESP32)

LAN Module (W5500 with PoE V12) or CANBus Unit (CA-IS3050G)

XT30 (2+2) power connector

Grove cables

This explicitly indicates that the LAN Module (W5500 with PoE) is an alternative to a dedicated CAN transceiver unit, depending on how the system is deployed.


How the LAN Module (W5500 with PoE) fits into the design

1) Core control path: CAN (deterministic motion control)

In the current source code, CyberGear control is performed over CAN:

M5Stack sends and receives CAN frames to/from the actuator.

CAN is used for all real-time motion-critical communication.

This path is deterministic and well suited for actuator control.

This is the primary focus of the example firmware in the repository.


2) Optional networked configuration: Ethernet via W5500

The inclusion of a W5500-based LAN Module with PoE in the hardware list suggests an extended deployment scenario:

The W5500 provides wired Ethernet connectivity to the M5Stack system.

PoE allows power and data to be delivered over a single Ethernet cable, simplifying wiring in lab, robot, or installation environments.

In such a configuration, the system can be viewed as:

Ethernet (W5500 + PoE)
        ↓
M5Stack (ESP32)
        ↓
CAN Bus
        ↓
Xiaomi CyberGear Actuators

Here, CAN remains the real-time motion-control bus, while Ethernet acts as a supervisory or integration layer.


3) Typical roles for W5500 in this project architecture

While the repository does not include Ethernet-specific firmware examples, the hardware choice enables several practical use cases:

  • Remote monitoring
    Expose actuator state (position, torque, temperature) to a PC or server over Ethernet.
  • High-level command input
    Accept motion commands or configuration parameters from a networked application and translate them into CAN frames locally.
  • Logging and diagnostics
    Stream CAN-derived data over Ethernet for logging, visualization, or debugging.
  • Clean deployment with PoE
    Use a single Ethernet cable for both power and communication, reducing wiring complexity in robotics setups.

Importantly, this keeps CAN timing isolated from Ethernet traffic, which is a common best practice in robotics and automation systems.


How it works (control flow)

AI-generated image

1.Initialization

  • M5Stack configures the CAN interface.
  • CyberGear node is detected and initialized.
  • Control mode is selected.

2.State monitoring

  • Actuator feedback is read periodically via CAN.
  • Values are displayed on the M5Stack screen or processed internally.

3.Command transmission

  • Target position, velocity, or torque values are sent as CAN messages.
  • The structure naturally supports multiple actuators on the same bus.

4.(Optional) Network integration via W5500

  • Ethernet traffic handles supervision and integration.
  • CAN remains dedicated to motion control.

Author & community context

The project is maintained by project-sternbergia on GitHub and reflects a research-oriented, hands-on robotics approach. The repository shares practical insights gained from working directly with CyberGear hardware, making it valuable for other developers experimenting with the same actuator.

  • X: 

Source: https://x.com/chikuta 

 


Why it matters

A clear starting point for CyberGear control
CyberGear documentation alone can be hard to translate into working firmware. This project shows how to actually drive the actuator via CAN.

Flexible architecture: standalone or networked
By supporting either a CAN transceiver unit or a W5500 LAN Module with PoE, the same controller design can scale from bench experiments to networked robotic systems.

Real-world robotics pattern
Using CAN for motion and Ethernet for supervision mirrors architectures used in larger industrial and research robots.

W5500 as an integration enabler
In this context, W5500 is not just “Ethernet access”—it enables clean power delivery (PoE) and system-level integration without compromising CAN timing.


cybergear_m5 Project FAQ

Q. What is the cybergear_m5 project?

A. cybergear_m5 is an open-source robotics project that uses an M5Stack (ESP32) to control Xiaomi CyberGear smart actuators. It provides a practical firmware example for initializing actuators, reading real-time states, and sending motion commands over a CAN bus. Uniquely, it supports hardware configurations using either a standard CAN unit or a W5500-based LAN Module with PoE for network integration.

Q. What hardware is required to build this system?

A. According to the project repository, the core components are:

  • Actuator: Xiaomi CyberGear (integrated motor, driver, and encoder).
  • Controller: M5Stack Basic V2.7 (ESP32).
  • Interface (Choose one):
    • Option A: A standard CANBus Unit (e.g., CA-IS3050G).
    • Option B: A LAN Module based on W5500 with PoE.
  • Power/Cabling: XT30 connectors and Grove cables.

Q. Why does the project include a W5500 Ethernet Module?

A. The W5500 LAN Module serves two strategic purposes in this architecture:

  1. Network Supervision: It allows the M5Stack to act as a gateway, receiving high-level commands or streaming telemetry (position, torque, temp) to a PC over Ethernet, while keeping the local CAN bus dedicated to real-time motion.
  2. Simplified Wiring (PoE): The module supports Power over Ethernet (PoE), enabling the entire controller setup to receive both data and power through a single Ethernet cable, which is ideal for clean robotic installations.

Q. How does the control logic work?

A. The system follows a clear "Controller-Gateway" pattern:

  • Initialization: The M5Stack configures the CAN interface and detects the CyberGear actuator.
  • Motion Control: The ESP32 sends determinist frames via CAN bus to set target position, velocity, or torque.
  • Feedback: The ESP32 periodically reads the actuator's status via CAN.
  • Integration (Optional): If the W5500 is used, the ESP32 can report this status to a central server or accept remote commands via TCP/UDP.

Q. Why is Xiaomi CyberGear significant for robotics?

A. The Xiaomi CyberGear is a high-performance actuator that combines a motor, driver, and encoder into a compact unit communicating over CAN. It lowers the barrier to entry for building robotic arms and quadruped robots compared to traditional industrial servos, making it highly popular for research and prototyping.

Q. What makes this project a good reference for developers?

A. It bridges the gap between raw hardware documentation and a working implementation. By demonstrating how to drive CyberGear actuators via CAN and providing an architecture that scales from standalone bench testing to Ethernet-connected (W5500) robotic nodes, it offers a versatile template for modern mechatronics.

 

Documents
Comments Write