Skip to content

hanbinzheng/hero

Repository files navigation

Hero

Electrical control code for RMUL 2026

Architecture

  • Application Layer: High-level task management and logic for robot subsystems.
  • Algorithm Layer: Mathematical foundations including kinematics and state estimation.
  • Device Layer: Data Interpretation and control logic.
  • BSP Layer: Hardware abstraction and low-level peripheral drivers.

Project Structure

├── application/      # Logic-level task execution
│   ├── chassis         # Chassis control logic
│   ├── gimbal          # Pitch and Yaw control logic
│   ├── ammo            # Shotting logic
│   └── chore           # Referee UI and super capacitor tasks
├── algorithm/        # Core mathematical implementations
│   ├── kinematics      # Omni-directional chassis kinematics (omni-wheel and steering wheel)
│   ├── mahony          # Mahony filter for sensor fusion
│   ├── quaternion      # Quaternion-based calculation
│   └── pid             # PID control algorithms
├── device/           # Hardware component drivers
│   ├── can_device      # Reception callback of can device
│   ├── buzzer          # Buzzer encapsulation
│   ├── imu             # IMU data acquisition
│   ├── vision          # Communication with Orin Nano for self-aiming
│   ├── vt03            # Referee VT03 image link remote control
│   ├── referee         # General referee communication
│   ├── dji_motor       # Motors in use
│   ├── mi_motor        #
│   ├── dm_motor        #
│   └── dbus            # Remote control receiver (DBUS) protocol
└── bsp/              # Low-level hardware abstraction
    ├── bsp_fdcan       # FDCAN configurations
    ├── bsp_spi         # SPI for IMU communication
    ├── bsp_tim         # Timers for high-frequency control loops
    ├── bsp_usart       # Serial communication
    ├── bsp_dwt         # DWT for precise timing
    └── bsp_gpio        # GPIO configurations

Control Loops

The system utilizes hardware timer interrupts to ensure strict execution frequency for control stability:

TaskFrequencyTimerFunctionality
gimbal_task()1000 Hzhtim5yaw and pitch gimbal control, in application/Src/gimbal.c
ammo_task()125 Hzhtim12chassis control, in application/Src/ammo.c
chassis_task()125 Hzhtim15steering chassis control, in application/Src/chassis.c
chore_task()200 Hzhtim2chores like referee ui update, in application/Src/chore.c

Build & Requirements

  • Toolchain: Arm GNU Toolchain (GCC)
  • Build System: Makefile
  • Hardware: STM32H723VGT6 (damiao-mc02)
  • Framework: STM32Cube HAL Package

About

Electrical control code for RMUL 2026 hero robot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages