JetKepler2300PM.cs 49 KB

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