Browse Source

revise clamshell sensor logic

chenzk 2 days ago
parent
commit
f290e3b809

+ 2 - 2
PunkHPX8_RT/Config/System.sccfg

@@ -354,8 +354,8 @@
 		<config default="25" name="OverflowLevelLow" nameView="OverflowLevelLow" description="Overflow Level Low" max="100" min="0" paramter="" tag="" unit="mm" type="Integer"></config>
 		<config default="1000" name="RinseDripIdlePeriod" nameView="RinseDripIdlePeriod" description="Rinse Drip Idle Period" max="100000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
 		<config default="1000" name="ClamShellOpenCheckDelay" nameView="ClamShellOpenCheckDelay" description="ClamShell Open Check Delay" max="100000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
-		<config default="5" name="ClamShellCloseDistanceThreshold" nameView="ClamShellCloseDistanceThreshold" description="Clam Shell Close DistanceT hreshold" max="1000" min="0" paramter="" tag="" unit="mm" type="Integer"></config>
-		<config default="55" name="ClamShellOpenDistanceThreshold" nameView="ClamShellOpenDistanceThreshold" description="Clam Shell Open DistanceT hreshold" max="1000" min="0" paramter="" tag="" unit="mm" type="Integer"></config>
+		<config default="60" name="ClamShellCloseDistanceThreshold" nameView="ClamShellCloseDistanceThreshold" description="Clam Shell Close DistanceT hreshold" max="1000" min="0" paramter="" tag="" unit="mm" type="Integer"></config>
+		<config default="30" name="ClamShellOpenDistanceThreshold" nameView="ClamShellOpenDistanceThreshold" description="Clam Shell Open DistanceT hreshold" max="1000" min="0" paramter="" tag="" unit="mm" type="Integer"></config>
 		<config default="50" name="ReclaimSpeed" nameView="ReclaimSpeed" description="Reclaim Speed" max="1000" min="0" paramter="" tag="" unit="mm/s" type="Integer"></config>
 		<config default="400" name="ReclaimAcceleration" nameView="ReclaimAcceleration" description="Reclaim Acceleration" max="10000" min="0" paramter="" tag="" unit="mm/s^2" type="Integer"></config>
 		<config default="1000" name="ReclaimJerk" nameView="ReclaimJerk" description="Reclaim Jerk" max="10000" min="0" paramter="" tag="" unit="mm/s^3" type="Integer"></config>

+ 2 - 2
PunkHPX8_RT/Devices/PlatingCell/ClamShellCloseRoutine.cs

@@ -69,7 +69,7 @@ namespace PunkHPX8_RT.Devices.PlatingCell
         {
             if (_close)
             {
-                if (_device.PlatingCellDeviceData.ClamShellDistance <= _closeSensor)
+                if (_device.PlatingCellDeviceData.ClamShellDistance >= _closeSensor) //大于close sensor就算关
                 {
                     LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module, $"ClamShell is Closed");
                     //_device.PlatingCellDeviceData.ClamShellClosed = true;
@@ -83,7 +83,7 @@ namespace PunkHPX8_RT.Devices.PlatingCell
             }
             else
             {
-                if (_device.PlatingCellDeviceData.ClamShellDistance > _openSensor)
+                if (_device.PlatingCellDeviceData.ClamShellDistance <= _openSensor) //open sensor就算开
                 {
                     LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module, $"ClamShell is Opened");
                     //_device.PlatingCellDeviceData.ClamShellClosed = false;

+ 2 - 2
PunkHPX8_RT/Devices/PlatingCell/PlatingCellDevice.cs

@@ -400,12 +400,12 @@ namespace PunkHPX8_RT.Devices.PlatingCell
                 if(variable == CLAMSHELL_DISTANCE)
                 {
                     double distance = Convert.ToDouble(value);
-                    if(distance <= _closeSensor)
+                    if(distance >= _closeSensor)
                     {
                         _platingCellData.ClamShellClosed = true;
                         _platingCellData.ClamShellOpened = false;
                     }
-                    if(distance >= _openSensor)
+                    if(distance <= _openSensor)
                     {
                         _platingCellData.ClamShellClosed = false;
                         _platingCellData.ClamShellOpened = true;

+ 8 - 8
PunkHPX8_Twincate/PunkHPX8/PlcTest/POUs/MAIN.TcPOU

@@ -1456,30 +1456,30 @@ END_IF
 
 //platingCell1 ClamShell
 IF PlatingCell1_2_DO_16CHANNEL_EL2809_N401_9 = TRUE THEN
-	PlatingCell1_2_AI_8CHANNEL_0_10V_EL3068_N402_1:=1300;
-ELSE
 	PlatingCell1_2_AI_8CHANNEL_0_10V_EL3068_N402_1:=19660;
+ELSE
+	PlatingCell1_2_AI_8CHANNEL_0_10V_EL3068_N402_1:=1300;
 END_IF
 
 //platingCell2 ClamShell
 IF PlatingCell1_2_DO_16CHANNEL_EL2809_N401_10 = TRUE THEN
-	PlatingCell1_2_AI_8CHANNEL_0_10V_EL3068_N402_2:=1300;
-ELSE
 	PlatingCell1_2_AI_8CHANNEL_0_10V_EL3068_N402_2:=19660;
+ELSE
+	PlatingCell1_2_AI_8CHANNEL_0_10V_EL3068_N402_2:=1300;
 END_IF
 
 //platingCell3 ClamShell
 IF PlatingCell1_2_DO_16CHANNEL_EL2809_N401_11 = TRUE THEN
-	PlatingCell3_4_AI_8CHANNEL_0_10V_EL3068_N432_1:=1300;
-ELSE
 	PlatingCell3_4_AI_8CHANNEL_0_10V_EL3068_N432_1:=19660;
+ELSE
+	PlatingCell3_4_AI_8CHANNEL_0_10V_EL3068_N432_1:=1300;
 END_IF
 
 //platingCell4 ClamShell
 IF PlatingCell1_2_DO_16CHANNEL_EL2809_N401_12 = TRUE THEN
-	PlatingCell3_4_AI_8CHANNEL_0_10V_EL3068_N432_2:=1300;
-ELSE
 	PlatingCell3_4_AI_8CHANNEL_0_10V_EL3068_N432_2:=19660;
+ELSE
+	PlatingCell3_4_AI_8CHANNEL_0_10V_EL3068_N432_2:=1300;
 END_IF
 ]]></ST>
     </Implementation>