Browse Source

TM/LL Pump/Vent/Purge done.

sangwq 2 years ago
parent
commit
b8bd250b4e

+ 1 - 1
Venus/Venus_MainPages/ViewModels/OverViewModel.cs

@@ -1067,7 +1067,7 @@ namespace Venus_MainPages.ViewModels
             }
         }
 
-        private async void OnPurge()
+        private void OnPurge()
         {
             //if (RtDataValues[$"{ModuleName}.FsmState"].ToString() ==PMState.Purge.ToString())
             //if (PMCurrentState == PMState.Purging || N2SetPoint<=0)

+ 1 - 1
Venus/Venus_MainPages/Views/TMView.xaml.cs

@@ -127,7 +127,7 @@ namespace Venus_MainPages.Views
             robot.RobotTAction = WaferRobotTAction.LLB;
         }
 
-        private async void Original_Click(object sender, RoutedEventArgs e)
+        private void Original_Click(object sender, RoutedEventArgs e)
         {
             robot.RobotTAction = WaferRobotTAction.T_Origin;
             //await Task.Delay(1000);

+ 183 - 15
Venus/Venus_RT/Modules/LLs/LLEntity.cs

@@ -10,6 +10,13 @@ namespace Venus_RT.Modules
 {
     class LLEntity : Entity, IEntity, IModuleEntity
     {
+        public enum LLStatus
+        {
+            Not_Ready,
+            Ready_For_TM,
+            Ready_For_EFEM,
+        }
+
         public enum STATE
         {
             Unknown,
@@ -20,7 +27,11 @@ namespace Venus_RT.Modules
             Pumping,
             Venting,
             Purging,
-            Leakchecking,
+            LeakCheck,
+            Prepare_For_TM,
+            Prepare_For_EFEM,
+            Ready_For_TM,
+            Ready_For_EFEM,
         }
 
         public enum MSG
@@ -33,13 +44,18 @@ namespace Venus_RT.Modules
             Purge,
             CyclePurge,
             LeakCheck,
+            Prepare_TM,
+            Prepare_EFEM,
+            TM_Exchange_Ready,
+            EFEM_Exchange_Ready,
             Error,
             Abort,
-
-
         }
 
         public ModuleName Module { get; private set; }
+
+        public LLStatus Status { get; private set; }
+
         public bool Check(int msg, out string reason, params object[] args)
         {
             throw new NotImplementedException();
@@ -86,20 +102,26 @@ namespace Venus_RT.Modules
 
         private void InitFsmMap()
         {
-            fsm = new StateMachine<TMEntity>(Module.ToString(), (int)STATE.Init, 50);
+            fsm = new StateMachine<LLEntity>(Module.ToString(), (int)STATE.Init, 50);
             fsm.EnableRepeatedMsg(true);
 
-            AnyStateTransition(FSM_MSG.TIMER,   fnMonitor,      FSM_STATE.SAME);
+            EnterExitTransition<STATE, FSM_MSG>(STATE.Ready_For_TM,     fnEnterTMReady,     FSM_MSG.NONE,   fnExitTMReady);
+            EnterExitTransition<STATE, FSM_MSG>(STATE.Ready_For_EFEM,   fnEnterEFEMReady,   FSM_MSG.NONE,   fnExitEFEMReady);
+
+            //AnyStateTransition(FSM_MSG.TIMER,   fnMonitor,          FSM_STATE.SAME);
 
 
-            AnyStateTransition(MSG.Error,       fnError,        STATE.Error);
-            AnyStateTransition(MSG.Online,      fnOnline,       FSM_STATE.SAME);
-            AnyStateTransition(MSG.Offline,     fnOffline,      FSM_STATE.SAME);
-            AnyStateTransition(MSG.Home,        fnHome,         STATE.Initializing);
+            AnyStateTransition(MSG.Error,       fnError,            STATE.Error);
+            AnyStateTransition(MSG.Online,      fnOnline,           FSM_STATE.SAME);
+            AnyStateTransition(MSG.Offline,     fnOffline,          FSM_STATE.SAME);
+            AnyStateTransition(MSG.Home,        fnHome,             STATE.Initializing);
 
             // Home
             Transition(STATE.Initializing,      FSM_MSG.TIMER,      fnHoming,           STATE.Idle);
 
+            Transition(STATE.Idle,              FSM_MSG.TIMER,      fnMonitor,          STATE.Idle);
+            Transition(STATE.Init,              FSM_MSG.TIMER,      fnMonitor,          STATE.Init);
+
             //vent sequence
             Transition(STATE.Idle,              MSG.Vent,           FnStartVent,        STATE.Venting);
             Transition(STATE.Venting,           FSM_MSG.TIMER,      FnVentTimeout,      STATE.Idle);
@@ -111,14 +133,25 @@ namespace Venus_RT.Modules
             Transition(STATE.Pumping,           MSG.Abort,          FnAbortPump,        STATE.Idle);
 
             // Purge sequence
-            Transition(PMState.Idle,            MSG.CyclePurge,     FnStartPurge,       PMState.Purging);
-            Transition(PMState.Purging,         FSM_MSG.TIMER,      FnPurgeTimeout,     PMState.Idle);
-            Transition(PMState.Purging,         MSG.Abort,          FnAbortPurge,       PMState.Idle);
+            Transition(STATE.Idle,              MSG.CyclePurge,     FnStartPurge,       STATE.Purging);
+            Transition(STATE.Purging,           FSM_MSG.TIMER,      FnPurgeTimeout,     STATE.Idle);
+            Transition(STATE.Purging,           MSG.Abort,          FnAbortPurge,       STATE.Idle);
 
             // Leak check sequence
-            Transition(PMState.Idle,            MSG.LeakCheck,      FnStartLeakCheck,   PMState.LeakCheck);
-            Transition(PMState.LeakCheck,       FSM_MSG.TIMER,      FnLeakCheckTimeout, PMState.Idle);
-            Transition(PMState.LeakCheck,       MSG.Abort,          FnAbortLeakCheck,   PMState.Idle);
+            Transition(STATE.Idle,              MSG.LeakCheck,      FnStartLeakCheck,   STATE.LeakCheck);
+            Transition(STATE.LeakCheck,         FSM_MSG.TIMER,      FnLeakCheckTimeout, STATE.Idle);
+            Transition(STATE.LeakCheck,         MSG.Abort,          FnAbortLeakCheck,   STATE.Idle);
+
+            // 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.Ready_For_TM,      MSG.TM_Exchange_Ready,  null,                   STATE.Idle);
+
+            // 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.Ready_For_EFEM,    MSG.EFEM_Exchange_Ready, null,                  STATE.Idle);
+
 
             Running = true;
         }
@@ -154,8 +187,33 @@ namespace Venus_RT.Modules
             return true;
         }
 
+        private bool fnEnterTMReady(object[] param)
+        {
+            Status = LLStatus.Ready_For_TM;
+            return true;
+        }
+
+        private bool fnExitTMReady(object[] param)
+        {
+            Status = LLStatus.Not_Ready;
+            return true;
+        }
+
+        private bool fnEnterEFEMReady(object[] param)
+        {
+            Status = LLStatus.Ready_For_EFEM;
+            return true;
+        }
+
+        private bool fnExitEFEMReady(object[] param)
+        {
+            Status = LLStatus.Not_Ready;
+            return true;
+        }
+
         private bool fnMonitor(object[] param)
         {
+            _debugRoutine();
             return true;
         }
 
@@ -167,6 +225,7 @@ namespace Venus_RT.Modules
 
         private bool fnOnline(object[] param)
         {
+            IsOnline = true;
             return true;
         }
 
@@ -282,5 +341,114 @@ namespace Venus_RT.Modules
             _leakCheckRoutine.Abort();
             return true;
         }
+
+        private bool FnStartPrepareTM(object[] param)
+        {
+            return _pumpingRoutine.Start() == RState.Running;
+        }
+
+        private bool FnPreparaTMTimeout(object[] param)
+        {
+            RState ret = _pumpingRoutine.Monitor();
+            if (ret == RState.Failed || ret == RState.Timeout)
+            {
+                PostMsg(MSG.Error);
+                return false;
+            }
+
+            return ret == RState.End;
+        }
+
+        private bool FnStartPrepareEFEM(object[] param)
+        {
+            return _ventingRoutine.Start() == RState.Running;
+        }
+
+        private bool FnPrepareEFEMTimeout(object[] param)
+        {
+            RState ret = _ventingRoutine.Monitor();
+            if (ret == RState.Failed || ret == RState.Timeout)
+            {
+                PostMsg(MSG.Error);
+                return false;
+            }
+
+            return ret == RState.End;
+        }
+
+
+        private void _debugRoutine()
+        {
+            int flag = 0;
+            // Test Home routine
+            if (flag == 1)
+            {
+                PostMsg(MSG.Home);
+            }
+            else if (flag == 2)
+            {
+                PostMsg(MSG.Vent);
+            }
+            else if (flag == 3)
+            {
+                PostMsg(MSG.Pump);
+            }
+            //else if (flag == 4)
+            //{
+            //    PostMsg(MSG.PumpLoadLock);
+            //}
+            //else if (flag == 5)
+            //{
+            //    PostMsg(MSG.VentLoadLock);
+            //}
+            //else if (flag == 6)
+            //{
+            //    PostMsg(MSG.PurgeLoadLock);
+            //}
+            //else if (flag == 7)
+            //{
+            //    PostMsg(MSG.LaunchPump);
+            //}
+            //else if (flag == 8)
+            //{
+            //    PostMsg(MSG.LaunchTurboPump);
+            //}
+            //else if (flag == 9)
+            //{
+            //    PostMsg(MSG.LoadLockLeakCheck);
+            //}
+            else if (flag == 10)
+            {
+                PostMsg(MSG.CyclePurge);
+            }
+            //else if (flag == 11)
+            //{
+            //    PostMsg(MSG.GasLinePurge);
+            //}
+            //else if (flag == 12)
+            //{
+            //    PostMsg(MSG.LeakCheck);
+            //}
+            //else if (flag == 13)
+            //{
+            //    PostMsg(MSG.GasLeakCheck);
+            //}
+            //else if (flag == 14)
+            //{
+            //    PostMsg(MSG.LLPlace);
+            //}
+            //else if (flag == 15)
+            //{
+            //    PostMsg(MSG.LLPick);
+            //}
+            //else if (flag == 16)
+            //{
+            //    PostMsg(MSG.RunRecipe, "7777");
+            //}
+            //else if (flag == 17)
+            //{
+            //    PostMsg(MSG.MFCVerification, "MFC2", (double)50, 10);
+            //}
+        }
     }
 }

