refactor(FOC): 添加Doxygen文档注释并优化SVPWM算法性能

添加了完整的Doxygen文档注释到FOC算法模块的所有函数、类和变量,提升了代码可读性和维护性。同时优化了SVPWM算法实现,将atan2f替换为符号法扇区判断,显著提升计算效率(约15周期vs atan2f 300周期),并改进了arm_sin_cos_f32替代sqrtf提高性能。

feat(FOC): 统一电气角度计算避免重复运算

重构代码以统一电气角度计算,在各个控制循环中只计算一次电气角度并传递给需要的函数,避免了多次重复的fmodf运算和角度归一化操作,提升了实时控制性能。

refactor(Filter): 改进α-β观测器角度处理精度

修改角度卡尔曼滤波器在归一化角度空间[0,360)内工作,避免大累积角度的浮点精度损失问题,确保静止状态下不会产生虚假速度,同时保持与下游代码的兼容性。

refactor: 为算法模块添加完整文档注释

为所有算法模块(FOC、Filter、pid、thermal)添加了详细的Doxygen文档注释,包括函数说明、参数描述、返回值说明等,便于代码理解和API文档生成。
This commit is contained in:
cbb
2026-05-23 22:46:32 +08:00
parent bec7c11b87
commit 4c4e47e9e3
62 changed files with 10367 additions and 126 deletions
@@ -1,3 +1,9 @@
/**
* @file RTE/_Debug_GD32C103CB/RTE_Components.h
* @brief GD32 RTE 外设库或运行时配置源文件
* @note 本文件仅补充 Doxygen 文档注释,不改变代码逻辑。
*/
/*
* CSOLUTION generated file: DO NOT EDIT!
* Generated by: csolution version 2.13.0+p3-g40b6564e
@@ -13,43 +19,62 @@
/*
* Define the Device Header File:
*/
/** @brief CMSIS_device_header 宏定义 */
#define CMSIS_device_header "gd32c10x.h"
/* GigaDevice::Device:GD32C10x_StdPeripherals:ADC@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_ADC 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_ADC
/* GigaDevice::Device:GD32C10x_StdPeripherals:BKP@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_BKP 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_BKP
/* GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_CAN 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_CAN
/* GigaDevice::Device:GD32C10x_StdPeripherals:CRC@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_CRC 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_CRC
/* GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_DBG 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_DBG
/* GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_DMA 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_DMA
/* GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_EXTI 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_EXTI
/* GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_FMC 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_FMC
/* GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_FWDGT 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_FWDGT
/* GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_GPIO 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_GPIO
/* GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_MISC 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_MISC
/* GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_PMU 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_PMU
/* GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_RCU 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_RCU
/* GigaDevice::Device:GD32C10x_StdPeripherals:RTC@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_RTC 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_RTC
/* GigaDevice::Device:GD32C10x_StdPeripherals:SPI_I2S@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_SPI 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_SPI
/* GigaDevice::Device:GD32C10x_StdPeripherals:TIMER@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_TIMER 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_TIMER
/* GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_USART 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_USART
/* GigaDevice::Device:GD32C10x_StdPeripherals:WWDGT@1.0.0 */
/** @brief RTE_DEVICE_STDPERIPHERALS_WWDGT 宏定义 */
#define RTE_DEVICE_STDPERIPHERALS_WWDGT