51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
/**
|
|
* @file main.c
|
|
* @author jimingqing
|
|
* @date 2023-08-14
|
|
* @version 0.0.1
|
|
* @copyright XiazhiTech Copyright (c) 2023
|
|
*
|
|
* @brief
|
|
*/
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "main.h"
|
|
|
|
hall_handle_t hall_handle;
|
|
foc_handle_t foc_handle;
|
|
|
|
/* Function ------------------------------------------------------------------*/
|
|
|
|
/**
|
|
* @brief The application entry point.
|
|
* @retval int
|
|
*/
|
|
int main(void)
|
|
{
|
|
board_init();
|
|
// // FOC控制流程
|
|
// foc_handle.Vqd.d = 0;
|
|
// foc_handle.Vqd.q = 1;
|
|
// // 获取电角度
|
|
// // int16_t control_elec_angle = hall_handle.control_elec_angle;
|
|
// hall_handle.control_elec_angle++;
|
|
// // 计算Valpha Vbeta
|
|
// alphabeta_t Valphabeta = math_rev_park(foc_handle.Vqd, hall_handle.control_elec_angle);
|
|
// // 计算SVPWM输出
|
|
// // svmpw()
|
|
while (1)
|
|
{
|
|
// hall_handle.control_elec_angle++;
|
|
// foc_handle.Valphabeta = math_rev_park(foc_handle.Vqd, hall_handle.control_elec_angle);
|
|
// svmpw(foc_handle);
|
|
// 测试PWM输出
|
|
|
|
led_ctrl(1);
|
|
HAL_Delay(500);
|
|
led_ctrl(0);
|
|
HAL_Delay(500);
|
|
}
|
|
}
|
|
|
|
/* END OF FILE ---------------------------------------------------------------*/
|