JetVenusPM.cs 41 KB

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