Bladeren bron

2022-08-12 / Wendell

Actions
1. [fix] ocpp procDogTime variable type change from unsigned int to long int
2. [mod] use FireChargingVoltage when gun type is 'P'
3. [mod] modify EV_MAX_CURRENT_DELAY value to 60 (s)
4. [mod] modify MAX_DIFF_POWER_TO_DERATING to 5 (kW)
5. modify subVersion to 01

Files
1. As follow commit history

Image version : V2.04.XX.XXXX.XX
Wendell 2 jaren geleden
bovenliggende
commit
1b8d98d25f

+ 2 - 1
EVSE/Projects/DO360/Apps/Module_EvComm.c

@@ -1875,7 +1875,8 @@ void WriteChargingInfoResponse(int socket, struct PACKET_STRUCTURE *packet, unsi
 
     if(chargingInfo[gun]->PantographFlag == YES)
     {
-        voltage = (unsigned short)(chargingInfo[gun]->PresentChargingVoltage * 10);
+        //voltage = (unsigned short)(chargingInfo[gun]->PresentChargingVoltage * 10);
+        voltage = (unsigned short)(chargingInfo[gun]->FireChargingVoltage);
         current = (unsigned short)(chargingInfo[gun]->PresentChargingCurrent * 10);
     }
 

+ 2 - 2
EVSE/Projects/DO360/Apps/Module_PsuComm.c

@@ -56,7 +56,7 @@
 #define MAX_ADJ_BALANCE_CURRENT         30          // unit: 0.1A, 3A
 #define START_BALANCE_CRITERIA          100         // unit: 0.01%, 1%
 #define STOP_BALANCE_CRITERIA           10          // unit: 0.01%, 0.1%
-#define EV_MAX_CURRENT_DELAY            120         // unit: second
+#define EV_MAX_CURRENT_DELAY            60          // unit: second
 #define EV_MAX_STAGE_CURRENT_DELAY      30          // unit: second
 #define WAIT_SLAVE_READY_TIME           15          // unit: second
 #define WAIT_SLAVE_DELAY                1           // unit: second
@@ -81,7 +81,7 @@
 #endif
 
 #define MIN_RELEASE_POWER               30          // unit: 1kw
-#define MAX_DIFF_POWER_TO_DERATING      8           // unit: 1kw
+#define MAX_DIFF_POWER_TO_DERATING      5           // unit: 1kw
 #define MAX_DIFF_POWER_TO_EXTEND        3           // unit: 1kw
 #define MIN_DIFF_PHYSICAL_POWER         3           // unit: 1kw
 #define PSU_DEBUG_MSG                   0

+ 117 - 1
EVSE/Projects/DO360/Apps/ReadCmdline.c

@@ -1065,6 +1065,7 @@ void GetTemperature(char *inputCmd, unsigned int opt)
             usleep(10000);
         }
     }while(keepRun);
+    printf("\r\n");
 }
 
 void GetInputVol(char *inputCmd, unsigned int opt)
@@ -4729,6 +4730,115 @@ void RelayAutoTest(char *inputCmd)
     DisableAbnormalRelay();
 }
 
