123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017 |
- using System;
- using System.Collections.Generic;
- using Aitex.Core.Common;
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Device.Unit;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.Device.Bases;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Schedulers;
- using MECF.Framework.Common.SubstrateTrackings;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
- using VirgoCommon;
- using VirgoRT.Devices.IODevices;
- using VirgoRT.Instances;
- using VirgoRT.Module;
- using VirgoRT.Modules;
- namespace VirgoRT.Devices
- {
- enum ValveType
- {
- PROCESS,
- FAST_PUMP,
- SOFT_PUMP,
- FAST_VENT,
- PURGE,
- Mfc1,
- Mfc2,
- Mfc3,
- Mfc4,
- Mfc5
- }
- class JetPM : PM
- {
- // ----------------------------Fields--------------------------
- //
- private readonly IoLid _Lid;
- //private readonly IoCylinder _LidLocker;
- private readonly IoMessage _Messager;
- private readonly IoSensor _ATM_sw;
- private readonly IoSensor _VAC_sw;
- private readonly IoSensor _WLK_sw;
- private readonly IoSensor _CDAPressure;
- private readonly IoSensor _CoolantInletTC;
- private readonly IoSensor _CoolantOutletTC;
- private readonly IoSensor _ArmNotExtend;
- private readonly IoSensor _N2Pressure_sw;
- private readonly IoSensor _RFG_Interlock;
- private readonly IoPressureControl _pressureController;
- private readonly IoHeater _SubstrateTC;
- private readonly IoHeater _ForelineTC;
- private readonly IoValve _SoftPumpValve;
- private readonly IoValve _FastPumpValve;
- private readonly IoValve _ProcessValve;
- private readonly IoValve _PurgeValve;
- private readonly IoValve _FastVentValve;
- private readonly IoValve _Mfc1Valve;
- private readonly IoValve _Mfc2Valve;
- private readonly IoValve _Mfc3Valve;
- private readonly IoValve _Mfc4Valve;
- private readonly IoValve _Mfc5Valve;
- //private readonly IoValve _N2SupplyValve;
- private readonly IoCylinder _slitDoor;
- private readonly IoCylinder _LiftPin;
- private readonly IoCylinder _PinSmall; // 3'
- private readonly IoCylinder _PinMedium; // 4'
- private readonly RfPowerBase _Generator;
- private readonly RfPowerBase _GeneratorBias;
- private readonly RfMatchBase _Match;
- private readonly PumpBase _MainPump;
- private readonly ChillerBase _Chiller;
- private readonly IoGasStick[] _gasLines;
- private readonly ChillerBase _gridChiller;
- private readonly IoHeater _gridHeater;
- private readonly R_TRIG _trigBasePressure = new R_TRIG();
- private readonly R_TRIG _trigBaseTemperature = new R_TRIG();
- private readonly R_TRIG _trigWaterFlowCloseChiller = new R_TRIG();
- private double BasePressure;
- private double BaseTemperature;
- private bool EnableBiasRF = false;
- private int _bigWafer = 0;
- private int _midWafer = 0;
- private int _smallWafer = 0;
- private int gasCount = 0;
- private bool _smallGuidePinEnable;
- private bool _mediumGuidePinEnable;
- private MovementPosition _smallGuidePinDummyPos = MovementPosition.Down;
- private MovementPosition _mediumGuidePinDummyPos = MovementPosition.Down;
- // --------------------------Properties------------------------
- //
- public new ModuleName Module { get; }
- // 门的状态
- public bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
- public bool IsArmNotExtend => _ArmNotExtend.Value;
- // 盖子的状态
- public bool IsLidClosed => _Lid.OFFFeedback;
- // 盖子的锁
- //public bool IsLidLocked => !_LidLocker.ONSetPoint && _LidLocker.OFFSetPoint;
- public MovementPosition LiftPinPosition
- {
- get
- {
- MovementPosition pos = MovementPosition.Unknown;
- if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
- {
- pos = MovementPosition.Up;
- }
- else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
- {
- pos = MovementPosition.Down;
- }
- return pos;
- }
- }
- public MovementPosition SmallPosition
- {
- get
- {
- if (!_smallGuidePinEnable) return _smallGuidePinDummyPos;
- if (_smallWafer == 0)
- return MovementPosition.Down;
- MovementPosition res = MovementPosition.Unknown;
- if (_PinSmall.ONFeedback && !_PinSmall.OFFFeedback)
- {
- res = MovementPosition.Up;
- }
- else if (_PinSmall.OFFFeedback && !_PinSmall.ONFeedback)
- {
- res = MovementPosition.Down;
- }
- return res;
- }
- }
- public MovementPosition MediumPosition
- {
- get
- {
- if (!_mediumGuidePinEnable) return _mediumGuidePinDummyPos;
- if (_midWafer == 0)
- return MovementPosition.Down;
- MovementPosition res = MovementPosition.Unknown;
- if (_PinMedium.ONFeedback && !_PinMedium.OFFFeedback)
- {
- res = MovementPosition.Up;
- }
- else if (_PinMedium.OFFFeedback && !_PinMedium.ONFeedback)
- {
- res = MovementPosition.Down;
- }
- return res;
- }
- }
- public override bool IsError
- {
- get
- {
- if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
- {
- return _MainPump.IsError || _Generator.IsError || _GeneratorBias.IsError;
- }
- else
- {
- return _MainPump.IsError || _Generator.IsError;
- }
- }
- }
- public override bool IsIdle { get; }
- // 腔体压力
- public bool IsPressureToleranceEnabled
- {
- get => _pressureController.EnableTolerance;
- set => _pressureController.EnableTolerance = value;
- }
- public override double ChamberPressure => _pressureController.ProcessGauge.Value;
- public override double ChamberPressurePressure => _pressureController.PressureGauge.Value;
- public double ForelinePressure => _pressureController.ForelineGauge.Value;
- public PressureCtrlMode PressureMode => _pressureController.ThrottleValve.PressureMode;
- public double TargetPressure => _pressureController.TargetPressure;
- // 压力信号
- public bool IsATM => _ATM_sw.Value;
- public bool IsVAC => _VAC_sw.Value;
- public bool IsWLK => _WLK_sw.Value;
- public bool IsRFGInterlockOn => _RFG_Interlock.Value;
- // 温度
- public float SubstrateTempSP => _SubstrateTC.ControlTcSetPoint;
- public float SubstrateTempFB => _SubstrateTC.ControlTcFeedback;
- public float CoolantInletTempFB => _SubstrateTC.CoolantInletTcFeedback;
- public float CoolantOutletTempFB => _SubstrateTC.CoolantOutletTcFeedback;
- // Pump 状态
- public bool IsPumpRunning => _MainPump.IsRunning;
- public bool IsFastPumpOpened => _FastPumpValve.Status;
- public bool IsSoftPumpOpened => _SoftPumpValve.Status;
- public bool IsMfc1ValveOpened => _Mfc1Valve.Status;
- public bool IsMfc2ValveOpened => _Mfc2Valve.Status;
- public bool IsMfc3ValveOpened => _Mfc3Valve.Status;
- public bool IsMfc4ValveOpened => _Mfc4Valve.Status;
- public bool IsMfc5ValveOpened => _Mfc5Valve.Status;
- public bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
- public bool IsCDA_OK => _CDAPressure.Value;
- public bool IsCoolantInletTC_OK => _CoolantInletTC.Value;
- public bool IsCoolantOutletTC_OK => _CoolantOutletTC.Value;
- // 蝶阀位置
- public float TVPosition => _pressureController.ThrottleValve.PositionFeedback;
- // 腔体压力.end
- // 射频
- public float ForwardPower => _Generator.ForwardPower;
- public bool IsGeneratorON => _Generator.IsPowerOn;
- public float GeneratorSetpoint => _Generator.PowerSetPoint;
- // Bias射频
- public float ForwardPowerBias => _GeneratorBias.ForwardPower;
- public bool IsGeneratorONBias => _GeneratorBias.IsPowerOn;
- public float GeneratorSetpointBias => _GeneratorBias.PowerSetPoint;
- public float CTune => _GeneratorBias.CTune;
- public float CLoad => _GeneratorBias.CLoad;
- public int VPP => _GeneratorBias.VPP;
- // 流气
- public double TotalGasSetpoint
- {
- get
- {
- double sum = 0;
- foreach (var gas in _gasLines)
- {
- sum += gas.FlowSP;
- }
- return sum;
- }
- }
- public bool HasGasOutOfRange
- {
- get
- {
- foreach (var gas in _gasLines)
- {
- if (!gas.IsOutOfRange)
- return false;
- }
- return true;
- }
- }
- // --------------------------Constructor-----------------------
- //
- public JetPM(ModuleName mod) : base(mod.ToString())
- {
- Module = mod;
- _smallGuidePinEnable = SC.GetValue<bool>($"System.SmallGuidePinEnable");
- _mediumGuidePinEnable = SC.GetValue<bool>($"System.MediumGuidePinEnable");
- BasePressure = SC.GetValue<double>($"{mod}.ChamberBasePressureThreshold");
- BaseTemperature = SC.GetValue<double>($"{mod}.ChamberBaseTemperatureThreshold");
- _smallWafer = SC.GetValue<int>($"System.SmallWafer");
- _midWafer = SC.GetValue<int>($"System.MidWafer");
- _bigWafer = SC.GetValue<int>($"System.BigWafer");
- EnableBiasRF = SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF");
- for (int i = 1; i <= 5; i++)
- {
- if (SC.GetValue<bool>($"{Module}.MfcGas{i}.Enable")) gasCount++;
- }
- //_gasLines = new IoGasStick[gasCount];
- _gasLines = new IoGasStick[5];
- //for (int index = 0; index < gasCount; index++)
- //{
- // _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
- //}
- for (int index = 0; index < 5; index++)
- {
- _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
- }
- _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VirgoDevice.Lid}");
- //_LidLocker = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LidLocker}");
- _Messager = DEVICE.GetDevice<IoMessage>($"{Module}.Messager");
- _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
- _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
- _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
- _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
- _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
- _CoolantInletTC = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantInletTCOK");
- _CoolantOutletTC = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantOutletTCOK");
- _ArmNotExtend = DEVICE.GetDevice<IoSensor>($"{Module}.SensorArmNotExtend");
- _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
- _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VirgoDevice.PressureControl}");
- _SubstrateTC = DEVICE.GetDevice<IoHeater>($"{Module}.HeaterChamber");
- _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
- _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveSoftPumping}");
- _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveFastPumping}");
- _ProcessValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveProcess}");
- _FastVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveFastVent}");
- _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveChamberPurge}");
- _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc1}");
- _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc2}");
- _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc3}");
- _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc4}");
- _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc5}");
- _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.SlitDoor}");
- _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LiftPin}");
- _PinSmall = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.SmallPin}");
- _PinMedium = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.MediumPin}");
- _Generator = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.Rf}");
- _GeneratorBias = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.BiasRf}");
- _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VirgoDevice.MainPump}");
- _Chiller = DEVICE.GetDevice<ChillerBase>($"{Module}.{VirgoDevice.Chiller}");
- _gridChiller = DEVICE.GetDevice<ChillerBase>($"{Module}.GridChiller");
- _gridHeater = DEVICE.GetDevice<IoHeater>($"{Module}.GridHeater");
- _gridHeater.Controller = (IoHeaterController)_gridChiller;
- // RS223 AdTec Generator
- if (SC.GetValue<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)
- {
- _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.Rf}");
- }
- if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Kashiyama)
- {
- _MainPump = DEVICE.GetDevice<KashiyamaPump>($"{Module}.{VirgoDevice.MainPump}");
- }
- // Ethernet Comet Generator Bias
- if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF") &&
- SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
- SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
- {
- _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VirgoDevice.BiasRf}");
- }
- // RS223 AdTec Generator Bias
- if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF") &&
- SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
- {
- _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.BiasRf}");
- }
- // RS232 AdTec match
- if (SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.AdTec)
- {
- _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VirgoDevice.Match}");
- }
- // RS232 Dry pump, SKY
- if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
- {
- if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
- {
- _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VirgoDevice.MainPump}");
- }
- else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
- {
- _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VirgoDevice.MainPump}");
- }
- }
- if (SC.GetValue<bool>($"{mod}.Chiller.EnableChiller") &&
- SC.GetValue<int>($"{mod}.Chiller.CommunicationType") == (int)CommunicationType.RS232 &&
- SC.GetValue<int>($"{mod}.Chiller.MFG") == (int)ChillerMFG.SMC)
- {
- _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VirgoDevice.Chiller}");
- }
- System.Diagnostics.Debug.Assert(null != _Generator);
- System.Diagnostics.Debug.Assert(null != _MainPump);
- if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
- {
- System.Diagnostics.Debug.Assert(null != _GeneratorBias);
- }
- WaferManager.Instance.SubscribeLocation(Module, 1);
- }
- public override bool Initialize()
- {
- base.Initialize();
- DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature", () => SubstrateTempFB);
- DATA.Subscribe($"{Module}.WaferSize", () => WaferManager.Instance.GetWafer(Module, 0).Size.ToString());
- DATA.Subscribe($"{Module}.EnableBiasRF", () => EnableBiasRF);
- return true;
- }
- // -----------------------------Method-------------------------
- //
- public override void Home()
- {
- // 与yp讨论过,PM 初始化不需要
- SetLiftPin(MovementPosition.Down, out _);
- //SetSlitDoor(false, out _);
- if (WaferManager.Instance.CheckNoWafer(Module, 0))
- {
- SetGuidePinSmall(MovementPosition.Down);
- SetGuidePinMedium(MovementPosition.Down);
- }
- if (IsSlitDoorClosed)
- {
- SetSlitDoor(false, out _);
- }
- else if (!IsSlitDoorClosed)
- {
- SetSlitDoor(false, out _);
- }
- else if (_slitDoor.State == CylinderState.Error)
- {
- SetSlitDoor(true, out _);
- }
- if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
- {
- _Messager.SetMessager(1); //Virgo B
- }
- else
- {
- _Messager.SetMessager(0); //Virgo A
- }
- }
- public void SetSlitDoor(bool open, out string reason)
- {
- reason = string.Empty;
-
- // [XIAHUAN]: 只在关门的时候检查arm not extend
- if (!open && !IsArmNotExtend)
- {
- EV.PostAlarmLog(Module.ToString(), "Arm Not Extend 信号不满足");
- return;
- }
- _slitDoor.SetCylinder(open, out reason);
- }
- public override bool CheckWaterLeak()
- {
- return _WLK_sw.Value;
- }
- public override bool CheckCDAOK()
- {
- return _CDAPressure.Value;
- }
- public override bool CheckCoolantInletTCOK()
- {
- return _CoolantInletTC.Value;
- }
- public override bool CheckCoolantOutletTCOK()
- {
- return _CoolantOutletTC.Value;
- }
- public override bool CheckArmExtendOK()
- {
- return _ArmNotExtend.Value;
- }
- public override bool CheckAtm()
- {
- return _ATM_sw.Value && ChamberPressure > 700000;
- }
- public override bool CheckVacuum()
- {
- return _VAC_sw.Value && ChamberPressure < 100;
- }
- public bool CheckSlitDoorOpen()
- {
- return _slitDoor.State == CylinderState.Open;
- }
- public bool CheckSlitDoorClose()
- {
- return _slitDoor.State == CylinderState.Close;
- }
- public bool CheckLiftUp()
- {
- return _LiftPin.State == CylinderState.Open;
- }
- public bool CheckLiftDown()
- {
- return _LiftPin.State == CylinderState.Close;
- }
- public void StartPump(bool on)
- {
- //_pressureController.StartPump(on);
- _MainPump?.SetPumpOnOff(on);
- }
- public void SetValveOnOff(ValveType vlvType, bool on)
- {
- switch (vlvType)
- {
- case ValveType.PROCESS:
- _ProcessValve.TurnValve(on, out _);
- break;
- case ValveType.FAST_PUMP:
- _FastPumpValve.TurnValve(on, out _);
- break;
- case ValveType.SOFT_PUMP:
- _SoftPumpValve.TurnValve(on, out _);
- break;
- case ValveType.FAST_VENT:
- _FastVentValve.TurnValve(on, out _);
- break;
- case ValveType.PURGE:
- _PurgeValve.TurnValve(on, out _);
- break;
- case ValveType.Mfc1:
- _Mfc1Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc2:
- _Mfc2Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc3:
- _Mfc3Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc4:
- _Mfc4Valve.TurnValve(on, out _);
- break;
- case ValveType.Mfc5:
- _Mfc5Valve.TurnValve(on, out _);
- break;
- default:
- throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
- }
- }
- public void CheckPressureStability()
- {
- IsPressureToleranceEnabled = true;
- }
- public override void Monitor()
- {
- foreach (var gas in _gasLines)
- {
- gas.Monitor();
- }
- _trigBasePressure.CLK = ChamberPressurePressure >= BasePressure;
- if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller"))
- {
- _trigBaseTemperature.CLK = CoolantOutletTempFB >= BaseTemperature;
- }
- else
- {
- _trigBaseTemperature.CLK = SubstrateTempFB >= BaseTemperature;
- }
- if (_trigBasePressure.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, "PM pressure out of tolerance");
- if (_trigBaseTemperature.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, "PM temperature out of tolerance");
- _trigWaterFlowCloseChiller.CLK = SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") && !CheckWaterLeak() && _Chiller != null && _Chiller.IsRunning;
- if (_trigWaterFlowCloseChiller.Q)
- {
- Aitex.Core.RT.Log.LOG.Info("Turn off chiller by water leak");
- _Chiller.SetChillerOnOff(false);
- }
- }
- public void CloseValves()
- {
- _SoftPumpValve.TurnValve(false, out _);
- _FastPumpValve.TurnValve(false, out _);
- _ProcessValve.TurnValve(false, out _);
- _PurgeValve.TurnValve(false, out _);
- _FastVentValve.TurnValve(false, out _);
- _PurgeValve.TurnValve(false, out _);
- _Mfc1Valve.TurnValve(false, out _);
- _Mfc2Valve.TurnValve(false, out _);
- _Mfc3Valve.TurnValve(false, out _);
- _Mfc4Valve.TurnValve(false, out _);
- _Mfc5Valve.TurnValve(false, out _);
- foreach (var stick in _gasLines)
- {
- stick.Stop();
- }
- }
- public bool FlowGas(int gasNum, double val)
- {
- if (_gasLines.Length <= gasNum)
- return false;
- _gasLines[gasNum].Flow(val);
- return true;
- }
- public void StopAllGases()
- {
- foreach (var line in _gasLines)
- {
- line.Stop();
- }
- }
- public bool SetLiftPin(MovementPosition dirt, out string reason)
- {
- reason = string.Empty;
- switch (dirt)
- {
- case MovementPosition.Down:
- return _LiftPin.SetCylinder(false, out reason);
- case MovementPosition.Up:
- return _LiftPin.SetCylinder(true, out reason);
- case MovementPosition.Left:
- case MovementPosition.Right:
- case MovementPosition.Middle:
- throw new ArgumentException("Movement argument error");
- }
- return true;
- }
- public void SetGuidePin(WaferSize ws, MovementPosition dirt)
- {
- if (ws == WaferSize.WS3)
- SetGuidePinSmall(dirt);
- else if (ws == WaferSize.WS4)
- SetGuidePinMedium(dirt);
- }
- public void PrepareGuidePinForPlace(WaferSize ws)
- {
- if (ws == WaferSize.WS3)
- {
- SetGuidePinSmall(MovementPosition.Up);
- SetGuidePinMedium(MovementPosition.Down);
- }
- else if (ws == WaferSize.WS4)
- {
- SetGuidePinSmall(MovementPosition.Down);
- SetGuidePinMedium(MovementPosition.Up);
- }
- else if (ws == WaferSize.WS6)
- {
- SetGuidePinSmall(MovementPosition.Down);
- SetGuidePinMedium(MovementPosition.Down);
- }
- }
- public bool CheckGuidePinIsReadyForTransfer(WaferSize ws)
- {
- if (ws == WaferSize.WS3)
- {
- return SmallPosition == MovementPosition.Up && MediumPosition == MovementPosition.Down;
- }
- else if (ws == WaferSize.WS4)
- {
- return SmallPosition == MovementPosition.Down && MediumPosition == MovementPosition.Up;
- }
- else if (ws == WaferSize.WS6)
- {
- return SmallPosition == MovementPosition.Down && MediumPosition == MovementPosition.Down;
- }
- //else if (ws == WaferSize.WS8)
- //{
- // return SmallPosition == MovementPosition.Down && MediumPosition == MovementPosition.Down;
- //}
- else
- return false;
- }
- private void SetGuidePinSmall(MovementPosition dirt)
- {
- if (_smallGuidePinEnable)
- {
- EV.PostInfoLog(Module.ToString(), $"set small pin {dirt}, smallWafer={_smallWafer}");
- switch (dirt)
- {
- case MovementPosition.Down:
- if (_smallWafer != 0)
- _PinSmall?.SetCylinder(false, out _);
- break;
- case MovementPosition.Up:
- if (_smallWafer != 0)
- _PinSmall?.SetCylinder(true, out _);
- break;
- default:
- throw new ArgumentException("Movement argument error");
- }
- }
- else
- {
- _smallGuidePinDummyPos = dirt;
- }
- }
- private void SetGuidePinMedium(MovementPosition dirt)
- {
- if(_mediumGuidePinEnable)
- {
- EV.PostInfoLog(Module.ToString(), $"set medium pin {dirt}, midWafer={_midWafer}");
- switch (dirt)
- {
- case MovementPosition.Down:
- if (_midWafer != 0)
- _PinMedium?.SetCylinder(false, out _);
- break;
- case MovementPosition.Up:
- if (_midWafer != 0)
- _PinMedium?.SetCylinder(true, out _);
- break;
- default:
- throw new ArgumentException("Movement argument error");
- }
- }
- else
- {
- _mediumGuidePinDummyPos = dirt;
- }
- }
- public void SetGeneratorCommunicationMode(int mode)
- {
- _Generator?.SetCommunicationMode(mode);
- }
- public bool GeneratorPowerOn(bool on)
- {
- if (_Generator == null) return false;
- if (on && !IsRFGInterlockOn)
- {
- EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
- return false;
- }
- return _Generator.SetPowerOnOff(on, out _);
- }
- public bool GeneratorSetpower(float val)
- {
- if (_Generator == null) return false;
- if (Math.Abs(val) > 0.01)
- _Generator.SetPower((ushort)val);
- return true;
- }
- public bool GeneratorBiasPowerOn(bool on)
- {
- if (_GeneratorBias == null) return false;
- if (on && !IsRFGInterlockOn)
- {
- EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足");
- return false;
- }
- return _GeneratorBias.SetPowerOnOff(on, out _);
- }
- public bool GeneratorBiasSetpower(float val)
- {
- if (_GeneratorBias == null) return false;
- if (Math.Abs(val) > 0.01)
- _GeneratorBias.SetPower((ushort)val);
- return true;
- }
- public bool GeneratorBiasSetMatchMode(bool val)
- {
- if (_GeneratorBias == null) return false;
- string reason = string.Empty;
- _GeneratorBias.SetMatchingAutoMode(val, out reason);
- return true;
- }
- public bool SetMatchPosition(float c1, float c2)
- {
- if (_Match == null) return false;
- string reason = string.Empty;
- _Match.SetMatchPosition(c1, c2, out reason);
- return true;
- }
- public bool SetBiasMatchPosition(float c1, float c2)
- {
- if (_GeneratorBias == null) return false;
- string reason = string.Empty;
- _GeneratorBias.SetMatchPosition(c1, c2, out reason);
- return true;
- }
- public void FullOpenTV()
- {
- _pressureController.FullOpenThrottleValve();
- }
- public void HeatSubstrate(double val)
- {
- _SubstrateTC?.RampTemp((float)val);
- _SubstrateTC?.TurnOnOff(true);
- }
- public void HeatChiller(double value, double offset)
- {
- _Chiller?.SetChillerTemp((float)value, (float)offset);
- _Chiller?.SetChillerOnOff(true);
- }
- public bool CheckChillerStatus()
- {
- return _Chiller != null && _Chiller.IsRunning && !_Chiller.IsError;
- }
- public void HeatForeline(double val)
- {
- _ForelineTC?.RampTemp((float)val);
- }
- public override bool CheckEnableTransfer(EnumTransferType type)
- {
- if (type == EnumTransferType.Pick)
- {
- return _slitDoor.State == CylinderState.Open && _LiftPin.State == CylinderState.Open;
- }
- if (type == EnumTransferType.Place)
- {
- return _slitDoor.State == CylinderState.Open && _LiftPin.State == CylinderState.Close;
- }
- return false;
- }
- public bool CheckEnableTransfer(EnumTransferType type, WaferSize waferSize)
- {
- bool guidePinIsOk = CheckGuidePinIsReadyForTransfer(waferSize);
- bool pressureIsOk = CheckSlitDoorOpen() || IsATM;
- if (type == EnumTransferType.Pick)
- {
- return _LiftPin.State == CylinderState.Open && pressureIsOk
- && CheckGuidePinIsReadyForTransfer(waferSize);
- }
- if (type == EnumTransferType.Place)
- {
- return _LiftPin.State == CylinderState.Close && pressureIsOk
- && CheckGuidePinIsReadyForTransfer(waferSize);
- }
- return false;
- }
- public override void TransferHandoff(EnumTransferType type)
- {
- switch (type)
- {
- case EnumTransferType.Pick:
- SetLiftPin(MovementPosition.Up, out _);
- break;
- case EnumTransferType.Place:
- SetLiftPin(MovementPosition.Down, out _);
- break;
- case EnumTransferType.Extend:
- break;
- case EnumTransferType.Retract:
- break;
- default:
- break;
- }
- }
- public override void Reset()
- {
- _trigBasePressure.RST = true;
- _trigBaseTemperature.RST = true;
- }
- }
- /// <summary>
- /// PM Action
- /// </summary>
- abstract class PmActionBase : ActionBase
- {
- protected internal JetPM _chamber;
- protected PmActionBase(ModuleName mod, JetPM pm) : base(mod)
- {
- _chamber = pm;
- }
- }
- class PinAction : PmActionBase
- {
- public MovementPosition Pos { get; }
- public bool IsWaferTransfered { get; }
- public PMEntity PmEntity { get; set; }
- private Hand _blade;
- private bool _isPick;
- private bool _delay;
- public PinAction(ModuleName mod, JetPM pm, MovementPosition pos, bool isTransferWafer, Hand blade, bool isPick, bool isDelay) : base(mod, pm)
- {
- this.Pos = pos;
- IsWaferTransfered = isTransferWafer;
- _blade = blade;
- _isPick = isPick;
- _delay = isDelay;
- }
- public override void Execute()
- {
- if (Module == ModuleName.PMA)
- PmEntity = Singleton<RouteManager>.Instance.PMA;
- else if (Module == ModuleName.PMB)
- PmEntity = Singleton<RouteManager>.Instance.PMB;
- if (PmEntity != null)
- {
- EV.PostInfoLog(Module.ToString(), $"开始执行 Delayrecorder");
- PmEntity.PostMsg(PMEntity.MSG.MoveLiftPin, Pos, ID, _isPick, _delay);
- }
- }
- public override void OnPostWork(string data = null)
- {
- if (IsWaferTransfered)
- {
- if (Pos == MovementPosition.Up)
- {
- WaferManager.Instance.WaferMoved(ModuleName.EfemRobot, _blade==Hand.Blade1 ? 0 : 1, Module, 0);
- }
- else
- {
- WaferManager.Instance.WaferMoved(Module, 0, ModuleName.EfemRobot, _blade == Hand.Blade1 ? 0 : 1);
- }
- }
- }
- }
- class SlitDoorAction : PmActionBase
- {
- public PMEntity PmEntity { get; set; }
-
- private bool _isOpen;
- public SlitDoorAction(ModuleName mod, JetPM pm, bool isOpen ) : base(mod, pm)
- {
- _isOpen = isOpen;
- }
- public override void Execute()
- {
- if (Module == ModuleName.PMA)
- PmEntity = Singleton<RouteManager>.Instance.PMA;
- else if (Module == ModuleName.PMB)
- PmEntity = Singleton<RouteManager>.Instance.PMB;
- if (PmEntity != null)
- {
- if (_isOpen)
- {
- PmEntity.PostMsg(PMEntity.MSG.OpenSlitDoor, ID );
- }
- else
- {
- PmEntity.PostMsg(PMEntity.MSG.CloseSlitDoor, ID);
- }
- }
- }
- public override void OnPostWork(string data = null)
- {
- }
- }
- }
|