diff --git a/Modules/SicModules/PMs/Routines/Base/PMBaseRoutine.cs b/Modules/SicModules/PMs/Routines/Base/PMBaseRoutine.cs index 56498dd..d6900e8 100644 --- a/Modules/SicModules/PMs/Routines/Base/PMBaseRoutine.cs +++ b/Modules/SicModules/PMs/Routines/Base/PMBaseRoutine.cs @@ -1010,6 +1010,35 @@ namespace SicModules.PMs.Routines.Base } } + protected void WaitChamberPressDownTo(int id, double press, int timeout) + { + Tuple ret = ExecuteAndWait(id, () => + { + Notify($"Wait pm pressure to {press} mbar"); + return true; + }, + () => + { + return _pm.GetChamberPressure() <= press; + }, + timeout * 1000); + + if (ret.Item1) + { + if (ret.Item2 == Result.FAIL) + { + throw (new RoutineFaildException()); + } + else if (ret.Item2 == Result.TIMEOUT) + { + Stop($"Wait Chamber Pressure Down to {press} Timeout,over {timeout} seconds;"); + throw (new RoutineFaildException()); + } + else + throw (new RoutineBreakException()); + } + } + protected void SetIoValueByGroup(int id, IoGroupName groupName, bool close, int timeout) { Tuple ret = ExecuteAndWait(id, () => @@ -1602,48 +1631,6 @@ namespace SicModules.PMs.Routines.Base } } - protected void SetThrottlePressureAndWaitSetPoint(int id, IoThrottleValve2 _IoThrottle, double pressure, double _pmPressureMaxDiff, int timeout) - { - Tuple ret = ExecuteAndWait(id, () => - { - Notify($"Set Throttle pressure to {pressure} and wait"); - string reason = String.Empty; - - //将当前值赋值给设定值 - _IoThrottle.PressureSetpoint = _IoThrottle.PressureFeedback; - - if (!_IoThrottle.SetPressure(out reason, 0, new object[] { pressure })) - { - Stop($"Set Throttle pressure to { pressure} failed, { reason}"); - return false; - } - - return true; - }, - () => - { - return Math.Abs(_IoThrottle.PressureSetpoint - pressure) <= 1; - }, - timeout * 1000); - - if (ret.Item1) - { - if (ret.Item2 == Result.FAIL) - { - throw (new RoutineFaildException()); - } - else if (ret.Item2 == Result.TIMEOUT) - { - Stop($"Set Throttle Pressure to {pressure} timeout, over {timeout} seconds"); - throw (new RoutineFaildException()); - } - else - throw (new RoutineBreakException()); - } - } - - - protected void SetThrottlePressureAndWait(int id, IoThrottleValve2 _IoThrottle, double pressure, double _pmPressureMaxDiff, int timeout) { Tuple ret = ExecuteAndWait(id, () => @@ -1680,7 +1667,44 @@ namespace SicModules.PMs.Routines.Base throw (new RoutineBreakException()); } } - + + protected void SetThrottlePressureAndWait(int id, IoThrottleValve2 _IoThrottle, double pressure, int timeout) + { + Tuple ret = ExecuteAndWait(id, () => + { + Notify($"Set Throttle pressure to {pressure} and wait"); + string reason = String.Empty; + + if (!_IoThrottle.SetPressure(out reason, 0, new object[] { pressure })) + { + Stop($"Set Throttle pressure to {pressure} failed, {reason}"); + return false; + } + + return true; + }, + () => + { + return _IoThrottle.PressureFeedback <= pressure; + }, + timeout * 1000); + + if (ret.Item1) + { + if (ret.Item2 == Result.FAIL) + { + throw (new RoutineFaildException()); + } + else if (ret.Item2 == Result.TIMEOUT) + { + Stop($"Set Throttle Pressure to {pressure} timeout, over {timeout} seconds"); + throw (new RoutineFaildException()); + } + else + throw (new RoutineBreakException()); + } + } + protected void SetThrottleToTargetAndNoWait(int id, IoThrottleValve2 _IoThrottle, double pressure) { Tuple ret = Execute(id, () => @@ -1737,6 +1761,35 @@ namespace SicModules.PMs.Routines.Base } } + protected void WaitThrottleToPressureAndSetMfcSpecial(int id, IoThrottleValve2 _IoThrottle, double pressure, int timeout) + { + Tuple ret = ExecuteAndWait(id, () => + { + return true; + }, + () => + { + SetMfcRampByGroupAndPressureAlways(currentPressureUpOrDown); + return _IoThrottle.PressureFeedback <= pressure; + }, + timeout * 1000); + + if (ret.Item1) + { + if (ret.Item2 == Result.FAIL) + { + throw (new RoutineFaildException()); + } + else if (ret.Item2 == Result.TIMEOUT) + { + Stop($"Set Throttle Pressure to {pressure} timeout, over {timeout} seconds"); + throw (new RoutineFaildException()); + } + else + throw (new RoutineBreakException()); + } + } + protected void WaitPMPressureAndSetMfcSpecial(int id, double pressure, int timeout) { Tuple ret = Wait(id, () => diff --git a/Modules/SicModules/PMs/Routines/PMCleanRoutine.cs b/Modules/SicModules/PMs/Routines/PMCleanRoutine.cs index 69ebab0..31f321c 100644 --- a/Modules/SicModules/PMs/Routines/PMCleanRoutine.cs +++ b/Modules/SicModules/PMs/Routines/PMCleanRoutine.cs @@ -198,6 +198,9 @@ namespace SicModules.PMs.Routines private double _pmPressureMaxDiff; //蝶阀与目标压力的差值范围(认为调整到位了) private int _throttleTimeout; //蝶阀调整到指定压力的超时时间 + private int _ventTimeout; + private int _pumpTimeout; + private double _throttleFinalPressure = 300;//蝶阀最终调整对的压力 @@ -222,6 +225,9 @@ namespace SicModules.PMs.Routines _pmPressureMaxDiff = SC.GetValue($"PM.{Module}.ThrottlePressureMaxDiff"); _throttleTimeout = SC.GetValue($"PM.{Module}.ThrottlePressureTimeout"); + _ventTimeout = SC.GetValue($"PM.{Module}.Clean.VentTimeout"); + _pumpTimeout = SC.GetValue($"PM.{Module}.Clean.PumpTimeout"); + _pressureLoopCount = SC.GetValue($"PM.{Module}.Clean.CycleCleanCount"); _pressureMin = SC.GetValue($"PM.{Module}.Clean.PumpBasePressure"); _pressureMinDelay = SC.GetValue($"PM.{Module}.Clean.PumpDelayTime"); @@ -320,13 +326,13 @@ namespace SicModules.PMs.Routines SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode, _IoThrottle, 5); //伺服压力设定值到0mbar - SetThrottlePressureAndWaitSetPoint((int)RoutineStep.SetTv1, _IoThrottle, _pressureMin, _pmPressureMaxDiff, _throttleTimeout); + SetThrottleToTargetAndNoWait((int)RoutineStep.SetTv1, _IoThrottle, _pressureMin); //M2、M9、M15、M19-M40 MFC 5s ramp 到0 SetMfcByGroup((int)RoutineStep.SetM2toM40, MfcGroupName.M2toM40, 0, 5); //等待腔体压力Pump到设定值 - WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pressureMin, _pmPressureMaxDiff, _throttleTimeout); + WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pressureMin, _throttleTimeout); TimeDelay((int)RoutineStep.TimeDelay2, 3); @@ -365,7 +371,7 @@ namespace SicModules.PMs.Routines SetIoValueByGroup((int)RoutineStep.SetEPV2_1, IoGroupName.EPV2, false, _IoValueOpenCloseTimeout); SetPressureUpOrDown((int)RoutineStep.SetPressUpOrDown1, PressureUpOrDown.Uping); - WaitThrottleToPressureAndSetMfcSpecial((int)RoutineStep.WaitPressureUp, _IoThrottle, _pressureMax, _pmPressureMaxDiff, _pressureMaxTimeout); + WaitThrottleToPressureAndSetMfcSpecial((int)RoutineStep.WaitPressureUp, _IoThrottle, _pressureMax, _ventTimeout); ////设置蝶阀为压力模式 //SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode1, _IoThrottle, 5); @@ -388,7 +394,7 @@ namespace SicModules.PMs.Routines SetMfcByGroup((int)RoutineStep.SetM2toM40_1, MfcGroupName.M2toM40, 0, 3); //伺服到0mbar - SetThrottlePressureAndWait((int)RoutineStep.SetPressureDown, _IoThrottle, _pressureMin, _pmPressureMaxDiff, _throttleTimeout); + SetThrottlePressureAndWait((int)RoutineStep.SetPressureDown, _IoThrottle, _pressureMin, _pumpTimeout); //TimeDelay((int)RoutineStep.TimeDelay8, 3); diff --git a/Modules/SicModules/PMs/Routines/PMLeakCheckRoutine.cs b/Modules/SicModules/PMs/Routines/PMLeakCheckRoutine.cs index dfc7246..a78137a 100644 --- a/Modules/SicModules/PMs/Routines/PMLeakCheckRoutine.cs +++ b/Modules/SicModules/PMs/Routines/PMLeakCheckRoutine.cs @@ -359,13 +359,13 @@ namespace SicModules.PMs.Routines SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode, _IoThrottle, 5); //伺服压力设定值到0mbar - SetThrottlePressureAndWaitSetPoint((int)RoutineStep.SetTv1, _IoThrottle, _pressureMin, _pmPressureMaxDiff, _throttleTimeout); + SetThrottleToTargetAndNoWait((int)RoutineStep.SetTv1, _IoThrottle, _pressureMin); //M2、M9、M15、M19-M40 MFC 3s ramp到0 SetMfcByGroup((int)RoutineStep.SetM2toM40, MfcGroupName.M2toM40, 0, 3); //等待腔体压力Pump到设定值 - WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pressureMin, _pmPressureMaxDiff, _throttleTimeout); + WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pressureMin, _throttleTimeout); TimeDelay((int)RoutineStep.TimeDelay8, 3); diff --git a/Modules/SicModules/PMs/Routines/PMMfcRorRoutine.cs b/Modules/SicModules/PMs/Routines/PMMfcRorRoutine.cs index 09e633c..60cceaf 100644 --- a/Modules/SicModules/PMs/Routines/PMMfcRorRoutine.cs +++ b/Modules/SicModules/PMs/Routines/PMMfcRorRoutine.cs @@ -456,10 +456,10 @@ namespace SicModules.PMs.Routines SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode_1, _IoThrottle, 5); //伺服压力设定值到0mbar - SetThrottlePressureAndWaitSetPoint((int)RoutineStep.SetTV_1, _IoThrottle, _pumpBasePressure, _pressureMaxDiff, _throttleTimeout); + SetThrottleToTargetAndNoWait((int)RoutineStep.SetTV_1, _IoThrottle, _pumpBasePressure); //等待腔体压力Pump到设定值 - WaitChamberPressDownTo((int)RoutineStep.WaitTV_1, _pumpBasePressure, _pressureMaxDiff, _throttleTimeout); + WaitChamberPressDownTo((int)RoutineStep.WaitTV_1, _pumpBasePressure, _throttleTimeout); } //关闭蝶阀,再关闭EPV2 @@ -523,7 +523,7 @@ namespace SicModules.PMs.Routines SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode_2, _IoThrottle, 5); //伺服压力设定值到0mbar - SetThrottlePressureAndWaitSetPoint((int)RoutineStep.SetTV_2, _IoThrottle, _pumpBasePressure, _pressureMaxDiff, _throttleTimeout); + SetThrottleToTargetAndNoWait((int)RoutineStep.SetTV_2, _IoThrottle, _pumpBasePressure); //等待腔体压力Pump到设定值 WaitChamberPressDownTo((int)RoutineStep.WaitTV_2, _pumpBasePressure, _pressureMaxDiff, _throttleTimeout); diff --git a/Modules/SicModules/PMs/Routines/PMPumpRoutine.cs b/Modules/SicModules/PMs/Routines/PMPumpRoutine.cs index b61d85a..9419c5a 100644 --- a/Modules/SicModules/PMs/Routines/PMPumpRoutine.cs +++ b/Modules/SicModules/PMs/Routines/PMPumpRoutine.cs @@ -222,13 +222,13 @@ namespace SicModules.PMs.Routines SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode, _IoThrottle, 5); //伺服压力设定值到0mbar - SetThrottlePressureAndWaitSetPoint((int)RoutineStep.SetTv1, _IoThrottle, _pumpBasePressure, _pmPressureMaxDiff, _throttleTimeout); + SetThrottleToTargetAndNoWait((int)RoutineStep.SetTv1, _IoThrottle, _pumpBasePressure); //M2、M9、M15、M19-M40 MFC 3s ramp到0 SetMfcByGroup((int)RoutineStep.SetM2to40, MfcGroupName.M2toM40, 0, 3); //等待腔体压力Pump到设定值 - WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pumpBasePressure, _pmPressureMaxDiff, _throttleTimeout); + WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pumpBasePressure, _throttleTimeout); //蝶阀设置为位置模式,开度设置为最大 SetThrottleToPositionMode((int)RoutineStep.SetTVPositionMode, _IoThrottle, _throttleTimeout); diff --git a/Modules/SicModules/PMs/Routines/PMPurgeRoutine.cs b/Modules/SicModules/PMs/Routines/PMPurgeRoutine.cs index 0d08e31..a4c3652 100644 --- a/Modules/SicModules/PMs/Routines/PMPurgeRoutine.cs +++ b/Modules/SicModules/PMs/Routines/PMPurgeRoutine.cs @@ -220,6 +220,10 @@ namespace SicModules.PMs.Routines private int _IoValueOpenCloseTimeout = 10; //开关阀门超时时间 private double _pmPressureMaxDiff; //蝶阀与目标压力的差值范围(认为调整到位了) private int _throttleTimeout; //蝶阀调整到指定压力的超时时间 + + private int _ventTimeout; + private int _pumpTimeout; + private int _EPV12TimeSapn = 10; private int _waitPressureTimeout = 600; //等待腔体压力上升到950的超时时间 @@ -245,6 +249,9 @@ namespace SicModules.PMs.Routines _pmPressureMaxDiff = SC.GetValue($"PM.{Module}.ThrottlePressureMaxDiff"); _throttleTimeout = SC.GetValue($"PM.{Module}.ThrottlePressureTimeout"); + _ventTimeout = SC.GetValue($"PM.{Module}.Purge.VentTimeout"); + _pumpTimeout = SC.GetValue($"PM.{Module}.Purge.PumpTimeout"); + _pressureLoopCount = SC.GetValue($"PM.{Module}.Purge.CyclePurgeCount"); _pumpBasePressure = SC.GetValue($"PM.{Module}.Purge.PumpBasePressure"); _pressureMinDelay = SC.GetValue($"PM.{Module}.Purge.PumpDelayTime"); @@ -342,13 +349,13 @@ namespace SicModules.PMs.Routines SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode, _IoThrottle, 5); //伺服压力设定值到0mbar - SetThrottlePressureAndWaitSetPoint((int)RoutineStep.SetTv1, _IoThrottle, _pumpBasePressure, _pmPressureMaxDiff, _throttleTimeout); + SetThrottleToTargetAndNoWait((int)RoutineStep.SetTv1, _IoThrottle, _pumpBasePressure); //M2、M9、M15、M19-M40 MFC 5s ramp 到0 SetMfcByGroup((int)RoutineStep.SetM2toM40, MfcGroupName.M2toM40, 0, 5); //等待腔体压力Pump到设定值 - WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pumpBasePressure, _pmPressureMaxDiff, _throttleTimeout); + WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _pumpBasePressure, _throttleTimeout); TimeDelay((int)RoutineStep.TimeDelay2, 3); @@ -387,7 +394,7 @@ namespace SicModules.PMs.Routines SetIoValueByGroup((int)RoutineStep.SetEPV2_1, IoGroupName.EPV2, false, _IoValueOpenCloseTimeout); SetPressureUpOrDown((int)RoutineStep.SetPressUpOrDown1, PressureUpOrDown.Uping); - WaitThrottleToPressureAndSetMfcSpecial((int)RoutineStep.WaitPressureUp, _IoThrottle, _ventBasePressure, _pmPressureMaxDiff, _pressureMaxTimeout); + WaitThrottleToPressureAndSetMfcSpecial((int)RoutineStep.WaitPressureUp, _IoThrottle, _ventBasePressure, _ventTimeout); ////设置蝶阀为压力模式 //SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode1, _IoThrottle, 5); @@ -411,7 +418,7 @@ namespace SicModules.PMs.Routines SetMfcByGroup((int)RoutineStep.SetM2toM40_1, MfcGroupName.M2toM40, 0, 3); //伺服到0mbar - SetThrottlePressureAndWait((int)RoutineStep.SetPressureDown, _IoThrottle, _pumpBasePressure, _pmPressureMaxDiff, _throttleTimeout); + SetThrottlePressureAndWait((int)RoutineStep.SetPressureDown, _IoThrottle, _pumpBasePressure, _pumpTimeout); //TimeDelay((int)RoutineStep.TimeDelay8, 3); diff --git a/Modules/SicModules/PMs/Routines/PMVacIdleRoutine.cs b/Modules/SicModules/PMs/Routines/PMVacIdleRoutine.cs index 8f4532b..14f3761 100644 --- a/Modules/SicModules/PMs/Routines/PMVacIdleRoutine.cs +++ b/Modules/SicModules/PMs/Routines/PMVacIdleRoutine.cs @@ -222,13 +222,13 @@ namespace SicModules.PMs.Routines SetThrottleToPressModeAndWait((int)RoutineStep.SetTVPressMode, _IoThrottle, 5); //伺服压力设定值到0mbar - SetThrottlePressureAndWaitSetPoint((int)RoutineStep.SetTv1, _IoThrottle, _vacPumpBasePressure, _pmPressureMaxDiff, _throttleTimeout); + SetThrottleToTargetAndNoWait((int)RoutineStep.SetTv1, _IoThrottle, _vacPumpBasePressure); //M2、M9、M15、M19-M40 MFC 3s ramp到0 SetMfcByGroup((int)RoutineStep.SetM2to40, MfcGroupName.M2toM40, 0, 3); //等待腔体压力Pump到设定值 - WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _vacPumpBasePressure, _pmPressureMaxDiff, _throttleTimeout); + WaitChamberPressDownTo((int)RoutineStep.WaitTv1, _vacPumpBasePressure, _throttleTimeout); //蝶阀设置为位置模式,开度设置为最大 SetThrottleToPositionMode((int)RoutineStep.SetTVPositionMode, _IoThrottle, _throttleTimeout); diff --git a/SicUI/Properties/AssemblyInfo.cs b/SicUI/Properties/AssemblyInfo.cs index 7724a8e..902b917 100644 --- a/SicUI/Properties/AssemblyInfo.cs +++ b/SicUI/Properties/AssemblyInfo.cs @@ -54,6 +54,6 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.3.0.40314")] +[assembly: AssemblyVersion("1.3.0.40315")] [assembly: AssemblyInformationalVersion("手动通用版(无EFEM)")]