Browse Source

Added Auto Pump/vent option.

sangwq 1 year ago
parent
commit
75314148f5

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

@@ -92,6 +92,9 @@
 		<config default="40" name="DelayTimeBeforeLiftDown" nameView="Delay Time before lift down" description="冷却前,lift pin停留多久再落下" max="600" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="0" name="SingleArmOption"   nameView="Single Arm Option"   description="0, both; 1, Blade1; 2, Blade2" max="2" min="0" paramter="" tag="" unit="" type="Integer" />
 
+		<config default="4" name="LLAutoPumpInWaferOpt" nameView="Loadlock Auto Pump Option for Raw Wafer" description="Auto Pumping Loadlock while raw wafer number big or equal then this number" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
+		<config default="0" name="LLAutoPumpOutWaferOpt" nameView="Loadlock Auto Pump Option for Processed Wafer" description="Auto Pumping Loadlock while processed wafer number less or equal than this number" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
+
 		<configs name="LoadPort" nameView="LoadPort" >
 			<config default="30" name="MotionTimeout" nameView="Motion Timeout"  description="Motion Timeout" max="60" min="1" paramter="" tag="" unit="s" type="Integer" />
 			<config default="30" name="HomeTimeout" nameView="Home Timeout"  description="LoadPort初始化超时时间" max="60" min="1" paramter="" tag="" unit="s" type="Integer" />
@@ -148,6 +151,10 @@
 		<config default="50"  name="WithPMPressureDifference"   nameView="TM PM Pressure Difference"   description="TM和PM压差" max="100" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
 		<config default="0" name="SingleArmOption"   nameView="Single Arm Option"   description="0, both; 1, Blade1; 2, Blade2" max="2" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="0" name="QueryAWCOption"   nameView="Query AWC Option"   description="0, None; 1, Only TMPick Open; 2, Only TMPlace Open; 3, Both Open" max="3" min="0" paramter="" tag="" unit="" type="Integer" />
+
+		<config default="0" name="LLAutoVentInWaferOpt" nameView="Loadlock Aut Vent Option For Raw Wafer" description="Auto Venting Loadlock while raw wafer number less or equal than this number" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
+		<config default="4" name="LLAutoVentOutWaferOpt" nameView="Loadlock Auto Vent Option For Processed Wafer" description="Auto Venting Loadlock while processed wafer number big or equal than this number" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
+
 		<configs name="TM_MFC1" nameView="MFC1" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 1 or not" tag="" unit="" type="Bool" />
 			<config default="O2" name="GasName" nameView="Gas Name" description="Name of NO.1 gas stick" tag="" unit="" type="String" />

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

@@ -163,7 +163,7 @@ namespace Venus_RT.Devices
         public  bool? TMPumpIsRunning => _TMPump?.IsRunning;
         public  bool? LLPumpIsRunning => _LLPump?.IsRunning;
 
-        enum LLPumpState
+        public enum LLPumpState
         {
             Idle,
             LLAUsing,
@@ -172,6 +172,8 @@ namespace Venus_RT.Devices
 
         LLPumpState _llPumpingState = LLPumpState.Idle;
 
+        public LLPumpState LLPumpStatus { get { return _llPumpingState; } }
+
         private string _allInstalledModules { get { return SC.GetStringValue("System.InstalledModules").ToString(); } }
         public bool PMASlitDoorClosed
         {
@@ -869,7 +871,8 @@ namespace Venus_RT.Devices
                 _llPumpingState = LLPumpState.LLBUsing;
                 return true;
             }
-            LOG.Write(eEvent.WARN_DEFAULT_WARN, LLname, "无法打开,另一个泵正在用!");
+
+            //LOG.Write(eEvent.WARN_DEFAULT_WARN, LLname, "无法打开,另一个泵正在用!");
             //locked
             return false;
         }

