JetPM.cs 38 KB

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