JetKepler2300PM.cs 50 KB

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