How mrbuchixiangcai/micro-wheeled_leg-robot works
Project Type and Purpose
• This is a tightly integrated robotics project combining:
• Mechanical design (CAD models, 3D-printed, CNC-machined, and carbon-fiber panels).
• Electronic hardware (four custom PCBs, sensors, and actuators).
• Embedded software (ESP32-based firmware using Arduino IDE and simpleFOC motor control).
• Network/Web interface (WiFi AP/STA with WebSocket JSON communication and browser-based UI).
File Structure
• 1.RobotModel: CAD source (OriginalRobotModel.stp); manufactured parts separated into 3D printing, CNC, and panel cutting; purchased-parts BOM.
• 2.Hardware: Four PCB projects (Controller, Encoder, IMU, ServoDebug) each with BOM, Gerber, schematic, and source JSON.
• README files describe firmware dependencies, wiring, and usage.
Extract Architectural Insights from README
• Main controller: ESP32 + L6234 brushless driver; communicates with AS5600 encoder and MPU6050 IMU over I²C; servo bus uses time-division multiplexing; WebSocket server in firmware serves a web UI stored in flash.
• Firmware built in Arduino IDE leveraging simpleFOC and a custom WebSocket library.
• Remote clients (Chrome/Firefox on any OS) connect via WebSocket to control the robot.
1. Mechanical Assembly
– CAD model (.stp) → Manufacturing pipelines (3D print, CNC, panels).
2. Power Subsystem
– Battery pack → XH2.54 connector → 5 V/3.3 V regulators on main PCB.
3. Electronic Hardware
– Main Control PCB (ESP32 + L6234 driver)
– Encoder PCB (AS5600)
– IMU PCB (MPU6050)
– ServoDebug PCB (Serial mux board)
4. Actuators & Sensors
– Brushless wheel motors
– FEETECH bus servos (legs)
– Encoders (AS5600)
– IMU (MPU6050)
5. Embedded Firmware Layer
– Arduino Sketch
– Hardware abstraction: simpleFOC motor driver, I²C driver, serial bus driver, WebSocket server, JSON parser
– Configuration (FEETECH debug settings, encoder calibration)
6. Network & UI
– WiFi AP/STA modes (ESP32 WiFi stack)
– Web page (HTML/JS) stored in flash → served over WebSocket
– Remote client (Browser) with joystick UI
7. External Tools & Libraries
– simpleFOC library
– WebSocket Arduino library
– LCEDA PCB toolchain (for PCB sources)
– FEETECH Debug Software (servo config)
• Battery → Main Control PCB power inputs → voltage regulators → ESP32 & sensors
• ESP32 ↔ AS5600 (I²C lines)
• ESP32 ↔ MPU6050 (same I²C bus)
• ESP32 → L6234 driver → Brushless motors (FOC control commands)
• ESP32 ↔ FEETECH servos (time-division multiplexed serial)
• ESP32 WiFi stack → WebSocket → Browser UI
• Browser → Joystick commands → ESP32 → motor/servo control loop
• Firmware modules ↔ external libraries (simpleFOC, WebSocket, JSON)
c. Architectural Patterns & Principles
• Layered architecture in firmware:
Presentation (WebSocket + web UI)
Control (command dispatcher)
Hardware abstraction (motor, sensor drivers)
• Separation of concerns:
Mechanical CAD → manufacturing
Electronics design → independent PCB modules
Firmware → cross-device abstraction via libraries
• Use of bus multiplexing for servo debugging
d. Key Technologies & Frameworks
• ESP32 (WiFi + dual-core MCU)
• Arduino IDE
• simpleFOC library (brushless control)
• WebSocket + JSON (realtime remote control)
• AS5600, MPU6050 sensors
• L6234PD013TR motor driver
• LCEDA (PCB design)