| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- #ifndef __Protect_H_
- #define __Protect_H_
- #include "FU68xx_5.h"
- #include <Myproject.h>
- typedef enum
- {
- FaultNoSource = 0, // 无故障
- FaultHardOVCurrent = 1, // 硬件过流
- FaultSoftOVCurrent = 2, // 软件过流
- FaultUnderVoltage = 3, // 欠压保护 OK
- FaultOverVoltage = 4, // 过压保护 OK
- FaultLossPhase = 5, // 缺相保护
- FaultStall = 6, // 堵转保护
- FaultStart = 7, // 启动保护 NO
- FaultPFC = 8, // PFC保护
- FaultIpmTemp = 9, // IPM温度保护 OK
- Faultcummution = 10, // 通信保护
- FaultIbusOffset = 11, //pianzhi
- FaultGuanTempSensor = 12, //pianzhi
- FaultHuanTempSensor = 13, //pianzhi
- FaultshuruLoss = 14,
-
- } FaultStateType;
- typedef enum
- {
- PFCFaultNoSource = 0, // 无故障
- PFCFaultHardOVCurrent = 1, // 硬件过流
- PFCFaultOverVoltage = 2, // 过压保护
- PFCFaultIbusOffset = 3,
- } PFCFaultStateType;
- typedef struct
- {
- uint16 IbusOffsetRecoverCnt; ///偏执电压保护恢复时间
- uint16 OverVoltDetecCnt; // 过压检测计数
- uint16 UnderVoltDetecCnt; // 欠压检测计数
- uint16 VoltRecoverCnt; // 过压恢复计数
- uint8 IbusOffsetProtectTimes; //偏执电压保护次数
- uint16 CurrentGP03Count;
- }PFCFaultVarible;
- typedef struct
- {
- uint16 SecondStartTimes; // 二次启动保护的次数
- uint16 StallTimes; // 堵转保护次数
- uint16 LossPHTimes; // 缺相保护次数
- uint16 CurrentPretectTimes; // 过流保护次数
- uint8 StartFlag; // 启动保护的标志位,用于判断哪个方法起作用
- uint8 StallFlag; // 堵转保护的标志位,用于判断哪个方法起作用
- uint8 IbusOffsetProtectTimes; //偏执电压保护次数
- uint8 shurulossTimes;
-
- }ProtectVarible;
- typedef struct
- {
- uint8 segment; // 分段执行
- //voltage protect
- uint16 OverVoltDetecCnt; // 过压检测计数
- uint16 UnderVoltDetecCnt; // 欠压检测计数
- uint16 VoltRecoverCnt; // 过压恢复计数
- uint16 OverTempDetecCnt; // 过温检测计数
- uint16 OverHuantempDetecCnt; // 过温检测计数
- uint16 OverGuantempDetecCnt; // 过温检测计数
- uint16 TempRecoverCnt; // 过温恢复计数
- uint16 HuantempRecoverCnt; // 过温恢复计数
- uint16 GuantempRecoverCnt; // 过温恢复计数
- uint32 CurrentRecoverCnt; // 过流保护恢复计数
- uint8 IbusOffsetRecoverCnt; ///偏执电压保护恢复次数
- //stall protect
- uint16 StallDelayCnt; // 堵转延迟判断计时
- uint16 StallDectEs; // method 1,与ES相关
- uint16 StallDectEs2; // method 1,与ES相关
- uint16 StallDectSpeed; // method 2,与速度相关
- uint32 StallReCount; // 堵转保护恢复计数
-
- //Loss Phase protect
- uint16 Lphasecnt; // 缺相保护计时
- uint16 AOpencnt ; // A缺相计数
- uint16 BOpencnt ; // B缺相计数
- uint16 COpencnt ; // C缺相计数
- uint16 mcLossPHRecCount; // 缺相恢复计数
- uint16 shurulossRecCount; // 缺相恢复计数
- int16 shurulossCnt;
-
- int32 CurrentASum;
- int32 CurrentBSum;
- int32 CurrentCSum;
-
- int16 CurrentAAlign;
- int16 CurrentBAlign;
- int16 CurrentCAlign;
-
- //start protect
- int16 StartESCount; // 启动保护判断ES的计数
- int16 StartEsCnt; // 启动保护判断ES的计时
- int16 StartDelay; // 启动保护判断ES的延迟
- int16 StartFocmode; // 启动保护判断FOCMODE状态的计时
- int16 StartSpeedCnt; // 启动保护判断速度和ES的计时
- uint32 commu_time;
- }FaultVarible;
- extern FaultStateType xdata mcFaultSource;
- extern PFCFaultStateType xdata PFCFaultSource;
- extern ProtectVarible xdata mcProtectTime;
- extern FaultVarible idata mcFaultDect;
- extern PFCFaultVarible idata PFCFaultDect;
- extern void Fault_OverUnderVoltage(void);
- extern void Fault_Overcurrent(void);
- extern void Fault_OverCurrentRecover(void);
- extern void Fault_Stall(void);
- extern void Fault_phaseloss(void);
- extern void Fault_IPMOverTemp(void);
- extern void PFCFault_OverUnderVoltage(void);
- extern void PFCFault_Overcurrent(void);
- extern void Fault_Detection(void);
- extern void PFCFault_Detection(void);
- #endif
|