LoadLockLeakCheckRoutine.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.Core.RT.SCCore;
  3. using Venus_RT.Devices;
  4. using MECF.Framework.Common.Routine;
  5. using Venus_Core;
  6. namespace Venus_RT.Modules.PMs
  7. {
  8. class LoadLockLeakCheckRoutine : PMRoutineBase, IRoutine
  9. {
  10. private enum LeakCheckStep
  11. {
  12. kPumpToBasePressure,
  13. kPumpingDelay,
  14. kLeakCheckDelay,
  15. kEnd,
  16. }
  17. public double LeakRate { get; private set; }
  18. private int _basePressureLL = 100;
  19. private int _leakcheckPumpTimeLL = 180;
  20. private int _leakcheckWaitTimeLL = 300;
  21. private double _startPressure = 0;
  22. private double _endPressure = 0;
  23. private double _leakRate = 30.0;
  24. public LoadLockLeakCheckRoutine(JetPM chamber) : base(chamber)
  25. {
  26. Name = "Loadlock Leakcheck";
  27. }
  28. public RState Start(params object[] objs)
  29. {
  30. if (CheckLidLoadLock() &&
  31. CheckSlitDoor() &&
  32. CheckDryPump())
  33. {
  34. Reset();
  35. _chamber.CloseValves();
  36. _basePressureLL = SC.GetValue<int>($"{Module}.Pump.LoadLockPumpBasePressure");
  37. _leakcheckPumpTimeLL = SC.GetValue<int>($"{Module}.Pump.LoadLockLeakCheckPumpTime");
  38. _leakcheckWaitTimeLL = SC.GetValue<int>($"{Module}.Pump.LoadLockLeakCheckPumpTime");
  39. _leakRate = SC.GetValue<double>($"{Module}.Pump.LoadLockLeakRate");
  40. return Runner.Start(Module, Name);
  41. }
  42. return RState.Failed;
  43. }
  44. public RState Monitor()
  45. {
  46. Runner.Run((int)LeakCheckStep.kPumpToBasePressure, HOFs.WrapAction(_chamber.OpenValve, ValveType.LoadlockPumping, true), () => { return _chamber.LoadlockPressure <= _basePressureLL; })
  47. .Delay((int)LeakCheckStep.kPumpingDelay, _leakcheckPumpTimeLL * 1000)
  48. .Run((int)LeakCheckStep.kLeakCheckDelay, StartLeakCheck, _leakcheckWaitTimeLL * 1000)
  49. .End((int)LeakCheckStep.kEnd, CalcLeakCheckResult, _delay_50ms);
  50. return Runner.Status;
  51. }
  52. public void Abort()
  53. {
  54. CloseAllValves();
  55. }
  56. bool StartLeakCheck()
  57. {
  58. _chamber.OpenValve(ValveType.LoadlockPumping, false);
  59. _startPressure = _chamber.LoadlockPressure;
  60. Notify($"LoadLock压力开始值 {_startPressure} mt");
  61. return true;
  62. }
  63. bool CalcLeakCheckResult()
  64. {
  65. _endPressure = _chamber.LoadlockPressure;
  66. LeakRate = (_endPressure - _startPressure) * 60.0 / _leakcheckWaitTimeLL;
  67. if(LeakRate < _leakRate)
  68. {
  69. Notify($"LoadLock Leakcheck完成, 压力结束值: {_startPressure} mt, 漏率:{LeakRate} mt/min");
  70. }
  71. else
  72. {
  73. Stop($"LoadLock Leakcheck失败, 腔体漏率 [{LeakRate}] mt/min, 高于 [{_leakRate}] mt/min");
  74. }
  75. return true;
  76. }
  77. }
  78. }