How heartpain-kong/dm02_control works
This is STM32H7 firmware for a motor-control development board, providing drivers for DJI, Unitree, Lingzu and Damiao motors, a DJI remote-control example, and mecanum/steering chassis control. The evidenced startup initializes peripherals and calls control-task initialization; the sampled motor task dispatches motor commands and receives some CAN feedback. The README documents additional capabilities, but their detailed runtime wiring is not shown in the excerpts, so those connections are left out.
Main entry points: motor_task.cpp Motor task · motor_DJ.cpp DJI motor · motor_LZ.cpp Lingzu motor · main.c Firmware startup
Components 17
Control application
- Control task
dm02_motor/User_File/task/control_task.cpp - Chassis control
dm02_motor/User_File/algorithm/chassis/chassis.cpp - PID algorithm
dm02_motor/User_File/algorithm/PID/alg_pid.cpp - Slope algorithm
dm02_motor/User_File/algorithm/Slope/alg_slope.cpp
Motor control
- Motor task
dm02_motor/User_File/task/motor_task.cpp - DJI motor
dm02_motor/User_File/motor/motor_DJ/motor_DJ.cpp - Lingzu motor
dm02_motor/User_File/motor/motor_LZ/motor_LZ.cpp - Unitree motor
dm02_motor/User_File/motor/motor_YS/motor_YS.cpp - Damiao motor
dm02_motor/User_File/motor/motor_DM/motor_DM.cpp
Board interfaces
- Remote parser
dm02_motor/User_File/Driver/remote_control/remote_control.cpp - FDCAN interface
dm02_motor/User_File/BSP/CAN/bsp_fdcan.cpp - UART interface
dm02_motor/User_File/BSP/UART/UART.cpp - USB CDC
dm02_motor/USB_DEVICE/App/usb_device.c
STM32 platform
- Firmware startup
dm02_motor/Core/Src/main.c - Peripheral setup
dm02_motor/Core/Src
Other components
- DJI remote
- Motor hardware
Connections 13
- Firmware startup → Peripheral setup: initializes
- Firmware startup → Control task: initializes
- DJI remote → Remote parser: sends input
- Motor task → Lingzu motor: sets and sends
- Motor task → DJI motor: sets and sends
- Motor task → Damiao motor: sets and sends
- Motor task → Unitree motor: sets and sends
- Motor task → DJI motor: routes feedback
- Motor task → Lingzu motor: routes feedback
- DJI motor → Motor hardware: motor commands
- Lingzu motor → Motor hardware: motor commands
- Damiao motor → Motor hardware: motor commands
- Unitree motor → Motor hardware: motor commands