How mz0210/six-axis-robot-arm works
This repository is firmware for a standalone STM32F407 six-axis robot arm. The principal workflow accepts USART commands, parses motion requests, computes inverse kinematics and synchronized trajectories, then controls joints and sends Emm_V5 commands over CAN. The README also documents forward kinematics, action sequences, and periodic encoder calibration. Source excerpts are limited, so most application relationships below rely on the documented architecture; peripheral and CMSIS layers are grouped rather than mapped file by file.
Main entry points: freertos.c FreeRTOS Tasks · app_robot.c Command and Actions · can.c CAN Interface · main.c Firmware Startup
Components 19
Application
- Command and Actions
机器人Freertos/Core/Src/app_robot.c - FreeRTOS Tasks
机器人Freertos/Core/Src/freertos.c - Stored Action Sequences
机器人Freertos/Core/Src/app_robot.c
Motion Control
- DH Kinematics
机器人Freertos/Core/Src/robot_kinematics.c - DLS Inverse Kinematics
机器人Freertos/Core/Src/robot_ik_dls.c - S-Curve Trajectory
机器人Freertos/Core/Src/trajectory_planner.c - Trajectory Port
机器人Freertos/Core/Src/trajectory_planner_port.c
Motor Control
- Joint Control
机器人Freertos/Core/Src/MotorControl.c - Emm_V5 Protocol
机器人Freertos/Core/Src/Emm_V5.c - Encoder Feedback
机器人Freertos/Core/Src/MotorControl.c
Embedded Platform
- Firmware Startup
机器人Freertos/Core/Src/main.c - CAN Interface
机器人Freertos/Core/Src/can.c - USART Interface
机器人Freertos/Core/Src/usart.c - Timer Interface
机器人Freertos/Core/Src/tim.c - Interrupt Handlers
机器人Freertos/Core/Src/stm32f4xx_it.c - STM32 HAL
机器人Freertos/STM32F4xx_HAL_Driver/Inc - CMSIS Device Support
机器人Freertos/CMSIS
Other components
- Command Host
- Six Stepper Motors
Connections 23
- Command Host → USART Interface: sends commands
- USART Interface → Command and Actions: provides input
- Command and Actions → FreeRTOS Tasks: runs in tasks
- FreeRTOS Tasks → DLS Inverse Kinematics: dispatches motion
- Command and Actions → Stored Action Sequences: runs sequences
- Stored Action Sequences → DLS Inverse Kinematics: requests joint solutions
- DLS Inverse Kinematics → DH Kinematics: uses forward model
- FreeRTOS Tasks → S-Curve Trajectory: schedules 20 ms task
- Command and Actions → S-Curve Trajectory: requests Cartesian motion
- S-Curve Trajectory → Trajectory Port: uses port layer
- FreeRTOS Tasks → Joint Control: runs control loop
- Joint Control → Emm_V5 Protocol: issues motor commands
- Emm_V5 Protocol → CAN Interface: transmits CAN frames
- CAN Interface → Six Stepper Motors: controls over CAN
- Six Stepper Motors → CAN Interface: returns CAN feedback
- CAN Interface → Interrupt Handlers: signals receive events
- USART Interface → Interrupt Handlers: signals receive events
- Timer Interface → Interrupt Handlers: signals timer events
- Firmware Startup → STM32 HAL: initializes peripherals
- Firmware Startup → FreeRTOS Tasks: starts scheduler
机器人Freertos/Core/Src/main.c - FreeRTOS Tasks → Encoder Feedback: schedules calibration
- Encoder Feedback → Joint Control: calibrates joint control
- Firmware Startup → CMSIS Device Support: uses device support