+ 2 - 0
Venus/Venus_RT/Modules/RouteManager.cs

@@ -121,6 +121,8 @@ namespace Venus_RT.Modules
             PMA?.Initialize();
             PMB?.Initialize();
             TM?.Initialize();
+            LLA?.Initialize();
+            LLB?.Initialize();
             return true;
         }
         void SubscribeOperation()

+ 12 - 0
Venus/Venus_RT/Modules/TM/MFPickRoutine.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Venus_RT.Modules.TM
+{
+    class MFPickRoutine
+    {
+    }
+}

+ 12 - 0
Venus/Venus_RT/Modules/TM/MFPlaceRoutine.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Venus_RT.Modules.TM
+{
+    class MFPlaceRoutine
+    {
+    }
+}

+ 31 - 10
Venus/Venus_RT/Modules/TM/MFPumpRoutine.cs

@@ -36,7 +36,7 @@ namespace Venus_RT.Modules.TM
                 Reset();
                 _pumpBasePressure = SC.GetValue<double>($"{Module}.PumpBasePressure");
                 _pumpCrossingPressure = SC.GetValue<double>($"{Module}.PumpCrossingPressure");
-                _pumpingTimeout = SC.GetValue<int>($"{Module}.PumpCrossingPressure") * 1000;
+                _pumpingTimeout = SC.GetValue<int>($"{Module}.PumpingTimeout") * 1000;
 
                 return Runner.Start(Module, Name);
             }
