JetPM.cs 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.RT.SCCore;
  6. using Aitex.Core.RT.Log;
  7. using MECF.Framework.Common.Device.Bases;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
  10. using System;
  11. using System.Collections.Generic;
  12. using Venus_Core;
  13. using Venus_RT.Devices.IODevices;
  14. using Venus_RT.Devices.EPD;
  15. using Aitex.Core.RT.DataCenter;
  16. using Aitex.Core.RT.OperationCenter;
  17. namespace Venus_RT.Devices
  18. {
  19. enum ValveType
  20. {
  21. PVN21,
  22. PVN22,
  23. PV11,
  24. PV12,
  25. PV21,
  26. PV22,
  27. PV31,
  28. PV32,
  29. PV41,
  30. PV42,
  31. N2,
  32. Mfc1,
  33. Mfc2,
  34. Mfc3,
  35. Mfc4,
  36. Mfc5,
  37. Mfc6,
  38. Mfc7,
  39. Mfc8,
  40. PVHe1,
  41. PVHe2,
  42. GasFinal,
  43. SoftPump,
  44. FastPump,
  45. CHBPurge,
  46. TurboPumpPumping,
  47. TurboPumpPurge,
  48. Guage,
  49. LoadlockVent,
  50. LoadlockPumping
  51. }
  52. class JetPM : PM
  53. {
  54. private readonly IoLid _Lid;
  55. private readonly IoLid _LidLoadlock;
  56. private readonly IoCylinder _slitDoor;
  57. private readonly IoCylinder _LiftPin;
  58. private readonly IoCylinder _LoadLockArm;
  59. private readonly IoValve _PVN21Valve;
  60. private readonly IoValve _PVN22Valve;
  61. private readonly IoValve _PV11Valve;
  62. private readonly IoValve _PV12Valve;
  63. private readonly IoValve _PV21Valve;
  64. private readonly IoValve _PV22Valve;
  65. private readonly IoValve _PV31Valve;
  66. private readonly IoValve _PV32Valve;
  67. private readonly IoValve _PV41Valve;
  68. private readonly IoValve _PV42Valve;
  69. private readonly IoValve _N2Valve;
  70. private readonly IoValve _Mfc1Valve;
  71. private readonly IoValve _Mfc2Valve;
  72. private readonly IoValve _Mfc3Valve;
  73. private readonly IoValve _Mfc4Valve;
  74. private readonly IoValve _Mfc5Valve;
  75. private readonly IoValve _Mfc6Valve;
  76. private readonly IoValve _Mfc7Valve;
  77. private readonly IoValve _Mfc8Valve;
  78. private readonly IoValve _PVHe1Valve;
  79. private readonly IoValve _PVHe2Valve;
  80. private readonly IoValve _GasFinalValve;
  81. private readonly IoValve _SoftPumpValve;
  82. private readonly IoValve _FastPumpValve;
  83. private readonly IoValve _TurboPumpPumpingValve;
  84. private readonly IoValve _TurboPumpPurgeValve;
  85. private readonly IoValve _GuageValve;
  86. private readonly IoValve _LoadlockVentValve;
  87. private readonly IoValve _LoadlockPumpingValve;
  88. private readonly IoSensor _ATM_sw;
  89. private readonly IoSensor _CDAPressure;
  90. private readonly IoSensor _ATM_Loadlock_sw;
  91. private readonly IoSensor _N2Pressure_sw;
  92. private readonly IoSensor _VAC_sw;
  93. private readonly IoSensor _WLK_sw;
  94. private readonly IoSensor _Water_Flow;
  95. private readonly IoSensor _RFG_Interlock;
  96. private readonly IoSensor _PM_Lid_Closed;
  97. private readonly IoSensor _Source_RF_Fan;
  98. private readonly IoSensor _PM_SlitDoor_Closed;
  99. private readonly IoSensor _TurboPumpInterlock;
  100. private readonly PumpBase _MainPump;
  101. private readonly ESC5HighVoltage _ESCHV;
  102. private readonly AdixenTurboPump _TurboPump;
  103. private readonly PendulumValve _pendulumValve;
  104. private readonly ChillerBase _Chiller;
  105. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  106. private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  107. private readonly RfMatchBase _Match;
  108. private readonly RfMatchBase _BiasMatch;
  109. private readonly IoSignalTower _SignalTower;
  110. private readonly IoHeater _ForelineTC;
  111. private readonly IoPressureControl _pressureController;
  112. private readonly IoGasStick[] _gasLines;
  113. private readonly IoGasStick _gasLineN2;
  114. private readonly IoBacksideHe _backsideHe;
  115. // EndPoint
  116. private readonly EPDClient _epdClient;
  117. private readonly double _foreline_interlock_pressure = 750;
  118. public List<string> EPDCfgList => _epdClient.CFGFileList;
  119. public bool EPDCaptured => _epdClient.Captured;
  120. public bool EPDConnected => _epdClient.IsEPDConnected;
  121. // 盖子的状态
  122. public bool IsLidClosed => _Lid.OFFFeedback;
  123. public bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  124. public bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  125. public bool IsPumpRunning => _MainPump.IsRunning;
  126. public bool IsTurboPumpRunning => _TurboPump.IsRunning;
  127. public bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  128. public bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  129. public bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  130. public bool IsCDA_OK => _CDAPressure.Value;
  131. public bool IsFastPumpOpened => _FastPumpValve.Status;
  132. public bool IsSoftPumpOpened => _SoftPumpValve.Status;
  133. public bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  134. public bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  135. public bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  136. public bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  137. public bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  138. public bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  139. public bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  140. public bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  141. // 压力信号
  142. public bool IsATM => _ATM_sw.Value;
  143. public bool LiftPinIsDown => _LiftPin.OFFFeedback;
  144. public bool LiftPinIsUp => _LiftPin.ONFeedback;
  145. public bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  146. public bool IsVACLoadLock => LoadlockPressure <= 1000;
  147. public bool IsVAC => _VAC_sw.Value;
  148. public bool IsWaterFlowOk => _Water_Flow.Value;
  149. public bool IsWLK => _WLK_sw.Value;
  150. public bool IsRFGInterlockOn => _RFG_Interlock.Value;
  151. public bool PMLidClosed => _PM_Lid_Closed.Value;
  152. public bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  153. public bool SourceRFFanInterlock => _Source_RF_Fan.Value;
  154. public bool SlitDoorClosed => _PM_SlitDoor_Closed.Value;
  155. public double ProcessPressure => _pressureController.ProcessGauge.Value;
  156. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  157. public double ForelinePressure => _pressureController.ForelineGauge.Value;
  158. public double TargetPressure => _pressureController.TargetPressure;
  159. public double LoadlockPressure => _pressureController.LoadLockGauge.Value;
  160. public double ESCHePressure => _pressureController.ESCHeGauge.Value;
  161. public int ESCOutputVoltage => _ESCHV.OutputVoltage;
  162. public bool IsHVOn => _ESCHV.IsOn;
  163. public float CoolantInletTempFB => _Chiller.CoolantInletTcFeedback;
  164. public float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
  165. //Loadlock_Arm
  166. public bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
  167. public bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
  168. //Loadlock_Arm DO
  169. public bool LoadlockArmRetract => _LoadLockArm.OFFSetPoint;
  170. public bool LoadlockArmExtend => _LoadLockArm.ONSetPoint;
  171. public float ReflectPower => _Generator.ReflectPower;
  172. public float BiasReflectPower => _GeneratorBias.ReflectPower;
  173. public bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  174. public new ModuleName Module { get; }
  175. public MovementPosition LiftPinPosition
  176. {
  177. get
  178. {
  179. MovementPosition pos = MovementPosition.Unknown;
  180. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  181. {
  182. pos = MovementPosition.Up;
  183. }
  184. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  185. {
  186. pos = MovementPosition.Down;
  187. }
  188. return pos;
  189. }
  190. }
  191. public override bool CheckAtm()
  192. {
  193. return _ATM_sw.Value && ChamberPressure > 700000;
  194. }
  195. public bool CheckSlitDoorOpen()
  196. {
  197. return _slitDoor.State == CylinderState.Open;
  198. }
  199. public bool CheckSlitDoorClose()
  200. {
  201. return _slitDoor.State == CylinderState.Close;
  202. }
  203. public bool CheckLiftUp()
  204. {
  205. return _LiftPin.State == CylinderState.Open;
  206. }
  207. public bool CheckLiftDown()
  208. {
  209. return _LiftPin.State == CylinderState.Close;
  210. }
  211. public double TotalGasSetpoint
  212. {
  213. get
  214. {
  215. double sum = 0;
  216. foreach (var gas in _gasLines)
  217. {
  218. sum += gas.FlowSP;
  219. }
  220. return sum;
  221. }
  222. }
  223. public bool HasGasOutOfRange
  224. {
  225. get
  226. {
  227. foreach (var gas in _gasLines)
  228. {
  229. if (!gas.IsOutOfRange)
  230. return false;
  231. }
  232. return true;
  233. }
  234. }
  235. public JetPM(ModuleName mod) : base(mod.ToString())
  236. {
  237. Module = mod;
  238. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  239. _LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  240. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  241. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  242. _LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  243. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  244. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  245. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  246. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  247. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  248. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  249. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  250. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  251. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  252. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  253. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  254. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  255. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  256. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  257. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  258. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  259. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  260. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  261. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  262. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  263. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  264. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  265. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  266. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  267. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  268. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  269. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  270. _LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  271. _LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  272. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  273. _ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  274. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  275. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  276. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  277. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  278. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  279. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  280. _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  281. _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
  282. _PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  283. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  284. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  285. _SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  286. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  287. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  288. _gasLines = new IoGasStick[8];
  289. for (int index = 0; index < 8; index++)
  290. {
  291. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  292. }
  293. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  294. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  295. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  296. // RS232 Dry pump, SKY
  297. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  298. {
  299. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  300. {
  301. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  302. }
  303. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  304. {
  305. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  306. }
  307. }
  308. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  309. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  310. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  311. if (SC.GetValue<bool>($"{mod}.Chiller.EnableChiller") &&
  312. SC.GetValue<int>($"{mod}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  313. {
  314. if (SC.GetValue<int>($"{mod}.Chiller.MFG") == (int)ChillerMFG.SMC)
  315. {
  316. _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  317. }
  318. else if (SC.GetValue<int>($"{mod}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  319. {
  320. _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  321. }
  322. }
  323. // RS223 AdTec Generator
  324. if (SC.GetValue<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  325. SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  326. {
  327. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  328. }
  329. // Ethernet Comet Generator Bias
  330. if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF"))
  331. {
  332. if (SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  333. SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  334. {
  335. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  336. }
  337. else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  338. {
  339. _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  340. }
  341. }
  342. // RS232 AdTec match
  343. if (SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 &&
  344. SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.AdTec)
  345. {
  346. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  347. }
  348. // Bias Match
  349. if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  350. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  351. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  352. {
  353. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  354. }
  355. _epdClient = DEVICE.GetDevice<EPDClient>($"{Module}.{VenusDevice.EndPoint}");
  356. DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
  357. DATA.Subscribe($"{Name}.ProcessPressure", () => ProcessPressure);
  358. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  359. DATA.Subscribe($"{Name}.LoadlockPressure", () => LoadlockPressure);
  360. DATA.Subscribe($"{Name}.IsATM", () => IsATM);
  361. DATA.Subscribe($"{Name}.IsVAC", () => IsVAC);
  362. DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp);
  363. DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown);
  364. DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning);
  365. DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning);
  366. DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed);
  367. DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed);
  368. DATA.Subscribe($"{Name}.SRfIsOn", () => _Generator.IsPowerOn);
  369. DATA.Subscribe($"{Name}.BRfIsOn", () =>
  370. {
  371. return _GeneratorBias == null ? false : _GeneratorBias.IsPowerOn;
  372. }
  373. );
  374. DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => _TurboPump.RotationalSpeed);
  375. DATA.Subscribe($"{Name}.PendulumValve.Position", () => _pendulumValve.Position);
  376. DATA.Subscribe($"{Name}.PendulumValve.Pressure", () => _pendulumValve.Pressure);
  377. DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
  378. DATA.Subscribe($"{Name}.ChillerTem", () => CoolantInletTempFB);
  379. DATA.Subscribe($"{Name}.ESCHV.OutputVoltage", () => ESCOutputVoltage);
  380. DATA.Subscribe($"{Name}.ESCHV.IsOn", () => IsHVOn);
  381. //DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => _);
  382. OP.Subscribe($"{Module}.SetLiftPin", (cmd, args) => {
  383. if ((bool)args[0] == true)
  384. {
  385. return SetLiftPin(MovementPosition.Up, out _);
  386. }
  387. else
  388. {
  389. return SetLiftPin(MovementPosition.Down, out _);
  390. }
  391. });
  392. OP.Subscribe($"{Module}.SetSRf", (cmd, args) => {
  393. //GeneratorSetpower((float)args[0]);
  394. GeneratorPowerOn((bool)args[1]);
  395. return true;
  396. });
  397. OP.Subscribe($"{Module}.SetBRf", (cmd, args) => {
  398. //SetBiasMatchPosition((float)args[0], (float)args[1]);
  399. GeneratorBiasPowerOn((bool)args[0]);
  400. return true;
  401. });
  402. OP.Subscribe($"{Module}.SetSlitDoor", (cmd, args) => {
  403. SetSlitDoor((bool)args[0], out _);
  404. return true;
  405. });
  406. OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) => {
  407. _ESCHV.SetPowerOnOff((bool)args[0]);
  408. return true;
  409. });
  410. OP.Subscribe($"{Module}.SetESCHV", (cmd, args) => {
  411. SetESCClampVoltage((int)args[0]);
  412. return true;
  413. });
  414. OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) => {
  415. SetPVPostion((int)args[0]);
  416. return true;
  417. });
  418. OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) => {
  419. SetPVPressure((int)args[0]);
  420. return true;
  421. });
  422. OP.Subscribe($"{Module}.ClosePump", (cmd, args) => {
  423. TurnDryPump(false);
  424. return true;
  425. });
  426. OP.Subscribe($"{Module}.CloseTurboPump", (cmd, args) => {
  427. TurnTurboPump(false);
  428. return true;
  429. });
  430. _foreline_interlock_pressure = SC.GetValue<double>($"{mod}.ForelineInterlockPressure");
  431. }
  432. public void CloseValves()
  433. {
  434. _PVN21Valve.TurnValve(false, out _);
  435. _PVN22Valve.TurnValve(false, out _);
  436. _PV11Valve.TurnValve(false, out _);
  437. _PV12Valve.TurnValve(false, out _);
  438. _PV21Valve.TurnValve(false, out _);
  439. _PV22Valve.TurnValve(false, out _);
  440. _PV31Valve.TurnValve(false, out _);
  441. _PV32Valve.TurnValve(false, out _);
  442. _PV41Valve.TurnValve(false, out _);
  443. _PV42Valve.TurnValve(false, out _);
  444. _PVHe1Valve.TurnValve(false, out _);
  445. _PVHe2Valve.TurnValve(false, out _);
  446. _GasFinalValve.TurnValve(false, out _);
  447. _SoftPumpValve.TurnValve(false, out _);
  448. _FastPumpValve.TurnValve(false, out _);
  449. _TurboPumpPumpingValve.TurnValve(false, out _);
  450. _TurboPumpPurgeValve.TurnValve(false, out _);
  451. _GuageValve.TurnValve(false, out _);
  452. _LoadlockVentValve.TurnValve(false, out _);
  453. _LoadlockPumpingValve.TurnValve(false, out _);
  454. _N2Valve.TurnValve(false, out _);
  455. _FastPumpValve.TurnValve(false, out _);
  456. _Mfc1Valve.TurnValve(false, out _);
  457. _Mfc2Valve.TurnValve(false, out _);
  458. _Mfc3Valve.TurnValve(false, out _);
  459. _Mfc4Valve.TurnValve(false, out _);
  460. _Mfc5Valve.TurnValve(false, out _);
  461. _Mfc6Valve.TurnValve(false, out _);
  462. _Mfc7Valve.TurnValve(false, out _);
  463. _Mfc8Valve.TurnValve(false, out _);
  464. foreach (var stick in _gasLines)
  465. {
  466. stick.Stop();
  467. }
  468. }
  469. public void TurnDryPump(bool on)
  470. {
  471. //_pressureController.StartPump(on);
  472. _MainPump?.SetPumpOnOff(on);
  473. }
  474. public void TurnTurboPump(bool on)
  475. {
  476. _TurboPump?.SetPumpOnOff(on);
  477. }
  478. public void OpenValve(ValveType vlvType, bool on)
  479. {
  480. switch (vlvType)
  481. {
  482. case ValveType.PVN21:
  483. _PVN21Valve.TurnValve(on, out _);
  484. break;
  485. case ValveType.PVN22:
  486. _PVN22Valve.TurnValve(on, out _);
  487. break;
  488. case ValveType.PV11:
  489. _PV11Valve.TurnValve(on, out _);
  490. break;
  491. case ValveType.PV12:
  492. _PV12Valve.TurnValve(on, out _);
  493. break;
  494. case ValveType.PV21:
  495. _PV21Valve.TurnValve(on, out _);
  496. break;
  497. case ValveType.PV22:
  498. _PV22Valve.TurnValve(on, out _);
  499. break;
  500. case ValveType.PV31:
  501. _PV31Valve.TurnValve(on, out _);
  502. break;
  503. case ValveType.PV32:
  504. _PV32Valve.TurnValve(on, out _);
  505. break;
  506. case ValveType.PV41:
  507. _PV41Valve.TurnValve(on, out _);
  508. break;
  509. case ValveType.PV42:
  510. _PV42Valve.TurnValve(on, out _);
  511. break;
  512. case ValveType.N2:
  513. _N2Valve.TurnValve(on, out _);
  514. break;
  515. case ValveType.PVHe1:
  516. _PVHe1Valve.TurnValve(on, out _);
  517. break;
  518. case ValveType.PVHe2:
  519. _PVHe2Valve.TurnValve(on, out _);
  520. break;
  521. case ValveType.GasFinal:
  522. _GasFinalValve.TurnValve(on, out _);
  523. break;
  524. case ValveType.SoftPump:
  525. _SoftPumpValve.TurnValve(on, out _);
  526. break;
  527. case ValveType.FastPump:
  528. _FastPumpValve.TurnValve(on, out _);
  529. break;
  530. case ValveType.TurboPumpPumping:
  531. _TurboPumpPumpingValve.TurnValve(on, out _);
  532. break;
  533. case ValveType.TurboPumpPurge:
  534. _TurboPumpPurgeValve.TurnValve(on, out _);
  535. break;
  536. case ValveType.Guage:
  537. _GuageValve.TurnValve(on, out _);
  538. break;
  539. case ValveType.LoadlockVent:
  540. _LoadlockVentValve.TurnValve(on, out _);
  541. break;
  542. case ValveType.LoadlockPumping:
  543. _LoadlockPumpingValve.TurnValve(on, out _);
  544. break;
  545. case ValveType.Mfc1:
  546. _Mfc1Valve.TurnValve(on, out _);
  547. break;
  548. case ValveType.Mfc2:
  549. _Mfc2Valve.TurnValve(on, out _);
  550. break;
  551. case ValveType.Mfc3:
  552. _Mfc3Valve.TurnValve(on, out _);
  553. break;
  554. case ValveType.Mfc4:
  555. _Mfc4Valve.TurnValve(on, out _);
  556. break;
  557. case ValveType.Mfc5:
  558. _Mfc5Valve.TurnValve(on, out _);
  559. break;
  560. case ValveType.Mfc6:
  561. _Mfc6Valve.TurnValve(on, out _);
  562. break;
  563. case ValveType.Mfc7:
  564. _Mfc7Valve.TurnValve(on, out _);
  565. break;
  566. case ValveType.Mfc8:
  567. _Mfc8Valve.TurnValve(on, out _);
  568. break;
  569. default:
  570. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  571. }
  572. }
  573. public override void Monitor()
  574. {
  575. foreach (var gas in _gasLines)
  576. {
  577. gas.Monitor();
  578. }
  579. CheckPermanentInterlock();
  580. }
  581. private void CheckPermanentInterlock()
  582. {
  583. if (ProcessPressure > 100 && _GuageValve.SetPoint)
  584. {
  585. _GuageValve.TurnValve(false, out _);
  586. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  587. }
  588. }
  589. public void CheckIdleInterlock()
  590. {
  591. if(ForelinePressure > _foreline_interlock_pressure)
  592. {
  593. if(_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  594. {
  595. _pendulumValve.TurnValve(false);
  596. _TurboPumpPurgeValve.TurnValve(false, out _);
  597. _TurboPumpPumpingValve.TurnValve(false, out _);
  598. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  599. }
  600. }
  601. }
  602. public void BuzzerBlinking(double time)
  603. {
  604. _SignalTower.BuzzerBlinking(time);
  605. }
  606. public void SwitchOnBuzzerAndRed()
  607. {
  608. _SignalTower.SwitchOnBuzzerAndRed("", null);
  609. }
  610. public override void Home()
  611. {
  612. // 与yp讨论过,PM 初始化不需要
  613. SetLiftPin(MovementPosition.Down, out _);
  614. SetSlitDoor(false, out _);
  615. }
  616. public bool SetLiftPin(MovementPosition dirt, out string reason)
  617. {
  618. reason = string.Empty;
  619. switch (dirt)
  620. {
  621. case MovementPosition.Down:
  622. return _LiftPin.SetCylinder(false, out reason);
  623. case MovementPosition.Up:
  624. return _LiftPin.SetCylinder(true, out reason);
  625. case MovementPosition.Left:
  626. case MovementPosition.Right:
  627. case MovementPosition.Middle:
  628. throw new ArgumentException("Movement argument error");
  629. }
  630. return true;
  631. }
  632. public void SetSlitDoor(bool open, out string reason)
  633. {
  634. reason = string.Empty;
  635. if(open)
  636. {
  637. double maxPressureDifference = SC.GetValue<double>("System.PMLLMaxPressureDifference");
  638. if(Math.Abs(LoadlockPressure - ChamberPressure) > maxPressureDifference)
  639. {
  640. reason = $"{Module} and Loadlock pressure difference exceeds the max limit";
  641. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  642. return;
  643. }
  644. }
  645. _slitDoor.SetCylinder(open, out reason);
  646. }
  647. public bool RetractWafer()
  648. {
  649. return _LoadLockArm.SetCylinder(false, out _);
  650. }
  651. public bool ExtendWafer()
  652. {
  653. return _LoadLockArm.SetCylinder(true, out _);
  654. }
  655. public bool FlowGas(int gasNum, double val)
  656. {
  657. if (_gasLines.Length <= gasNum)
  658. return false;
  659. _gasLines[gasNum].Flow(val);
  660. return true;
  661. }
  662. public bool StopGas(int gasNum)
  663. {
  664. if (_gasLines.Length <= gasNum)
  665. return false;
  666. _gasLines[gasNum].Stop();
  667. return true;
  668. }
  669. public void StopAllGases()
  670. {
  671. foreach (var line in _gasLines)
  672. {
  673. line.Stop();
  674. }
  675. }
  676. public bool TurnPendulumValve(bool on)
  677. {
  678. return _pendulumValve.TurnValve(on);
  679. }
  680. public bool SetPVPressure(int pressure)
  681. {
  682. return _pendulumValve.SetPressure(pressure);
  683. }
  684. public bool SetPVPostion(int position)
  685. {
  686. return _pendulumValve.SetPosition(position);
  687. }
  688. public int GetPVPosition()
  689. {
  690. return _pendulumValve.Position;
  691. }
  692. public void HeatChiller(double value, double offset)
  693. {
  694. _Chiller?.SetChillerTemp((float)value, (float)offset);
  695. _Chiller?.SetChillerOnOff(true);
  696. }
  697. public bool CheckChillerStatus()
  698. {
  699. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  700. }
  701. public void SetGeneratorCommunicationMode(int mode)
  702. {
  703. _Generator?.SetCommunicationMode(mode);
  704. }
  705. public bool GeneratorPowerOn(bool on)
  706. {
  707. if (_Generator == null) return false;
  708. if (on && !IsRFGInterlockOn)
  709. {
  710. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  711. return false;
  712. }
  713. return _Generator.SetPowerOnOff(on, out _);
  714. }
  715. public bool GeneratorSetpower(float val)
  716. {
  717. if (_Generator == null) return false;
  718. if (Math.Abs(val) > 0.01)
  719. _Generator.SetPower((ushort)val);
  720. return true;
  721. }
  722. public bool GeneratorBiasPowerOn(bool on)
  723. {
  724. if (_GeneratorBias == null) return false;
  725. if (on && !IsRFGInterlockOn)
  726. {
  727. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  728. return false;
  729. }
  730. return _GeneratorBias.SetPowerOnOff(on, out _);
  731. }
  732. public bool GeneratorBiasSetpower(float val)
  733. {
  734. if (_GeneratorBias == null) return false;
  735. if (Math.Abs(val) > 0.01)
  736. _GeneratorBias.SetPower((ushort)val);
  737. return true;
  738. }
  739. public bool GeneratorBiasSetMatchMode(bool val)
  740. {
  741. if (_GeneratorBias == null) return false;
  742. string reason = string.Empty;
  743. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  744. return true;
  745. }
  746. public bool SetMatchPosition(float c1, float c2)
  747. {
  748. if (_Match == null) return false;
  749. string reason = string.Empty;
  750. _Match.SetMatchPosition(c1, c2, out reason);
  751. return true;
  752. }
  753. public bool SetBiasMatchPosition(float c1, float c2)
  754. {
  755. if (_BiasMatch == null) return false;
  756. string reason = string.Empty;
  757. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  758. return true;
  759. }
  760. public bool SetBiasPulseMode(bool on)
  761. {
  762. if (_GeneratorBias == null) return false;
  763. _GeneratorBias.SetPulseMode(on);
  764. return true;
  765. }
  766. public bool SetBiasPulseRateFreq(int nFreq)
  767. {
  768. if (_GeneratorBias == null) return false;
  769. _GeneratorBias.SetPulseRateFreq(nFreq);
  770. return true;
  771. }
  772. public bool SetDiasPulseDutyCycle(int percentage)
  773. {
  774. if (_GeneratorBias == null) return false;
  775. _GeneratorBias.SetPulseDutyCycle(percentage);
  776. return true;
  777. }
  778. public bool SetESCClampVoltage(int nVoltage)
  779. {
  780. if (_ESCHV == null) return false;
  781. return _ESCHV.SetOutputVoltage(nVoltage);
  782. }
  783. public bool CheckGeneratorAndHVInterlock(VenusDevice device)
  784. {
  785. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  786. string deviceName = device == VenusDevice.Rf ? "RF Generator" : "ESC HV";
  787. if (!PMLidClosed)
  788. {
  789. LOG.Write(evt, Module, $"Cannot Power ON {deviceName} as PM Lid is Open.");
  790. return false;
  791. }
  792. if (!IsVAC)
  793. {
  794. LOG.Write(evt, Module, $"Cannot Power ON {deviceName} as PM is not Vacuum.");
  795. return false;
  796. }
  797. if(!IsWaterFlowOk)
  798. {
  799. LOG.Write(evt, Module, $"Cannot Power ON {deviceName} as Water Flow is OFF.");
  800. return false;
  801. }
  802. if(!IsRFGInterlockOn)
  803. {
  804. LOG.Write(evt, Module, $"Cannot Power ON {deviceName} as Generator Interlock is OFF.");
  805. return false;
  806. }
  807. if(!SourceRFFanInterlock)
  808. {
  809. LOG.Write(evt, Module, $"Cannot Power ON {deviceName} as Source RF Fan is OFF.");
  810. return false;
  811. }
  812. if(!SlitDoorClosed)
  813. {
  814. LOG.Write(evt, Module, $"Cannot Power ON {deviceName} as Slit Door is open.");
  815. return false;
  816. }
  817. return true;
  818. }
  819. #region EndPoint
  820. public void EPDRecipeStart()
  821. {
  822. _epdClient.RecipeStart();
  823. }
  824. public void EPDRecipeStop()
  825. {
  826. _epdClient.RecipeStop();
  827. }
  828. public void EPDStepStart(string cfgName)
  829. {
  830. _epdClient.StepStart(cfgName);
  831. }
  832. public void EPDStepStop()
  833. {
  834. _epdClient.StepStop();
  835. }
  836. #endregion
  837. public void SetBacksideHeFlow(double flow)
  838. {
  839. if (_backsideHe == null) return ;
  840. _backsideHe.Flow(flow);
  841. }
  842. public bool SetBacksideHePressure(int mTorr)
  843. {
  844. if (_backsideHe == null) return false;
  845. return _backsideHe.SetBacksideHelium(mTorr);
  846. }
  847. public bool SetBacksideHeThreshold(int nMin, int nMax)
  848. {
  849. if (_backsideHe == null) return false;
  850. return _backsideHe.SetFlowThreshold(nMin, nMax);
  851. }
  852. }
  853. }