+void RelayAllOn(void)
+{
+    int MaxGunCount = 0;
+
+    MaxGunCount = ShmChargerInfo->Control.MaxConnector;
+
+    for(int i = 0; i < MaxGunCount; i++)
+    {
+        ShmChargerInfo->PsuGrouping.OutputRelayConfig[i].bits.Output_N = YES;
+        ShmChargerInfo->PsuGrouping.OutputRelayConfig[i].bits.Output_P = YES;
+    }
+
+    int ParallelRelayCount = 0;
+
+    if(ShmChargerInfo->Control.MaxConnector == GENERAL_GUN_QUANTITY)
+    {
+        ParallelRelayCount = ShmChargerInfo->Control.SysCtrl.bits.Enable6ParallelRelay == 1 ? PARALLEL_RELAY_COUNT : 3;
+    }
+    else
+    {
+        ParallelRelayCount = 1;
+    }
+
+    for(int i = 0; i < ParallelRelayCount; i++)
+    {
+        ShmChargerInfo->PsuGrouping.ParallelRelayConfig.CtrlValue |= 1 << i;
+    }
+}
+
+void RelayAllOff(void)
+{
+    int MaxGunCount = 0;
+
+    MaxGunCount = ShmChargerInfo->Control.MaxConnector;
+
+    for(int i = 0; i < MaxGunCount; i++)
+    {
+        ShmChargerInfo->PsuGrouping.OutputRelayConfig[i].bits.Output_N = NO;
+        ShmChargerInfo->PsuGrouping.OutputRelayConfig[i].bits.Output_P = NO;
+    }
+
+    int ParallelRelayCount = 0;
+
+    if(ShmChargerInfo->Control.MaxConnector == GENERAL_GUN_QUANTITY)
+    {
+        ParallelRelayCount = ShmChargerInfo->Control.SysCtrl.bits.Enable6ParallelRelay == 1 ? PARALLEL_RELAY_COUNT : 3;
+    }
+    else
+    {
+        ParallelRelayCount = 1;
+    }
+
+    for(int i = 0; i < ParallelRelayCount; i++)
+    {
+        ShmChargerInfo->PsuGrouping.ParallelRelayConfig.CtrlValue &= ~(1 << i);
+    }
+}
+
+void RelayLongTimeTest(char *inputCmd)
+{
+    int time = 0;
+    struct timespec _Loop_time;
+    bool keepRun = true;
+    bool _relayOn = false;
+
+    if(strcmp(inputCmd, "now") != EQUAL)
+    {
+        printf("\r\n");
+        printf("Input cmd fail ------  relay [timetest] [now]\r\n\r\n");
+        return;
+    }
+
+    if(!ShmChargerInfo->Control.RelayCtrl.bits.AbnormalRelay)
+    {
+        EnableAbnormalRelay();
+    }
+    printf("Relay Long Time Test Start\r\n");
+
+    do
+    {
+        time = GetTimeoutValue(_Loop_time) / mSEC_VAL;
+        if(time >= 10000)
+        {
+            if(!_relayOn)
+            {
+                printf("Set Relay All On\r\n");
+                RelayAllOn();
+                _relayOn = true;
+            }
+            else
+            {
+                printf("Set Relay All Off\r\n");
+                RelayAllOff();
+                _relayOn = false;
+            }
+            GetClockTime(&_Loop_time);
+        }
+
+        if(keepRun)
+        {
+            keepRun = IsLoopStopCmd() ? false : true;
+            usleep(10000);
+        }
+    }while(keepRun);
+    printf("\r\n");
+
+    DisableAbnormalRelay();
+}
+
 void RelayCmd(char *inputCmd, unsigned int opt)
 {
     char subMain[MAX_SUB_CMD_LENGTH];
@@ -4768,6 +4878,12 @@ void RelayCmd(char *inputCmd, unsigned int opt)
             RelayAutoTest(subSub);
             return;
         }
+
+        if(strcmp(subMain, "longtime") == EQUAL)
+        {
+            RelayLongTimeTest(subSub);
+            return;
+        }
     }
     printf("\r\n");
     printf("Input cmd fail ------  relay [abnormal | write | read | autotest] [...]\r\n\r\n");
@@ -5102,7 +5218,7 @@ int main(void)
 		    // 取得溫度
 		    GetTemperature(subCmd, option);
 		}
-		else if(strcmp(mainCmd, "acin") == 0)
+		else if(strcmp(mainCmd, "acin") == 0 || strcmp(mainCmd, "input") == 0)
 		{
 		    // 取得三向輸入電壓
 			GetInputVol(subCmd, option);

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

@@ -38,7 +38,7 @@
 #define PASS                1
 #define FAIL                -1
 #define RS485_RAW_DATA      0
-#define RS485_INFO(format, args...) StoreInternalCommLog("[%s:%4d][%s][EvMsg] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
+#define RS485_INFO(format, args...) StoreInternalCommLog("[%s:%4d][%s][RS485] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
 
 struct Address Addr = {
     AUX_ADD,

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

@@ -230,7 +230,7 @@ void Kill_Ocpp_Service(void);
 void Run_MaintainOcpp_Service(void);
 bool Is_MaintainOcpp_Task_Alive(void);
 void Kill_MaintainOcpp_Service(void);
-unsigned int Get_Ocpp_procDogTime(void);
+long int Get_Ocpp_procDogTime(void);
 void Clean_Ocpp_procDogTime(void);
 bool Is_Ocpp_BootNotification(void);
 void Clean_Ocpp_BootNotification(void);
@@ -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 = "00";
+char* subVersion = "01";
 #else
 char* fwVersion = "PCBA.00.04";
 char* subVersion = "00";
@@ -3304,7 +3304,7 @@ bool Get_Ocpp_ConnectionStatus(void)
 //===============================================
 // Ocpp procDogTime
 //===============================================
-unsigned int Get_Ocpp_procDogTime(void)
+long int Get_Ocpp_procDogTime(void)
 {
     if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
     {

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


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