Browse Source

2021-10-28 / Alston Lin
Actions
1. Remove use one PSU to check the cable check function
2. System Optimization

Files
1. As follow commit history

alston 3 years ago
parent
commit
841d021fa8

+ 3 - 3
EVSE/Projects/DS60-120/Apps/Module_InternalComm.c

@@ -947,7 +947,7 @@ void GetGfdAdc()
 		{
 			if (_chargingData[i]->Type == 0x09 && !ShmSysConfigAndInfo->SysConfig.AlwaysGfdFlag)
 			{
-				if ((_chargingData[i]->PresentChargingVoltage * 10) >= VOUT_MIN_VOLTAGE)
+				if (_chargingData[i]->FireChargingVoltage >= VOUT_MIN_VOLTAGE)
 					_chargingData[i]->GroundFaultStatus = GFD_PASS;
 				continue;
 			}
@@ -2160,8 +2160,7 @@ void CheckOutputVolNoneMatchFire(byte index)
 {
 	if (((_chargingData[index]->EvBatterytargetVoltage * 10) > 1500 ||
 			_chargingData[index]->RelayK1K2Status == NO) &&
-			(_chargingData[index]->Type == _Type_Chademo ||
-					_chargingData[index]->Type == _Type_CCS))
+			(_chargingData[index]->Type == _Type_CCS))
 	{
 		if (((_chargingData[index]->PresentChargingVoltage * 10) < _chargingData[index]->FireChargingVoltage - 300) ||
 				((_chargingData[index]->PresentChargingVoltage * 10) > _chargingData[index]->FireChargingVoltage + 300))
@@ -3039,6 +3038,7 @@ void RunForceStopProcess()
 			{
 				isCriticalStop = NO;
 				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PsuFailureAlarm = NORMAL;
+				system("/usr/bin/run_evse_restart.sh");
 			}
 		}
 	}

+ 7 - 2
EVSE/Projects/DS60-120/Apps/Module_PrimaryComm.c

@@ -35,6 +35,8 @@
 #define YES					1
 #define NO					0
 #define EQUAL				0
+#define NORMAL				0
+#define	ABNORMAL			1
 
 typedef unsigned char 		byte;
 
