Browse Source

2022-06-09 / Wendell

Actions
1. add DERATING_BY_OTP
2. add Stop_by_EVSE_condition flag
3. add psu dynamic control info
4. add uu psu error description

Files
1. As follow commit history
Wendell 2 years ago
parent
commit
ecd1c447f7
1 changed files with 103 additions and 34 deletions
  1. 103 34
      EVSE/Projects/define.h

+ 103 - 34
EVSE/Projects/define.h

@@ -188,6 +188,7 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
 #define ShmRelay2BdKey			1013
 #define ShmYesCustomKey         1014
 #define ShmOcppPHModuleKey      1015
+#define ShmSmartBoxKey          1016
 
 #define FaultCodeLength         5
 #define AlarmCodeLength         20
@@ -332,7 +333,7 @@ enum CoreProfile {
      isEnableLocalPowerSharing,
      PowerSharingServerIP,
      EVCCID_PREFIX,
-	 OffLineMaxChargingPower,
+     OffLineMaxChargingPower,
      ConfigurationVersion,
 	 _CoreProfile_CNT
 };
@@ -371,9 +372,9 @@ struct WifiConfigData
 {
 	unsigned char		WifiMode;					//0: disable, 1: Infrastructure client, 2: Infrastructure server, 3: Ad-Hoc
 	unsigned char		WifiSsid[256];				//default: Null
-	unsigned char		WifiPassword[224];			//default: Null
-	unsigned char		WifiBroadcastSsid;			//the SSID broadcast configuration, 0: hidden	1: broadcast
-	unsigned char		WifiTargetBssidMac[31];		//Target connect SSID MAC address, default: Null
+    unsigned char       WifiPassword[224];          //default: Null
+    unsigned char       WifiBroadcastSsid;          //the SSID broadcast configuration, 0: hidden   1: broadcast
+    unsigned char       WifiTargetBssidMac[31];     //Target connect SSID MAC address, default: Null
 	int					WifiRssi;					//dbm
 	unsigned char		WifiDhcpServer;				//0: enable, 1: disable
 	unsigned char		WifiDhcpClient;				//0: enable, 1: disable
@@ -597,7 +598,15 @@ struct SysConfigData
     unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
     unsigned char           PowerSharingServerIP[512];          // Local power sharing server ip address
     unsigned int            PowerSharingCapacityPower;          // Local power sharing capacity power
-    unsigned char			MaxChargingSoc;						//0: unlimit, 1 ~ 100 percent
+    unsigned char           MaxChargingSoc;                     //0: unlimit, 1 ~ 100 percent
+};
+
+struct DERATING_BY_OTP
+{
+    unsigned char isNeedDerating;
+    unsigned char deratingIndex;        // Current used power or current
+    double deratingTargetRate[5];       // Reduce the output energy rate
+    double deratingTargetCurrent[5];    // derating target current
 };
 
 struct ChargingInfoData
@@ -703,6 +712,9 @@ struct ChargingInfoData
     unsigned char       CCSGunType;
     struct timeval      PreChargeTimer;
     unsigned char       _SaftyDetect;
+    unsigned char       _TotalPsuCount;                 // Psu count for connector
+    unsigned char       _TakePsuGpCount;                // Get the used psu group count
+    struct DERATING_BY_OTP deratingByConnOtp;
 };
 
 typedef struct
@@ -1032,7 +1044,7 @@ struct SysInfoData
     unsigned char           AuthorizedStatus;           // cabinet authorized status
     CabinetSettingFlag      CabinetSetting;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
-    DC_Meter_Info DcMeterInfo[4];
+    DC_Meter_Info           DcMeterInfo[4];
     unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
     struct LCD_OVERRIDE     LcdOveride;                 // LCD override info (no use anymore)
@@ -1285,18 +1297,18 @@ char AlarmStatusCode[160][6]=
 	"012261",	//GB groundfault detection timeout (GFD)
 	"012262",	//Circuit Short L1
 	"012263",	// PSU Duplicate ID
-	"012264", 	// PSU Output Short Circuit
+	"012264", 	// Psu Fault : Infy => Output Short Circuit,UU => Abnormal discharge circuit
 	"012265", 	// PSU Discharge Abnormal
 	"012266", 	// PSU Dc Side ShutDown
 	"012267", 	// PSU Failure Alarm
 	"012268", 	// PSU Protection Alarm
-	"012269", 	// PSU FanFailure Alarm
+	"012269", 	// Psu Fault : Infy => Fan Fault,UU => Fan Fault
 	"012270", 	// PSU Input UVP
 	"012271",	// PSU Input OVP
 	"012272", 	// PSU WalkIn State
