Forráskód Böngészése

TM Robot PreRotation function for particle and throughput issues.

sangwq 1 éve%!(EXTRA string=óta)
szülő
commit
baeae1636e

+ 40 - 0
Venus/Framework/Common/Routine/RoutineRunner.cs

@@ -98,6 +98,16 @@ namespace MECF.Framework.Common.Routine
             return this;
         }
 
+        public RoutineRunner RunIf(Enum id, bool bRun, Func<bool> action, Func<bool> condition, int timeout = _defaultTimeout)
+        {
+            if(bRun)
+            {
+                return Run(id, action, condition, timeout);
+            }
+
+            return this;
+        }
+
         public RoutineRunner Run(Enum id, Func<bool> action, int delayMS = _defaultDelay)
         {
             if (bAllowSubStepStart(id))
@@ -115,6 +125,16 @@ namespace MECF.Framework.Common.Routine
             return this;
         }
 
+        public RoutineRunner RunIf(Enum id, bool bRun, Func<bool> action, int delayMS = _defaultDelay)
+        {
+            if(bRun)
+            {
+                return Run(id, action, delayMS);
+            }
+
+            return this;
+        }
+
 
         public RoutineRunner End(Enum id, Func<bool> action, Func<bool> condition, int timeout = _defaultTimeout)
         {
@@ -251,6 +271,16 @@ namespace MECF.Framework.Common.Routine
             return this;
         }
 
+        public RoutineRunner LoopRunIf(Enum id, bool bRun, Func<bool> action, Func<bool> condition, int timeout = _defaultTimeout)
+        {
+            if(bRun)
+            {
+                return LoopRun(id, action, condition, timeout);
+            }
+
+            return this;
+        }
+
         public RoutineRunner LoopRun(Enum id, Func<bool> action, int delayMS = _defaultDelay)
         {
             if (bAllowLoopSubStepStart(id))
@@ -267,6 +297,16 @@ namespace MECF.Framework.Common.Routine
             return this;
         }
 
