LLPlaceRoutine.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.Core.RT.SCCore;
  3. using Venus_RT.Devices;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.SubstrateTrackings;
  6. using System.Diagnostics;
  7. using System.Collections.Generic;
  8. using Venus_Core;
  9. namespace Venus_RT.Modules.PMs
  10. {
  11. class LLPlaceRoutine : PMRoutineBase, IRoutine
  12. {
  13. private enum LLPlaceStep
  14. {
  15. kPrepareTransfer,
  16. kExtend,
  17. kPinUp,
  18. kRetract,
  19. kPostTransfer,
  20. kOpenFastPump,
  21. }
  22. private int _prepareTransferTimeout = 120;
  23. private int _transferWaferTimeout = 120;
  24. private bool _isATMMode = false;
  25. public LLPlaceRoutine(JetPM chamber) : base(chamber)
  26. {
  27. Name = "PlaceWafer";
  28. }
  29. public RState Start(params object[] objs)
  30. {
  31. _prepareTransferTimeout = SC.GetValue<int>($"{Module}.PrepareTransferTimeout");
  32. _transferWaferTimeout = SC.GetValue<int>($"{Module}.TransferWaferTimeout");
  33. _isATMMode = SC.GetValue<bool>("System.IsATMMode");
  34. if (WaferManager.Instance.CheckHasWafer(ModuleName.PMA, 0))
  35. {
  36. Stop("腔体里面有 Wafer,不能执行放片动作");
  37. return RState.Failed;
  38. }
  39. if (WaferManager.Instance.CheckNoWafer(ModuleName.LLA, 0))
  40. {
  41. Stop("Loadlock 里面没有 Wafer,不能执行放片动作");
  42. return RState.Failed;
  43. }
  44. if (_isATMMode)
  45. {
  46. if(!_chamber.IsATM || !_chamber.IsATMLoadlock)
  47. {
  48. Stop("腔体非大气状态,请先执行充气动作");
  49. return RState.Failed;
  50. }
  51. }
  52. else
  53. {
  54. if(!_chamber.IsVAC || !_chamber.IsVACLoadLock)
  55. {
  56. Stop("腔体非真空状态,请先执行抽真空动作");
  57. return RState.Failed;
  58. }
  59. }
  60. _chamber.OpenValve(ValveType.FastPump, false);
  61. _chamber.OpenValve(ValveType.LoadlockPumping, false);
  62. Reset();
  63. return Runner.Start(Module, Name);
  64. }
  65. public RState Monitor()
  66. {
  67. Runner.Run((int)LLPlaceStep.kPrepareTransfer, PrepareTransfer, IsPrepareReady, _prepareTransferTimeout * 1000)
  68. .Run((int)LLPlaceStep.kExtend, _chamber.ExtendWafer, () => { return _chamber.IsLoadlockArmExtend; }, _transferWaferTimeout * 1000)
  69. .Run((int)LLPlaceStep.kPinUp, SetLiftPinUp, () => { return _chamber.CheckLiftUp(); })
  70. .Run((int)LLPlaceStep.kRetract, _chamber.RetractWafer, () => { return _chamber.IsLoadlockArmRetract; }, _transferWaferTimeout * 1000)
  71. .Run((int)LLPlaceStep.kPostTransfer, PostTransfer, IsPostTransferReady, _prepareTransferTimeout * 1000)
  72. .End((int)LLPlaceStep.kOpenFastPump, OpenFastPump, _delay_50ms);
  73. return Runner.Status;
  74. }
  75. private bool PrepareTransfer()
  76. {
  77. _chamber.SetLiftPin(MovementPosition.Down, out _);
  78. _chamber.SetSlitDoor(true, out _);
  79. return true;
  80. }
  81. private bool IsPrepareReady()
  82. {
  83. return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorOpen();
  84. }
  85. private bool PostTransfer()
  86. {
  87. WaferManager.Instance.WaferMoved(ModuleName.LLA, 0, ModuleName.PMA, 0);
  88. _chamber.SetLiftPin(MovementPosition.Down, out _);
  89. _chamber.SetSlitDoor(false, out _);
  90. return true;
  91. }
  92. private bool IsPostTransferReady()
  93. {
  94. return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorClose();
  95. }
  96. private bool SetLiftPinUp()
  97. {
  98. return _chamber.SetLiftPin(MovementPosition.Up, out _);
  99. }
  100. private bool OpenFastPump()
  101. {
  102. if (!_isATMMode)
  103. _chamber.OpenValve(ValveType.FastPump, true);
  104. return true;
  105. }
  106. public void Abort()
  107. {
  108. }
  109. }
  110. }