Browse Source

Cooling功能bug修复

lixiang 9 months ago
parent
commit
465f0690e7

+ 2 - 2
Venus/Venus_RT/Config/System_Kepler2200.sccfg

@@ -220,10 +220,10 @@
 		<!--<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />-->
 		<config default="100" name="ControlPressureCheckPoint" nameView="Control Pressure CheckPoint" description="LLA Chamber 控压 检测值" max="300" min="0" paramter="" tag="" unit="Pa" type="Integer" />
 		<config default="90"  name="ControlPressureSetPoint"   nameView="Control Pressure SetPoint"   description="LLA Chamber 控压 设定值" max="200" min="0" paramter="" tag="" unit="Pa" type="Integer" />
-		<config default="90"  name="LLACoolingTime"   nameView="Cooling Time"   description="LLA 冷却吹扫时间" max="200" min="0" paramter="" tag="" unit="s" type="Integer" />
+		<!--<config default="90"  name="LLACoolingTime"   nameView="Cooling Time"   description="LLA 冷却吹扫时间" max="200" min="0" paramter="" tag="" unit="s" type="Integer" />
 		<config default="90"  name="LLBCoolingTime"   nameView="Cooling Time"   description="LLB 冷却吹扫时间" max="200" min="0" paramter="" tag="" unit="s" type="Integer" />
 		<config default="1000"  name="LLAMFCFlow"   nameView="Cooling MFC Flow"   description="LLA 冷却吹扫流量" max="5000" min="0" paramter="" tag="" unit="sccm" type="Integer" />
-		<config default="1000"  name="LLBMFCFlow"   nameView="Cooling MFC Flow"   description="LLB 冷却吹扫流量" max="5000" min="0" paramter="" tag="" unit="sccm" type="Integer" />
+		<config default="1000"  name="LLBMFCFlow"   nameView="Cooling MFC Flow"   description="LLB 冷却吹扫流量" max="5000" min="0" paramter="" tag="" unit="sccm" type="Integer" />-->
 
 
 

+ 13 - 41
Venus/Venus_RT/Modules/LLs/LLEntity.cs

@@ -130,6 +130,8 @@ namespace Venus_RT.Modules
         private readonly MFVentRoutine _ventingRoutine;
         private readonly MFLeakCheckRoutine _leakCheckRoutine;
         private readonly MFPurgeRoutine _purgeRoutine;
+
+        private readonly MFCoolingRoutine _coolingRoutine;
         private readonly int _slotNumber = 4;
         private bool startControlPressureFlag = true;
 
@@ -156,7 +158,7 @@ namespace Venus_RT.Modules
             _ventingRoutine = new MFVentRoutine(_JetTM, Module);
             _leakCheckRoutine = new MFLeakCheckRoutine(_JetTM, Module);
             _purgeRoutine = new MFPurgeRoutine(_JetTM, Module);
-
+            _coolingRoutine=new MFCoolingRoutine(_JetTM, Module);
 
             _slotNumber = SC.GetValue<int>($"{module.ToString()}.SlotNumber");
             WaferManager.Instance.SubscribeLocation(Module, _slotNumber);
@@ -459,7 +461,8 @@ namespace Venus_RT.Modules
                 PostMsg(MSG.TM_Exchange_Ready, false);
                 return false;
             }
-
+            _coolingMFCFlow = SC.GetValue<double>($"{Module.ToString()}.Cooling.MFCFlow");
+            _coolingTime = SC.GetValue<int>($"{Module.ToString()}.Cooling.CoolingTime");
             return _ventingRoutine.Start() == RState.Running;
         }
 
@@ -702,7 +705,7 @@ namespace Venus_RT.Modules
             _JetTM.TurnSoftPumpValve(Module, false);
 
             _JetTM.TurnPurgeValve(Module, false);
