2024-05-08 03:04:20 +08:00
|
|
|
//
|
|
|
|
// Created by ZK on 2023/3/14.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef BOOOOMFOC_STSPIN32G4_EVB_CONTROLLER_H
|
|
|
|
#define BOOOOMFOC_STSPIN32G4_EVB_CONTROLLER_H
|
|
|
|
|
2024-05-17 00:43:58 +08:00
|
|
|
#include "arm_math.h"
|
|
|
|
|
2024-05-10 02:39:53 +08:00
|
|
|
typedef struct sFOC
|
|
|
|
{
|
|
|
|
bool is_armed;
|
|
|
|
|
|
|
|
float v_bus, v_bus_filt, i_a, i_b, i_c;
|
|
|
|
|
|
|
|
float i_q, i_q_filt, i_d, i_d_filt, i_bus, i_bus_filt, power_filt;
|
|
|
|
float dtc_a, dtc_b, dtc_c;
|
|
|
|
|
|
|
|
float current_ctrl_p_gain, current_ctrl_i_gain;
|
|
|
|
float current_ctrl_integral_d, current_ctrl_integral_q;
|
|
|
|
} tFOC;
|
|
|
|
|
|
|
|
extern tFOC FOC;
|
|
|
|
|
2024-05-17 00:43:58 +08:00
|
|
|
|
|
|
|
extern void SpeedControl(float32_t target,float32_t angleVal);
|
|
|
|
extern bool FOC_current(float Id_set, float Iq_set, float Theta, float bw);
|
2024-05-10 02:39:53 +08:00
|
|
|
|
|
|
|
|
2024-05-08 03:04:20 +08:00
|
|
|
#endif //BOOOOMFOC_STSPIN32G4_EVB_CONTROLLER_H
|