JetKepler2300PM.cs 49 KB

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