-            //_JetTM.TurnN2Valve(false);
+
 
             if (Module == ModuleName.LLA)
             {
@@ -719,49 +722,18 @@ namespace Venus_RT.Modules
 
         private bool FnStartCooling(object[] param)
         {
-            _coolingMFCFlow = SC.GetValue<double>($"{Module.ToString()}.Cooling.MFCFlow");
-            _coolingTime = SC.GetValue<int>($"{Module.ToString()}.Cooling.CoolingTime");
-
-            _JetTM.TurnPurgeValve(Module, true);
-
-            if (Module == ModuleName.LLA)
-            {
-                _JetTM.SetLLAFlow((int)_coolingMFCFlow);
-            }
-            else if (Module == ModuleName.LLB)
-            {
-                _JetTM.SetLLBFlow((int)_coolingMFCFlow);
-            }
-            _coolingStopWatch.Restart();
-            return true;
-        }
-        private bool FnStopCooling()
-        {
-            _JetTM.TurnPurgeValve(Module, false);
-
-            if (Module == ModuleName.LLA)
-            {
-                _JetTM.SetLLAFlow(0);
-            }
-            else if (Module == ModuleName.LLB)
-            {
-                _JetTM.SetLLBFlow(0);
-            }
-            return true;
+           return _coolingRoutine.Start() == RState.Running;         
         }
+       
         private bool FnCoolingTimeout(object[] param)
-        {
-            if (_coolingStopWatch.ElapsedMilliseconds > _coolingTime *1000 )
-            {
-                _coolingFlag = false;
-
-                FnStopCooling();
-                return true;
-            }
-            else
+        {          
+            RState ret = _coolingRoutine.Monitor();
+            if (ret == RState.Failed || ret == RState.Timeout)
             {
+                PostMsg(MSG.Error);
                 return false;
             }
+            return ret == RState.End;
         }
         private bool FnTMExchange(object[] param)
         {

+ 108 - 66
Venus/Venus_RT/Modules/TM/MFCoolingRoutine.cs

@@ -1,73 +1,115 @@
-//using Aitex.Core.RT.Routine;
-//using Aitex.Core.RT.SCCore;
-//using MECF.Framework.Common.Equipment;
-//using System;
-//using System.Collections.Generic;
-//using System.Linq;
-//using System.Text;
-//using System.Threading.Tasks;
-//using Venus_Core;
-//using Venus_RT.Devices;
+using Aitex.Core.RT.Routine;
+using Aitex.Core.RT.SCCore;
+using MECF.Framework.Common.Equipment;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Venus_Core;
+using Venus_RT.Devices;
 
-//namespace Venus_RT.Modules.TM
-//{
-//    class MFCoolingRoutine : ModuleRoutineBase, IRoutine
-//    {
-//        private enum CoolingStep
-//        {
-//            kStartCooling,
-//            kWaitCoolingEnd,
-            
-//            KDelay,
-//        }
-//        private int _coolingTime;
-//        private int _mfccoolingflow;
-//        private readonly JetTM _JetTM;
+namespace Venus_RT.Modules.TM
+{
+    class MFCoolingRoutine : ModuleRoutineBase, IRoutine
+    {
+        private enum CoolingStep
+        {
+            kDelay,
+            kStopVent,
+            kStartCooling,
+            kWaitCoolingEnd,
 
-//        public MFCoolingRoutine(JetTM jetTM, ModuleName mod) : base(mod)
-//        {
-//            _JetTM = jetTM;
-//            if (mod == ModuleName.LLA)
-//            {
-//                _coolingTime   = SC.GetValue<int>($"TM.LLACoolingTime");
-//                _mfccoolingflow= SC.GetValue<int>($"TM.LLAMFCFlow");
-//            }
-//            else if (mod == ModuleName.LLB) 
-//            {
-//                _coolingTime    = SC.GetValue<int>($"TM.LLBCoolingTime");
-//                _mfccoolingflow = SC.GetValue<int>($"TM.LLBMFCFlow");
-//            }
-//            else
-//            {
-//                _coolingTime = 0;
-//                _mfccoolingflow = 0;
-//            }
+            kEndCooling,
+        }
+        private int _coolingTime;
+        private double _coolingMFCFlow;
+        private readonly JetTM _JetTM;
+        private Stopwatch _coolingStopWatch = new Stopwatch();
 
-//        }
-//        public RState Start(params object[] objs)
-//        {
-            
+        public MFCoolingRoutine(JetTM jetTM, ModuleName mod) : base(mod)
+        {
+            _JetTM = jetTM;
 
-//            return Runner.Start(Module, Name);
-//        }
 
-//        public RState Monitor()
-//        {
-//            //Runner.Run(CoolingStep.kStartCooling,   StartCooling)
-//            //      .Wait
+        }
+        public RState Start(params object[] objs)
+        {
+             _coolingMFCFlow = SC.GetValue<double>($"{Module}.Cooling.MFCFlow");
+             _coolingTime    = SC.GetValue<int>($"{Module}.Cooling.CoolingTime");
 
-//            return Runner.Status;
-//        }
 
-//        private bool StartCooling()
-//        {
-//            _JetTM.TurnPurgeValve(Module, true);
-//            _JetTM.TurnExhaustValve(Module, true);
-//            return true;
-//        }
-//        public void Abort()
-//        {
-            
-//        }
-//    }
-//}
+            return Runner.Start(Module, Name);
+        }
+
+        public RState Monitor()
+        {
+            Runner .Delay(CoolingStep.kDelay,         1000)
+                   .Run(CoolingStep.kStopVent,        StopVent)                  
+                   .Run(CoolingStep.kStartCooling,    StartCooling)
+                   .Wait(CoolingStep.kWaitCoolingEnd, CoolingIsEnd)
+                   .End(CoolingStep.kEndCooling,      ResetCooling, NullFun);
+
+            return Runner.Status;
+        }
+        private bool StopVent()
+        {
+            _JetTM.TurnVentValve(Module, false);
+            _JetTM.TurnExhaustValve(Module, false);
+
+            return true;
+        }
+        private bool StartCooling()
+        {
+            _JetTM.TurnPurgeValve(Module, true);
+            _JetTM.TurnExhaustValve(Module, true);
+
+            if (Module == ModuleName.LLA)
+            {
+                _JetTM.SetLLAFlow((int)_coolingMFCFlow);
+            }
+            else if (Module == ModuleName.LLB)
+            {
+                _JetTM.SetLLBFlow((int)_coolingMFCFlow);
+            }
+            _coolingStopWatch.Start();
+            return true;
+        }
+        private bool CoolingIsEnd()
+        {
+            return _coolingStopWatch.ElapsedMilliseconds > _coolingTime * 1000;
+        }
+
+        private bool ResetCooling()
+        {
+            _coolingStopWatch.Reset();
+            if (Module == ModuleName.LLA)
+            {
+                _JetTM.SetLLAFlow(0);
+            }
+            else if (Module == ModuleName.LLB)
+            {
+                _JetTM.SetLLBFlow(0);
+            }
+            _JetTM.TurnPurgeValve(Module, false);
+            _JetTM.TurnExhaustValve(Module, false);
+
+            return true;
+        }
+        public void Abort()
+        {
+            _coolingStopWatch.Reset();
+            if (Module == ModuleName.LLA)
+            {
+                _JetTM.SetLLAFlow(0);
+            }
+            else if (Module == ModuleName.LLB)
+            {
+                _JetTM.SetLLBFlow(0);
+            }
+            _JetTM.TurnPurgeValve(Module, false);
+            _JetTM.TurnExhaustValve(Module, false);
+        }
+    }
+}

+ 1 - 1
Venus/Venus_RT/Modules/TM/MFPlaceRoutine.cs

@@ -116,7 +116,7 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-          Runner.Wait(PlaceStep.WaitModuleReady,      () => _llModule.IsIdle,      _delay_60s)
+          Runner.Wait(PlaceStep.WaitModuleReady,      () => _llModule.IsIdle,      _delay_3m)
                 .RunIf(PlaceStep.PreRotation,          _JetTM.PreRotateModules.ContainsKey(_targetModule),      RotateArm,      WaitRotateDone, _delay_30s)
                 .Run(PlaceStep.ModulePrepare,          ModulePrepare,               IsModulePrepareReady)
                 .Wait(PlaceStep.WaitPressreStable,     TMLLPressureIsOK,                                   _delay_60s)

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

@@ -107,16 +107,15 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            Runner.Wait(SwapStep.WaitModuleReady, () => _llModule.IsIdle, _delay_60s)
-                .RunIf(SwapStep.PreRotation, _JetTM.PreRotateModules.ContainsKey(_targetModule), RotateArm, WaitRotateDone, _delay_30s)
-                .Run(SwapStep.ModulePrepare, ModulePrepare, IsModulePrepareReady)
+            Runner.Wait(SwapStep.WaitModuleReady, () => _llModule.IsIdle, _delay_3m)
+                .RunIf(SwapStep.PreRotation,      _JetTM.PreRotateModules.ContainsKey(_targetModule), RotateArm, WaitRotateDone, _delay_30s)
+                .Run(SwapStep.ModulePrepare,      ModulePrepare, IsModulePrepareReady)
                 .Wait(SwapStep.WaitPressreStable, TMLLPressureIsOK, _delay_60s)
-
-                .Run(SwapStep.OpenSlitDoor, OpenSlitDoor, IsSlitDoorOpen, _delay_30s)
-                .LoopStart(SwapStep.MoveWafer, loopName(), _actionList.Count, MoveWafer)
-                .LoopEnd(SwapStep.WaitMaferMoved, NullFun, WaitWaferMoved)
-                .Run(SwapStep.CloseSlitDoor, CloseSlitDoor, IsSlitDoorClosed, _delay_30s)
-                .End(SwapStep.NotifyDone, NotifyLLDone, _delay_50ms);
+                .Run(SwapStep.OpenSlitDoor,       OpenSlitDoor,  IsSlitDoorOpen, _delay_30s)
+                .LoopStart(SwapStep.MoveWafer,    loopName(),    _actionList.Count, MoveWafer)
+                .LoopEnd(SwapStep.WaitMaferMoved, NullFun,       WaitWaferMoved)
+                .Run(SwapStep.CloseSlitDoor,      CloseSlitDoor, IsSlitDoorClosed, _delay_30s)
+                .End(SwapStep.NotifyDone,         NotifyLLDone, _delay_50ms);
 
             return Runner.Status;
         }