/************************************************************************ Project: Welling Motor Control Paltform Filename: torqobs.h Partner Filename: torqobs.c Description: The header file of asr.c Complier: IAR Embedded Workbench for ARM 8.40, IAR Systems. CPU TYPE : STM32F30x ************************************************************************* Copyright (c) 2022 Welling Motor Technology(Shanghai) Co. Ltd. All rights reserved. ************************************************************************* ************************************************************************* Revising History (ECL of this file): ************************************************************************/ /************************************************************************ Beginning of File, do not put anything above here except notes Compiler Directives: *************************************************************************/ #ifndef TORQOBS_H #define TORQOBS_H #include "typedefine.h" /************************************************************************ Definitions & Macros (#define ...) *************************************************************************/ /************************************************************************ global varibles Macros (#define ...) *************************************************************************/ /************************************************************************ TypeDefs & Structure defines *************************************************************************/ typedef struct { UWORD uwRatioJm; // Q0, Ratio of load inertia and motor inertia UWORD uwMtJm; // Motor rotational inertia UWORD uwMtFlxWb; // unit: 0.01mWb, Flux linkage UWORD uwUbVt; // unit: 0.1V, Voltage base UWORD uwIbAp; // unit: 0.01A, Current base UWORD uwFbHz; // unit: Hz, Frequency base UWORD uwFTbsHz; // TBS frequency UWORD uwPairs; // Pole pairs base UWORD uwWtcHz; // unit:Hz,Load torque observer bandwidth } TORQOBS_COEFIN; typedef struct { UWORD uwKpPu; UWORD uwKitPu; ULONG uwCur2TorqKPu; ULONG ulJmPu_Inv; UWORD uwTCtrPu; } TORQOBS_COEFOUT; typedef struct { SWORD swIqfbkPu; SWORD swSpdPu; SWORD swIqMaxPu; SWORD swIqMinPu; }TORQOBS_IN; typedef struct { SWORD swSpdObsPu; SLONG slSpdObsPu; SWORD swTorqObsPu; SWORD swErrZ1Pu; SLONG slIqLoadPu; SWORD swIqLoadPu; SLONG slDeltaTorqPu; } TORQOBS_OUT; /************************************************************************ TypeDefs & Structure defines *************************************************************************/ /************************************************************************ Constant Table *************************************************************************/ /************************************************************************ Exported Variables: *************************************************************************/ extern TORQOBS_COEFIN torqobs_stCoefIn; extern TORQOBS_COEFOUT torqobs_stCoef; extern TORQOBS_IN torqobs_stCalIn; extern TORQOBS_OUT torqobs_stCalOut; /************************************************************************ RAM ALLOCATION: *************************************************************************/ /************************************************************************ Exported Function Call Prototypes (N/A) *************************************************************************/ void torqobs_voInit(void); void torqobs_voCoef(TORQOBS_COEFIN *in, TORQOBS_COEFOUT *out); void torqobs_voCal(TORQOBS_IN *in, TORQOBS_COEFOUT *cof, TORQOBS_OUT *out); /************************************************************************ Flag Define (N/A) *************************************************************************/ #endif /************************************************************************ Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd. All rights reserved. ************************************************************************* End of this File (EOF)! Do not put anything after this part! *************************************************************************/