+        public RoutineRunner LoopRunIf(Enum id, bool bRun, Func<bool> action, int delayMS = _defaultDelay)
+        {
+            if(bRun)
+            {
+                return LoopRun(id, action, delayMS);
+            }
+
+            return this;
+        }
+
         public RoutineRunner LoopEnd(Enum id, Func<bool> action, Func<bool> condition, int timeout = _defaultTimeout)
         {
             if (bAllowLoopSubStepStart(id))

+ 8 - 0
Venus/Venus_RT/Config/System.sccfg

@@ -169,6 +169,14 @@
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="10000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
 		</configs>
+		<configs name="PreRotation" nameView="Pre Rotation definition">
+			<config default="PMA" name="PMA" nameView="PMA" description="Pre Rotation Station of PMA" max="" min="" paramter="" tag="" visible="true" unit="" type="String" />
+			<config default="PMB" name="PMB" nameView="PMB" description="Pre Rotation Station of PMB" max="" min="" paramter="" tag="" visible="true" unit="" type="String" />
+			<config default="PMC" name="PMC" nameView="PMC" description="Pre Rotation Station of PMC" max="" min="" paramter="" tag="" visible="true" unit="" type="String" />
+			<config default="PMD" name="PMD" nameView="PMD" description="Pre Rotation Station of PMD" max="" min="" paramter="" tag="" visible="true" unit="" type="String" />
+			<config default="LLA" name="LLA" nameView="LLA" description="Pre Rotation Station of LLA" max="" min="" paramter="" tag="" visible="true" unit="" type="String" />
+			<config default="LLB" name="LLB" nameView="LLB" description="Pre Rotation Station of LLB" max="" min="" paramter="" tag="" visible="true" unit="" type="String" />
+		</configs>
 		
 	</configs>
 	<!--LLA-->

+ 1 - 1
Venus/Venus_RT/Devices/TM/JetTM.cs

@@ -734,7 +734,7 @@ namespace Venus_RT.Devices
                     double maxPressureDifference = SC.GetValue<double>("System.TMLLMaxPressureDifference");
                     if (Math.Abs(GetModulePressure(loadlock) - GetModulePressure(ModuleName.TM)) > maxPressureDifference)
                     {
-                        reason = $"{loadlock} and TM pressure difference exceeds the max limit {maxPressureDifference}";
+                        reason = $"{loadlock}:{GetModulePressure(loadlock)} and TM : {GetModulePressure(ModuleName.TM)} pressure difference exceeds the max limit {maxPressureDifference}";
                         LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
                         return false;
                     }

+ 1 - 1
Venus/Venus_RT/Devices/TM/SIASUNRobot.cs

@@ -127,7 +127,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.Goto;
             _status = RState.Running;
-            return _SendCommand($"GOTO N {_StationNumbers[station]} SLOT {slot + 1} ARM {Hand2Arm(hand)}");
+            return _SendCommand($"GOTO N {_StationNumbers[station]} R RE Z DOWN SLOT {slot + 1} ARM {Hand2Arm(hand)}");
         }
         public bool MoveTo(ModuleName stnFrom, ModuleName stnTo, Hand hand)
         {

+ 8 - 14
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -513,6 +513,7 @@ namespace Venus_RT.Modules.PMs
             Transition(PMState.Idle,            MSG.PreparePick,    FnStartPreparePick,     PMState.PreparePick);
             Transition(PMState.PreparePick,     MSG.Abort,          FnAbortPreparePick,     PMState.Idle);
             Transition(PMState.PreparePick,     FSM_MSG.TIMER,      FnPreparePickTimeout,   PMState.ReadyForPick);
+            Transition(PMState.PreparePick,     MSG.PreparePick,    null,                   PMState.PreparePick);
             Transition(PMState.ReadyForPick,    MSG.Abort,          FnAbortPick,            PMState.Idle);
             Transition(PMState.ReadyForPick,    MSG.DropDownWafer,  FnStartDropDownWafer,   PMState.DropDownWafer);
             Transition(PMState.DropDownWafer,   FSM_MSG.TIMER,      FnDropDownTimeout,      PMState.DropDownReady);
@@ -524,6 +525,7 @@ namespace Venus_RT.Modules.PMs
             Transition(PMState.Idle,            MSG.PreparePlace,   FnStartPreparePlace,    PMState.PreparePlace);
             Transition(PMState.PreparePlace,    MSG.Abort,          FnAbortPreparePlace,    PMState.Idle);
             Transition(PMState.PreparePlace,    FSM_MSG.TIMER,      FnPreparePlaceTimeout,  PMState.ReadyForPlace);
+            Transition(PMState.PreparePlace,    MSG.PreparePlace,   null,                   PMState.PreparePlace);
             Transition(PMState.ReadyForPlace,   MSG.LiftUpWafer,    FnStartLiftUpWafer,     PMState.LiftUpWafer);
             Transition(PMState.LiftUpWafer,     FSM_MSG.TIMER,      FnLiftUpTimeout,        PMState.LiftUpReady);
             Transition(PMState.LiftUpReady,     MSG.PlaceReady,     FnStartFinishPlace,     PMState.FinishPlace);
@@ -578,20 +580,12 @@ namespace Venus_RT.Modules.PMs
             //}, PMState.Idle);
             #endregion
 
-            Transition(PMState.Idle, MSG.PartialPressure, FnStartPartialPressure, PMState.PartialPressureTesting);
-            
-            Transition(PMState.PartialPressureTesting, FSM_MSG.TIMER, FnPartialPressureTimeout, PMState.Idle);
-           
-            Transition(PMState.PartialPressureTesting, MSG.Abort, FnAbortPartialPressure, PMState.Idle);
-
-            Transition(PMState.Idle, MSG.VATPerformance, FnStartVATPerformance, PMState.VATPerformanceTesting);
-
-            Transition(PMState.VATPerformanceTesting, FSM_MSG.TIMER, FnVATPerformanceTimeout, PMState.Idle);
-
-            Transition(PMState.VATPerformanceTesting, MSG.Abort, FnAbortVATPerformance, PMState.Idle);
-
-            
-         
+            Transition(PMState.Idle,                    MSG.PartialPressure,    FnStartPartialPressure,     PMState.PartialPressureTesting);
+            Transition(PMState.PartialPressureTesting,  FSM_MSG.TIMER,          FnPartialPressureTimeout,   PMState.Idle);
+            Transition(PMState.PartialPressureTesting,  MSG.Abort,              FnAbortPartialPressure,     PMState.Idle);
+            Transition(PMState.Idle,                    MSG.VATPerformance,     FnStartVATPerformance,      PMState.VATPerformanceTesting);
+            Transition(PMState.VATPerformanceTesting,   FSM_MSG.TIMER,          FnVATPerformanceTimeout,    PMState.Idle);
+            Transition(PMState.VATPerformanceTesting,   MSG.Abort,              FnAbortVATPerformance,      PMState.Idle);
 
             Running = true;
 

+ 50 - 10
Venus/Venus_RT/Modules/TM/MFPMPlaceRoutine.cs

@@ -21,6 +21,7 @@ namespace Venus_RT.Modules.TM
         private enum PlaceStep
         {
             WaitPMReady,
+            PreRotation,
             PMPrepare,
             ArmExtend,
             QueryAWC,
@@ -43,6 +44,7 @@ namespace Venus_RT.Modules.TM
 
         private DateTime _starttime;
         private bool _queryAwc;
+        private Dictionary<ModuleName, ModuleName> _rotateModules =  new Dictionary<ModuleName, ModuleName>();
         public MFPMPlaceRoutine(JetTM tm, ITransferRobot robot) : base(ModuleName.TMRobot)
         {
             _JetTM = tm;
@@ -53,6 +55,19 @@ namespace Venus_RT.Modules.TM
                 _queryAwc = true;
             else
                 _queryAwc = false;
+
+            foreach (var mod in new List<ModuleName> { ModuleName.PMA, ModuleName.PMB, ModuleName.PMC, ModuleName.PMD})
+            {
+                string rotateModule = SC.GetStringValue($"TM.PreRotation.{mod}");
+                if(rotateModule.Length == 3)
+                {
+                    ModuleName rotModule = ModuleHelper.Converter(rotateModule);
+                    if(ModuleHelper.IsPm(rotModule) || ModuleHelper.IsLoadLock(rotModule))
+                    {
+                        _rotateModules.Add(mod, rotModule);
+                    }
+                }
+            }
         }
         public RState Start(params object[] objs)
         {
@@ -102,15 +117,17 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            Runner.Wait(PlaceStep.WaitPMReady,     () => _pmModule.IsIdle,                         _delay_60s)
-                .Run(PlaceStep.PMPrepare,          ModulePrepare,          IsModulePrepareReady,   _delay_60s)
-                .Run(PlaceStep.ArmExtend,          ArmExtend,              WaitRobotExtendDone,    _placingTimeout)
-                .Run(PlaceStep.QueryAWC,           QueryAWC,               WaitRobotQueryDone,     _delay_1s)
-                .Run(PlaceStep.LiftUpWafer,        NotifyPMPlaceWafer,     WaitPMWaferLiftUp,      _delay_30s)
-                .Delay(PlaceStep.PlaceDelay,                                                       _placeDelayTime)
-                .Run(PlaceStep.ArmRetract,         ArmRetract,             WaitRobotRetractDone,   _delay_30s)
-                .Run(PlaceStep.SavePlaceData,      RecordAWCData,          NullFun)
-                .End(PlaceStep.NotifyDone,         NotifyPMDone,                                   _delay_50ms);
+            Runner.Wait(PlaceStep.WaitPMReady,     () => _pmModule.IsIdle,                                      _delay_60s)
+                .RunIf(PlaceStep.PreRotation,       _rotateModules.ContainsKey(_targetModule),                  RotateArm,       WaitRotateDone)
+                .Run(PlaceStep.PMPrepare,          ModulePrepare,                       IsModulePrepareReady,   _delay_60s)
+                .Run(PlaceStep.ArmExtend,          ArmExtend,                           WaitRobotExtendDone,    _placingTimeout)
+                .Run(PlaceStep.QueryAWC,           QueryAWC,                            WaitRobotQueryDone,     _delay_1s)
+                .Run(PlaceStep.LiftUpWafer,        NotifyPMPlaceWafer,                  WaitPMWaferLiftUp,      _delay_30s)
+                .Delay(PlaceStep.PlaceDelay,        _placeDelayTime)
+                .Run(PlaceStep.ArmRetract,         ArmRetract,                          WaitRobotRetractDone,   _delay_30s)
+                .Run(PlaceStep.SavePlaceData,      RecordAWCData,                       NullFun)
+                .End(PlaceStep.NotifyDone,         NotifyPMDone,                                                _delay_50ms);
+
             return Runner.Status;
         }
 
@@ -125,6 +142,29 @@ namespace Venus_RT.Modules.TM
             return _pmModule.Status == PMEntity.PMStatus.Ready_For_Place && _pmModule.IsSlitDoorOpen;
         }
 
+        private bool RotateArm()
+        {
+            _pmModule.PostMsg(PMEntity.MSG.PreparePlace); // Notify PM to Serv pressure in advance for throughput enhancement
+            return _robot.Goto(_rotateModules[_targetModule], 0, _hand);
+        }
+
+        private bool WaitRotateDone()
+        {
+            if (_robot.Status == RState.Running)
+            {
+                return false;
+            }
+            else if (_robot.Status == RState.End)
+            {
+                return true;
+            }
+            else
+            {
+                Runner.Stop($"TM Robot Rotate Arm failed, {_robot.Status}");
+                return true;
+            }
+        }
+
         private bool ArmExtend()
         {
             return _robot.PlaceExtend(_targetModule, _targetSlot, _hand);
@@ -138,7 +178,7 @@ namespace Venus_RT.Modules.TM
             if (!_queryAwc)
                 return true;
             else
-                return _robot.QueryAwc(); ;
+                return _robot.QueryAwc();
         }
         private bool WaitRobotExtendDone()
         {

+ 52 - 12
Venus/Venus_RT/Modules/TM/MFPMSwapRoutine.cs

@@ -19,6 +19,7 @@ namespace Venus_RT.Modules.TM
         private enum SwapStep
         {
             WaitPMReady,
+            PreRotation,
             PickPrepare,
             PickExtend,
             DropDownWafer,
@@ -44,11 +45,26 @@ namespace Venus_RT.Modules.TM
         private Hand _pickHand;
         private Hand _placeHand;
 
+        private Dictionary<ModuleName, ModuleName> _rotateModules = new Dictionary<ModuleName, ModuleName>();
+
         public MFPMSwapRoutine(JetTM tm, ITransferRobot robot) : base(ModuleName.TMRobot)
         {
             _JetTM = tm;
             _robot = robot;
             Name = "Swap with PM";
+
+            foreach (var mod in new List<ModuleName> { ModuleName.PMA, ModuleName.PMB, ModuleName.PMC, ModuleName.PMD })
+            {
+                string rotateModule = SC.GetStringValue($"TM.PreRotation.{mod}");
+                if (rotateModule.Length == 3)
+                {
+                    ModuleName rotModule = ModuleHelper.Converter(rotateModule);
+                    if (ModuleHelper.IsPm(rotModule) || ModuleHelper.IsLoadLock(rotModule))
+                    {
+                        _rotateModules.Add(mod, rotModule);
+                    }
+                }
+            }
         }
         public RState Start(params object[] objs)
         {
@@ -102,18 +118,19 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            Runner.Wait(SwapStep.WaitPMReady,  () => _pmModule.IsIdle, _delay_60s)
-                .Run(SwapStep.PickPrepare,     PickPrepare,            IsModuleReadyForPick)
-                .Run(SwapStep.PickExtend,      PickExtend,             WaitRobotExtendDone)
-                .Run(SwapStep.DropDownWafer,   NotifyPMPickWafer,      WaitPMWaferDropDown)
-                .Delay(SwapStep.PickDelay,     _pickDelayTime)
-                .Run(SwapStep.PickRetract,     PickRetract,            WaitRobotRetractDone)
-                .Run(SwapStep.PlacePrepare,    PlacePrepare,           IsModuleReadyForPlace)
-                .Run(SwapStep.PlaceExtend,     PlaceExtend,            WaitRobotExtendDone)
-                .Run(SwapStep.LiftUpWafer,     NotifyLiftUpWafer,      WaitPMWaferLiftUp)
-                .Delay(SwapStep.PlaceDelay,    _placeDelayTime)
-                .Run(SwapStep.PlaceRetract,    PlaceRetract,           WaitRobotRetractDone)
-                .End(SwapStep.NotifyDone,      NotifyPMDone,           _delay_50ms);
+            Runner.Wait(SwapStep.WaitPMReady,   () => _pmModule.IsIdle,                         _delay_60s)
+                .RunIf(SwapStep.PreRotation,    _rotateModules.ContainsKey(_targetModule),      RotateArm,      WaitRotateDone)
+                .Run(SwapStep.PickPrepare,      PickPrepare,                                    IsModuleReadyForPick)
+                .Run(SwapStep.PickExtend,       PickExtend,                                     WaitRobotExtendDone)
+                .Run(SwapStep.DropDownWafer,    NotifyPMPickWafer,                              WaitPMWaferDropDown)
+                .Delay(SwapStep.PickDelay,      _pickDelayTime)
+                .Run(SwapStep.PickRetract,      PickRetract,                                    WaitRobotRetractDone)
+                .Run(SwapStep.PlacePrepare,     PlacePrepare,                                   IsModuleReadyForPlace)
+                .Run(SwapStep.PlaceExtend,      PlaceExtend,                                    WaitRobotExtendDone)
+                .Run(SwapStep.LiftUpWafer,      NotifyLiftUpWafer,                              WaitPMWaferLiftUp)
+                .Delay(SwapStep.PlaceDelay,     _placeDelayTime)
+                .Run(SwapStep.PlaceRetract,     PlaceRetract,           WaitRobotRetractDone)
+                .End(SwapStep.NotifyDone,       NotifyPMDone,           _delay_50ms);
 
             return Runner.Status;
         }
@@ -175,6 +192,29 @@ namespace Venus_RT.Modules.TM
             }
         }
 
+        private bool RotateArm()
+        {
+            _pmModule.PostMsg(PMEntity.MSG.PreparePick); // Notify PM to Serv pressure in advance for throughput enhancement
+            return _robot.Goto(_rotateModules[_targetModule], 0, _placeHand);
+        }
+
+        private bool WaitRotateDone()
+        {
+            if (_robot.Status == RState.Running)
+            {
+                return false;
+            }
+            else if (_robot.Status == RState.End)
+            {
+                return true;
+            }
+            else
+            {
+                Runner.Stop($"TM Robot Rotate Arm failed, {_robot.Status}");
+                return true;
+            }
+        }
+
         private bool NotifyPMPickWafer()
         {
             _pmModule.PostMsg(PMEntity.MSG.DropDownWafer);