Files
foc_ccs/3rd/dfoc.h

36 lines
919 B
C

#ifndef __DFOC_H
#define __DFOC_H
struct Motor_ {
int Mot_num;
float Ua;
float Ub;
float Uc;
float Ubeta;
float Ualpha;
float dc_a;
float dc_b;
float dc_c;
};
void Motor_en(void);
float constrain(float amt, float low, float high);
void SetPwm(int Mot_num, float Ua, float Ub, float Uc);
float normalizeAngle(float angle);
void SetPhaseVoltage(struct Motor_ *Motor, float Uq, float angle_el);
float cal_Iq_Id(float current_a, float current_b, float angle_el);
void Check_Sensor(void);
void FOC_Init(void);
float M0_electricAngle(void);
float M1_electricAngle(void);
void M0_Set_Angle(float Target);
void M0_Set_Velocity(float Target);
void M0_Set_CurTorque(float Target);
void M1_Set_Angle(float Target);
void M1_Set_Velocity(float Target);
void M1_Set_CurTorque(float Target);
float velocityopenloop(float target);
void Print_Velocity(int Motor_Velocity);
#endif