123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- /************************************************************************
- Project: Welling Motor Control Paltform
- Filename: alignstartup.h
- Partner Filename: alignstartup.c
- Description: The header file of asr.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):
- ************************************************************************/
- #include "typedefine.h"
- /************************************************************************
- Beginning of File, do not put anything above here except notes
- Compiler Directives:
- *************************************************************************/
- #ifndef ALIGN_H
- #define ALIGN_H
- /************************************************************************
- Compiler Directives (N/A)
- *************************************************************************/
- #ifdef _ALIGN_C_
- #define _ALIGN_EXT
- #else
- #define _ALIGN_EXT extern
- #endif
- /************************************************************************
- Definitions & Macros (#define ...)
- *************************************************************************/
- #define ALIGN_COF_DEFAULT \
- { \
- 0, 0, 0 \
- } // Default value of ASR_SPDPI_COF
- #define ALIGN_OUT_DEFAULT \
- { \
- 0, 0, 0, 0 \
- } // Default value of ASR_SPDPI_OUT
- /************************************************************************
- global varibles Macros (#define ...)
- *************************************************************************/
- /************************************************************************
- TypeDefs & Structure defines
- *************************************************************************/
- typedef struct
- { // Input of " acr_voCurPI "
- ULONG ulStatCt; // Q14, Current reference
- SWORD swRotateDir; // Q14, Current feedback
- SWORD swCurRefrompu; // Q12, Voltage output maximum limit
- UWORD uwObsElecThetaPu;
- } ALIGN_IN;
- typedef struct
- { // Output of " acr_voCurPI "
- ULONG ulStatCt; // Q14, Output voltage feedback
- UWORD uwAngSwitchK;
- SLONG slIdRefPu; // Q26, Output voltage feedback
- SWORD swIdRefPu; // Q14, Error recorder
- SLONG slIqRefPu; // Q26, Output voltage feedback
- SWORD swIqRefPu; // Q14, Error recorder
- SLONG slDragSpdRefPu;
- SLONG slDragSpdPu;
- SLONG slAngManuPu;
- UWORD uwAngManuPu;
- UWORD uwAngRefPu;
- BOOL blStartUpOvrFlg;
- BOOL blCurSwitchOvrFlg;
- BOOL blAngSwitchOvrFlg;
- } ALIGN_OUT;
- typedef struct
- { // Input of " acr_voCurPI "
- UWORD uwAlignCurPu;
- ULONG ulAlignRampTbcCt; // Q12, Current coefficient of proportion
- ULONG ulAlignHoldTbcCt;
- ULONG ulAlignCurIncPerTbcPu; // Q15, Current coefficient of Integral
- UWORD uwDragCurPu; // Q15, Active Resistance
- ULONG ulDragSpdIncPerTbcPu;
- ULONG ulOpen2ClzCurIncPerTbcPu;
- ULONG ulDragSpdRampTbcCt;
- SLONG uwDragSpdPu;
- SLONG slAlignAngInit;
- ULONG ulOpen2ClzCurRampTbcCt;
- UWORD uwSPIreadOnceCt;
- } ALIGN_COF;
- /************************************************************************
- Exported Variables:
- *************************************************************************/
- #ifdef _ALIGN_C_
- _ALIGN_EXT ALIGN_COF align_stCoef = ALIGN_COF_DEFAULT;
- _ALIGN_EXT ALIGN_OUT align_stOut = ALIGN_OUT_DEFAULT;
- #else
- _ALIGN_EXT ALIGN_COF align_stCoef;
- _ALIGN_EXT ALIGN_OUT align_stOut;
- #endif
- /************************************************************************
- RAM ALLOCATION:
- *************************************************************************/
- #define align_stIn (*(ALIGN_IN *)TBC_BUFFER)
- /************************************************************************
- Exported Function Call Prototypes (N/A)
- *************************************************************************/
- #ifdef _ALIGN_C_
- _ALIGN_EXT void align_voInitPos(ALIGN_IN *in, ALIGN_COF *coef, ALIGN_OUT *out);
- _ALIGN_EXT void align_voStartUp(ALIGN_IN *in, ALIGN_COF *coef, ALIGN_OUT *out);
- _ALIGN_EXT void align_voOpen2Clz(ALIGN_IN *in, ALIGN_COF *coef, ALIGN_OUT *out);
- _ALIGN_EXT void align_voCoef();
- _ALIGN_EXT void align_voInit(void);
- #else
- _ALIGN_EXT void align_voInitPos(ALIGN_IN *in, ALIGN_COF *coef, ALIGN_OUT *out);
- _ALIGN_EXT void align_voStartUp(ALIGN_IN *in, ALIGN_COF *coef, ALIGN_OUT *out);
- _ALIGN_EXT void align_voOpen2Clz(ALIGN_IN *in, ALIGN_COF *coef, ALIGN_OUT *out);
- _ALIGN_EXT void align_voCoef();
- _ALIGN_EXT void align_voInit(void);
- #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!
- *************************************************************************/
|