#ifndef __CURRENT_DECOUPLED_CONTROL_H_ #define __CURRENT_DECOUPLED_CONTROL_H_ #define DQCurrentKpKiCalEnable (1) #define CURRENT_DECOUPLED_CONTROL_LD 0.0055 //(LD) #define CURRENT_DECOUPLED_CONTROL_LQ 0.011//(LQ) #define CURRENT_DECOUPLED_CONTROL_PSI (Psi*0.9) typedef struct { int16 Omega; int16 DCurrent0; int16 QCurrent0; int16 DCurrent; int16 QCurrent; int16 DcVoltage; int16 DDutyQ15; int16 QDutyQ15; int16 DCurrentDecoupledControlK; int16 QCurrentDecoupledControlK1; int16 QCurrentDecoupledControlK2; int16 QCurrentDecoupledControlK3; int16 DVoltageComponent; int16 DVoltageComponentAbs; int16 QVoltageComponent; int16 QVoltageComponentAbs; int16 QVoltageComponent1; int16 QVoltageComponent2; }CurrentDecoupledControlTypeDef; typedef struct { int16 DCurrentKpk; int16 QCurrentKpk; int16 DCurrentKik; int16 QCurrentKik; int16 KpwmkValue; int16 DCurrentKp; int16 QCurrentKp; int16 DCurrentKi; int16 QCurrentKi; int16 KpwmValue; }DQCurrentPITypeDef; //#define D_CURRENT_DECOUPLED_CONTROL_K _Q11(MAX_OMEG_RAD_SEC * CURRENT_DECOUPLED_CONTROL_LQ * HW_BOARD_CURR_BASE / HW_BOARD_VOLTAGE_BASE)//D轴解耦系数 //#define Q_CURRENT_DECOUPLED_CONTROL_K1 _Q13(MAX_OMEG_RAD_SEC * CURRENT_DECOUPLED_CONTROL_PSI / HW_BOARD_VOLTAGE_BASE)//Q轴解耦系数1 //#define Q_CURRENT_DECOUPLED_CONTROL_K2 _Q11(MAX_OMEG_RAD_SEC * CURRENT_DECOUPLED_CONTROL_LD * HW_BOARD_CURR_BASE / HW_BOARD_VOLTAGE_BASE)//Q轴解耦系数2 #define h (20.0)//中频带宽 //#define DCurrentKi_K (uint16)(CURRENT_DECOUPLED_CONTROL_LD * (h + 1.0) / 4.5 / h / h / TPWM_VALUE) //#define DCurrentKp_K (uint16)(CURRENT_DECOUPLED_CONTROL_LD * (h + 1.0) / 3.0 / h / TPWM_VALUE) //#define QCurrentKi_K (uint16)(CURRENT_DECOUPLED_CONTROL_LQ * (h + 1.0) / 4.5 / h / h / TPWM_VALUE) //#define QCurrentKp_K (uint16)(CURRENT_DECOUPLED_CONTROL_LQ * (h + 1.0) / 3.0 / h / TPWM_VALUE) //#define Kpwmk (uint16)(HW_BOARD_VOLTAGE_BASE / HW_BOARD_CURR_BASE)//逆变器增益系数 extern CurrentDecoupledControlTypeDef xdata mcCurrentDecoupledControl; extern DQCurrentPITypeDef xdata DQCurrentPI; extern void CurrentDecoupledControlFunction(void); //extern void CurrentDecoupledControlFunctionInit(void); extern void DQCurrentKpKiCal(void); extern void CurrentDecoupledControlFunctionInit(float MotorLd , float MotorLq , float MotorPsi , float VoltageBase , float CurrentBase , float OmegaRadSec); extern void DQCurrentKpKiCalInit(float MotorLd , float MotorLq , float Ts , float VoltageBase , float CurrentBase , float hValue); #endif