Browse Source

Merge branch 'AW-CCS' of https://git.phihong.com.tw:30000/System_Integration/CSU3_AM335x into AW-CCS

8009 2 years ago
parent
commit
75751379df

+ 16 - 1
EVSE/Projects/AW-Regular/Apps/main.c

@@ -4629,6 +4629,9 @@ int main(void)
 						// Firmware version
 						get_firmware_version(gun_index);
 
+						// Change availability check
+						checkAvailability(gun_index);
+
 						// OCPP BootNotification info set
 						DEBUG_INFO("==========================================\n");
 						DEBUG_INFO("System ID: %s\n",ShmSysConfigAndInfo->SysConfig.SystemId);
@@ -4663,9 +4666,21 @@ int main(void)
 
 						// If rotate switch equal zero, the system needs to change Debug mode
 						if(ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch == 0)
+						{
 							setChargerMode(gun_index, SYS_MODE_DEBUG);
+						}
 						else
-							setChargerMode(gun_index, SYS_MODE_IDLE);
+						{
+							// Check is operactive
+							if(ShmCharger->gun_info[gun_index].isOperactive)
+							{
+								setChargerMode(gun_index, SYS_MODE_IDLE);
+							}
+							else
+							{
+								setChargerMode(gun_index, SYS_MODE_MAINTAIN);
+							}
+						}
 					}
 
 					break;

+ 21 - 8
EVSE/Projects/DO360/Apps/Module_PsuComm.c

@@ -42,9 +42,10 @@
 #define MAX_PSU_POWER_OFF_CURRENT       50          // unit: 0.1A, 5A
 #define MAX_PSU_POWER_OFF_VOLTAGE       100         // unit: 0.1A, 10V
 #define PRECHARGE_OFFSET_VOLTAGE        20          // unit: 0.1V, 2V
-#define PRECHARGE_RANGE_VOLTAGE         100         // unit: 0.1V, 10V
+#define PRECHARGE_RANGE_VOLTAGE         200         // unit: 0.1V, 10V
 #define WAIT_PRECHARGE_TIME             10          // unit: second
 #define EXTEND_CAPABILITY_DELAY         30          // unit: second
+#define EXTEND_AFTER_DERATING_DELAY     3           // unit: second
 #define EXTEND_LOADING                  8000        // unit: 0.01%, 80%
 #define RELEASE_LOADING                 5000        // unit: 0.01%, 50%
 #define RELEASE_LOADING_OFFSET          1000        // unit: 0.01%, 10%
@@ -3158,6 +3159,8 @@ void CheckSmoothDerating(unsigned char master)
 
 void CheckReleaseOrExtend(unsigned char master)
 {
+    int time = 0;
+
     if((ShmChargerInfo->Control.TestCtrl.bits.ChargingSimulation || Is_EnableReleaseAndExtendWhenForceCharging(master)) &&
         ShmPsuGrouping->GroupCollection[master].GroupCtrl.RoleCtrl.DeratingCtrlValue == 0 &&
         ShmPsuGrouping->GroupCollection[master].GroupCtrl.RoleCtrl.ExtendCapabilityCtrlValue == 0)
@@ -3185,16 +3188,24 @@ void CheckReleaseOrExtend(unsigned char master)
         else if(ShmPsuGrouping->GroupCollection[master].DiffPower_Capability <= MAX_DIFF_POWER_TO_EXTEND &&
             ShmPsuGrouping->GroupCollection[master].DiffPower_PhysicalLimit >= MIN_DIFF_PHYSICAL_POWER)
         {
-            int available = GetPsuGroupAvailable(master);
+            time = GetTimeoutValue(_ExtendCapability_time[master]) / uSEC_VAL;
 
-            if(available > 0)
+            if(time >= EXTEND_AFTER_DERATING_DELAY)
             {
-                if(!ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable)
+                int available = GetPsuGroupAvailable(master);
+
+                if(available > 0)
                 {
-                    LOG_INFO("Gun %d Extend Capability Available", master + 1);
-                    GetClockTime(&_ExtendCapability_time[master]);
+                    if(!ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable)
+                    {
+                        LOG_INFO("Gun %d Extend Capability Available, DifPcap: %.1f kW, DifPphy: %.1f",
+                            master + 1,
+                            ShmPsuGrouping->GroupCollection[master].DiffPower_Capability,
+                            ShmPsuGrouping->GroupCollection[master].DiffPower_PhysicalLimit);
+                        GetClockTime(&_ExtendCapability_time[master]);
+                    }
+                    ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable = true;
                 }
-                ShmPsuGrouping->GroupCollection[master].GroupCtrl.bits.ExtendAvailable = true;
             }
         }
     }
@@ -4122,6 +4133,7 @@ void PsuGroupDeratingProcess(unsigned char master)
     {
         ShmPsuGrouping->GroupCollection[master].GroupCtrl.RoleCtrl.DeratingCtrlValue = 0;
         UpdateGunAvailableCapability(master);
+        GetClockTime(&_ExtendCapability_time[master]);
         LOG_INFO("Gun %d Derating Completed", master + 1);
     }
 }
@@ -4778,7 +4790,8 @@ void PsuGroupControlProcess(void)
                 if(ShmPsuGrouping->GroupCollection[group].PreRole != role)
                 {
                     ShmPsuGrouping->GroupCollection[group].PreRole = role;
-                    PSU_LOG("===== PSU Group[%02X] ===== Extend Stop", group);
+                    PSU_LOG("===== PSU Group[%02X] ===== Extend Stop, %d.%d V",
+                        group, (ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage / 10), (ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage % 10));
                     GetClockTime(&_PsuGroupRole_time[group]);
                 }
 

+ 1 - 1
EVSE/Projects/DO360/Apps/main.c

@@ -422,7 +422,7 @@ bool isModelNameMatch = true;
 //char* rfidPortName = "/dev/ttyS2";
 #if ENABLE_PCBA_TEST == 0
 char* fwVersion = "V2.04.00.0000.00";
-char* subVersion = "01";
+char* subVersion = "03";
 #else
 char* fwVersion = "PCBA.00.04";
 char* subVersion = "00";

BIN
EVSE/Projects/DO360/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/DO360/Images/ramdisk.gz