/************************************************************************ Project: Welling FAN Motor Developing platform Filename: fluxweaken.h Partner Filename: fluxweaken.c Description: Partner file of fluxweaken.c Complier: IAR Embedded Workbench for ARM 7.80, IAR Systems. CPU TYPE : ST32F0xx ************************************************************************* Copyright (c) 2019 Welling Motor Technology(Shanghai) Co. Ltd. All rights reserved. ************************************************************************* ************************************************************************* Revising History (ECL of this file): 20191225, by cyf, create this file; ************************************************************************/ #include "typedefine.h" #include "macroequ.h" /************************************************************************ Beginning of File, do not put anything above here except notes Compiler Directives: *************************************************************************/ #ifndef FWCTRl_H #define FWCTRl_H /************************************************************************ Compiler Directives (N/A) *************************************************************************/ #ifdef _FWCTRL_C_ #define FWCTRl_EXT #else #define FWCTRl_EXT extern #endif /************************************************************************ Definitions & Macros *************************************************************************/ /************************************************************************ Constant Table (N/A) Is = 0.6A ,Iq^2 = Is^2 - Id^2 *************************************************************************/ //#if (USER_MOTOR_ID == USER_HUAWEI_V2) #define FW_CNTS 17 static const SWORD fw_swIqLimTab[FW_CNTS] = { 10240, // 0,id = 0A ,Iqlimit = 0.6A 10240, // 1,id = -0.025A 10240, // 2,id = -0.05A 10240, // 3,id = -0.075A 10240, // 4,id = -0.1A 10240, // 5,id = -0.125A 10240, // 6,id = -0.15A 10240, // 7,id = -0.175A 10240, // 8,id = -0.2A 10240, // 9,id = -0.225A 10240, // 10,id = -0.25A 10240, // 11,id = -0.275A 10240, // 12,id = -0.3A 10240, // 13,id = -0.325A 10240, // 14,id = -0.35A 10240, // 15,id = -0.375A 10240, // 16,id = -0.4A }; //#endif /************************************************************************ TypeDefs & Structure defines (N/A) *************************************************************************/ typedef struct { UWORD uwUdcCnt; UWORD uwUdcMinPu; UWORD uwUdcPu; SWORD swEnable; SWORD swIdFwoutPu; SLONG slIdFwoutPu; SWORD swFwIqLimPu; SWORD swVolErrPu; UWORD uwFwCoefPu; // Q14 } FW_OUT; typedef struct { UWORD uwKpPu; // Q14 UWORD uwKitPu; // Q14 SWORD swIdMinPu; // Q14 SWORD swIdCharacterPu; // Q14 SWORD swIqMinPu; SWORD swIqMaxPu; } FW_COFIN; typedef struct { UWORD uwKpPu; // Q14 UWORD uwKitPu; // Q14 SWORD swIdMinPu; // Q14 SWORD swIdCharacterPu; // Q14 SWORD swIqMinPu; SWORD swIqMaxPu; } FW_COF; typedef struct { SWORD swPwmalphaPu; // Q14 SWORD swPwmbetaPu; // Q14 UWORD uwUdcPu; // Q14 } FW_IN; /************************************************************************ Exported Variables *************************************************************************/ #ifdef _FWCTRL_C_ FWCTRl_EXT FW_OUT fw_stFluxWeakeningOutPu; FWCTRl_EXT FW_COF fw_stFluxWeakeningCoefPu; #else FWCTRl_EXT FW_OUT fw_stFluxWeakeningOutPu; FWCTRl_EXT FW_COF fw_stFluxWeakeningCoefPu; #endif /************************************************************************ RAM ALLOCATION: *************************************************************************/ #define fw_stFluxWeakeningInPu (*(FW_IN *)TBC_BUFFER) #define fw_stFluxWeakeningCoefInPu (*(FW_COFIN *)MN_BUFFER) /************************************************************************ Exported Function Call Prototypes *************************************************************************/ #ifdef _FWCTRL_C_ FWCTRl_EXT void fw_voFluxWeakeningGen(FW_IN *IN, FW_COF *COF, FW_OUT *OUT); FWCTRl_EXT void fw_voFluxWeakeningCoef(FW_COFIN *COFIN, FW_COF *COF); FWCTRl_EXT void fw_voInit(void); #else FWCTRl_EXT void fw_voFluxWeakeningGen(FW_IN *IN, FW_COF *COF, FW_OUT *OUT); FWCTRl_EXT void fw_voFluxWeakeningCoef(FW_COFIN *COFIN, FW_COF *COF); FWCTRl_EXT void fw_voInit(void); #endif /************************************************************************ Local Function Call Prototypes (N/A) *************************************************************************/ /************************************************************************ Flag Define (N/A) *************************************************************************/ #endif /************************************************************************ Copyright (c) 2019 Welling Motor Technology(Shanghai) Co. Ltd. All rights reserved. ************************************************************************* End of this File (EOF)! Do not put anything after this part! *************************************************************************/