Просмотр исходного кода

Enhance the Pre-rotation function

sangwq 1 год назад
Родитель
Сommit
2694bdc96c

+ 3 - 0
Venus/Framework/Common/CommonData/RobotMoveInfo.cs

@@ -42,6 +42,9 @@ namespace MECF.Framework.Common.CommonData
         [EnumMember]
 
         Retracting,
+
+        [EnumMember]
+        Rotating,
     }
 
     [Serializable]

+ 16 - 2
Venus/Venus_RT/Devices/TM/JetTM.cs

@@ -243,6 +243,9 @@ namespace Venus_RT.Devices
                 }
             }
         }
+
+        public  Dictionary<ModuleName, ModuleName> PreRotateModules { get; private set; }
+
         public JetTM() : base("TM")
         {
             _TMLid  = DEVICE.GetDevice<IoLid>($"TM.{VenusDevice.TMLid}");
@@ -344,9 +347,20 @@ namespace Venus_RT.Devices
                     _LLPump = DEVICE.GetDevice<EdwardsPump>($"LLA.{VenusDevice.MainPump}");
                 }
             }
-            //_LLPump = DEVICE.GetDevice<SkyPump>($"LLA.{VenusDevice.MainPump}");
 
-            //_TMPump = DEVICE.GetDevice<SkyPump>($"TM.{VenusDevice.MainPump}");
+            PreRotateModules = new Dictionary<ModuleName, ModuleName>();
+            foreach (var mod in new List<ModuleName> { ModuleName.LLA, ModuleName.LLB, 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))
+                    {
+                        PreRotateModules.Add(mod, rotModule);
+                    }
+                }
+            }
 
             DATA.Subscribe("TM.PumpIsRunning", () => TMPumpIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             OP.Subscribe("TM.ControlPump", (cmd, args) =>

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

@@ -127,6 +127,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.Goto;
             _status = RState.Running;
+            SetRobotMovingInfo(RobotAction.Rotating, hand, station);
             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)

+ 1 - 0
Venus/Venus_RT/Modules/LLs/LLEntity.cs

@@ -174,6 +174,7 @@ namespace Venus_RT.Modules
             // Prepare TM Transfer
             Transition(STATE.Idle,              MSG.Prepare_TM,         FnStartPrepareTM,       STATE.Prepare_For_TM);
             Transition(STATE.Prepare_For_TM,    FSM_MSG.TIMER,          FnPreparaTMTimeout,     STATE.Ready_For_TM);
+            Transition(STATE.Prepare_For_TM,    MSG.Prepare_TM,         null,                   STATE.Prepare_For_TM);
             Transition(STATE.Prepare_For_TM,    MSG.Abort,              FnAbortPreparaTM,       STATE.Idle);
             Transition(STATE.Ready_For_TM,      MSG.TM_Exchange_Ready,  null,                   STATE.Idle);
             Transition(STATE.Ready_For_TM,      MSG.Abort,              null,                   STATE.Idle);

+ 9 - 23
Venus/Venus_RT/Modules/TM/MFPMPlaceRoutine.cs

@@ -44,7 +44,6 @@ 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;
@@ -55,19 +54,6 @@ 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)
         {
@@ -117,16 +103,16 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            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)
+            Runner.Wait(PlaceStep.WaitPMReady,     () => _pmModule.IsIdle,                                          _delay_60s)
+                .RunIf(PlaceStep.PreRotation,       _JetTM.PreRotateModules.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.ArmRetract,         ArmRetract,                          WaitRobotRetractDone,       _delay_30s)
                 .Run(PlaceStep.SavePlaceData,      RecordAWCData,                       NullFun)
-                .End(PlaceStep.NotifyDone,         NotifyPMDone,                                                _delay_50ms);
+                .End(PlaceStep.NotifyDone,         NotifyPMDone,                                                    _delay_50ms);
 
             return Runner.Status;
         }
@@ -145,7 +131,7 @@ namespace Venus_RT.Modules.TM
         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);
+            return _robot.Goto(_JetTM.PreRotateModules[_targetModule], 0, _hand);
         }
 
         private bool WaitRotateDone()

+ 14 - 29
Venus/Venus_RT/Modules/TM/MFPMSwapRoutine.cs

@@ -45,26 +45,11 @@ 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)
         {
@@ -118,19 +103,19 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            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);
+            Runner.Wait(SwapStep.WaitPMReady,       () => _pmModule.IsIdle,                             _delay_60s)
+                .RunIf(SwapStep.PreRotation,        _JetTM.PreRotateModules.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;
         }
@@ -195,7 +180,7 @@ 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);
+            return _robot.Goto(_JetTM.PreRotateModules[_targetModule], 0, _placeHand);
         }
 
         private bool WaitRotateDone()

+ 31 - 7
Venus/Venus_RT/Modules/TM/MFPlaceRoutine.cs

