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