JetKepler2300PM.cs 47 KB

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