
Origin is a highly integrated, omnidirectional mobile robotics platform. Based on an STM32 main controller and a Raspberry Pi for high-level computer vision, it features a 2-DOF gimbal driven by Daran joint motors, a mecanum wheel chassis, real-time FPV video downlink, and a machine vision target recognition system. It is ideal for robotics algorithm validation, inspection/reconnaissance, and secondary development.
English | 简体中文
- 🌟 Key Features
- 🏗️ System Architecture
- 🧰 Hardware & Mechanical Design
- 🔌 Bill of Materials (BOM)
- 📂 Directory Structure
- 🚀 Deployment & Commissioning
- ⚖️ License
- 🧠 Robust Core Controller
- Based on the STM32F407 microcontroller, developed using the STM32 Standard Peripheral Library (FWLIB).
- Runs the FreeRTOS real-time operating system for efficient and stable multi-tasking (kinematics solver, gimbal control, sensor fusion, and protocol parsing).
- 🚀 High-Precision Omnidirectional Chassis
- Features a 4-wheel independent mecanum drive system.
- Powered by MG513 gear motors equipped with GMR high-precision magnetic encoders. Utilizes STM32 timer AB-phase capture for high-frequency closed-loop PID velocity control and precise odometry.
- 🎯 Infinite-Rotation 2-DOF Tactical Gimbal
- Driven by Daran joint motors (via CAN bus) providing zero-backlash, ultra-precise attitude control.
- Innovatively integrates a Slip Ring to allow 360° continuous, infinite rotation on the Yaw axis, completely eliminating cable tangling.
- Equipped with a high-power laser module for precise target indication in physical space.
- 📡 Advanced Sensing & Interaction
- Attitude Estimation: Onboard MPU6050 IMU provides accurate chassis attitude data.
- Manual Override: Natively supports ET16S and FS-i6S (FlySky) RC transmitters (via SBUS/PPM protocol) for ultra-low latency manual control.
- PC Tuning: Built-in custom serial protocol (
protocol) seamlessly interfaces with a PC-based serial tuning assistant for real-time PID monitoring and adjustment.
- 👁️ Dual Vision System
- AI Edge Computing: Mounts a binocular camera module paired with a Raspberry Pi to execute depth extraction and OpenCV/YOLO-based target recognition. The Pi sends high-level movement commands via a reserved serial port.
- Zero-Latency FPV: Hardware-based FPV camera and VTX (Video Transmitter) provide an immersive, real-time first-person view.
The firmware (src/) utilizes a modular design. The main data flows are as follows:
- Sensor Layer (
src/Hardware/): Reads MPU6050/ICM20948 data via I2C; captures GMR encoder pulses via Timers; parses incoming RC receiver signals. - Compute & Control Layer (FreeRTOS Tasks): Executes mecanum wheel forward/inverse kinematics; calculates PID closed-loop outputs for chassis wheels and the gimbal's Daran joint motors.
- Actuation Layer: Sends torque/position commands to Daran motors via CAN bus; outputs PWM signals to drive the MG513 chassis motors.
- Communication Layer (
src/SYSTEM/protocol): Handles data packetizing/depacketizing with the PC tuning assistant, providing real-time system state feedback.
Origin is more than just software. It includes a complete, built-from-scratch mechanical structure and custom circuit boards. All hardware source files are open-sourced under the hardware/ directory.
- Omnidirectional Chassis with Independent Suspension: Features a modular frame. Each of the four mecanum wheels is equipped with an independent suspension system (dual 110mm RC shock absorbers per wheel). This hardcore mechanical design ensures all wheels maintain ground contact and traction over uneven terrain, guaranteeing the accuracy of the kinematics solver.
- Infinite Rotation Gimbal: Custom-designed gimbal bracket and payload basket. Clever internal wire routing combined with a "Jingyan 12-channel high-current slip ring" perfectly solves wire twisting during multi-turn, wide-range target tracking.
- To handle the 24V power system and multi-voltage rail requirements (5V for Raspberry Pi, 3.3V for MCU and sensors), dedicated main control and motor drive boards were designed.
- PCBs were routed using EasyEDA Pro. In addition to providing
.eprosource files in this GitHub repo, detailed interactive BOMs and 1-click fabrication files are hosted on the OSHWHub platform. - 👉 Click here to view the Origin hardware project page on OSHWHub
| Category | Component Name | Interface/Protocol | Core Function |
|---|---|---|---|
| Main MCU | STM32F407 Series | Global | Runs FreeRTOS, core task scheduler |
| Edge Compute | Raspberry Pi | UART / USB | Executes machine vision algorithms & logic |
| Chassis Motors | MG513 with GMR encoder (x4) | PWM + AB Phase | Mecanum drive and high-frequency velocity feedback |
| Mobility | Mecanum Wheels (Set of 4) | Mechanical | Omnidirectional movement (strafing, diagonal, spin) |
| Suspension | 110mm RC springs (x8) | Mechanical | Independent suspension (2 per wheel) for uneven terrain |
| Gimbal Actuators | Daran Joint Motor | CAN Bus | High-precision, zero-backlash gimbal stabilization |
| Gimbal Struct. | Jingyan 12-Ch High-Current Slip Ring | Electrical | 360° continuous rotation without power/signal loss |
| IMU / Sensing | MPU6050 | I2C | Provides chassis attitude data |
| Machine Vision | Binocular Camera Module | USB / CSI | Captures depth & frontal imagery for Raspberry Pi AI |
| Tactical Add-on | Laser Module | GPIO | Precise target indication in physical space |
| RC Receiver | ET16S / FS-i6S Receiver | Serial (SBUS/PPM) | Ultra-low latency manual override |
| FPV System | Camera Module + VTX | Direct Power | Immersive first-person video downlink |
| Interaction | 0.96-inch OLED Screen | I2C | Basic system state display & debugging |
| Power System | 24V Battery Pack | XT30 / Heavy wire | Powers motors, gimbal, and the entire control system |
The project strictly follows a software/hardware separation principle:
Origin/
├── hardware/ # Hardware and structural design source files
│ ├── mechanical/ # SolidWorks 3D models (chassis, gimbal, slip ring, etc.)
│ └── PCB/ # Schematics and PCB layouts (main board, driver board)
├── src/ # STM32 low-level firmware (FreeRTOS based)
│ ├── CORE/ # Cortex-M4 core files
│ ├── FWLIB/ # STM32F4 Standard Peripheral Library
│ ├── FreeRTOS/ # FreeRTOS source code
│ ├── Hardware/ # Peripheral driver layer
│ │ ├── DrEmpower/ # Daran joint motor CAN drivers
│ │ ├── ICM20948/ & MPU6050/ # IMU attitude sensor drivers
│ │ ├── RC_drv/ # ET16S & FS-i6S receiver parsers
│ │ └── encoder.c, motor.c...# Encoders, motors, OLED, etc.
│ ├── SYSTEM/ # System-level services
│ │ └── protocol/ # PC serial tuning protocol parser
│ └── USER/ # Keil entry point (main.c) & IRQ handlers
├── .gitignore
├── README.md & README.zh.md
├── LICENSE # Software Open Source License (GPLv3)
└── LICENSE-HW # Hardware Open Source License (CC BY-NC-SA 4.0)
The project is divided into STM32 lower-level control and Raspberry Pi upper-level vision. Below is the guide for compiling and tuning the lower-level firmware:
- IDE: Keil uVision 5 (or VS Code with the
keil-assistantextension). - Device Pack: Requires
Keil.STM32F4xx_DFPpack. - Debugger: ST-Link V2 or J-Link emulator.
- Hardware Viewer: EasyEDA Pro (to open files under
hardware/PCB/). - Waveform Tuning: Wildfire (YeHuo) Multi-function Debug Assistant (Interfaces with
SYSTEM/protocolto plot real-time PID curves—a must-have for chassis tuning). - Gimbal Config: Daran Motor Host Software (Used to assign CAN IDs, set zero-points, and test torque).
- Emergency Flashing: FlyMcu (Useful to unbrick the MCU via Serial ISP if SWD is locked due to incorrect pin configurations).
- Clone the Source:
git clone [https://github.com/My-user04/Origin.git](https://github.com/My-user04/Origin.git)
- Open the Project: Navigate to
src/USER/and double-clickYuandian.uvprojxto launch Keil uVision 5. - Configure the Debugger:
- Click Options for Target (magic wand icon) -> Debug tab.
- Select your connected emulator (e.g.,
ST-Link DebuggerorJ-LINK). - Click Settings to ensure the STM32 chip is recognized, and check
Reset and Runin the Flash Download tab.
- Build & Download:
- Press F7 (Build) to compile the project. Ensure there are
0 Error(s)in the build output. - Connect your debugger to the main board's SWD port, power the board, and press F8 (Download) to flash the firmware.
- Press F7 (Build) to compile the project. Ensure there are
SAFETY WARNING: This project utilizes a 24V power system and high-torque joint motors. For the first power-on, you MUST elevate the chassis to suspend all mecanum wheels off the ground. Incorrect PID polarities can cause the robot to violently spin out of control (runaway) and cause injury or damage.
- Wiring Check: Double-check that the AB phases and PWM lines of the MG513 encoders are correctly seated.
- Gimbal Calibration: Before running the code, connect a USB-to-CAN module to your PC and use the Daran Motor Host Software to calibrate the mechanical zero-point of the gimbal motors.
- Main Power: Turn on your RC transmitter, plug in the 24V battery, and verify that the OLED screen boots up and displays the initialization state.
- PID Tuning via PC:
- Connect a USB-to-TTL module from your PC to the main board's tuning serial port.
- Open the Wildfire Debug Assistant and map the corresponding channels.
- Input a target velocity and observe the actual velocity waveform. Progressively tune P, I, and D parameters until the waveform converges rapidly without severe overshoot.
- Documentation for Raspberry Pi vision algorithms and binocular camera integration is currently being organized. OpenCV environment setup and UART communication protocols will be added soon.
This project adopts a dual-track "Software/Hardware Separation" licensing model to protect hardware IP while fostering software community collaboration:
💻 Software / Firmware The microcontroller source code under the
src/directory is licensed under the GNU General Public License v3.0. You are free to modify, use, and distribute this code, provided you strictly comply with the GPLv3 terms (including its copyleft provisions).🧰 Hardware / 3D Models / PCB All physical design files under the
hardware/directory (including SolidWorks models, assemblies, schematics, and PCBs) are licensed under the CC BY-NC-SA 4.0 (Attribution-NonCommercial-ShareAlike 4.0 International) license. You are free to share and adapt these designs for personal learning and DIY purposes, but they are strictly prohibited from being used for commercial profit or mass production/sale. You must give appropriate credit and distribute your contributions under the same license.
Note: Third-party open-source components included in this project (such as FreeRTOS and STM32 Standard Peripheral Libraries) remain strictly subject to the original licenses provided by their respective authors or vendors.