@@ -47,22 +47,40 @@ namespace Venus_RT.Modules.TM
         public RState Monitor()
         {
             Runner.Wait((int)PumpStep.kWaitPeerModule,  WaitPeerModule)
-                .Run((int)PumpStep.kSoftPump,           HOFs.WrapAction(_JetTM.TurnSoftPumpValve, Module, true),    () => { return _JetTM.GetModulePressure(Module) < _pumpCrossingPressure; }, _pumpingTimeout)
-                .Run((int)PumpStep.kFastPump,           SwitchFastPump,                                             () => { return _JetTM.GetModulePressure(Module) < _pumpBasePressure; },     _pumpingTimeout)
-                .End((int)PumpStep.kClosePumpValves,    ClosePumpValves,                                            _delay_50ms);
+                .Run((int)PumpStep.kSoftPump,           OpenSoftPump,                       () => { return _JetTM.GetModulePressure(Module) < _pumpCrossingPressure; }, _pumpingTimeout)
+                .Run((int)PumpStep.kFastPump,           SwitchFastPump,                     IsPressureReady,                                                            _pumpingTimeout)
+                .End((int)PumpStep.kClosePumpValves,    ClosePumpValves,                    _delay_50ms);
 
             return Runner.Status;
         }
 
         private bool WaitPeerModule()
         {
-            if(Module == ModuleName.LLA)
+            if(!IsPressureReady())
             {
-                return !_JetTM.IsLLBFastPumpOpen && !_JetTM.IsLLBSoftPumpOpen;
+                if (Module == ModuleName.LLA)
+                {
+                    return !_JetTM.IsLLBFastPumpOpen && !_JetTM.IsLLBSoftPumpOpen;
+                }
+                else if (Module == ModuleName.LLB)
+                {
+                    return !_JetTM.IsLLAFastPumpOpen && !_JetTM.IsLLASoftPumpOpen;
+                }
             }
-            else if (Module == ModuleName.LLB)
+            
+            return true;
+        }
+
+        private bool IsPressureReady()
+        {
+            return _JetTM.GetModulePressure(Module) < _pumpBasePressure;
+        }
+
+        private bool OpenSoftPump()
+        {
+            if (!IsPressureReady())
             {
-                return !_JetTM.IsLLAFastPumpOpen && !_JetTM.IsLLASoftPumpOpen;
+                _JetTM.TurnSoftPumpValve(Module, true);
             }
 
             return true;
@@ -70,8 +88,11 @@ namespace Venus_RT.Modules.TM
 
         private bool SwitchFastPump()
         {
-            _JetTM.TurnSoftPumpValve(Module, false);
-            _JetTM.TurnFastPumpValve(Module, true);
+            if (!IsPressureReady())
+            {
+                _JetTM.TurnSoftPumpValve(Module, false);
+                _JetTM.TurnFastPumpValve(Module, true);
+            }
 
             return true;
         }

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

@@ -69,7 +69,7 @@ namespace Venus_RT.Modules.TM
             Runner.Delay((int)PurgeStep.kCloseValves, _delay_1s)
                 .Run((int)PurgeStep.kPumpToCrossing,            HOFs.WrapAction(_JetTM.TurnSoftPumpValve, Module, true),    () => { return _JetTM.GetModulePressure(Module) < _CrossingPressure; })
                 .Run((int)PurgeStep.kPumpToBase,                SwitchFastPump,                                             () => { return _JetTM.GetModulePressure(Module) < _basePressure; })
-                .LoopStart((int)PurgeStep.kPurgeDelay_1,        "Purge",            _purgeCycleCounter,                     HOFs.WrapAction(_JetTM.TurnSoftPumpValve, Module, false),           _delay_1s)
+                .LoopStart((int)PurgeStep.kPurgeDelay_1,        "Purge",            _purgeCycleCounter,                     HOFs.WrapAction(_JetTM.TurnFastPumpValve, Module, false),           _delay_1s)
                 .LoopRun((int)PurgeStep.kPurgeVent,             HOFs.WrapAction(_JetTM.TurnVentValve, Module, true),        () => { return _JetTM.GetModulePressure(Module) >= _purgeVentPressure; })
                 .LoopRun((int)PurgeStep.kPurgeDelay_2,          HOFs.WrapAction(_JetTM.TurnVentValve, Module, false),       _delay_1s)
                 .LoopRun((int)PurgeStep.kPurgePumpToCrossing,   HOFs.WrapAction(_JetTM.TurnSoftPumpValve, Module, true),    () => { return _JetTM.GetModulePressure(Module) < _basePressure; })

+ 24 - 3
Venus/Venus_RT/Modules/TM/MFVentRoutine.cs

@@ -40,15 +40,36 @@ namespace Venus_RT.Modules.TM
 
         public RState Monitor()
         {
-            Runner.Run((int)VentStep.kVenting,          HOFs.WrapAction(_JetTM.TurnVentValve, Module, true),    HOFs.Apply(_JetTM.IsModuleATM, Module),     _ventingTimeout)
-                .End((int)VentStep.kCloseVentValves,    HOFs.WrapAction(_JetTM.TurnVentValve, Module, false),    _delay_50ms);
+            Runner.Run((int)VentStep.kVenting,          OpenVentValve,      IsPressureReady,    _ventingTimeout)
+                .End((int)VentStep.kCloseVentValves,    CloseVentValve,     _delay_50ms);
 
             return Runner.Status;
         }
 
-        public void Abort()
+        private bool OpenVentValve()
+        {
+            if(!IsPressureReady())
+            {
+                _JetTM.TurnVentValve(Module, true);
+            }
+
+            return true;
+        }
+
+        private bool CloseVentValve()
         {
             _JetTM.TurnVentValve(Module, false);
+            return true;
+        }
+
+        private bool IsPressureReady()
+        {
+            return _JetTM.IsModuleATM(Module);
+        }
+
+        public void Abort()
+        {
+            CloseVentValve();
         }
     }
 }