+ 6 - 6
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -637,7 +637,7 @@ namespace Venus_RT.Modules
         #region Vacuum System
         private void PumpingTMRobotTask()
         {
-            if (!_tmRobot.IsAvailable)
+            if (!_tmRobot.IsAvailable || _tmRobot.RobotStatus == RState.Running)
                 return;
 
             foreach (var mod in _vacSchedulers)
@@ -849,7 +849,7 @@ namespace Venus_RT.Modules
 
         private void ProcessTMRobotTask()
         {
-            if (_tmRobot.IsAvailable)
+            if (_tmRobot.IsAvailable && _tmRobot.RobotStatus != RState.Running)
             {
                 if (WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, 0) || WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, 1))
                 {
@@ -1203,7 +1203,7 @@ namespace Venus_RT.Modules
 
         private void PumpingEFEMRobotTask()
         {
-            if (!_efemRobot.IsAvailable)
+            if (!_efemRobot.IsAvailable || _efemRobot.RobotStatus == RState.Running)
                 return;
 
             foreach (var scheduler in _atmSchedulers)
@@ -2284,7 +2284,7 @@ namespace Venus_RT.Modules
 
         private void UpdateProcessJobStatus()
         {
-            if (_efemRobot.RobotStatus == RState.Running)
+            if (_efemRobot.RobotStatus == RState.Running ||_tmRobot.RobotStatus == RState.Running)
                 return;
 
             foreach (var pj in _lstProcessJobs)
@@ -2313,8 +2313,8 @@ namespace Venus_RT.Modules
             if (_lstControlJobs.Count == 0)
                 return;
 
-            if (_efemRobot.RobotStatus == RState.Running)
-                return;
+            if (_efemRobot.RobotStatus == RState.Running || _tmRobot.RobotStatus == RState.Running)
+                    return;
 
             bool allControlJobComplete = true;
             List<ControlJobInfo> cjRemoveList = new List<ControlJobInfo>();

+ 17 - 2
Venus/Venus_RT/Modules/EFEM/EfemSwapRoutine.cs

@@ -39,6 +39,9 @@ namespace Venus_RT.Modules.EFEM
         MoveItem _currentAction;
         private int _actionCount = 0;
 
+        private int _autoPumpOptInWafer = 4;
+        private int _autoPumpOptOutWafer = 0;
+
         public EfemSwapRoutine(EfemBase efem) : base(ModuleName.EfemRobot)
         {
             _efem = efem;
@@ -85,7 +88,10 @@ namespace Venus_RT.Modules.EFEM
             }
                 
 
-            _moveTimeout = SC.GetValue<int>($"EFEM.MotionTimeout") * 1000;
+            _moveTimeout = SC.GetValue<int>("EFEM.MotionTimeout") * 1000;
+            _autoPumpOptInWafer = SC.GetValue<int>("EFEM.LLAutoPumpInWaferOpt");
+            _autoPumpOptOutWafer = SC.GetValue<int>("EFEM.LLAutoPumpOutWaferOpt");
+
             _actionCount = _actionList.Count;
             return Runner.Start(Module, $"EFEM Swap with {_targetModule}");
         }
@@ -206,7 +212,16 @@ namespace Venus_RT.Modules.EFEM
 
         private bool NotifyLLDone()
         {
-            _llModule.PostMsg(LLEntity.MSG.EFEM_Exchange_Ready);
+            var waferStatus = _llModule.GetWaferProcessStatus();
+            if (waferStatus.unprocessed >= _autoPumpOptInWafer && waferStatus.processed <= _autoPumpOptOutWafer)
+            {
+                _llModule.PostMsg(LLEntity.MSG.AutoPump);
+            }
+            else
+            {
+                _llModule.PostMsg(LLEntity.MSG.EFEM_Exchange_Ready);
+            }
+            
             return true;
         }
 

+ 43 - 3
Venus/Venus_RT/Modules/LLs/LLEntity.cs

@@ -47,6 +47,8 @@ namespace Venus_RT.Modules
             Offline,
             Pump,
             Vent,
+            AutoPump,
+            AutoVent,
             Purge,
             CyclePurge,
             LeakCheck,
@@ -93,6 +95,7 @@ namespace Venus_RT.Modules
         private readonly MFVentRoutine _ventingRoutine;
         private readonly MFLeakCheckRoutine _leakCheckRoutine;
         private readonly MFPurgeRoutine _purgeRoutine;
+        private readonly int _slotNumber = 4;
         public LLEntity(ModuleName module)
         {
             Module = module;
@@ -105,8 +108,8 @@ namespace Venus_RT.Modules
             _purgeRoutine       = new MFPurgeRoutine(_JetTM, Module);
 
 
-            var soltCount= SC.GetValue<int>($"{module.ToString()}.SlotNumber");
-            WaferManager.Instance.SubscribeLocation(Module, soltCount);
+            var _slotNumber = SC.GetValue<int>($"{module.ToString()}.SlotNumber");
+            WaferManager.Instance.SubscribeLocation(Module, _slotNumber);
 
             InitFsmMap();
         }
@@ -177,15 +180,18 @@ namespace Venus_RT.Modules
             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.Prepare_TM,         null,                   STATE.Ready_For_TM);
             Transition(STATE.Ready_For_TM,      MSG.Abort,              null,                   STATE.Idle);
+            Transition(STATE.Ready_For_TM,      MSG.AutoVent,           FnStartVent,            STATE.Venting);
 
             // Prepare EFEM Transfer
             Transition(STATE.Idle,              MSG.Prepare_EFEM,       FnStartPrepareEFEM,     STATE.Prepare_For_EFEM);
             Transition(STATE.Prepare_For_EFEM,  FSM_MSG.TIMER,          FnPrepareEFEMTimeout,   STATE.Ready_For_EFEM);
             Transition(STATE.Prepare_For_EFEM,  MSG.Abort,              FnAbortPrepareEFEM,     STATE.Idle);
             Transition(STATE.Ready_For_EFEM,    MSG.EFEM_Exchange_Ready, null,                  STATE.Idle);
+            Transition(STATE.Ready_For_EFEM,    MSG.Prepare_EFEM,       null,                   STATE.Ready_For_EFEM);
             Transition(STATE.Ready_For_EFEM,    MSG.Abort,              null,                   STATE.Idle);
-
+            Transition(STATE.Ready_For_EFEM,    MSG.AutoPump,           FnTryAutoPump,          STATE.Pumping);
 
             Running = true;
         }
@@ -221,6 +227,29 @@ namespace Venus_RT.Modules
             return true;
         }
 