@@ -20,6 +20,7 @@ namespace Venus_RT.Modules.TM
         private enum PlaceStep
         {
             WaitModuleReady,
+            PreRotation,
             ModulePrepare,
             OpenSlitDoor,
             Placing,
@@ -95,13 +96,14 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            Runner.Wait(PlaceStep.WaitModuleReady, () => _llModule.IsIdle, _delay_60s)
-                .Run(PlaceStep.ModulePrepare,      ModulePrepare,          IsModulePrepareReady)
-                .Run(PlaceStep.OpenSlitDoor,       OpenSlitDoor,           IsSlitDoorOpen)
-                .Run(PlaceStep.Placing,            Placing,                WaitPlaceDone)
-                .Run(PlaceStep.QueryAwc,           QueryAwc,               WaitQueryDoneAndRecord)
-                .Run(PlaceStep.CloseSlitDoor,      CloseSlitDoor,          IsSlitDoorClosed)
-                .End(PlaceStep.NotifyDone,         NotifyLLDone,           _delay_50ms);          
+            Runner.Wait(PlaceStep.WaitModuleReady, () => _llModule.IsIdle,      _delay_60s)
+                .RunIf(PlaceStep.PreRotation,      _JetTM.PreRotateModules.ContainsKey(_targetModule),      RotateArm,      WaitRotateDone)
+                .Run(PlaceStep.ModulePrepare,      ModulePrepare,               IsModulePrepareReady)
+                .Run(PlaceStep.OpenSlitDoor,       OpenSlitDoor,                IsSlitDoorOpen)
+                .Run(PlaceStep.Placing,            Placing,                     WaitPlaceDone)
+                .Run(PlaceStep.QueryAwc,           QueryAwc,                    WaitQueryDoneAndRecord)
+                .Run(PlaceStep.CloseSlitDoor,      CloseSlitDoor,               IsSlitDoorClosed)
+                .End(PlaceStep.NotifyDone,         NotifyLLDone,                _delay_50ms);          
             return Runner.Status;
         }
 
@@ -165,6 +167,28 @@ namespace Venus_RT.Modules.TM
             }
         }
 
+        private bool RotateArm()
+        {
+            _llModule.PostMsg(LLEntity.MSG.Prepare_TM); // Notify Loadlock to Serv pressure in advance for throughput enhancement
+            return _robot.Goto(_JetTM.PreRotateModules[_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 QueryAwc()
         {

+ 45 - 8
Venus/Venus_RT/Modules/TM/MFSwapRoutine.cs

@@ -20,6 +20,7 @@ namespace Venus_RT.Modules.TM
         private enum SwapStep
         {
             WaitModuleReady,
+            PreRotation,
             ModulePrepare,
             OpenSlitDoor,
             MoveWafer,
@@ -85,14 +86,15 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            Runner.Wait(SwapStep.WaitModuleReady,  () => _llModule.IsIdle,     _delay_60s)
-                .Run(SwapStep.ModulePrepare,       ModulePrepare,              IsModulePrepareReady)
-                .Run(SwapStep.OpenSlitDoor,        OpenSlitDoor,               IsSlitDoorOpen)
-                .LoopStart(SwapStep.MoveWafer,     loopName(),                 _actionList.Count,      MoveWafer)
-                .LoopEnd(SwapStep.WaitMaferMoved,  NullFun,                    WaitWaferMoved)
-                .Run(SwapStep.CloseSlitDoor,       CloseSlitDoor,              IsSlitDoorClosed)
-                .End(SwapStep.NotifyDone,          NotifyLLDone,               _delay_50ms);
-
+            Runner.Wait(SwapStep.WaitModuleReady,   () => _llModule.IsIdle,         _delay_60s)
+                .RunIf(SwapStep.PreRotation,        _JetTM.PreRotateModules.ContainsKey(_targetModule),         RotateArm,  WaitRotateDone)
+                .Run(SwapStep.ModulePrepare,        ModulePrepare,                  IsModulePrepareReady)
+                .Run(SwapStep.OpenSlitDoor,         OpenSlitDoor,                   IsSlitDoorOpen)
+                .LoopStart(SwapStep.MoveWafer,      loopName(),                     _actionList.Count,          MoveWafer)
+                .LoopEnd(SwapStep.WaitMaferMoved,   NullFun,                        WaitWaferMoved)
+                .Run(SwapStep.CloseSlitDoor,        CloseSlitDoor,                  IsSlitDoorClosed)
+                .End(SwapStep.NotifyDone,           NotifyLLDone,                   _delay_50ms);
+                
             return Runner.Status;
         }
 
@@ -198,6 +200,41 @@ namespace Venus_RT.Modules.TM
             }
         }
 
+        private bool RotateArm()
+        {
+            ModuleName preModule = _targetModule;
+            Hand rotateHand = Hand.Blade1;
+            if (ModuleHelper.IsLoadLock(_actionList.Peek().DestinationModule) && ModuleHelper.IsTMRobot(_actionList.Peek().SourceModule))
+            {
+                rotateHand = (Hand)_actionList.Peek().SourceSlot;
+                preModule = _JetTM.PreRotateModules[_targetModule];
+            }
+            else
+            {
+                rotateHand = (Hand)_actionList.Peek().DestinationSlot;
+            }
+                
+            _llModule.PostMsg(LLEntity.MSG.Prepare_TM); // Notify Loadlock to Serv pressure in advance for throughput enhancement
+            return _robot.Goto(preModule, 0, rotateHand);
+        }
+
+        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 NotifyLLDone()
         {
             _llModule.PostMsg(LLEntity.MSG.TM_Exchange_Ready);