123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- /************************************************************************
- Project: Welling Motor Control Paltform
- Filename: crdnt.h
- Partner Filename: crdnt.c
- Description: The header file of crdnt.c
- Complier: IAR Embedded Workbench for ARM 7.80, IAR Systems.
- CPU TYPE : GD32F3x0
- *************************************************************************
- Copyright (c) 2018 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 CRDNT_H
- #define CRDNT_H
- /************************************************************************
- Modules used (included header files)
- *************************************************************************/
- #include "typedefine.h"
- /************************************************************************
- Compiler Directives
- *************************************************************************/
- #ifdef _CRDNT_C_
- #define _CRDNT_EXT
- #else
- #define _CRDNT_EXT extern
- #endif
- /************************************************************************
- Definitions & Macros (#define ...)
- *************************************************************************/
- #define CRD_CLARK_OUT_DEFAULT \
- { \
- 0, 0 \
- } // Default value of CLARKOUT
- #define CRD_PARK_OUT_DEFAULT \
- { \
- 0, 0 \
- } // Default value of PARKOUT
- #define CRD_IPARK_OUT_DEFAULT \
- { \
- 0, 0 \
- } // Default value of IPARKOUT
- #define CRD_ICLARK_OUT_DEFAULT \
- { \
- 0, 0, 0 \
- } // Default value of ICLARKOUT
-
- /************************************************************************
- TypeDefs & Structure defines (N/A)
- *************************************************************************/
- /************************************************************************
- fuction Clarke TypeDefs & Structure defines
- *************************************************************************/
- typedef struct
- { // Input of crd_voClark
- SWORD swAPu;
- SWORD swBPu;
- SWORD swCPu;
- } CRD_CLARK_IN;
- typedef struct
- { // outputs of crd_voClark
- SWORD swAlphaPu;
- SWORD swBetaPu;
- } CRD_CLARK_OUT;
- /************************************************************************
- function Park TypeDefs & Structure defines
- *************************************************************************/
- typedef struct
- { // Input of crd_voPark
- SWORD swAlphaPu;
- SWORD swBetaPu;
- UWORD uwThetaPu; // Q15
- } CRD_PARK_IN;
- typedef struct
- { // outputs of crd_voPark
- SWORD swDPu;
- SWORD swQPu;
- } CRD_PARK_OUT;
- /************************************************************************
- function Inverse park TypeDefs & Structure defines
- *************************************************************************/
- typedef struct
- { // Input of crd_voIpark
- SWORD swDPu;
- SWORD swQPu;
- UWORD uwThetaPu; // Q15
- } CRD_IPARK_IN;
- typedef struct
- { // outputs of crd_voIpark
- SWORD swAlphaPu;
- SWORD swBetaPu;
- } CRD_IPARK_OUT;
- /************************************************************************
- function Inverse clark TypeDefs & Structure defines
- *************************************************************************/
- typedef struct
- { // Input of crd_voIclark
- SWORD swIClarkAlfaPu;
- SWORD swIClarkBetaPu;
- } CRD_ICLARK_IN;
- typedef struct
- { // Output of crd_voIclark
- SWORD swIClarkaPu;
- SWORD swIClarkbPu;
- SWORD swIClarkcPu;
- } CRD_ICLARK_OUT;
- /************************************************************************
- Constant Table
- *************************************************************************/
- /************************************************************************
- Exported Variables:
- *************************************************************************/
- #ifdef _CRDNT_C_
- _CRDNT_EXT CRD_CLARK_OUT crd_stCurClarkOut = CRD_CLARK_OUT_DEFAULT;
- _CRDNT_EXT CRD_CLARK_OUT crd_stVltClarkOut = CRD_CLARK_OUT_DEFAULT;
- _CRDNT_EXT CRD_PARK_OUT crd_stCurParkOut = CRD_PARK_OUT_DEFAULT;
- _CRDNT_EXT CRD_PARK_OUT crd_stVltParkOut = CRD_PARK_OUT_DEFAULT;
- _CRDNT_EXT CRD_IPARK_OUT crd_stCurIParkOut = CRD_IPARK_OUT_DEFAULT;
- _CRDNT_EXT CRD_IPARK_OUT crd_stVltIParkOut = CRD_IPARK_OUT_DEFAULT;
- _CRDNT_EXT CRD_ICLARK_OUT crd_stCurIClarkOut = CRD_ICLARK_OUT_DEFAULT;
- _CRDNT_EXT CRD_ICLARK_OUT crd_stVltIClarkOut = CRD_ICLARK_OUT_DEFAULT;
- #else
- _CRDNT_EXT CRD_CLARK_OUT crd_stCurClarkOut;
- _CRDNT_EXT CRD_CLARK_OUT crd_stVltClarkOut;
- _CRDNT_EXT CRD_PARK_OUT crd_stCurParkOut;
- _CRDNT_EXT CRD_PARK_OUT crd_stVltParkOut;
- _CRDNT_EXT CRD_IPARK_OUT crd_stCurIParkOut;
- _CRDNT_EXT CRD_IPARK_OUT crd_stVltIParkOut;
- _CRDNT_EXT CRD_ICLARK_OUT crd_stCurIClarkOut;
- _CRDNT_EXT CRD_ICLARK_OUT crd_stVltIClarkOut;
- #endif
- /************************************************************************
- RAM ALLOCATION:
- *************************************************************************/
- #define crd_stClarkIn (*(CRD_CLARK_IN *)TBC_BUFFER)
- #define crd_stParkIn (*(CRD_PARK_IN *)TBC_BUFFER)
- #define crd_stIParkIn (*(CRD_IPARK_IN *)TBC_BUFFER)
- #define crd_stIClarkIn (*(CRD_ICLARK_IN *)TBC_BUFFER)
- /************************************************************************
- Exported Function Call Prototypes (N/A)
- *************************************************************************/
- #ifdef _CRDNT_C_
- _CRDNT_EXT void crd_voClark(CRD_CLARK_IN *in, CRD_CLARK_OUT *out);
- _CRDNT_EXT void crd_voPark(CRD_PARK_IN *in, CRD_PARK_OUT *out);
- _CRDNT_EXT void crd_voIPark(CRD_IPARK_IN *in, CRD_IPARK_OUT *out);
- _CRDNT_EXT void crd_voIClark(CRD_ICLARK_IN *in, CRD_ICLARK_OUT *out);
- #else
- _CRDNT_EXT void crd_voClark(CRD_CLARK_IN *in, CRD_CLARK_OUT *out);
- _CRDNT_EXT void crd_voPark(CRD_PARK_IN *in, CRD_PARK_OUT *out);
- _CRDNT_EXT void crd_voIPark(CRD_IPARK_IN *in, CRD_IPARK_OUT *out);
- _CRDNT_EXT void crd_voIClark(CRD_ICLARK_IN *in, CRD_ICLARK_OUT *out);
- #endif
- /************************************************************************
- 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!!!!!!!!!!!
- *************************************************************************/
|