How tangwp1588/mini-mechanum-wheel-robot works
This is STM32 firmware for a four-wheel mecanum robot. The documented runtime workflow accepts ESP32 gamepad commands, applies drive-mode and yaw correction, computes wheel targets, closes each wheel’s speed loop using encoder feedback, and drives the motors. It also provides an ST7789 telemetry and PID-tuning interface. The README documents the control stages; excerpts confirm startup, controller handling, UART, and display integration. Several control and UI implementation details were not sampled, so those links rely on README evidence.
Main entry points: controller_input.c Controller processing · uart_handler.c Gamepad UART · pid.c Yaw correction · kinematics.c Mecanum kinematics
Components 16
Runtime startup
- Firmware startup
Core/Src/main.c
Command and sensing
- Gamepad UART
Core/Src/uart_handler.c - Controller processing
Core/Src/controller_input.c - IMU interface
Core/Src/bno08x.c
Motion control
- Yaw correction
Core/Src/pid.c - Mecanum kinematics
Core/Src/kinematics.c - Wheel speed PID
Core/Src/pid.c
Hardware interfaces
- Motor output
Core/Src/motor.c - Encoder feedback
Core/Src/encoder.c
Display and tuning
- ST7789 display
Drivers/ST7789/st7789.c - Telemetry and PID menu
Core/Src/menu.c
Other components
- Remote operator
- ESP32 wireless
- BNO085 IMU
- TB6612 driver
- Four encoder motors
Connections 17
- Remote operator → ESP32 wireless: sends commands
README.md - ESP32 wireless → Gamepad UART: transmits input
README.md - Firmware startup → Gamepad UART: initializes UART
Core/Src/main.c - Gamepad UART → Controller processing: provides controller data
- BNO085 IMU → IMU interface: provides heading
README.md - Controller processing → Yaw correction: enables correction
Core/Src/controller_input.c - IMU interface → Yaw correction: supplies yaw
README.md - Yaw correction → Mecanum kinematics: corrects command
README.md - Controller processing → Mecanum kinematics: selects drive mode
README.md - Mecanum kinematics → Wheel speed PID: sets wheel targets
README.md - Encoder feedback → Wheel speed PID: feeds speed feedback
README.md - Wheel speed PID → Motor output: sets motor drive
README.md - Motor output → TB6612 driver: drives outputs
README.md - TB6612 driver → Four encoder motors: powers motors
README.md - Firmware startup → ST7789 display: initializes display
Core/Src/main.c - Telemetry and PID menu → ST7789 display: renders telemetry
- Remote operator → Telemetry and PID menu: tunes PID
README.md