@@ -311,8 +313,11 @@ void GetInputGpioStatus()
 		{
 			if (_reCheckCount[_PRIMARY_CHECK_TAG_AC_CONTACT] >= 3)
 			{
-				if (ShmDcCommonData->psuKeepCommunication == YES ||
-						gpio_in.AC_Connector == YES)
+				if (ShmPrimaryMcuData->InputDet.bits.EmergencyButton == NORMAL &&
+					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PsuFailureAlarm == NORMAL &&
+					ShmPrimaryMcuData->InputDet.bits.DoorOpen  &&
+						(ShmDcCommonData->psuKeepCommunication == YES ||
+						gpio_in.AC_Connector == YES))
 				{
 					ShmSysConfigAndInfo->SysInfo.AcContactorStatus =
 						ShmPrimaryMcuData->InputDet.bits.AcContactorDetec = YES;

+ 29 - 29
EVSE/Projects/DS60-120/Apps/Module_PsuComm.c

@@ -2100,25 +2100,25 @@ int main(void)
 								}
 								else
 								{
-									if (chargingInfo[groupIndex]->SystemStatus == SYS_MODE_PREPARE_FOR_EVSE)
-									{
-										if (startModuleFlag)
-										{
-											if (ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == YES)
-											{
-												isStartOutputSwitch[0] = true;
-												SwitchSinglePower(ShmDcCommonData->connector[0][0], PSU_POWER_ON);
-												FlashSingleLed(ShmDcCommonData->connector[0][0], PSU_FLASH_ON);
-											}
-											else
-											{
-												isStartOutputSwitch[groupIndex] = true;
-												SwitchSinglePower(ShmDcCommonData->connector[groupIndex][0], PSU_POWER_ON);
-												FlashSingleLed(ShmDcCommonData->connector[groupIndex][0], PSU_FLASH_ON);
-											}
-										}
-									}
-									else
+//									if (chargingInfo[groupIndex]->SystemStatus == SYS_MODE_PREPARE_FOR_EVSE)
+//									{
+//										if (startModuleFlag)
+//										{
+//											if (ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == YES)
+//											{
+//												isStartOutputSwitch[0] = true;
+//												SwitchSinglePower(ShmDcCommonData->connector[0][0], PSU_POWER_ON);
+//												FlashSingleLed(ShmDcCommonData->connector[0][0], PSU_FLASH_ON);
+//											}
+//											else
+//											{
+//												isStartOutputSwitch[groupIndex] = true;
+//												SwitchSinglePower(ShmDcCommonData->connector[groupIndex][0], PSU_POWER_ON);
+//												FlashSingleLed(ShmDcCommonData->connector[groupIndex][0], PSU_FLASH_ON);
+//											}
+//										}
+//									}
+//									else
 									{
 										bool isNeedToOpenPower = false;
 										for (byte index = 0; index < ShmPsuData->GroupCount; index++)
@@ -2164,16 +2164,16 @@ int main(void)
 									}
 									else
 									{
-										if (chargingInfo[groupIndex]->SystemStatus == SYS_MODE_PREPARE_FOR_EVSE)
-										{
-											if (startModuleFlag)
-											{
-												isStartOutputSwitch[groupIndex] = true;
-												SwitchSinglePower(ShmDcCommonData->connector[groupIndex][0], PSU_POWER_ON);
-												FlashSingleLed(ShmDcCommonData->connector[groupIndex][0], PSU_FLASH_ON);
-											}
-										}
-										else
+//										if (chargingInfo[groupIndex]->SystemStatus == SYS_MODE_PREPARE_FOR_EVSE)
+//										{
+//											if (startModuleFlag)
+//											{
+//												isStartOutputSwitch[groupIndex] = true;
+//												SwitchSinglePower(ShmDcCommonData->connector[groupIndex][0], PSU_POWER_ON);
+//												FlashSingleLed(ShmDcCommonData->connector[groupIndex][0], PSU_FLASH_ON);
+//											}
+//										}
+//										else
 										{
 											if (!isStartOutputSwitch[groupIndex] || startModuleFlag)
 											{

+ 17 - 4
EVSE/Projects/DS60-120/Apps/ReadCmdline.c

@@ -522,7 +522,11 @@ void CheckAcStatus(char *v1)
 {
 	if (strcmp(v1, "-1") == 0|| strcmp(v1, "") == 0)
 	{
-		printf("AC Status = %d \n", ShmSysConfigAndInfo->SysInfo.AcContactorStatus);
+		printf("AC 1Status = %d \n", ShmSysConfigAndInfo->SysInfo.AcContactorStatus);
+		printf("AC 2Status = %d \n", ShmPrimaryMcuData->InputDet.bits.AcContactorDetec);
+		printf("AC 3Status = %d \n", ShmDcCommonData->psuKeepCommunication);
+		printf("AC EmergencyButton = %d \n", ShmPrimaryMcuData->InputDet.bits.EmergencyButton);
+		printf("AC acContactSwitch = %d \n", ShmDcCommonData->acContactSwitch);
 	}
 	else
 		ShmSysConfigAndInfo->SysInfo.AcContactorStatus = atoi(v1);
@@ -949,6 +953,7 @@ void AverageCharging(char *g1_vol, char *g1_cur, char *g2_vol, char *g2_cur)
 					    printf ("[AverageCharging (%d) - SYS_MODE_IDLE] \n", gun_index);
 					}
 
+					ShmDcCommonData->StartToChargingFlag[gun_index] = 0x01;
 					_chargingData[gun_index]->SystemStatus = SYS_MODE_PREPARING;
 				}
 					break;
@@ -1308,6 +1313,10 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 
     		    //****** 注意~此行為是防止 K1K2 先開導到無法升壓 ( Relay Board 在此 state 還未搭上 K1K2 )
     		    //確定模組己升壓完成
+				//#define GFD_WAIT			0
+				//#define GFD_PASS			1
+				//#define GFD_FAIL			2
+				//#define GFD_WARNING		3
     		    if(_chargingData[_GunIndex]->GroundFaultStatus == 0x01 ||
     		        _chargingData[_GunIndex]->GroundFaultStatus == 0x03)
     		    {
@@ -1724,10 +1733,14 @@ int main(void)
 		}
 		else if (strcmp(newString[0], "test") == 0)
 		{
+			if (!FindChargingInfoData(1, &_chargingData[0]))
+				{
+					printf("FindChargingInfoData error\n");
+				}
+
 			// Test Command
-			printf ("mode = %d \n", ShmSysConfigAndInfo->SysInfo.MainChargingMode);
-			ShmSysConfigAndInfo->SysInfo.MainChargingMode = _MAIN_CHARGING_MODE_AVER;
-			printf ("mode = %d \n", ShmSysConfigAndInfo->SysInfo.MainChargingMode);
+			memcpy(_chargingData[1]->EvConnAlarmCode, "023983", 6);
+			ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason = YES;
 		}
 		else if(strcmp(newString[0], "strchg") == 0)
 		{

+ 3 - 3
EVSE/Projects/DS60-120/Apps/main.c

@@ -215,7 +215,7 @@ bool isModelNameMatch = true;
 
 int rfidFd = -1;
 char* rfidPortName = "/dev/ttyS2";
-char* fwVersion = "V2.02.00.0000.00";
+char* fwVersion = "V2.03.00.0000.00";
 
 sqlite3 *localDb;
 bool isDb_ready;
@@ -8908,7 +8908,7 @@ int main(void)
 					if (chargingInfo[gun_index]->Type == _Type_Chademo)
 					{
 						// 檢查樁端的 GFD 結果
-						if (isPrechargeStatus_chademo(gun_index) == 8)
+						if (isPrechargeStatus_chademo(gun_index) >= 6)
 						{
 							// 當前操作的槍號,進入 Charging
 							setChargerMode(gun_index, SYS_MODE_CHARGING);
@@ -8917,7 +8917,7 @@ int main(void)
 					else if (chargingInfo[gun_index]->Type == _Type_GB)
 					{
 						// 檢查樁端的 GFD 結果
-						if (isPrechargeStatus_gb(gun_index) > 9)
+						if (isPrechargeStatus_gb(gun_index) >= 6)
 						{
 							setChargerMode(gun_index, SYS_MODE_CHARGING);
 						}