+ 2 - 0
Venus/Venus_RT/Modules/TM/TMEntity.cs

@@ -197,6 +197,7 @@ namespace Venus_RT.Modules
             RState ret = _ventingRoutine.Monitor();
             if (ret == RState.Failed || ret == RState.Timeout)
             {
+                _ventingRoutine.Abort();
                 PostMsg(MSG.Error);
                 return false;
             }
@@ -220,6 +221,7 @@ namespace Venus_RT.Modules
             RState ret = _pumpingRoutine.Monitor();
             if (ret == RState.Failed || ret == RState.Timeout)
             {
+                _pumpingRoutine.Abort();
                 PostMsg(MSG.Error);
                 return false;
             }

+ 2 - 0
Venus/Venus_RT/Venus_RT.csproj

@@ -212,6 +212,8 @@
     <Compile Include="Modules\Schedulers\TransferModule.cs" />
     <Compile Include="Modules\TM\MFHomeRoutine.cs" />
     <Compile Include="Modules\TM\MFLeakCheckRoutine.cs" />
+    <Compile Include="Modules\TM\MFPickRoutine.cs" />
+    <Compile Include="Modules\TM\MFPlaceRoutine.cs" />
     <Compile Include="Modules\TM\MFPumpRoutine.cs" />
     <Compile Include="Modules\TM\MFPurgeRoutine.cs" />
     <Compile Include="Modules\TM\MFVentRoutine.cs" />

