Selaa lähdekoodia

2020-06-12 /Edward Lien

Actions:
1.Module_AlarmDetect.c add SystemAcOutputOCPL2 SystemAcOutputOCPL3.
2.Module_InternalComm.c add GridVoltage[0]~GridVoltage[2] EVSEPresentCurrent[0]~EVSEPresentCurrent[2].
3.define.h add PresentChargingVoltageL2, PresentChargingVoltageL3, PresentChargingCurrentL2, PresentChargingCurrentL3
4.main.c main.h variables name CPxxx => Cpxxx
5.main.h GridVoltage[3], EVSEPresentCurrent[3], OutputRelayStatus

Files:
1. As follow commit history

Image version: D0.15.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
Edward Lien 4 vuotta sitten
vanhempi
commit
f42e12f145

+ 8 - 8
EVSE/Projects/AW-CCS/Apps/Module_AlarmDetect.c

@@ -462,18 +462,18 @@ int main(void)
 			{
 				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_OVER_CURRENT)
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == OFF)
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = ON;
 						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_OVER_CURRENT;
 						DEBUG_INFO("ALARM_L2_OVER_CURRENT : alarm \r\n");
 					}
 				}
 				else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_OVER_CURRENT)))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == ON)
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = OFF;
 						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_OVER_CURRENT;
 						DEBUG_INFO("ALARM_L2_OVER_CURRENT : recover \r\n");
 					}
@@ -481,18 +481,18 @@ int main(void)
 
 				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_OVER_CURRENT)
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == OFF)
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = ON;
 						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_OVER_CURRENT;
 						DEBUG_INFO("ALARM_L3_OVER_CURRENT : alarm \r\n");
 					}
 				}
 				else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_OVER_CURRENT)))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == ON)
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = OFF;
 						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_OVER_CURRENT;
 						DEBUG_INFO("ALARM_L3_OVER_CURRENT : recover \r\n");
 					}

+ 36 - 12
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

@@ -1846,47 +1846,57 @@ int main(void)
 					{
 							if(ShmCharger->gun_info[gun_index].PilotVoltage.PilotVoltageNegative >= -12)
 							{
-									ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_G;
+									ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_G;
 							}
 							else
 							{
-									ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_H;
+									ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_H;
 							}
 					}
 					else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
 					{
-							ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_A;
+							ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_A;
 					}
 					else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B)
 					{
 							if(ShmCharger->gun_info[gun_index].PilotVoltage.PilotVoltageNegative == 0.0)
 							{
-									ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_B1;
+									ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_B1;
 							}
 							else
 							{
-									ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_B2;
+									ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_B2;
 							}
 					}
 					else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C)
 					{
-							ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_C;
+							ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_C;
 					}
 					else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_D)
 					{
-							ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_D;
+							ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_D;
 					}
 					else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_E)
 					{
-							ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_E;
+							ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_E;
 					}	
 					else	//CP_STATE_F
 					{
-							ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentState = CCS_CP_STATE_F;
+							ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentState = CCS_CP_STATE_F;
 					}
-					ShmCharger->gun_info[gun_index].acCcsInfo.CPPositiveVoltage = ShmCharger->gun_info[gun_index].PilotVoltage.PilotVoltagePositive;
-					ShmCharger->gun_info[gun_index].acCcsInfo.CPNegativeVoltage = ShmCharger->gun_info[gun_index].PilotVoltage.PilotVoltageNegative;					
-					ShmCharger->gun_info[gun_index].acCcsInfo.CPPresentPWMDuty = ShmCharger->gun_info[gun_index].primaryMcuState.current_limit;
+					ShmCharger->gun_info[gun_index].acCcsInfo.CpPositiveVoltage = ShmCharger->gun_info[gun_index].PilotVoltage.PilotVoltagePositive;
+					ShmCharger->gun_info[gun_index].acCcsInfo.CpNegativeVoltage = ShmCharger->gun_info[gun_index].PilotVoltage.PilotVoltageNegative;					
+					ShmCharger->gun_info[gun_index].acCcsInfo.CpPresentPWMDuty = ShmCharger->gun_info[gun_index].primaryMcuState.current_limit;
+					
+					if(ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][0]>0)
+					{
+						ShmCharger->gun_info[gun_index].acCcsInfo.OutputRelayStatus = ON;
+					}
+					else
+					{
+						ShmCharger->gun_info[gun_index].acCcsInfo.OutputRelayStatus = OFF;	
+					}					
+					
 					
 					failCount[gun_index] = 0;
 				}
@@ -2280,8 +2290,15 @@ int main(void)
 							ShmSysConfigAndInfo->SysInfo.InputVoltageR = ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12;
 							ShmSysConfigAndInfo->SysInfo.InputVoltageS = ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23;
 							ShmSysConfigAndInfo->SysInfo.InputVoltageT = ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31;
+							
 
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltage = ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12;
+							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL2 = ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23;
+							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL3 = ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31;
+							
+							ShmCharger->gun_info[gun_index].acCcsInfo.GridVoltage[0] = ShmSysConfigAndInfo->SysInfo.InputVoltageR;
+							ShmCharger->gun_info[gun_index].acCcsInfo.GridVoltage[1] = ShmSysConfigAndInfo->SysInfo.InputVoltageS;
+							ShmCharger->gun_info[gun_index].acCcsInfo.GridVoltage[2] = ShmSysConfigAndInfo->SysInfo.InputVoltageT;
 
 							failCount[gun_index] = 0;
 						}
@@ -2301,6 +2318,13 @@ int main(void)
 						if(Query_Present_OutputCurrent(Uart1Fd, (gun_index>0?ADDR_AC_PRIMARY_2:ADDR_AC_PRIMARY_1), &ShmCharger->gun_info[gun_index].outputCurrent) == PASS)
 						{
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrent = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
+							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL2 = (float)ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
+							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL3 = (float)ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
+							
+							
+							ShmCharger->gun_info[gun_index].acCcsInfo.EVSEPresentCurrent[0] = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
+							ShmCharger->gun_info[gun_index].acCcsInfo.EVSEPresentCurrent[1] = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
+							ShmCharger->gun_info[gun_index].acCcsInfo.EVSEPresentCurrent[2] = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];							
 
 							failCount[gun_index] = 0;
 						}

+ 8 - 26
EVSE/Projects/AW-CCS/Apps/main.c

@@ -1154,24 +1154,6 @@ unsigned char isModeChange(unsigned char gun_index)
 	return result;
 }
 
-unsigned char isCCSMode(unsigned char gun_index, unsigned char mode)
-{
-	return ((ShmCharger->gun_info[gun_index].acCcsInfo.EVChargeProgress == mode)?YES:NO);
-}
-
-unsigned char isCCSModeChange(unsigned char gun_index)
-{
-	unsigned char result = NO;
-
-	if(!isMode(gun_index, ShmCharger->gun_info[gun_index].PreviousEVChargeProgress))
-	{
-		result = YES;
-
-		ShmCharger->gun_info[gun_index].PreviousEVChargeProgress = ShmCharger->gun_info[gun_index].acCcsInfo.EVChargeProgress;
-	}
-
-	return result;
-}
 //===============================================
 // Get firmware version
 //===============================================
@@ -1204,7 +1186,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.14.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.15.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -2721,11 +2703,11 @@ int main(void)
 										ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;	
 										ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;	
 #ifdef	CCS_SIMULATION_DATA				
-										ShmCharger->gun_info[gun_index].acCcsInfo.SetCPPWMDuty = CCS_PWM_DUTY_100;						
+										ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty = CCS_PWM_DUTY_100;						
 #endif	//CCS_SIMULATION_DATA		
 									}
 								}
-								if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.SetCPPWMDuty == CCS_PWM_DUTY_100)
+								if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty == CCS_PWM_DUTY_100)
 								{
 									ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_100;
 									ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = ON;	
@@ -2750,7 +2732,7 @@ int main(void)
 						ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;	
 						
 #ifdef	CCS_SIMULATION_DATA				
-						ShmCharger->gun_info[gun_index].acCcsInfo.SetCPPWMDuty = CCS_PWM_DUTY_100;						
+						ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty = CCS_PWM_DUTY_100;						
 #endif	//CCS_SIMULATION_DATA
 					}
 
@@ -2766,7 +2748,7 @@ int main(void)
 						ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;	
 						
 #ifdef	CCS_SIMULATION_DATA				
-						ShmCharger->gun_info[gun_index].acCcsInfo.SetCPPWMDuty = CCS_PWM_DUTY_100;						
+						ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty = CCS_PWM_DUTY_100;						
 #endif	//CCS_SIMULATION_DATA
 					}
 					else
@@ -2774,7 +2756,7 @@ int main(void)
 						ShmCharger->gun_info[gun_index].rfidReq = OFF;
 					}
 					
-					if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.SetCPPWMDuty == CCS_PWM_DUTY_100)
+					if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty == CCS_PWM_DUTY_100)
 					{
 						ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_100;
 						ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = ON;	
@@ -3622,7 +3604,7 @@ int main(void)
 										ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;	
 						
 #ifdef	CCS_SIMULATION_DATA				
-										ShmCharger->gun_info[gun_index].acCcsInfo.SetCPPWMDuty = CCS_PWM_DUTY_100;						
+										ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty = CCS_PWM_DUTY_100;						
 #endif	//CCS_SIMULATION_DATA											
 									}
 								}
@@ -3642,7 +3624,7 @@ int main(void)
 										setChargerMode(gun_index, SYS_MODE_CHARGING);
 									}
 								}
-								if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.SetCPPWMDuty == CCS_PWM_DUTY_100)
+								if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty == CCS_PWM_DUTY_100)
 								{
 									DEBUG_INFO("Set PWM duty 100% go to SYS_MODE_TERMINATING.\r\n");
 									

+ 13 - 10
EVSE/Projects/AW-CCS/Apps/main.h

@@ -525,21 +525,21 @@ typedef struct CCS_INFO
 	uint8_t		PaymentOption;					/* 0x00 EIM, 0x01 Pnc */
 	float		EVSEMaxCurrent;					/*unit: 1 amp*/
 	float		EVSEMinCurrent;					/*unit: 1 amp*/
-	float		EVSENominalVoltage;				/*unit: 1 volt*/
+	float		GridVoltage[3];				    /*unit: 1 volt*/
 	uint8_t		MeterID[32];					/*unit: 1 amp*/
-	float		MeterReadingValue;				/*unit: Wh*/
+	float		MeterReadingValue;				/*unit: 1Wh*/
 	uint8_t		EVOperation;					/*0:Charge, 1:Discharge*/
 	uint8_t		EVChargeProgress;				/*0: Stop
 													1: Start
 													2: Renegotiate
 													3: Standby */
-	uint8_t		SetCPPWMDuty;					/*unit: 1%
+	uint8_t		CpSetPWMDuty;					/*unit: 1%
 													0: 0%
 													5: 5%
 													100: 100%*/
-	uint8_t		SetCP2StateE;					/*0:disable, 1:enable*/
-	uint8_t		CPPresentPWMDuty;				/*unit:1%*/
-	uint8_t		CPPresentState;					/*1: A (12V, no PWM)
+	uint8_t		CpSetStateE;					/*0:disable, 1:enable*/
+	uint8_t		CpPresentPWMDuty;				/*unit:1%*/
+	uint8_t		CpPresentState;					/*1: A (12V, no PWM)
 													2: B1 (9V, no PWM)
 													3: B2 (9V, with PWM)
 													4: C (6V, with PWM)
@@ -548,9 +548,11 @@ typedef struct CCS_INFO
 													7: F (-12V, no PWM)
 													8: G (>12V)
 													9: H  (<12V)*/
-	float		CPPositiveVoltage;				/*uint: 1V*/
-	float		CPNegativeVoltage;				/*uint: 1V*/
-	uint32_t	CcsHeartBeat;				/*unit: 1*/
+	float		CpPositiveVoltage;				/*uint: 1V*/
+	float		CpNegativeVoltage;				/*uint: 1V*/
+	uint32_t	CcsHeartBeat;					/*unit: 1*/
+	float 		EVSEPresentCurrent[3];				//unit: 1A
+	float 		AvailableChargingPower;			//1KW
 	uint16_t 	ChargingPermission:1;				/*0x00: Not ready yet, stay in idle mode or go into terminating process.
 												  0x01: start charging process*/
 	uint16_t 	ConnectorLockerStatus:1;			/*0x00: released
@@ -558,7 +560,8 @@ typedef struct CCS_INFO
 												 
 	uint16_t	RcdStatus:1;					/* 0x00 no error
 												   0x01 an error */
-	uint16_t	TempFlag3:1;
+	uint16_t	OutputRelayStatus:1;			/*0: OFF
+												1: ON*/
 	uint16_t	TempFlag4:1;
 	uint16_t	TempFlag5:1;
 	uint16_t	TempFlag6:1;

BIN
EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/AW-CCS/Images/ramdisk.gz


+ 4 - 0
EVSE/Projects/define.h

@@ -436,6 +436,10 @@ struct ChargingInfoData
 	unsigned char 		EvConnAlarmCode[7];
 	float 				ChargingProfileCurrent;	//0~6553.5 amp
 	float 				ChargingProfilePower;	//0~6553.5 kW
+	float 				PresentChargingVoltageL2;	//0~6553.5 volt
+	float 				PresentChargingVoltageL3;	//0~6553.5 volt
+	float 				PresentChargingCurrentL2;		//0~6553.5 amp	
+	float 				PresentChargingCurrentL3;		//0~6553.5 amp	
 };
 
 struct SysInfoData