feat(FOC): 添加齿槽转矩补偿功能

- 实现齿槽转矩补偿算法,通过查表+线性插值方式计算补偿电压值
- 添加齿槽转矩校准功能,支持正转3次+反转3次的非阻塞校准状态机
- 在所有控制模式中集成齿槽转矩补偿,包括开环、角度、速度、电流和MIT模式
- 硬编码预校准的正反转补偿表数据
- 通过CAN命令支持运行时触发校准功能
- 添加相关配置参数和调试开关
This commit is contained in:
cbb
2026-05-19 01:26:42 +08:00
parent 9955132e0e
commit bec7c11b87
7 changed files with 322 additions and 109 deletions
+6
View File
@@ -1153,6 +1153,12 @@ void CAN_transmiter::communication_check() {
Angle_kalman.init(0); // 角度滤波
Vel_kalman.init(0); // 角度滤波
}
// 齿槽转矩校准 (first_byte bit4) — DEBUG,平时不启用
#if FOC_DEBUG
if (first_byte >> 4 & 0x01) {
FOC.cogging_calib_request = true;
}
#endif
// 休眠
if (eigth_byte & 0x80 >> 7) {
app_prepare_deep_sleep(true);