-	"012273", 	// PSU Power Limited State
-	"012274", 	// PSU Id Repeat
-	"012275", 	// PSU Severe Uneven Current
+	"012273", 	// Psu Fault : Infy => Power Limited State,UU => Dc OVP and shutdown
+	"012274", 	// Psu Fault : Infy => Id Repeat,UU => Id Repeat
+	"012275", 	// Psu Fault : Infy => Severe Uneven Current,UU => Pfc internal unbalance
 	"012276", 	// PSU Three Phase Input Inadequate
 	"012277", 	// PSU Three Phase Onput Imbalance
 	"012278", 	// PSU Ffc Side ShutDown
@@ -1328,18 +1340,18 @@ char AlarmStatusCode[160][6]=
 	"012304",   // connection disconnected from power cabinet
 	"012305",   // Meter communication timeout
 	"012306",   // The dip switch of the PSU may be incorrect
-    "012307",   // Psu Fuse Burn-Out
-    "012308",   // Psu Pfc And Dcdc Communication Fault
-    "012309",   // Psu Bus Voltage Unbalance
-    "012310",   // Psu Bus Over Voltage
-    "012311",   // Psu Bus Voltage Abnormal
-    "012312",   // Psu Bus Under Voltage
-    "012313",   // Psu Input Phase Loss
-    "012314",   // Psu Fan Full Speed
-    "012315",   // Psu Temperature Power Limit
-    "012316",   // Psu Ac Power Limit
-    "012317",   // Psu Dcdc Eeprom Fault
-    "012318",   // Psu Pfc Eeprom Fault
+    "012307",   // Psu Fault : Infy => Fuse Burn-Out,UU => Pfc internal OVP
+    "012308",   // Psu Fault : Infy => Pfc And Dcdc Communication Fault,UU => Pfc And Dcdc Communication Fault
+    "012309",   // Psu Fault : Infy => Bus Voltage Unbalance,UU => Dc output voltage unbalance
+    "012310",   // Psu Fault : Infy => Bus Over Voltage,UU => Ac site OVP
+    "012311",   // Psu Fault : Infy => Bus Voltage Abnormal,UU => Ac site UVP
+    "012312",   // Psu Fault : Infy => Bus Under Voltage,UU => Pfc internal UVP
+    "012313",   // Psu Fault : Infy => Input Phase Loss,UU => Dc to Dc don’t work
+    "012314",   // Psu Fault : Infy => Fan Full Speed,UU => Fan don’t work
+    "012315",   // Psu Fault : Infy => Temperature Power Limit,UU => env OTP、Pfc OTP、output relay broken、Dc OTP
+    "012316",   // Psu Fault : Infy => Ac Power Limit,UU => Ac OVP and shutdown
+    "012317",   // Psu Fault : Infy => Dcdc Eeprom Fault,UU => Dc to Dc broken
+    "012318",   // Psu Fault : Infy => Pfc Eeprom Fault,UU => Pfc broken
     "012319",   // Psu Dcdc Over Voltage
     "012320",   // System CHAdeMO output UCP
     "012321",   // System CCS output UCP
@@ -1348,13 +1360,13 @@ char AlarmStatusCode[160][6]=
     "012324",   // Connector 1 detects abnormal voltage on the output line
     "012325",   // Connector 2 detects abnormal voltage on the output line
     "012326",   // System task is lost
-    "012327",   // DC input ovp
-    "012328",   // DC input uvp
-    "012329",   // Psu Can Communication Fault
-    "012330",   // Psu Dc to Dc OTP
-    "012331",   // Psu Dc to Dc OVP
+    "012327",   // System DC input ovp
+    "012328",   // System DC input uvp
+    "012329",   // Psu Fault : Infy => Psu Can Communication Fault,UU =>
+    "012330",   // Psu Fault : Infy => Psu Dc to Dc OTP,UU => env UTP
+    "012331",   // Psu Fault : Infy => Psu Dc to Dc OVP,UU => Dc output OVP
     "012332",   // Chiller Tube OTP
-    "012333",   // reserved
+    "012333",   // Psu Fault : Infy => DC input ovp (Phase OVP),UU => Dc output UVP
     "012334",   // reserved
     "012335",   // reserved
     "012336",   // reserved
@@ -1540,7 +1552,8 @@ struct AlarmCodeData
             unsigned char PsuDcDcOtp:1;                             //bit 2
             unsigned char PsuDcDcOvp:1;                             //bit 3
             unsigned char ChillerTubeOTP : 1;                       //bit 4
-            unsigned char :3;                                       //reserved bit 5 ~ bit 7
+            unsigned char PsuPhaseOvp:1;                            //bit 5
+            unsigned char :2;                                       //reserved bit 6 ~ bit 7
             //AlarmVal[17]
             unsigned char :8;                                       //reserved bit 0 ~ bit 7
             //AlarmVal[18]
@@ -1875,7 +1888,7 @@ char InfoStatusCode[384][6]=
     "023981",   // ERROR_CODE_CHADEMO_OUTPUT_VOLTAGE_MORE_THEN_10_PERCENT
     "023982",   // ERROR_CODE_CHADEMO_ADC_LESS_THAN_10V
     "023983",   // STOP by EV with unknow reason
-    "023984",   // Reserved
+    "023984",   // STOP by EVSE condition (Config or OCPP)
     "023985",   // Reserved
     "023986",   // Reserved
     "023987",   // Reserved
@@ -2221,7 +2234,8 @@ struct InfoCodeData
             unsigned char CHADEMO_OUTPUT_VOLTAGE_MORE_THEN_10_PERCENT:1; //bit 1
             unsigned char CHADEMO_ADC_LESS_THAN_10V:1;              //bit 2
             unsigned char Stop_by_EV_with_unknow_reason:1;          //bit 3
-            unsigned char :4;                                       //bit 4 ~ 7 reserved
+            unsigned char Stop_by_EVSE_condition:1;                 //bit 4
+            unsigned char :3;                                       //bit 5 ~ 7 reserved
 			//InfoVal[40]
 			unsigned char BackendDisconnectedViaEthernet:1;			//bit 0
 			unsigned char BackendDisconnectViaWiFi:1;				//bit 1
@@ -2298,6 +2312,8 @@ struct PsuModuleData
 	unsigned int 		AlarmCode;
 	unsigned int 		FaultCode;			//
 	unsigned int 		IAvailableCurrent;		            // unit: 0.1A
+    unsigned short  PresentMaxOutputVoltage;//abcd=abc.d volt
+    unsigned short  KwAvailablePower;       // unit: 0.1 kw
 };
 
 /*Following are the information for each PSU Group*/
@@ -2319,6 +2335,11 @@ struct PsuGroupData
     unsigned short          TempIAvailableCurrent;          // unit: 0.1A
     unsigned short          StableIAvailableCurrent;        // unit: 0.1A
     unsigned short          StableCurrentCounter;           // stable current counter
+    unsigned short          GroupMaxVoltage;                // unit: 0.1V
+    unsigned char           IsUsing;                        // 0 : none use
+    unsigned char           UsingTarget;                    // 0xFF : Check
+    unsigned char           PwSwitchStatus;
+    unsigned short          TotalRatingPower;               // unit: 1kW
 };
 
 /*Following is the information for system all PSU*/
@@ -2334,6 +2355,54 @@ struct PsuData
 	unsigned char           PsuStopChargeFlag;
 };
 
+struct SmartTimeChk
+{
+    struct timespec     FetchLoopTime;
+    unsigned char       IsFetchStart;
+
+    struct timespec     ReleaseLoopTime;
+    unsigned char       IsReleaseStart;
+};
+
+struct DynamicFetchCtrl
+{
+    unsigned char       ShareGroup;         // 255 : None
+    unsigned char       FetchLoopStep;      // 0 : None, 1 : Output Vol, 2 : RCB ON, 3 : Current sharing, 4 : Finish
+    unsigned short      ShareTargetCurrent; // 0.1A
+    unsigned char       TargetRelay;        // 255 : None
+};
+
+struct DynamicReleaseCtrl
+{
+    unsigned char       ReleaseGroup;       // 255 : None
+    unsigned char       ReleaseLoopStep;    // 0 : None, 1 : Limit Pwr, 2 : Pwr OFF, 3. RCB OFF, 4. Finish
+    float               CheckOutPwrIsStable;// 0.1kw
+    unsigned char       TargetRelay;        // 255 : None
+
+    float               LimitCurCap;        // Inform 0.1A
+    float               LimitPwrCap;        // Inform 0.1kw
+    float               LimitCur;           // Target 0.1A
+    float               LimitPwr;           // Target 0.1kw
+};
+
+struct ConnInfo
+{
+    unsigned char ConnectorStaus;
+    unsigned char NeedToFetch;
+};
+
+struct SmartBoxData
+{
+    struct ConnInfo     ConnectorStatus[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];     // Connector 1 / 2 Status : None, Wait, Using
+    struct ConnInfo     AnotherConnectorStatus[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+    unsigned char       ConnectorUsingGroupCount[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY]; // Psu group for connector
+    struct SmartTimeChk SmartChk[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+    struct DynamicFetchCtrl Dynamic4Fetch[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+    struct DynamicReleaseCtrl Dynamic4Release[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+    unsigned char       ParallelRelayStatus[3];
+    unsigned char       RcbParallelStatus[3];
+};
+
 /************************************************************************************/
 /**************************CHAdeMO protocol Share memory*********************/
 /**************************************************************************************/
@@ -6045,8 +6114,8 @@ struct OCPP20Data
 			unsigned char SecurityEventNotificationConf :1;
 			unsigned char SignCertificateReq :1;
 			unsigned char SignCertificateConf :1;
-			unsigned char NotifyCustomerInformationReq :1;	//bit 6
-			unsigned char NotifyCustomerInformationConf :1;	//bit 7
+            unsigned char NotifyCustomerInformationReq :1;  //bit 6
+            unsigned char NotifyCustomerInformationConf :1; //bit 7
 
 		} bits;
 	} SpMsg;