Browse Source

debug gas verification.

sangwq 2 years ago
parent
commit
c4864f5546

+ 1 - 0
Venus/Venus_Core/EventDefine.cs

@@ -17,6 +17,7 @@ namespace Aitex.Core.RT.Log{
 		EV_DEVICE_INFO = 16,
 		ERR_DEVICE_INFO = 17,
 		ERR_EXCEPTION = 18,
+		WARN_DEVICE_INFO = 19,
 		INFO_DEVICE_IO_HEATER = 1000,
 		WARN_DEVICE_IO_HEATER = 1001,
 		ERR_DEVICE_IO_HEATER = 1002,

+ 9 - 0
Venus/Venus_RT/Config/LogDefine.json

@@ -144,6 +144,15 @@
     "Note": ""
   },
   {
+    "Id": 19,
+    "Level": "Warning",
+    "LogEnum": "WARN_DEVICE_INFO",
+    "GlobalDescription_zh": "{0}。",
+    "GlobalDescription_en": "{0}.",
+    "Module": "System",
+    "Note": "Device Warning"
+  },
+  {
     "Id": 1000,
     "Level": "Info",
     "LogEnum": "INFO_DEVICE_IO_HEATER",

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

@@ -103,6 +103,7 @@
 		<config default="false" name="EnableGridHeater" nameView="Enable Chamber Grid Heater" description="" max="10" min="0" paramter="" tag="" unit="" type="Bool" />
 		<config default="5" name="RecipeToleranceIgnoreTime" nameView="Ignore Time Before Check Recipe Step Tolerance" description="" max="60" min="0" paramter="" tag="" unit="s" type="Integer" />
 		<config default="1" name="RecipeRunningMode" nameView="0, only run current recipe; 1, include chuck/dechuck recipe" description="" max="5" min="0" paramter="" tag="" unit="" type="Integer" />
+		<config default="751" name="ForelineInterlockPressure" nameView="Foreline Interlock Pressure" description="" max="2000" min="500" paramter="" tag="" unit="°C" type="Double" />
 
 		<configs name="MFCVerification" nameView="MFC Verification" >
 			<config default="1" name="BasePressure" nameView="开始条件:腔体压力达到时开始流气" max="100" min="1" paramter="" tag="" unit="mTorr" visible="true" type="Double" />

+ 23 - 3
Venus/Venus_RT/Devices/JetPM.cs

@@ -126,6 +126,8 @@ namespace Venus_RT.Devices
         // EndPoint 
         private readonly EPDClient _epdClient;
 
+        private readonly double _foreline_interlock_pressure = 750;
+
         public List<string> EPDCfgList => _epdClient.CFGFileList;
         public bool EPDCaptured => _epdClient.Captured;
         public bool EPDConnected => _epdClient.IsEPDConnected;
@@ -443,8 +445,9 @@ namespace Venus_RT.Devices
                 return true;
             });
 
-        }
 
+            _foreline_interlock_pressure = SC.GetValue<double>($"{mod}.ForelineInterlockPressure");
+        }
 
         public void CloseValves()
         {
@@ -602,10 +605,27 @@ namespace Venus_RT.Devices
                 gas.Monitor();
             }
 