+ 91 - 92
Venus/Venus_Simulator/Instances/SimulatorSystem.cs

@@ -159,6 +159,7 @@ namespace Venus_Simulator.Instances
             SetAiValue($"{mod}.AI_Time", DateTime.Now.Hour);
             SetAiValue($"{mod}.AI_Minute", DateTime.Now.Minute);
             SetAiValue($"{mod}.AI_Second", DateTime.Now.Second);
+
         }
 
         private void SetTMDefaultValue()
@@ -192,6 +193,13 @@ namespace Venus_Simulator.Instances
             IO.DI[$"{mod}.DI_LLA_Foreline_VAC_Gauge_Alarm"].Value = true;
             IO.DI[$"{mod}.DI_LLB_Chamber_VAC_Gauge_Alarm"].Value = true;
             IO.DI[$"{mod}.DI_LLB_Foreline_VAC_Gauge_Alarm"].Value = true;
+
+            IO.DI[$"{mod}.DI_LLA_Lid_Door_Closed"].Value = true;
+            IO.DI[$"{mod}.DI_LLB_Lid_Door_Closed"].Value = true;
+
+            SetAiValue($"{mod}.AI_TM_CHB_Pressure", 100);
+            SetAiValue($"{mod}.AI_LLA_CHB_Pressure", 100);
+            SetAiValue($"{mod}.AI_LLB_CHB_Pressure", 100);
         }
 
         private bool OnMonitor()
