refactor: migrate from DJI motors to DM motors, simplify to gimbal-only control

- Rewrite DM motor driver based on DM_6220 reference protocol (MIT/PosVel/Velocity modes)
- Use velocity control mode: MCU runs angle PID with IMU feedback, motor handles speed loop
- Rewrite vision protocol with 3 frame types (0xA5 auto data, 0xA6 manual data, 0xA7 command)
- Decouple serial parsing (opencv module) from mode switching (robot_cmd module)
- Implement dual-loop architecture: vision PID outer loop → angle ref → motor PID inner loop
- Add KF/PID reset on mode switch transitions
- Merge motor_reverse_flag and feedback_reverse_flag into single output_reverse flag
- Remove DMMotorEnable/DMMotorStop (motor always runs, controlled by angle ref)
- Remove unused modules: DJI/LK/HT/step/servo motors, chassis, shoot, referee
- Add ExitRun0Mode() for STM32H723 power supply configuration
- Clean up CMakeLists: 115 → 76 C source files
This commit is contained in:
2026-05-29 23:37:36 +08:00
parent 5b3333125d
commit 4d1702b577
17 changed files with 790 additions and 1485 deletions
+8 -31
View File
@@ -75,47 +75,35 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE
bsp/log/bsp_log.c
bsp/bsp_tools.c
# modules
# modules - algorithm
modules/algorithm/controller.c
modules/algorithm/kalman_filter.c
modules/algorithm/QuaternionEKF.c
modules/algorithm/crc8.c
modules/algorithm/crc16.c
modules/algorithm/user_lib.c
modules/bluetooth/HC05.c
# modules - sensors
modules/BMI088/bmi088.c
modules/imu/BMI088driver.c
modules/imu/BMI088Middleware.c
modules/imu/ins_task.c
# modules - communication
modules/master_machine/master_process.c
modules/master_machine/seasky_protocol.c
modules/motor/DJImotor/dji_motor.c
modules/motor/HTmotor/HT04.c
modules/motor/LKmotor/LK9025.c
modules/motor/DMmotor/dmmotor.c
modules/motor/step_motor/step_motor.c
modules/motor/step_motor/X_V2.c
modules/motor/servo_motor/servo_motor.c
modules/motor/motor_task.c
modules/oled/oled.c
modules/referee/crc_ref.c
modules/referee/rm_referee.c
modules/referee/referee_UI.c
modules/referee/referee_task.c
modules/remote/remote_control.c
modules/super_cap/super_cap.c
modules/can_comm/can_comm.c
modules/timachine/board_comm.c
# modules - motor
modules/motor/DMmotor/dmmotor.c
modules/motor/motor_task.c
# modules - system
modules/message_center/message_center.c
modules/daemon/daemon.c
modules/alarm/buzzer.c
modules/vofa/vofa.c
modules/opencv/opencv.c
modules/timachine/board_comm.c
# application
application/gimbal/gimbal.c
application/chassis/chassis.c
application/shoot/shoot.c
application/cmd/robot_cmd.c
application/robot.c
)
@@ -144,21 +132,12 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
# modules
modules/algorithm
modules/bluetooth
modules/BMI088
modules/imu
modules/master_machine
modules/motor/DJImotor
modules/motor/LKmotor
modules/motor/HTmotor
modules/motor/step_motor
modules/motor/servo_motor
modules/motor/DMmotor
modules/motor
modules/oled
modules/referee
modules/remote
modules/super_cap
modules/can_comm
modules/message_center
modules/daemon
@@ -169,8 +148,6 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
modules
# application
application/chassis
application/shoot
application/gimbal
application/cmd
application