-            if(ProcessPressure > 100 && _GuageValve.SetPoint)
+            CheckInterlock();
+        }
+
+        private void CheckInterlock()
+        {
+            if (ProcessPressure > 100 && _GuageValve.SetPoint)
             {
                 _GuageValve.TurnValve(false, out _);
-                LOG.Write(eEvent.EV_DEVICE_INFO, Module, "Process pressure exceed 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
+                LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
+            }
+
+            if(ForelinePressure > _foreline_interlock_pressure)
+            {
+                if(_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
+                {
+                    _pendulumValve.TurnValve(false);
+                    _TurboPumpPurgeValve.TurnValve(false, out _);
+                    _TurboPumpPumpingValve.TurnValve(false, out _);
+
+                    LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
+                }
             }
         }
 

+ 4 - 0
Venus/Venus_RT/Devices/PendulumValve.cs

@@ -168,6 +168,7 @@ namespace Venus_RT.Devices
             Module          = mod.ToString();
             var _PortNum    = SC.GetStringValue($"{mod}.PendulumValve.Port");
             _serial         = new AsyncSerialPort(_PortNum, 9600, 7, System.IO.Ports.Parity.Even, System.IO.Ports.StopBits.One, EOF);
+            IsOpen = false;
         }
 
         public bool Initialize()
@@ -352,6 +353,7 @@ namespace Venus_RT.Devices
         {
             if(_CheckStatus())
             {
+                IsOpen = postion > 0;
                 return SendCommand(Operation.SetPosition, postion);
             }
 
@@ -362,6 +364,7 @@ namespace Venus_RT.Devices
         {
             if(_CheckStatus())
             {
+                IsOpen = true;
                 return SendCommand(Operation.SetPressure, pressure);
             }
 
@@ -377,6 +380,7 @@ namespace Venus_RT.Devices
         {
             if(_CheckStatus(on))
             {
+                IsOpen = on;
                 return SendCommand(on ? Operation.OpenValve : Operation.CloseValve);
             }
 

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

@@ -98,6 +98,7 @@ namespace Venus_RT.Modules.PMs
             GasFlow,
             StopGasFlow,
             RfPower,
+            MFCVerification,
             MaxMsg
         }
 
@@ -124,6 +125,7 @@ namespace Venus_RT.Modules.PMs
         private readonly PMProcessRoutine           _processRoutine;
         private readonly GasFlowRoutine             _gasFlowRoutine;
         private readonly RFPowerSwitchRoutine       _rfPowerRoutine;
+        private readonly PMGasVerificationRoutine   _gasVerificationRoutine;
 
         public bool IsIdle
         {
@@ -207,6 +209,7 @@ namespace Venus_RT.Modules.PMs
             _processRoutine         = new PMProcessRoutine(_chamber, _pumpRoutine);
             _gasFlowRoutine         = new GasFlowRoutine(_chamber);
             _rfPowerRoutine         = new RFPowerSwitchRoutine(_chamber, true);
+            _gasVerificationRoutine = new PMGasVerificationRoutine(_chamber);
 
             fsm                     = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 50);
 
@@ -322,6 +325,11 @@ namespace Venus_RT.Modules.PMs
             Transition(PMState.RfPowering,      FSM_MSG.TIMER,      FnRfPowerTimeout,           PMState.Idle);
             Transition(PMState.RfPowering,      MSG.Abort,          FnAbortRfPower,             PMState.Idle);
 
+            //MFC verification
+            Transition(PMState.Idle,            MSG.MFCVerification,    FnStartMFCVerification,     PMState.MFCVerification);
+            Transition(PMState.MFCVerification, FSM_MSG.TIMER,          FnMFCVerificationTimeout,   PMState.Idle);
+            Transition(PMState.MFCVerification, MSG.Abort,              FnAbortMFCVerification,     PMState.Idle);
+
             Running = true;
 
             WaferManager.Instance.SubscribeLocation(ModuleName.PMA, 1);
@@ -829,6 +837,30 @@ namespace Venus_RT.Modules.PMs
             return true;
         }
 
+        private bool FnStartMFCVerification(object[] param)
+        {
+            _gasVerificationRoutine.Init((string)param[0], (double)param[1], (int)param[2]);
+            return _gasVerificationRoutine.Start(param) ==  RState.Running;
+        }
+
+        private bool FnMFCVerificationTimeout(object[] param)
+        {
+            RState ret = _gasVerificationRoutine.Monitor();
+            if (ret == RState.Failed || ret == RState.Timeout)
+            {
+                PostMsg(MSG.Error);
+                return false;
+            }
+
+            return ret == RState.End;
+        }
+
+        private bool FnAbortMFCVerification(object[] param)
+        {
+            _gasVerificationRoutine.Abort();
+            return true;
+        }
+
         private void _debugRoutine()
         {
             int flag = 0;
@@ -897,6 +929,10 @@ namespace Venus_RT.Modules.PMs
             {
                 PostMsg(MSG.RunRecipe, "7777");
             }
+            else if(flag == 17)
+            {
+                PostMsg(MSG.MFCVerification, "MFC2", (double)50, 10);
+            }
         }
     }
 }

+ 4 - 4
Venus/Venus_RT/Modules/PMs/PMGasVerificationRoutine.cs

@@ -130,7 +130,7 @@ namespace Venus_RT.Modules.PMs
             {
                 if (_mfcFlow <= 0 || _mfcFlow > _mfcDevice.Scale)
                 {
-                    LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, $"MFC set value {_mfcFlow} not valid");
+                    LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, $"MFC set value {_mfcFlow} not valid");
                     return RState.Failed;
                 }
                 _paramFlowSet.Add(0, _mfcFlow);
@@ -192,7 +192,7 @@ namespace Venus_RT.Modules.PMs
                 }
                 else
                 {
-                    Stop($"MFC Gas Verification fail, Cannot pumping down to {_basePressure} mTorr in {_pumpingTime} seconds");
+                    Runner.Stop($"MFC Gas Verification fail, Cannot pumping down to {_basePressure} mTorr in {_pumpingTime} seconds");
                     return true;
                 }
             }
@@ -244,7 +244,7 @@ namespace Venus_RT.Modules.PMs
 
             if(Math.Abs(_mfcDevice.SetPoint - _mfcDevice.FeedBack) / _mfcDevice.SetPoint > _flowStableTolerance)
             {
-                Runner.Stop($"");
+                Runner.Stop($"Gas is not Stable");
                 return true;
             }
   
@@ -278,7 +278,7 @@ namespace Venus_RT.Modules.PMs
             bool isOk = Math.Abs(deviation) <= Math.Abs(_maxDeviation);
             if (!isOk)
             {
-                LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, $"MFC {_mfcDevice.DisplayName} verify failed, deviation is {deviation}%, exceed max tolerance {_maxDeviation}%");
+                LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, $"MFC{_mfcIndex} verify failed, deviation{deviation} exceed max tolerance{_maxDeviation}");
             }
 
             if (_paramMode == VerifyMode.TenPoint)

+ 6 - 2
Venus/Venus_Simulator/Devices/TurboPumpMockPMA.cs

@@ -57,6 +57,10 @@ namespace Venus_Simulator.Devices
             if (string.IsNullOrEmpty(message))
                 throw new ArgumentException("Hardware command message is invalid");
 
+            if(message.Contains("TMPON"))
+            {
+                string[] temps = message.Trim().Split('\r');
+            }
             string[] strs = message.Trim().Split('\r');
             foreach(string msg in strs)
             {
@@ -81,7 +85,7 @@ namespace Venus_Simulator.Devices
                     byteArray[7] = valveStatus;
 
                     OnWriteMessage(byteArray);
-                    return;
+                    continue;
                 }
                 else if (str.Contains("TMPON"))
                 {
@@ -94,7 +98,7 @@ namespace Venus_Simulator.Devices
                     _simTurboPumpStatus = TurboPumpStatus.OFF;
                 }
                 else
-                    return;
+                    continue;
 
                 OnWriteMessage(sRes);
             }