@@ -220,8 +228,9 @@ namespace Venus_Simulator.Instances
                 //MonitorIOPumpCtrl(ModuleName.PMB);
 
                 ChangeTime(ModuleName.TM);
-
-
+                MonitorMFPressure(ModuleName.TM);
+                MonitorMFPressure(ModuleName.LLA);
+                MonitorMFPressure(ModuleName.LLB);
             }
             catch (Exception e)
             {
@@ -410,28 +419,6 @@ namespace Venus_Simulator.Instances
             DOAccessor vent_vlv = IO.DO[$"{mod}.DO_N2_Valve"];
             //DOAccessor purge_vlv = IO.DO[$"{mod}.DO_Chamber_purge_valve"];
 
-            //if (vent_vlv.Value || purge_vlv.Value)
-            //{
-            //    if (vent_vlv.Value && purge_vlv.Value)
-            //    {
-            //        float getAiValue_ChamberPressure = GetAiValue($"{mod}.{sAI_ChamberPressure}");
-            //        float getAiValue_ProcessPressure = GetAiValue($"{mod}.{sAI_ProcessPressure}");
-            //        if (getAiValue_ProcessPressure <= 10000 && getAiValue_ChamberPressure > 10000)
-            //        {
-            //            SetAiValue($"{mod}.{sAI_ChamberPressure}", GetAiValue($"{mod}.{sAI_ChamberPressure}") + 30000);
-            //            //SetAiValue($"{mod}.{sAI_ProcessPressure}", GetAiValue($"{mod}.{sAI_ProcessPressure}") - 150);
-            //        }
-            //        else if (getAiValue_ProcessPressure <= 10000 && getAiValue_ChamberPressure <= 10000)
-            //        {
-            //            getAiValue_ProcessPressure = getAiValue_ChamberPressure;
-            //            SetAiValue($"{mod}.{sAI_ChamberPressure}", GetAiValue($"{mod}.{sAI_ProcessPressure}") + 1500);
-            //            SetAiValue($"{mod}.{sAI_ProcessPressure}", GetAiValue($"{mod}.{sAI_ProcessPressure}") + 1500);
-            //        }
-            //        //SetAiValue($"{mod}.{sAI_ChamberPressure}", GetAiValue($"{mod}.{sAI_ChamberPressure}") + _rd.Next(45000, 50000));
-            //        //SetAiValue($"{mod}.{sAI_ProcessPressure}", GetAiValue($"{mod}.{sAI_ProcessPressure}") + _rd.Next(150, 160));
-            //    }
-            //    else
-            //
             if (vent_vlv.Value)
             {
                     float getAiValue_ChamberPressure = GetAiValue($"{mod}.{sAI_ChamberPressure}");
@@ -512,88 +499,100 @@ namespace Venus_Simulator.Instances
                 SetAiValue($"{mod}.AI_Loadlock_Pressure", 20);
             }
 
+            // ATM switch
+            IO.DI[$"{mod}.DI_PM_ATM_SW"].Value = GetAiValue($"{mod}.{sAI_ChamberPressure}") > ATM_THRESHOLD;
 
-            // 模拟压力计漂移
-            //int p1 = (int)GetMockChamberPressure(mod);
-            //int new_p1 = _rd.Next(p1 - 2, p1 + 2);
-            //SetAiValue($"{mod}.AI_Chamber_Pressure", new_p1);
+            // VAC switch
+            IO.DI[$"{mod}.DI_PM_VAC_SW"].Value = GetAiValue($"{mod}.{sAI_ChamberPressure}") < VAC_SW_PRESSURE;
 
-            //int p2 = (int)GetAiValue($"{mod}.AI_Foreline_Pressure");
-            //int new_p2 = _rd.Next(p2 - 1, p2 + 1);
-            //SetAiValue($"{mod}.AI_Foreline_Pressure", new_p2);
 
-            //int p3 = (int)GetAiValue($"{mod}.AI_Process_Pressure");
-            //int new_p3 = _rd.Next(p3 - 1, p3 + 1);
-            //SetAiValue($"{mod}.AI_Process_Pressure", new_p3);
+        }
 
