JetKepler2300PM.cs 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.SCCore;
  5. using Aitex.Core.RT.Log;
  6. using Aitex.Core.Util;
  7. using MECF.Framework.Common.Device.Bases;
  8. using MECF.Framework.Common.Equipment;
  9. using System;
  10. using System.Collections.Generic;
  11. using Venus_Core;
  12. using Venus_RT.Modules;
  13. using Venus_RT.Devices.IODevices;
  14. using Venus_RT.Devices.EPD;
  15. using MECF.Framework.Common.SubstrateTrackings;
  16. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  17. using System.Threading.Tasks;
  18. using Aitex.Core.RT.DataCenter;
  19. using Aitex.Core.Backend;
  20. using Aitex.Core.RT.OperationCenter;
  21. using Aitex.Core.RT.Event;
  22. using System.Diagnostics;
  23. namespace Venus_RT.Devices
  24. {
  25. class JetKepler2300PM : JetPMBase
  26. {
  27. private readonly IoLid _Lid;
  28. private readonly IoLid _LidLoadlock;
  29. private readonly IoCylinder _slitDoor;
  30. private readonly IoCylinder _LiftPin;
  31. private readonly IoCylinder _LoadLockArm;
  32. private readonly IoValve _PVN21Valve;
  33. private readonly IoValve _PVN22Valve;
  34. private readonly IoValve _PV11Valve;
  35. private readonly IoValve _PV12Valve;
  36. private readonly IoValve _PV21Valve;
  37. private readonly IoValve _PV22Valve;
  38. private readonly IoValve _PV31Valve;
  39. private readonly IoValve _PV32Valve;
  40. private readonly IoValve _PV41Valve;
  41. private readonly IoValve _PV42Valve;
  42. private readonly IoValve _N2Valve;
  43. private readonly IoValve _Mfc1Valve;
  44. private readonly IoValve _Mfc2Valve;
  45. private readonly IoValve _Mfc3Valve;
  46. private readonly IoValve _Mfc4Valve;
  47. private readonly IoValve _Mfc5Valve;
  48. private readonly IoValve _Mfc6Valve;
  49. private readonly IoValve _Mfc7Valve;
  50. private readonly IoValve _Mfc8Valve;
  51. private readonly IoValve _PVHe1Valve;
  52. private readonly IoValve _PVHe2Valve;
  53. private readonly IoValve _GasFinalValve;
  54. private readonly IoValve _SoftPumpValve;
  55. private readonly IoValve _FastPumpValve;
  56. private readonly IoValve _TurboPumpPumpingValve;
  57. private readonly IoValve _TurboPumpPurgeValve;
  58. private readonly IoValve _GuageValve;
  59. private readonly IoValve _LoadlockVentValve;
  60. private readonly IoValve _LoadlockPumpingValve;
  61. private readonly IoSensor _ATM_sw;
  62. private readonly IoSensor _CDAPressure;
  63. private readonly IoSensor _ATM_Loadlock_sw;
  64. private readonly IoSensor _N2Pressure_sw;
  65. private readonly IoSensor _VAC_sw;
  66. private readonly IoSensor _WLK_sw;
  67. private readonly IoSensor _Water_Flow;
  68. private readonly IoSensor _RFG_Interlock;
  69. private readonly IoSensor _PM_Lid_Closed;
  70. private readonly IoSensor _Source_RF_Fan;
  71. private readonly IoSensor _PM_SlitDoor_Closed;
  72. private readonly IoSensor _TurboPumpInterlock;
  73. private readonly IoSensor _GasBoxDoor;
  74. private readonly IoSensor _GasBoxPressure;
  75. private readonly PumpBase _MainPump;
  76. private readonly ESC5HighVoltage _ESCHV;
  77. private readonly AdixenTurboPump _TurboPump;
  78. private readonly PendulumValve _pendulumValve;
  79. //private readonly ChillerBase _Chiller;
  80. private readonly ChillerBase _InnerChiller;
  81. private readonly ChillerBase _OuterChiller;
  82. private readonly ChillerBase _TopChiller;
  83. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  84. private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  85. private readonly RfMatchBase _Match;
  86. private readonly RfMatchBase _BiasMatch;
  87. private readonly IoSignalTower _SignalTower;
  88. private readonly IoHeater _ForelineTC;
  89. private readonly IoHeater _WallTC;
  90. private readonly IoPressureControl _pressureController;
  91. private readonly IoGasStick[] _gasLines;
  92. private readonly IoGasStick _gasLineN2;
  93. private readonly IoBacksideHe _backsideHe;
  94. private readonly IoMfc _heMfc;
  95. private readonly double _foreline_interlock_pressure = 750;
  96. private Stopwatch _GasRFStopWatch = new Stopwatch();
  97. private bool _GasFlag = false;
  98. private float _chillerInnerTemp => GetAiValue($"{Module}.AI_ESC_inner_coolant_outlet_TC_Temp");
  99. private float _chillerOuterTemp => GetAiValue($"{Module}.AI_ESC_outer_coolant_outlet_TC_Temp");
  100. private float _chillerTopTemp => GetAiValue($"{Module}.AI_Top_Plate_coolant_outlet_TC_Temp");
  101. private Stopwatch _pendulumValveStopWatch = new Stopwatch();
  102. // 盖子的状态
  103. public override bool IsLidClosed => _Lid.OFFFeedback;
  104. public override bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  105. public override bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  106. public override bool IsPumpRunning => _MainPump.IsRunning;
  107. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  108. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  109. public override float TurboPumpSpeed => _TurboPump.Speed;
  110. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  111. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  112. public override bool IsCDA_OK => _CDAPressure.Value;
  113. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  114. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  115. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  116. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  117. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  118. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  119. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  120. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  121. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  122. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  123. public override bool IsGuageValveOpened => _GuageValve.Status;
  124. // 压力信号
  125. public override bool IsATM => _ATM_sw.Value;
  126. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  127. public override bool LiftPinIsDown => _LiftPin.OFFFeedback;
  128. public override bool LiftPinIsUp => _LiftPin.ONFeedback;
  129. public override bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  130. public override bool IsVACLoadLock => LoadlockPressure <= 1000;
  131. public override bool IsVAC => _VAC_sw.Value;
  132. public override bool IsWaterFlowOk => true;
  133. public override bool IsWLK => _WLK_sw.Value;
  134. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  135. public override bool PMLidClosed => _PM_Lid_Closed.Value;
  136. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  137. public override bool SourceRFFanInterlock => _Source_RF_Fan.Value;
  138. public override bool SlitDoorClosed => _PM_SlitDoor_Closed.Value;
  139. //public override double ProcessLowPressure => _pressureController.ProcessLow.Value;
  140. //public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
  141. public override double CalculationPressure
  142. {
  143. get
  144. {
  145. if (ProcessPressure < 100)
  146. {
  147. return ProcessPressure;
  148. }
  149. else
  150. {
  151. return ChamberPressure;
  152. }
  153. }
  154. }
  155. public override double ProcessPressure => _pressureController.ProcessGauge.Value;
  156. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  157. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  158. public override double TargetPressure => _pressureController.TargetPressure;
  159. public override double LoadlockPressure => 0;
  160. public override double ESCHePressure => _pressureController.ESCHeGauge.Value;
  161. public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
  162. public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
  163. public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
  164. public override bool IsHVOn => _ESCHV.IsOn;
  165. public override float CoolantInletTempFB => 0;
  166. public override float CoolantOutletTempFB => 0;
  167. public override bool ChillerIsRunning => false;
  168. public bool innerChillerIsRunning => _InnerChiller.IsRunning;
  169. public bool outerChillerIsRunning => _OuterChiller.IsRunning;
  170. public bool topChillerIsRunning => _TopChiller.IsRunning;
  171. //Loadlock_Arm
  172. public override bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
  173. public override bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
  174. //Loadlock_Arm DO
  175. public override bool LoadlockArmRetract => _LoadLockArm.OFFSetPoint;
  176. public override bool LoadlockArmExtend => _LoadLockArm.ONSetPoint;
  177. public override float ReflectPower => _Generator.ReflectPower;
  178. public override float BiasReflectPower => _GeneratorBias.ReflectPower;
  179. public override float ForwardPower => _Generator.ForwardPower;
  180. public override float BiasForwardPower => _GeneratorBias.ForwardPower;
  181. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  182. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  183. public override float RFMatchC2 => _Match != null ? _Match.TunePosition2 : 0;
  184. public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  185. public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  186. public new ModuleName Module { get; }
  187. public override MovementPosition LiftPinPosition
  188. {
  189. get
  190. {
  191. MovementPosition pos = MovementPosition.Unknown;
  192. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  193. {
  194. pos = MovementPosition.Up;
  195. }
  196. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  197. {
  198. pos = MovementPosition.Down;
  199. }
  200. return pos;
  201. }
  202. }
  203. public override bool CheckAtm()
  204. {
  205. return _ATM_sw.Value && ChamberPressure > 700000;
  206. }
  207. public override bool CheckSlitDoorOpen()
  208. {
  209. return _slitDoor.State == CylinderState.Open;
  210. }
  211. public override bool CheckSlitDoorClose()
  212. {
  213. return _slitDoor.State == CylinderState.Close;
  214. }
  215. public override bool CheckLiftUp()
  216. {
  217. return _LiftPin.State == CylinderState.Open;
  218. }
  219. public override bool CheckLiftDown()
  220. {
  221. return _LiftPin.State == CylinderState.Close;
  222. }
  223. public override double TotalGasSetpoint
  224. {
  225. get
  226. {
  227. double sum = 0;
  228. foreach (var gas in _gasLines)
  229. {
  230. sum += gas.FlowSP;
  231. }
  232. return sum;
  233. }
  234. }
  235. public override bool HasGasOutOfRange
  236. {
  237. get
  238. {
  239. foreach (var gas in _gasLines)
  240. {
  241. if (!gas.IsOutOfRange)
  242. return false;
  243. }
  244. return true;
  245. }
  246. }
  247. public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
  248. public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
  249. public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
  250. public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
  251. public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
  252. public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
  253. public override double MFC7FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas7").FeedBack;
  254. public override double MFC8FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas8").FeedBack;
  255. public override bool PendulumValveIsOpen()
  256. {
  257. return _pendulumValve.IsOpen;
  258. }
  259. #region 构造函数
  260. public JetKepler2300PM(ModuleName moduleName) : base(moduleName)
  261. {
  262. Module = moduleName;
  263. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  264. _LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  265. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  266. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  267. _LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  268. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  269. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  270. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  271. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  272. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  273. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  274. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  275. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  276. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  277. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  278. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  279. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  280. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  281. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  282. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  283. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  284. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  285. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  286. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  287. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  288. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  289. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  290. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  291. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  292. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  293. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  294. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  295. _LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  296. _LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  297. _heMfc = DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe");
  298. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  299. _ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  300. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  301. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  302. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  303. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  304. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  305. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  306. _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  307. _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
  308. _PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  309. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  310. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  311. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  312. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  313. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  314. _SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  315. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  316. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  317. _gasLines = new IoGasStick[8];
  318. for (int index = 0; index < 8; index++)
  319. {
  320. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  321. }
  322. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  323. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  324. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  325. // RS232 Dry pump, SKY
  326. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  327. {
  328. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  329. {
  330. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  331. }
  332. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  333. {
  334. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  335. }
  336. }
  337. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  338. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  339. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  340. //if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  341. // SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  342. //{
  343. // if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  344. // {
  345. // _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  346. // }
  347. // else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  348. // {
  349. // _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  350. // }
  351. //}
  352. if (SC.GetValue<bool>($"{Module}.InnerChiller.EnableChiller") &&
  353. SC.GetValue<int>($"{Module}.InnerChiller.CommunicationType") == (int)CommunicationType.RS232)
  354. {
  355. if (SC.GetValue<int>($"{Module}.InnerChiller.MFG") == (int)ChillerMFG.SMC)
  356. {
  357. _InnerChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.InnerChiller}");
  358. }
  359. else if (SC.GetValue<int>($"{Module}.InnerChiller.MFG") == (int)ChillerMFG.AIRSYS)
  360. {
  361. _InnerChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.InnerChiller}");
  362. }
  363. }
  364. if (SC.GetValue<bool>($"{Module}.OuterChiller.EnableChiller") &&
  365. SC.GetValue<int>($"{Module}.OuterChiller.CommunicationType") == (int)CommunicationType.RS232)
  366. {
  367. if (SC.GetValue<int>($"{Module}.OuterChiller.MFG") == (int)ChillerMFG.SMC)
  368. {
  369. _OuterChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.OuterChiller}");
  370. }
  371. else if (SC.GetValue<int>($"{Module}.OuterChiller.MFG") == (int)ChillerMFG.AIRSYS)
  372. {
  373. _OuterChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.OuterChiller}");
  374. }
  375. }
  376. if (SC.GetValue<bool>($"{Module}.TopChiller.EnableChiller") &&
  377. SC.GetValue<int>($"{Module}.TopChiller.CommunicationType") == (int)CommunicationType.RS232)
  378. {
  379. if (SC.GetValue<int>($"{Module}.TopChiller.MFG") == (int)ChillerMFG.SMC)
  380. {
  381. _TopChiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.TopChiller}");
  382. }
  383. else if (SC.GetValue<int>($"{Module}.TopChiller.MFG") == (int)ChillerMFG.AIRSYS)
  384. {
  385. _TopChiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.TopChiller}");
  386. }
  387. }
  388. // RS223 AdTec Generator
  389. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  390. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  391. {
  392. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  393. }
  394. // Ethernet Comet Generator Bias
  395. if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  396. {
  397. if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  398. SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  399. {
  400. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  401. }
  402. else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  403. {
  404. _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  405. }
  406. }
  407. // RS232 AdTec match
  408. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  409. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  410. {
  411. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  412. }
  413. // Bias Match
  414. if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  415. SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  416. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  417. {
  418. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  419. }
  420. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  421. _GasRFStopWatch.Stop();
  422. DATA.Subscribe($"{Module}.ChillerInnerTemp", () => _chillerInnerTemp);
  423. DATA.Subscribe($"{Module}.ChillerOuterTemp", () => _chillerOuterTemp);
  424. DATA.Subscribe($"{Module}.ChillerTopTemp", () => _chillerTopTemp);
  425. //DATA.Subscribe($"{Module}.InnerChiller.IsRunning", () => innerChillerIsRunning);
  426. //DATA.Subscribe($"{Module}.OuterChiller.IsRunning", () => outerChillerIsRunning);
  427. //DATA.Subscribe($"{Module}.TopChiller.IsRunning", () => topChillerIsRunning);
  428. //OP.Subscribe($"{Module}.HeatChiller", (cmd, args) => {
  429. // HeatChiller(ChillerType.InnerChiller, Convert.ToDouble(args[1]), Convert.ToDouble(args[2]));
  430. // return true;
  431. //});
  432. //OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) => {
  433. // //HeatChiller(ChillerType.InnerChiller, Convert.ToDouble(args[1]), Convert.ToDouble(args[2]));
  434. // OnOffChiller(ChillerType.InnerChiller, (bool)(args[1]));
  435. // return true;
  436. //});
  437. _pendulumValveStopWatch.Start();
  438. }
  439. #endregion
  440. public async override void CloseValves(int? delayTime = null)
  441. {
  442. _PVN21Valve.TurnValve(false, out _);
  443. // _PVN22Valve.TurnValve(false, out _);
  444. _PV11Valve.TurnValve(false, out _);
  445. _PV12Valve.TurnValve(false, out _);
  446. _PV21Valve.TurnValve(false, out _);
  447. _PV22Valve.TurnValve(false, out _);
  448. _PV31Valve.TurnValve(false, out _);
  449. _PV32Valve.TurnValve(false, out _);
  450. _PV41Valve.TurnValve(false, out _);
  451. _PV42Valve.TurnValve(false, out _);
  452. _PVHe1Valve.TurnValve(false, out _);
  453. _PVHe2Valve.TurnValve(false, out _);
  454. _SoftPumpValve.TurnValve(false, out _);
  455. _FastPumpValve.TurnValve(false, out _);
  456. _TurboPumpPumpingValve.TurnValve(false, out _);
  457. _TurboPumpPurgeValve.TurnValve(false, out _);
  458. _GuageValve.TurnValve(false, out _);
  459. _N2Valve.TurnValve(false, out _);
  460. _FastPumpValve.TurnValve(false, out _);
  461. _Mfc1Valve.TurnValve(false, out _);
  462. _Mfc2Valve.TurnValve(false, out _);
  463. _Mfc3Valve.TurnValve(false, out _);
  464. _Mfc4Valve.TurnValve(false, out _);
  465. _Mfc5Valve.TurnValve(false, out _);
  466. _Mfc6Valve.TurnValve(false, out _);
  467. _Mfc7Valve.TurnValve(false, out _);
  468. _Mfc8Valve.TurnValve(false, out _);
  469. foreach (var stick in _gasLines)
  470. {
  471. stick.Stop();
  472. }
  473. if (delayTime != null)
  474. {
  475. await Task.Delay((int)delayTime);
  476. }
  477. _GasFinalValve.TurnValve(false, out _);
  478. }
  479. public override void TurnDryPump(bool on)
  480. {
  481. //_pressureController.StartPump(on);
  482. _MainPump?.SetPumpOnOff(on);
  483. }
  484. public override void TurnTurboPump(bool on)
  485. {
  486. _TurboPump?.SetPumpOnOff(on);
  487. }
  488. public override void OpenValve(ValveType vlvType, bool on)
  489. {
  490. switch (vlvType)
  491. {
  492. case ValveType.PVN21:
  493. _PVN21Valve.TurnValve(on, out _);
  494. break;
  495. case ValveType.PVN22:
  496. _PVN22Valve.TurnValve(on, out _);
  497. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  498. break;
  499. case ValveType.PV11:
  500. _PV11Valve.TurnValve(on, out _);
  501. break;
  502. case ValveType.PV12:
  503. _PV12Valve.TurnValve(on, out _);
  504. break;
  505. case ValveType.PV21:
  506. _PV21Valve.TurnValve(on, out _);
  507. break;
  508. case ValveType.PV22:
  509. _PV22Valve.TurnValve(on, out _);
  510. break;
  511. case ValveType.PV31:
  512. _PV31Valve.TurnValve(on, out _);
  513. break;
  514. case ValveType.PV32:
  515. _PV32Valve.TurnValve(on, out _);
  516. break;
  517. case ValveType.PV41:
  518. _PV41Valve.TurnValve(on, out _);
  519. break;
  520. case ValveType.PV42:
  521. _PV42Valve.TurnValve(on, out _);
  522. break;
  523. case ValveType.N2:
  524. _N2Valve.TurnValve(on, out _);
  525. break;
  526. case ValveType.PVHe1:
  527. _PVHe1Valve.TurnValve(on, out _);
  528. break;
  529. case ValveType.PVHe2:
  530. _PVHe2Valve.TurnValve(on, out _);
  531. break;
  532. case ValveType.GasFinal:
  533. _GasFinalValve.TurnValve(on, out _);
  534. break;
  535. case ValveType.SoftPump:
  536. _SoftPumpValve.TurnValve(on, out _);
  537. break;
  538. case ValveType.FastPump:
  539. _FastPumpValve.TurnValve(on, out _);
  540. break;
  541. case ValveType.TurboPumpPumping:
  542. _TurboPumpPumpingValve.TurnValve(on, out _);
  543. break;
  544. case ValveType.TurboPumpPurge:
  545. _TurboPumpPurgeValve.TurnValve(on, out _);
  546. break;
  547. case ValveType.Guage:
  548. _GuageValve.TurnValve(on, out _);
  549. break;
  550. case ValveType.LoadlockVent:
  551. _LoadlockVentValve.TurnValve(on, out _);
  552. break;
  553. case ValveType.LoadlockPumping:
  554. _LoadlockPumpingValve.TurnValve(on, out _);
  555. break;
  556. case ValveType.Mfc1:
  557. _Mfc1Valve.TurnValve(on, out _);
  558. break;
  559. case ValveType.Mfc2:
  560. _Mfc2Valve.TurnValve(on, out _);
  561. break;
  562. case ValveType.Mfc3:
  563. _Mfc3Valve.TurnValve(on, out _);
  564. break;
  565. case ValveType.Mfc4:
  566. _Mfc4Valve.TurnValve(on, out _);
  567. break;
  568. case ValveType.Mfc5:
  569. _Mfc5Valve.TurnValve(on, out _);
  570. break;
  571. case ValveType.Mfc6:
  572. _Mfc6Valve.TurnValve(on, out _);
  573. break;
  574. case ValveType.Mfc7:
  575. _Mfc7Valve.TurnValve(on, out _);
  576. break;
  577. case ValveType.Mfc8:
  578. _Mfc8Valve.TurnValve(on, out _);
  579. break;
  580. default:
  581. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  582. }
  583. }
  584. public override void Monitor()
  585. {
  586. foreach (var gas in _gasLines)
  587. {
  588. gas.Monitor();
  589. }
  590. if (_pendulumValveStopWatch.ElapsedMilliseconds > 1000)
  591. {
  592. CheckPermanentInterlock();
  593. _pendulumValveStopWatch.Restart();
  594. }
  595. }
  596. protected override void CheckPermanentInterlock()
  597. {
  598. if (ProcessPressure >= 99 && _GuageValve.SetPoint)
  599. {
  600. _GuageValve.TurnValve(false, out _);
  601. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 99 mtorr, Guage Valve (DO-31) closed automaticlly.");
  602. }
  603. }
  604. public override void CheckIdleInterlock()
  605. {
  606. if (ForelinePressure > _foreline_interlock_pressure)
  607. {
  608. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  609. {
  610. _pendulumValve.TurnValve(false);
  611. _TurboPumpPurgeValve.TurnValve(false, out _);
  612. _TurboPumpPumpingValve.TurnValve(false, out _);
  613. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  614. }
  615. }
  616. }
  617. public override void BuzzerBlinking(double time)
  618. {
  619. _SignalTower.BuzzerBlinking(time);
  620. }
  621. public override void SwitchOnBuzzerAndRed()
  622. {
  623. _SignalTower.SwitchOnBuzzerAndRed("", null);
  624. }
  625. public override void Home()
  626. {
  627. // 与yp讨论过,PM 初始化不需要
  628. SetLiftPin(MovementPosition.Down, out _);
  629. if (_slitDoor.State == CylinderState.Open)
  630. {
  631. SetSlitDoor(true, out _);
  632. }
  633. else
  634. {
  635. SetSlitDoor(false, out _);
  636. }
  637. SetSlitDoor(false, out _);
  638. //2023/03/08添加
  639. OpenValve(ValveType.PVN22, true);
  640. //2023/04/25临时添加
  641. //RetractWafer();
  642. }
  643. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  644. {
  645. reason = string.Empty;
  646. switch (dirt)
  647. {
  648. case MovementPosition.Down:
  649. return _LiftPin.SetCylinder(false, out reason);
  650. case MovementPosition.Up:
  651. return _LiftPin.SetCylinder(true, out reason);
  652. case MovementPosition.Left:
  653. case MovementPosition.Right:
  654. case MovementPosition.Middle:
  655. throw new ArgumentException("Movement argument error");
  656. }
  657. return true;
  658. }
  659. public override bool SetSlitDoor(bool open, out string reason)
  660. {
  661. if (open)
  662. {
  663. if (RouteManager.IsATMMode)
  664. {
  665. if (!IsATM)
  666. {
  667. reason = $"{Module} is not ATM, can not open slit door";
  668. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  669. return false;
  670. }
  671. if (!IsTMATM)
  672. {
  673. reason = $"LoadLock is not ATM, can not open slit door";
  674. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  675. return false;
  676. }
  677. }
  678. else
  679. {
  680. double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  681. if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  682. {
  683. reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  684. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  685. return false;
  686. }
  687. }
  688. }
  689. return _slitDoor.SetCylinder(open, out reason);
  690. }
  691. public override bool RetractWafer()
  692. {
  693. return _LoadLockArm.SetCylinder(false, out _);
  694. }
  695. public override bool ExtendWafer()
  696. {
  697. return _LoadLockArm.SetCylinder(true, out _);
  698. }
  699. public override bool FlowGas(int gasNum, double val)
  700. {
  701. if (_gasLines.Length <= gasNum)
  702. return false;
  703. _gasLines[gasNum].Flow(val);
  704. return true;
  705. }
  706. public override bool StopGas(int gasNum)
  707. {
  708. if (_gasLines.Length <= gasNum)
  709. return false;
  710. _gasLines[gasNum].Stop();
  711. return true;
  712. }
  713. public override bool FlowN2(double val)
  714. {
  715. _gasLineN2.Flow(val);
  716. return true;
  717. }
  718. public override bool StopN2()
  719. {
  720. _gasLineN2.Stop();
  721. return true;
  722. }
  723. public override void StopAllGases()
  724. {
  725. foreach (var line in _gasLines)
  726. {
  727. line.Stop();
  728. }
  729. }
  730. public override bool TurnPendulumValve(bool on)
  731. {
  732. return _pendulumValve.TurnValve(on);
  733. }
  734. public override bool SetPVPressure(float pressure)
  735. {
  736. return _pendulumValve.SetPressure(pressure);
  737. }
  738. public override bool SetPVPostion(int position)
  739. {
  740. return _pendulumValve.SetPosition(position);
  741. }
  742. public override int GetPVPosition()
  743. {
  744. return _pendulumValve.Position;
  745. }
  746. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  747. {
  748. switch (chillerType)
  749. {
  750. //case ChillerType.Chiller:
  751. // _Chiller?.SetChillerTemp((float)value, (float)offset);
  752. // await Task.Delay(1000);
  753. // _Chiller?.SetChillerOnOff(true);
  754. // break;
  755. case ChillerType.InnerChiller:
  756. _InnerChiller?.SetChillerTemp((float)value, (float)offset);
  757. await Task.Delay(1000);
  758. _InnerChiller?.SetChillerOnOff(true);
  759. break;
  760. case ChillerType.OuterChiller:
  761. _OuterChiller?.SetChillerTemp((float)value, (float)offset);
  762. await Task.Delay(1000);
  763. _OuterChiller?.SetChillerOnOff(true);
  764. break;
  765. case ChillerType.TopChiller:
  766. _TopChiller?.SetChillerTemp((float)value, (float)offset);
  767. await Task.Delay(1000);
  768. _TopChiller?.SetChillerOnOff(true);
  769. break;
  770. }
  771. }
  772. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  773. {
  774. switch (chillerType)
  775. {
  776. //case ChillerType.Chiller:
  777. // _Chiller?.SetChillerOnOff(onoff);
  778. // break;
  779. case ChillerType.InnerChiller:
  780. _InnerChiller?.SetChillerOnOff(onoff);
  781. break;
  782. case ChillerType.OuterChiller:
  783. _OuterChiller?.SetChillerOnOff(onoff);
  784. break;
  785. case ChillerType.TopChiller:
  786. _TopChiller?.SetChillerOnOff(onoff);
  787. break;
  788. }
  789. }
  790. //public override bool CheckChillerStatus()
  791. //{
  792. // return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  793. //}
  794. public override void SetGeneratorCommunicationMode(int mode)
  795. {
  796. _Generator?.SetCommunicationMode(mode);
  797. }
  798. public override bool GeneratorPowerOn(bool on)
  799. {
  800. if (_Generator == null) return false;
  801. if (on && !IsRFGInterlockOn)
  802. {
  803. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  804. return false;
  805. }
  806. return _Generator.SetPowerOnOff(on, out _);
  807. }
  808. public override bool GeneratorSetpower(float val)
  809. {
  810. if (_Generator == null) return false;
  811. if (Math.Abs(val) > 0.01)
  812. _Generator.SetPower((ushort)val);
  813. return true;
  814. }
  815. public override bool GeneratorBiasPowerOn(bool on)
  816. {
  817. if (_GeneratorBias == null) return false;
  818. if (on && !IsRFGInterlockOn)
  819. {
  820. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  821. return false;
  822. }
  823. return _GeneratorBias.SetPowerOnOff(on, out _);
  824. }
  825. public override bool GeneratorBiasSetpower(float val)
  826. {
  827. if (_GeneratorBias == null) return false;
  828. if (Math.Abs(val) > 0.01)
  829. _GeneratorBias.SetPower((ushort)val);
  830. return true;
  831. }
  832. public override bool OnOffSetESCHV(bool val)
  833. {
  834. return _ESCHV.SetPowerOnOff(val);
  835. }
  836. public override bool SetWallTCTemperature(float value)
  837. {
  838. return _WallTC.RampTemp(value);
  839. }
  840. public override bool GeneratorBiasSetMatchMode(bool val)
  841. {
  842. if (_GeneratorBias == null) return false;
  843. string reason = string.Empty;
  844. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  845. return true;
  846. }
  847. public override bool SetMatchPosition(float c1, float c2)
  848. {
  849. if (_Match == null) return false;
  850. string reason = string.Empty;
  851. _Match.SetMatchPosition(c1, c2, out reason);
  852. return true;
  853. }
  854. public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  855. {
  856. if (_Match == null) return false;
  857. if (matchWorkMode == MatchWorkMode.Auto)
  858. {
  859. return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  860. }
  861. else if (matchWorkMode == MatchWorkMode.Manual)
  862. {
  863. return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  864. }
  865. return false;
  866. }
  867. public override bool SetBiasMatchPosition(float c1, float c2)
  868. {
  869. if (_BiasMatch == null) return false;
  870. string reason = string.Empty;
  871. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  872. return true;
  873. }
  874. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  875. {
  876. if (_BiasMatch == null) return false;
  877. if (matchWorkMode == MatchWorkMode.Auto)
  878. {
  879. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  880. }
  881. else if (matchWorkMode == MatchWorkMode.Manual)
  882. {
  883. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  884. }
  885. return false;
  886. }
  887. public override bool SetBiasPulseMode(bool on)
  888. {
  889. if (_GeneratorBias == null) return false;
  890. _GeneratorBias.SetPulseMode(on);
  891. return true;
  892. }
  893. public override bool SetBiasPulseRateFreq(int nFreq)
  894. {
  895. if (_GeneratorBias == null) return false;
  896. _GeneratorBias.SetPulseRateFreq(nFreq);
  897. return true;
  898. }
  899. public override bool SetDiasPulseDutyCycle(int percentage)
  900. {
  901. if (_GeneratorBias == null) return false;
  902. _GeneratorBias.SetPulseDutyCycle(percentage);
  903. return true;
  904. }
  905. public override bool SetESCClampVoltage(int nVoltage)
  906. {
  907. if (_ESCHV == null) return false;
  908. return _ESCHV.SetOutputVoltage(nVoltage);
  909. }
  910. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  911. {
  912. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  913. if (!PMLidClosed)
  914. {
  915. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  916. return false;
  917. }
  918. if (!IsVAC)
  919. {
  920. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  921. return false;
  922. }
  923. if (!IsWaterFlowOk)
  924. {
  925. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  926. return false;
  927. }
  928. if (!IsRFGInterlockOn)
  929. {
  930. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  931. return false;
  932. }
  933. if (!SourceRFFanInterlock)
  934. {
  935. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  936. return false;
  937. }
  938. if (!SlitDoorClosed)
  939. {
  940. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  941. return false;
  942. }
  943. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  944. {
  945. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  946. return false;
  947. }
  948. return true;
  949. }
  950. public override void SetBacksideHeFlow(double flow)
  951. {
  952. if (_backsideHe == null) return;
  953. _backsideHe.Flow(flow);
  954. }
  955. public override bool SetBacksideHePressure(float mTorr)
  956. {
  957. if (_backsideHe == null) return false;
  958. return _backsideHe.SetBacksideHelium(mTorr);
  959. }
  960. public override bool SetBacksideHeThreshold(int nMin, int nMax)
  961. {
  962. if (_backsideHe == null) return false;
  963. return _backsideHe.SetFlowThreshold(nMin, nMax);
  964. }
  965. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  966. {
  967. OpenValve(ValveType.GasFinal, true);
  968. FlowGas(5, flowSetpoint);
  969. TurnPendulumValve(true);
  970. SetPVPressure(pressureSetpoint);
  971. return true;
  972. }
  973. public async override Task<bool> AbortControlPressure()
  974. {
  975. FlowGas(5, 0);
  976. await Task.Delay(500);
  977. OpenValve(ValveType.GasFinal, false);
  978. return true;
  979. }
  980. public override bool PreparePlace()
  981. {
  982. if (!SetSlitDoor(true, out string reason))
  983. {
  984. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  985. return false;
  986. }
  987. if (!SetLiftPin(MovementPosition.Down, out reason))
  988. {
  989. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  990. return false;
  991. }
  992. return true;
  993. }
  994. public override bool PreparePick()
  995. {
  996. if (!SetSlitDoor(true, out string reason))
  997. {
  998. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  999. return false;
  1000. }
  1001. if (!SetLiftPin(MovementPosition.Up, out reason))
  1002. {
  1003. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1004. return false;
  1005. }
  1006. return true;
  1007. }
  1008. public override bool PreparePlaceIsOK()
  1009. {
  1010. return CheckSlitDoorOpen() && LiftPinIsDown;
  1011. }
  1012. public override bool PreparePickIsOK()
  1013. {
  1014. return CheckSlitDoorOpen() && LiftPinIsUp;
  1015. }
  1016. public override bool EndPlace()
  1017. {
  1018. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1019. {
  1020. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1021. return false;
  1022. }
  1023. if (!SetSlitDoor(false, out reason))
  1024. {
  1025. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1026. return false;
  1027. }
  1028. return true;
  1029. }
  1030. public override bool EndPick()
  1031. {
  1032. if (!SetSlitDoor(false, out string reason))
  1033. {
  1034. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1035. return false;
  1036. }
  1037. return true;
  1038. }
  1039. public override bool EndPlaceIsOK()
  1040. {
  1041. return CheckSlitDoorClose() && LiftPinIsDown;
  1042. }
  1043. public override bool EndPickIsOK()
  1044. {
  1045. return CheckSlitDoorClose();
  1046. }
  1047. public override void RTCloseEvent()
  1048. {
  1049. if (_Generator.IsPowerOn)
  1050. {
  1051. GeneratorPowerOn(false);
  1052. }
  1053. if (_GeneratorBias.IsPowerOn)
  1054. {
  1055. GeneratorBiasPowerOn(false);
  1056. }
  1057. if (PendulumValveIsOpen())
  1058. {
  1059. TurnPendulumValve(false);
  1060. }
  1061. }
  1062. public override bool RFInterlock(VenusDevice device)
  1063. {
  1064. eEvent evt = eEvent.ERR_RF;
  1065. if (!IsWaterFlowOk)
  1066. {
  1067. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  1068. return false;
  1069. }
  1070. if (!IsRFGInterlockOn)
  1071. {
  1072. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  1073. return false;
  1074. }
  1075. if (!SourceRFFanInterlock)
  1076. {
  1077. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  1078. return false;
  1079. }
  1080. if (GasIsOff())
  1081. {
  1082. LOG.Write(evt, Module, $"Cannot Power ON {device} as Gas is OFF.");
  1083. return false;
  1084. }
  1085. return true;
  1086. }
  1087. private bool GasIsOff()
  1088. {
  1089. if (IsMfc1ValveOpened == false && IsMfc2ValveOpened == false && IsMfc3ValveOpened == false && IsMfc4ValveOpened == false && IsMfc5ValveOpened == false && IsMfc6ValveOpened == false && IsMfc7ValveOpened == false && IsMfc8ValveOpened == false)
  1090. {
  1091. if (_GasRFStopWatch.IsRunning == false)
  1092. {
  1093. _GasRFStopWatch.Start();
  1094. }
  1095. if (_GasRFStopWatch.ElapsedMilliseconds > 1000)
  1096. {
  1097. _GasRFStopWatch.Reset();
  1098. _GasFlag = true;
  1099. return true;
  1100. }
  1101. }
  1102. else
  1103. {
  1104. _GasRFStopWatch.Reset();
  1105. _GasFlag = false;
  1106. }
  1107. return false;
  1108. }
  1109. }
  1110. }