Browse Source

update plating cell vertical

chenkui 6 days ago
parent
commit
f4354b9344

+ 9 - 9
PunkHPX8_RT/Config/Devices/Beckhoffcfg - plctask.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <BeckhoffCfg>
-	<Controller Name="MASTER" IPAddress="10.4.6.75.1.1" PortAddress="851">
+	<Controller Name="MASTER" IPAddress="192.168.0.200.1.1" PortAddress="851">
 
 		<!-- Need to have at least one input and one output before Axis stuff -->
 
@@ -830,8 +830,8 @@
 			<!--ErrorLimit>0</ErrorLimit-->
 			<ErrorLimit>2000</ErrorLimit>
 			<VoltageOffset>0</VoltageOffset>
-			<ReverseSoftwareLimit>-1190000</ReverseSoftwareLimit>
-			<ForwardSoftwareLimit>28000000</ForwardSoftwareLimit>
+			<ReverseSoftwareLimit>0</ReverseSoftwareLimit>
+			<ForwardSoftwareLimit>0</ForwardSoftwareLimit>
 			<!-- Speed 1430 rev/min = 23 rev/sec = 25000000 counts/sec -->
 			<!--Speed>25000000</Speed-->
 			<Speed>18000000</Speed>
@@ -845,8 +845,8 @@
 			<FeedforwardVelocity>0</FeedforwardVelocity>
 			<FeedforwardAcceleration>0</FeedforwardAcceleration>
 			<OffOnError>0</OffOnError>
-			<NegativeTorqueLimit>130</NegativeTorqueLimit>
-			<PositiveTorqueLimit>20</PositiveTorqueLimit>
+			<NegativeTorqueLimit>0</NegativeTorqueLimit>
+			<PositiveTorqueLimit>0</PositiveTorqueLimit>
 		</Axis>
 		<Axis Name="PlatingCell3_4.Vertical" MotorType="Yaskawa" COEAddress="192.168.0.14.4.1" COEPort="1016" DebugLogging="false">
 			<Input Address="MAIN.PlatingCell3_4Vertical_StatusWord" Type="StatusWord" DataType="uint"/>
@@ -916,15 +916,15 @@
 			<!--ErrorLimit>0</ErrorLimit-->
 			<ErrorLimit>2000</ErrorLimit>
 			<VoltageOffset>0</VoltageOffset>
-			<ReverseSoftwareLimit>-1190000</ReverseSoftwareLimit>
-			<ForwardSoftwareLimit>28000000</ForwardSoftwareLimit>
+			<ReverseSoftwareLimit>0</ReverseSoftwareLimit>
+			<ForwardSoftwareLimit>0</ForwardSoftwareLimit>
 			<!-- Speed 1430 rev/min = 23 rev/sec = 25000000 counts/sec -->
 			<!--Speed>25000000</Speed-->
 			<Speed>18000000</Speed>
 			<!--Speed>12000000</Speed-->
 			<!-- Acceleration/Deceleration 0.78 rev/min/min = 0.01 rev/sec/sec = 13800 counts/sec/sec -->
-			<Acceleration>138000000</Acceleration>
-			<Deceleration>138000000</Deceleration>
+			<Acceleration>0</Acceleration>
+			<Deceleration>0</Deceleration>
 			<!--Acceleration>13800000</Acceleration>
       <Deceleration>13800000</Deceleration-->
 			<Jerk>0</Jerk>

+ 1 - 1
PunkHPX8_RT/Modules/PlatingCell/PlatingCellDryRoutine.cs