+        public (int processed, int unprocessed) GetWaferProcessStatus()
+        {
+            int processedCount = 0;
+            int unprocessCount = 0;
+            for (int i = 0; i < _slotNumber; i++)
+            {
+                var wafer = WaferManager.Instance.GetWafer(Module, i);
+                if (!wafer.IsEmpty)
+                {
+                    if (wafer.ProcessState == Aitex.Core.Common.EnumWaferProcessStatus.Completed)
+                    {
+                        processedCount++;
+                    }
+                    else
+                    {
+                        unprocessCount++;
+                    }
+                }
+            }
+
+            return (processedCount, unprocessCount);
+        }
+
         private bool fnEnterTMReady(object[] param)
         {
             Status = LLStatus.Ready_For_TM;
@@ -331,6 +360,17 @@ namespace Venus_RT.Modules
             return true;
         }
 
+        private bool FnTryAutoPump(object[] param)
+        {
+            if(_JetTM.LLPumpStatus != JetTM.LLPumpState.Idle)
+            {
+                PostMsg(MSG.EFEM_Exchange_Ready);
+                return false;
+            }
+
+            return _pumpingRoutine.Start() == RState.Running;
+        }
+
         private bool FnStartPurge(object[] param)
         {
             return _purgeRoutine.Start() == RState.Running;

+ 2 - 0
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -522,6 +522,7 @@ namespace Venus_RT.Modules.PMs
             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.ReadyForPick,    MSG.PreparePick,    null,                   PMState.ReadyForPick);
             Transition(PMState.DropDownWafer,   FSM_MSG.TIMER,      FnDropDownTimeout,      PMState.DropDownReady);
             Transition(PMState.DropDownReady,   MSG.PickReady,      FnStartFinishPick,      PMState.FinishPick);
             Transition(PMState.FinishPick,      FSM_MSG.TIMER,      FnFinishPickTimeout,    PMState.Idle);
@@ -537,6 +538,7 @@ namespace Venus_RT.Modules.PMs
             Transition(PMState.LiftUpReady,     MSG.PlaceReady,     FnStartFinishPlace,     PMState.FinishPlace);
             Transition(PMState.PreparePlace,    MSG.Abort,          FnAortPlace,            PMState.Idle);
             Transition(PMState.ReadyForPlace,   MSG.Abort,          FnAortPlace,            PMState.Idle);
+            Transition(PMState.ReadyForPlace,   MSG.PreparePlace,   null,                   PMState.ReadyForPlace);
             Transition(PMState.LiftUpReady,     MSG.Abort,          FnAortPlace,            PMState.Idle);
             Transition(PMState.FinishPlace,     FSM_MSG.TIMER,      FnFinishPlaceTimeout,   PMState.Idle);
             

+ 16 - 1
Venus/Venus_RT/Modules/TM/MFSwapRoutine.cs

@@ -36,6 +36,9 @@ namespace Venus_RT.Modules.TM
         private ModuleName _targetModule;
         private LLEntity _llModule;
 
+        private int _autoVentOptInWafer = 0;
+        private int _autoVentOptOutWafer = 4;
+
 
         Queue<MoveItem> _actionList = new Queue<MoveItem>();
         MoveItem _currentAction;
@@ -81,6 +84,9 @@ namespace Venus_RT.Modules.TM
             Reset();
             _swapTimeout = SC.GetValue<int>($"TM.SwapTimeout") * 1000;
 
+            _autoVentOptInWafer = SC.GetValue<int>("TM.LLAutoVentInWaferOpt");
+            _autoVentOptOutWafer = SC.GetValue<int>("TM.LLAutoVentOutWaferOpt");
+
             return Runner.Start(Module, $"Swap with {_targetModule}");
         }
 
@@ -237,7 +243,16 @@ namespace Venus_RT.Modules.TM
 
         private bool NotifyLLDone()
         {
-            _llModule.PostMsg(LLEntity.MSG.TM_Exchange_Ready);
+            var waferStatus = _llModule.GetWaferProcessStatus();
+            if(waferStatus.processed >= _autoVentOptOutWafer && waferStatus.unprocessed <= _autoVentOptInWafer)
+            {
+                _llModule.PostMsg(LLEntity.MSG.AutoVent);
+            }
+            else
+            {
+                _llModule.PostMsg(LLEntity.MSG.TM_Exchange_Ready);
+            }
+            
             return true;
         }