feat(FOC): 增加闭环速度控制算法

- 重构setPhaseVoltage函数实现,提高执行效率
- 增加update_power函数,动态更新电源电压
- 优化velocity_open_loop函数,调用、setPhaseVoltage避免重复代码
- 实现angle_control和velocity_control闭环控制函数
- 调整PID控制器参数初始化及增加参数设置接口
- 改进电流和编码器速度卡尔曼滤波器实现
- 更新CAN通信数据打包逻辑,增加测试字段
- 在定时器中断中集成多种控制模式切换逻辑
- 完善角度传感器数据处理,改进速度计算方法
- 减小速度滤波数组大小,提升响应速度
This commit is contained in:
cbb
2025-11-06 02:07:15 +08:00
parent 516a7bd41d
commit 971374d8ec
12 changed files with 355 additions and 172 deletions
+1
View File
@@ -106,6 +106,7 @@ class CAN_transmiter {
can_receive_message_struct receive_message; // 接收消息结构体
FlagStatus can0_receive_flag; // CAN0接收标志
FlagStatus can0_send_flag; // CAN0发送标志
float_union_t testfloat_union = {0}; // 测试用
void communication_check(); // 通信检查
};