@@ -67,7 +67,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         public RState Monitor()
         {
-            Runner.RunIf(RunRecipeStep.VerticalGotoDry, _recipe.RinseZoffset != _recipe.DryZoffset,() => StartVertical("Risne", _recipe.DryZoffset, 0, 0), _delay_1ms)
+            Runner.RunIf(RunRecipeStep.VerticalGotoDry, _recipe.RinseZoffset != _recipe.DryZoffset,() => StartVertical("Rinse", _recipe.DryZoffset, 0, 0), _delay_1ms)
                   .WaitWithStopConditionIf(RunRecipeStep.CheckVerticalGotoDry, _recipe.RinseZoffset != _recipe.DryZoffset, CheckVerticalEnd, CheckVerticalError)
                   .Run(RunRecipeStep.ChangeRotation, () => ChangeRotationSpeed(_recipe.DrySpeed), _delay_1ms)
                   .Delay(RunRecipeStep.RotationDelay, _recipe.DryTime * 1000)

+ 5 - 5
PunkHPX8_RT/Modules/PlatingCell/PlatingCellInitializeRoutine.cs

@@ -27,8 +27,8 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         {
             CheckPowerSupplierConnected,
             CheckClamShellClosed,
-            VerticalGotoLoad,
-            VerticalGotoLoadCheck,
+            VerticalHome,
+            VerticalHomeCheck,
             RotationHome,
             RotationHomeCheck,
             AngleEntryTilt,
@@ -109,8 +109,8 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         {
             Runner.Run(InitializeStep.CheckPowerSupplierConnected, CheckPowerSupplierStatus, _delay_1ms)
                 .Run(InitializeStep.CheckClamShellClosed, () => _platingCellDevice.ClamShellClose(), CheckClamShellClosed, _delay_1s)
-                .Run(InitializeStep.VerticalGotoLoad, VerticalGotoLoad,100)
-                .WaitWithStopCondition(InitializeStep.VerticalGotoLoadCheck, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
+                .Run(InitializeStep.VerticalHome, VerticalHome,100)
+                .WaitWithStopCondition(InitializeStep.VerticalHome, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
                 .Run(InitializeStep.RotationHome, RotationGotoHome, 100)
                 .WaitWithStopCondition(InitializeStep.RotationHomeCheck, CheckRotationPositionStatus, CheckRotationPositionRunStop)
                 .Run(InitializeStep.AngleEntryTilt, () => _platingCellDevice.HeadtTiltAction(), CheckAngleTilt, _delay_1ms)
@@ -189,7 +189,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// vertical 运动到Load位置
         /// </summary>
         /// <returns></returns>
-        private bool VerticalGotoLoad()
+        private bool VerticalHome()
         {
             if(_verticalEntity != null )
             {

+ 1 - 1
PunkHPX8_RT/Modules/PlatingCell/PlatingCellRunRecipeRoutine.cs

@@ -497,7 +497,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                 LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Rotation Axis is not home");
                 return false;
             }
-            if (!_verticalEntity.IsIdle)
+            if (!_verticalEntity.AxisIsHome)
             {
                 LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Vertical Axis is not home");
                 return false;

+ 5 - 1
PunkHPX8_RT/Modules/PlatingCell/PlatingCellVerticalEntity.cs

@@ -100,6 +100,10 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// 是否在Load位置
         /// </summary>
         public bool IsInLoad { get { return _verticalAxis.CheckPositionIsInStation(_verticalAxis.MotionData.MotorPosition, "Load"); } }
+        /// <summary>
+        /// 电机是否Home
+        /// </summary>
+        public bool AxisIsHome { get { return _verticalAxis.IsHomed; } }
         #endregion
 
         /// <summary>
@@ -134,7 +138,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// </summary>
         private void InitialFsm()
         {
-            fsm = new StateMachine<PlatingCellVerticalEntity>(Module.ToString(), (int)PlatingCellVerticalState.Idle, 100);
+            fsm = new StateMachine<PlatingCellVerticalEntity>(Module.ToString(), (int)PlatingCellVerticalState.Init, 100);
             fsm.EnableRepeatedMsg(true);
 
             AnyStateTransition(VerticalMsg.Initialize, InitializeAll, PlatingCellVerticalState.Initializing);

+ 5 - 5
PunkHPX8_RT/Modules/PlatingCell/PlatingCellVerticalInitializeRoutine.cs

@@ -59,10 +59,10 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         public RState Monitor()
         {
-            Runner.Run(InitializeStep.VerticalHome, Home, NullFun, 100)
-                .WaitWithStopCondition(InitializeStep.VerticalHomeCheck, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
+            Runner.Run(InitializeStep.VerticalHome, Home, _delay_1ms)
+                .WaitWithStopCondition(InitializeStep.VerticalHomeCheck, CheckVerticalEndStatus, CheckVerticalEndRunStop)
                 .Run(InitializeStep.GoToLoad, VerticalGotoLoad, 100)
-                .WaitWithStopCondition(InitializeStep.GoToLoadCheck, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
+                .WaitWithStopCondition(InitializeStep.GoToLoadCheck, CheckVerticalEndStatus, CheckVerticalEndRunStop)
                 .End(InitializeStep.End, NullFun, _delay_1ms);
             return Runner.Status;
         }
@@ -119,7 +119,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// 检验Vertical移动状态
         /// </summary>
         /// <returns></returns>
-        private bool CheckVerticalPositionStatus()
+        private bool CheckVerticalEndStatus()
         {
             return _verticalAxis.Status == RState.End;
         }
@@ -127,7 +127,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// 检验Vertical是否还在运动
         /// </summary>
         /// <returns></returns>
-        private bool CheckVerticalPositionRunStop()
+        private bool CheckVerticalEndRunStop()
         {
             return _verticalAxis.Status == RState.Failed || _verticalAxis.Status == RState.Timeout;
         }

+ 10 - 8
PunkHPX8_RT/Modules/PlatingCell/PlatingCellVerticalPositionRoutine.cs

@@ -81,7 +81,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         public RState Monitor()
         {
-            Runner.Wait(PositionStep.WaitMatcher,CheckMatcher,_delay_2s)
+            Runner.Wait(PositionStep.WaitMatcher,CheckMatcher,_delay_60s)
                 .Run(PositionStep.GotoPosition, VerticalGotoPosition, 100)
                 .WaitWithStopCondition(PositionStep.GoToPositionCheck, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
                 .End(PositionStep.End, NullFun, _delay_1ms);
@@ -97,13 +97,18 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             {
                 return true;
             }
+            int count = 0;
             foreach (PlatingCellEntity item in _cellEntities)
             {
-                if (!WaferManager.Instance.CheckHasWafer(item.Module, 0))
+                if (WaferManager.Instance.CheckHasWafer(item.Module, 0))
                 {
-                    return false;
+                    count++;
                 }
             }
+            if (count == 1)
+            {
+                return true;
+            }
 
             WaferInfo firstWafer = WaferManager.Instance.GetWafer(_cellEntities[0].Module, 0);
             WaferInfo secondWafer = WaferManager.Instance.GetWafer(_cellEntities[1].Module, 0);
@@ -213,13 +218,10 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                 {
                     continue;
                 }
-                if (cellEntity.IsAuto)
-                {
-                    _cellEntities.Add(cellEntity);
-                }
+                _cellEntities.Add(cellEntity);
             }
             _verticalAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Vertical");
-            return Runner.Start(Module, "Start PlatingCell Vertical Initialize");
+            return Runner.Start(Module, "Start PlatingCell Vertical Position");
         }
     }
 }

+ 4 - 1
PunkHPX8_RT/Modules/ReservoirCellHomeRoutine.cs

@@ -127,7 +127,10 @@ namespace PunkHPX8_RT.Modules
         /// <returns></returns>
         private bool MetalsHome()
         {
-            _platingCellEntity.Invoke("HomeAll");
+            if (_platingCellEntity.IsAuto)
+            {
+                _platingCellEntity.Invoke("HomeAll");
+            }
             return true;
         }
         /// <summary>

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

@@ -188,7 +188,7 @@ VAR
 	//SystemExhaust2
 	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_2 AT%I* :INT:=12000;
 	//DiWaterPressure
-	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_5 AT%I* :INT:=25000;
+	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_5 AT%I* :INT:=10000;
 	//Nitrogen1BPressure
 	Facility_AI_8CHANNEL_0_10V_EL3068_N007_1 AT%I* :INT:=5700;
 	//Nitrogen1APressure
@@ -217,7 +217,7 @@ VAR
 	PlatingCell1_2_AI_8CHANNEL_0_10V_EL3086_N402_4 AT%I* :UDINT;
 	
 	//DiwReturnFlow
-	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_106 AT%I* :INT:=10000;
+	Facility_AI_8CHANNEL_4_20mA_EL3058_N006_106 AT%I* :INT:=25000;
 	
 	
 	//N2Enable