1
0

MyProject.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef __MYPROJECT_H_
  2. #define __MYPROJECT_H_
  3. #include <FU6522_72.h>
  4. #include <FU6522_72_MDU.h>
  5. #include <customer.h>
  6. #include <protect.h>
  7. #include <Definition.h>
  8. #include <Parameter.h>
  9. #include <peripheral.h>
  10. #include <control.h>
  11. #include <protect_def.h>
  12. #include <led.h>
  13. #include <pwm.h>
  14. #include <protocol.h>
  15. typedef struct
  16. {
  17. int16 IuOffset; //Iu的偏置电压
  18. int32 IuOffsetSum; //Iu的偏置电压总和
  19. int16 IvOffset; //Iv的偏置电压
  20. int32 IvOffsetSum; //Iv的偏置电压总和
  21. int16 Iw_busOffset; //Iw或Ibus的偏置电压
  22. int32 Iw_busOffsetSum;//Iw或Ibus的偏置电压总和
  23. int16 IbusOffset; //Ibus的偏置电压
  24. int32 IbusOffsetSum;//IIbus的偏置电压总和
  25. int16 OffsetCount; //偏置电压采集计数
  26. int8 OffsetFlag; //偏置电压结束标志位
  27. } CurrentOffset;
  28. extern CurrentOffset xdata mcCurOffset;
  29. extern int16 idata Power_Currt;
  30. void GetCurrentOffset(void);
  31. void FOC_Init(void);
  32. void Motor_Charge(void);
  33. void Motor_Static_Open(void);
  34. void Motor_Align(void);
  35. typedef union
  36. {
  37. uint8 SetMode;
  38. struct
  39. {
  40. uint8 CalibFlag : 1;
  41. uint8 ChargeSetFlag : 1;
  42. uint8 AlignSetFlag : 1;
  43. uint8 StartSetFlag : 1;
  44. } SetFlag;
  45. } MotStaM;
  46. extern MotStaM McStaSet;
  47. typedef struct
  48. {
  49. uint8 ChargeStep;
  50. uint8 Flg_ATORampEnd;
  51. uint16 State_Count;
  52. int16 mcPosCheckAngle;
  53. uint8 CurrentAlignStatus;
  54. float AngleProcess;
  55. int16 AngleStart;
  56. } FOCCTRL;
  57. extern FOCCTRL xdata mcFocCtrl;
  58. void ATORamp(void);
  59. extern uint16 Abs_F16(int16 value);
  60. void Config_Init(void);
  61. #endif