Skip to content

Repository files navigation

🤖 Origin

Gemini_Generated_Image_zcush7zcush7zcus

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 | 简体中文

Build StatusFirmware LicenseHardware LicensePlatform


📑 Table of Contents


🌟 Key Features

  • 🧠 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.

🏗️ System Architecture

The firmware (src/) utilizes a modular design. The main data flows are as follows:

  1. Sensor Layer (src/Hardware/): Reads MPU6050/ICM20948 data via I2C; captures GMR encoder pulses via Timers; parses incoming RC receiver signals.
  2. 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.
  3. Actuation Layer: Sends torque/position commands to Daran motors via CAN bus; outputs PWM signals to drive the MG513 chassis motors.
  4. Communication Layer (src/SYSTEM/protocol): Handles data packetizing/depacketizing with the PC tuning assistant, providing real-time system state feedback.

🧰 Hardware & Mechanical Design

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.

1. Mechanical Design (SolidWorks)

  • 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.
Origin_Assembly

2. Custom PCB (Hardware Circuits)

  • 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 .epro source 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

🔌 Bill of Materials (BOM)

CategoryComponent NameInterface/ProtocolCore Function
Main MCUSTM32F407 SeriesGlobalRuns FreeRTOS, core task scheduler
Edge ComputeRaspberry PiUART / USBExecutes machine vision algorithms & logic
Chassis MotorsMG513 with GMR encoder (x4)PWM + AB PhaseMecanum drive and high-frequency velocity feedback
MobilityMecanum Wheels (Set of 4)MechanicalOmnidirectional movement (strafing, diagonal, spin)
Suspension110mm RC springs (x8)MechanicalIndependent suspension (2 per wheel) for uneven terrain
Gimbal ActuatorsDaran Joint MotorCAN BusHigh-precision, zero-backlash gimbal stabilization
Gimbal Struct.Jingyan 12-Ch High-Current Slip RingElectrical360° continuous rotation without power/signal loss
IMU / SensingMPU6050I2CProvides chassis attitude data
Machine VisionBinocular Camera ModuleUSB / CSICaptures depth & frontal imagery for Raspberry Pi AI
Tactical Add-onLaser ModuleGPIOPrecise target indication in physical space
RC ReceiverET16S / FS-i6S ReceiverSerial (SBUS/PPM)Ultra-low latency manual override
FPV SystemCamera Module + VTXDirect PowerImmersive first-person video downlink
Interaction0.96-inch OLED ScreenI2CBasic system state display & debugging
Power System24V Battery PackXT30 / Heavy wirePowers motors, gimbal, and the entire control system

📂 Directory Structure

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)

🚀 Deployment & Commissioning

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:

1. Toolchain & Environment

  • IDE: Keil uVision 5 (or VS Code with the keil-assistant extension).
  • Device Pack: Requires Keil.STM32F4xx_DFP pack.
  • 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/protocol to 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).

2. Compilation & Flashing

  1. Clone the Source:
    git clone [https://github.com/My-user04/Origin.git](https://github.com/My-user04/Origin.git)
  2. Open the Project: Navigate to src/USER/ and double-click Yuandian.uvprojx to launch Keil uVision 5.
  3. Configure the Debugger:
    • Click Options for Target (magic wand icon) -> Debug tab.
    • Select your connected emulator (e.g., ST-Link Debugger or J-LINK).
    • Click Settings to ensure the STM32 chip is recognized, and check Reset and Run in the Flash Download tab.
  4. 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.

3. Hardware Power-On & Safety Checks ⚠️

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.

  1. Wiring Check: Double-check that the AB phases and PWM lines of the MG513 encoders are correctly seated.
  2. 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.
  3. 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.
  4. 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.

4. Vision Deployment (WIP...)

  • 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.

⚖️ License

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.

About

An STM32‑based modular multifunctional robotic platform featuring a dual‑axis stabilized gimbal, mecanum wheel omnidirectional mobility, FPV live video downlink, and a high‑performance independent suspension.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages