feat(FOC): 优化开环速度控制逻辑并提升性能

refactor(ADC): 重构采样逻辑并封装为 sampler 类
refactor(CAN): 更新 CAN 发送器以使用新的sampler 接口
refactor(timer): 调整定时器中断结构并优化任务调度
This commit is contained in:
cbb
2025-10-19 23:20:28 +08:00
parent 34df732659
commit 7f0ca1857b
8 changed files with 309 additions and 151 deletions
+23 -5
View File
@@ -7,14 +7,32 @@ extern "C" {
#include "stdint.h"
float get_mcu_temp(void);
float get_drv_temp(void);
float get_vbus_voltage(void);
float get_current(char);
class sampler {
private:
float vbus_samples[7];
float currU_samples[7];
float currV_samples[7];
float currW_samples[7];
float mcu_temp_samples[7];
float drv_temp_samples[7];
float tempora_sample;
public:
void init();
void update_mcu_temp(void);
void update_drv_temp(void);
void update_vbus_voltage(void);
void update_current(void);
float get_mcu_temp(void);
float get_drv_temp(void);
float get_vbus_voltage(void);
float get_current(char);
};
#ifdef __cplusplus
}
#endif
#endif