实现完整串口指令协议:模式切换、手动控制、PID在线调参

- 新增 PIDClear() 仅清运行时状态,保留 Kp/Ki/Kd 等配置
- 命令帧 0xA7 (3B): 自动/手动/调试三模式切换,带模式状态追踪
- 手动控制帧 0xA6 (8B): 解析 motor_speed_base(int16) + angle_velocity(float)
- 调试调参帧 0xA8 (38B): 在线更新全部9个 Kp/Ki/Kd 参数
- Command 解析纳入 Task_50ms (20Hz) 定时执行
- 添加通信协议文档 docs/通信协议.md
This commit is contained in:
2026-06-07 16:23:10 +08:00
parent d120fa0d17
commit 022e3424da
7 changed files with 488 additions and 25 deletions
+7
View File
@@ -111,4 +111,11 @@ void PIDInit(PIDInstance *pid, PID_Init_Config_s *config);
*/
float PIDCalculate(PIDInstance *pid, float measure, float ref);
/**
* @brief 清除PID运行时状态(积分、误差、输出等),保留配置参数
*
* @param pid PID实例指针
*/
void PIDClear(PIDInstance *pid);
#endif