-            // 根据当前压力值设定信号
-            //float chamber_pressure2 = GetMockChamberPressure(mod);
+        void MonitorMFPressure(ModuleName mod)
+        {
+            DOAccessor doSoftPump, doFastPump, doVent;
+            DIAccessor diATM, diVac;
+            string strAIPressure;
+            double basePressure = SystemConfig.Instance.GetValue<double>($"{mod}.PumpBasePressure");
 
-            // ATM switch
-            IO.DI[$"{mod}.DI_PM_ATM_SW"].Value = GetAiValue($"{mod}.{sAI_ChamberPressure}") > ATM_THRESHOLD;
+            if(mod == ModuleName.LLA)
+            {
+                doSoftPump = IO.DO[$"TM.DO_Soft_Pumping_Valve_LLA"];
+                doFastPump = IO.DO[$"TM.DO_Fast_Pumping_Valve_LLA"];
+                doVent = IO.DO[$"TM.DO_Vent_Valve_LLA"];
 
-            // VAC switch
-            IO.DI[$"{mod}.DI_PM_VAC_SW"].Value = GetAiValue($"{mod}.{sAI_ChamberPressure}") < VAC_SW_PRESSURE;
+                diATM = IO.DI[$"TM.DI_LLA_ATM_Switch"];
+                diVac = IO.DI[$"TM.DI_LLA_VAC_Switch"];
 
-            // Throttle valve
+                strAIPressure = $"TM.AI_LLA_CHB_Pressure";
+            }
+            else if(mod == ModuleName.LLB)
+            {
+                doSoftPump = IO.DO[$"TM.DO_Soft_Pumping_Valve_LLB"];
+                doFastPump = IO.DO[$"TM.DO_Fast_Pumping_Valve_LLB"];
+                doVent = IO.DO[$"TM.DO_Vent_Valve_LLB"];
 
-            //var pos_sp = IO.AO[$"{mod}.AO_Throttle_Valve_Pressure_Setpoint"].Value;
-            //var mock_pos_fb = _rd.Next(pos_sp - 2, pos_sp + 2);
-            ////IO.AI[$"{mod}.AI_Throttle_Valve_Real_Pressure"].Value = (short)mock_pos_fb;
-            //SetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure", mock_pos_fb);
+                diATM = IO.DI[$"TM.DI_LLB_ATM_Switch"];
+                diVac = IO.DI[$"TM.DI_LLB_VAC_Switch"];
 
-            // 压力值
-            //if (GetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure") < GetAoValue($"{mod}.AO_Throttle_Valve_Pressure_Setpoint"))
-            //{
-            //    short increase = (short)_rd.Next(20, 30);
-            //    SetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure", GetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure") + increase);
-            //    if (GetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure") > GetAoValue($"{mod}.AO_Throttle_Valve_Pressure_Setpoint"))
-            //    {
-            //        SetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure", GetAoValue($"{mod}.AO_Throttle_Valve_Pressure_Setpoint"));
-            //    }
-            //}
-            //else
-            //{
-            //    short increase = (short)_rd.Next(20, 30);
+                strAIPressure = $"TM.AI_LLB_CHB_Pressure";
+            }
+            else
+            {
+                doSoftPump = IO.DO[$"TM.DO_Soft_Pumping_Valve_TM"];
+                doFastPump = IO.DO[$"TM.DO_Fast_Pumping_Valve_TM"];
+                doVent = IO.DO[$"TM.DO_Vent_Valve_TM"];
 
-            //    SetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure", GetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure") - increase);
-            //    if (GetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure") < GetAoValue($"{mod}.AO_Throttle_Valve_Pressure_Setpoint"))
-            //    {
-            //        SetAiValue($"{mod}.AI_Throttle_Valve_Real_Pressure", GetAoValue($"{mod}.AO_Throttle_Valve_Pressure_Setpoint"));
-            //    }
-            //}
+                diATM = IO.DI[$"TM.DI_TM_ATM_Switch"];
+                diVac = IO.DI[$"TM.DI_TM_VAC_Switch"];
 
-            //// 位置值
-            //if (GetAiValue($"{mod}.AI_Throttle_Valve_Real_Position") < GetAoValue($"{mod}.AO_Throttle_Valve_Position_Setpoint"))
-            //{
-            //    short increase = (short)_rd.Next(20, 30);
-            //    SetAiValue($"{mod}.AI_Throttle_Valve_Real_Position", GetAiValue($"{mod}.AI_Throttle_Valve_Real_Position") + increase);
-            //    if (GetAiValue($"{mod}.AI_Throttle_Valve_Real_Position") > GetAoValue($"{mod}.AO_Throttle_Valve_Position_Setpoint"))
-            //    {
-            //        SetAiValue($"{mod}.AI_Throttle_Valve_Real_Position", GetAoValue($"{mod}.AO_Throttle_Valve_Position_Setpoint"));
-            //    }
-            //}
-            //else
-            //{
-            //    short increase = (short)_rd.Next(20, 30);
+                strAIPressure = $"TM.AI_TM_CHB_Pressure";
+            }
 
-            //    SetAiValue($"{mod}.AI_Throttle_Valve_Real_Position", GetAiValue($"{mod}.AI_Throttle_Valve_Real_Position") - increase);
-            //    if (GetAiValue($"{mod}.AI_Throttle_Valve_Real_Position") < GetAoValue($"{mod}.AO_Throttle_Valve_Position_Setpoint"))
-            //    {
-            //        SetAiValue($"{mod}.AI_Throttle_Valve_Real_Position", GetAoValue($"{mod}.AO_Throttle_Valve_Position_Setpoint"));
-            //    }
-            //}
-        }
+            if(doVent.Value)
+            {
+                if(GetAiValue(strAIPressure) < 500)
+                    SetAiValue(strAIPressure, GetAiValue(strAIPressure) + 100 + _rd.Next(-10, 10));
+                else if(GetAiValue(strAIPressure) < 5000)
+                    SetAiValue(strAIPressure, GetAiValue(strAIPressure) + 1000 + _rd.Next(-20, 20));
+                else if(GetAiValue(strAIPressure) < 100000)
+                    SetAiValue(strAIPressure, GetAiValue(strAIPressure) + 25000 + _rd.Next(-50, 50));
+                else if (GetAiValue(strAIPressure) < ATM_PRESSURE)
+                    SetAiValue(strAIPressure, GetAiValue(strAIPressure) + 50000 + _rd.Next(-100, 100));
+                else
+                    SetAiValue(strAIPressure, ATM_PRESSURE);
+            }
+            else if(doSoftPump.Value || doFastPump.Value)
+            {
+                if(GetAiValue(strAIPressure) < basePressure + 10)
+                    SetAiValue(strAIPressure, (int)basePressure);
+                else if (GetAiValue(strAIPressure) < 2000)
+                    SetAiValue(strAIPressure, GetAiValue(strAIPressure) - 100 + _rd.Next(-2, 3));
+                else if (GetAiValue(strAIPressure) < 67000)
+                    SetAiValue(strAIPressure, GetAiValue(strAIPressure) - 2000 + _rd.Next(-8, 10));
+                else
+                    SetAiValue(strAIPressure, GetAiValue(strAIPressure) - 65000 + _rd.Next(-500, 500));
+            }
 
-        //float GetMockChamberPressure(ModuleName mod)
-        //{
-        //    return GetAiValue($"{mod}.AI_Chamber_Pressure");
-        //}
+            if(GetAiValue(strAIPressure) > 20)
+                SetAiValue(strAIPressure, GetAiValue(strAIPressure) + _rd.Next(-2, 3));
 
-        //void SetMockChamberPressure(ModuleName mod, float val)
-        //{
-        //    SetAiValue($"{mod}.AI_Chamber_Pressure", val);
-        //}
+            if (GetAiValue(strAIPressure) > ATM_THRESHOLD)
+            {
+                diATM.Value = true;
+                diVac.Value = false;
+            }
+            else if(GetAiValue(strAIPressure) < VAC_SW_PRESSURE)
+            {
+                diATM.Value = false;
+                diVac.Value = true;
+            }
+            else
+            {
+                diATM.Value = false;
+                diVac.Value = false;
+            }
+        }
 
         void SetAiValue(string name, float value)
         {