123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698 |
- using System;
- using System.Collections.Generic;
- //using System.
- using Venus_RT.Devices;
- using Aitex.Core.RT.Log;
- using Venus_Core;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.RT.Tolerance;
- using System.Diagnostics;
- using MECF.Framework.Common.DBCore;
- //#pragma warning disable 0436
- namespace Venus_RT.Modules.PMs
- {
- class ProcessHelper
- {
- protected JetPMBase Chamber;
- private string Module;
- public RecipeHead m_RecipeHead;
- private static Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>> startHelper = new Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>>();
- private static Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>> checkerHelper = new Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>>();
- private static Dictionary<string, Action<ProcessUnitBase, RecipeStep>> endHelper = new Dictionary<string, Action<ProcessUnitBase, RecipeStep>>();
- private List<float> rfMatchC1 = new List<float>();
- private List<float> rfMatchC2 = new List<float>();
- private int rfMatchC1C2Index = 0;
- private List<float> biasRfMatchC1 = new List<float>();
- private List<float> biasRfMatchC2 = new List<float>();
- private int biasRfMatchC1C2Index = 0;
- public bool isLoop = false;
- public int loopsteps = 0;
- public int currentStepIndex = 0;
- private bool biasRFSetPointFlag = true;
- private double _scRFPowerAlarmTime;
- private double _scBiasRFPowerAlarmTime;
- private RecipeToleranceChecker _GasFlowToleranceChecker;
- private RecipeToleranceChecker _RFToleranceChecker;
- private RecipeToleranceChecker _BiasRFToleranceChecker;
- //private RecipeToleranceChecker _HeliumToleranceChecker;
- private RecipeToleranceChecker _PressureToleranceChecker;
- private RecipeToleranceChecker _HighTemperatureToleranceChecker;
- private RecipeToleranceChecker _MagnetToleranceChecker;
- private bool _isEnableMatchC1C2Offset;
- private int _matchC1C2OffsetValue;
- private bool _isEnableBiasMatchC1C2Offset;
- private int _biasMatchC1C2OffsetValue;
- private int _BiasReflectPowerOverCount = 0;
- private bool _BiasReflectPowerOverFlag = false;
- private bool _isInstalledEPD;
- private Stopwatch _lastEPDStepTimeStopwatch;
- public long? lastEPDStepTime;
- //private Fdc _fdc;
- //private string _RecipeId;
- public int EAP_StepTime;
- private Stopwatch _StableStopWach = new Stopwatch();
- //private int _RfReflectPowerOverCounter;
- public ProcessHelper(JetPMBase pm)
- {
- Chamber = pm;
- Module = pm.Module.ToString();
- Init();
- _GasFlowToleranceChecker = new RecipeToleranceChecker(Module);
- _RFToleranceChecker = new RecipeToleranceChecker(Module);
- _BiasRFToleranceChecker = new RecipeToleranceChecker(Module);
- //_HeliumToleranceChecker = new RecipeToleranceChecker(Module);
- _PressureToleranceChecker = new RecipeToleranceChecker(Module);
- _HighTemperatureToleranceChecker = new RecipeToleranceChecker(Module);
- _MagnetToleranceChecker = new RecipeToleranceChecker(Module);
- if (Chamber.ChamberType == JetChamber.Kepler2300 || Chamber.ChamberType == JetChamber.VenusSE || Chamber.ChamberType == JetChamber.VenusDE)
- {
- _isInstalledEPD = SC.GetValue<bool>($"{Module}.EPD.IsEnabled");
- }
- if (_isInstalledEPD)
- {
- _lastEPDStepTimeStopwatch = new Stopwatch();
- }
- _StableStopWach.Reset();
- }
- private void Init()
- {
- startHelper[$"{Module}.PressureByPressureModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => PressureByPressureModeUnit_Start(unit, step);
- checkerHelper[$"{Module}.PressureByPressureModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => PressureByPressureModeUnit_Check(unit, step);
- endHelper[$"{Module}.PressureByPressureModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => PressureByPressureModeUnit_End(unit, step);
- startHelper[$"{Module}.Kepler2200PressureByPressureModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => Kepler2200PressureByPressureModeUnit_Start(unit, step);
- checkerHelper[$"{Module}.Kepler2200PressureByPressureModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => Kepler2200PressureByPressureModeUnit_Check(unit, step);
- endHelper[$"{Module}.Kepler2200PressureByPressureModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => Kepler2200PressureByPressureModeUnit_End(unit, step);
- //startHelper [$"{Module}.PressureByValveModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => PressureByValveModeUnit_Start(unit, step);
- //checkerHelper [$"{Module}.PressureByValveModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => PressureByValveModeUnit_Check(unit, step);
- //endHelper [$"{Module}.PressureByValveModeUnit"] = (ProcessUnitBase unit, RecipeStep step) => PressureByValveModeUnit_End(unit, step);
- startHelper[$"{Module}.TCPUnit"] = (ProcessUnitBase unit, RecipeStep step) => TCPUnit_Start(unit, step);
- checkerHelper[$"{Module}.TCPUnit"] = (ProcessUnitBase unit, RecipeStep step) => TCPUnit_Check(unit, step);
- endHelper[$"{Module}.TCPUnit"] = (ProcessUnitBase unit, RecipeStep step) => TCPUnit_End(unit, step);
- startHelper[$"{Module}.RFUnit"] = (ProcessUnitBase unit, RecipeStep step) => RFUnit_Start(unit, step);
- checkerHelper[$"{Module}.RFUnit"] = (ProcessUnitBase unit, RecipeStep step) => RFUnit_Check(unit, step);
- endHelper[$"{Module}.RFUnit"] = (ProcessUnitBase unit, RecipeStep step) => RFUnit_End(unit, step);
- startHelper[$"{Module}.BiasUnit"] = (ProcessUnitBase unit, RecipeStep step) => BiasUnit_Start(unit, step);
- checkerHelper[$"{Module}.BiasUnit"] = (ProcessUnitBase unit, RecipeStep step) => BiasUnit_Check(unit, step);
- endHelper[$"{Module}.BiasUnit"] = (ProcessUnitBase unit, RecipeStep step) => BiasUnit_End(unit, step);
- startHelper[$"{Module}.GasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => GasControlUnit_Start(unit, step);
- checkerHelper[$"{Module}.GasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => GasControlUnit_Check(unit, step);
- endHelper[$"{Module}.GasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => GasControlUnit_End(unit, step);
- startHelper[$"{Module}.VenusSEGasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => VenusSEGasControlUnit_Start(unit, step);
- checkerHelper[$"{Module}.VenusSEGasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => VenusSEGasControlUnit_Check(unit, step);
- endHelper[$"{Module}.VenusSEGasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => VenusSEGasControlUnit_End(unit, step);
- startHelper[$"{Module}.VenusDEGasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => VenusDEGasControlUnit_Start(unit, step);
- checkerHelper[$"{Module}.VenusDEGasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => VenusDEGasControlUnit_Check(unit, step);
- endHelper[$"{Module}.VenusDEGasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => VenusDEGasControlUnit_End(unit, step);
- startHelper[$"{Module}.ESCHVUnit"] = (ProcessUnitBase unit, RecipeStep step) => ESCHVUnit_Start(unit, step);
- checkerHelper[$"{Module}.ESCHVUnit"] = (ProcessUnitBase unit, RecipeStep step) => ESCHVUnit_Check(unit, step);
- endHelper[$"{Module}.ESCHVUnit"] = (ProcessUnitBase unit, RecipeStep step) => ESCHVUnit_End(unit, step);
- startHelper[$"{Module}.ESCHV8InchUnit"] = (ProcessUnitBase unit, RecipeStep step) => ESCHV8InchUnit_Start(unit, step);
- checkerHelper[$"{Module}.ESCHV8InchUnit"] = (ProcessUnitBase unit, RecipeStep step) => ESCHV8InchUnit_Check(unit, step);
- endHelper[$"{Module}.ESCHV8InchUnit"] = (ProcessUnitBase unit, RecipeStep step) => ESCHV8InchUnit_End(unit, step);
- startHelper[$"{Module}.ProcessKitUnit"] = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_Start(unit, step);
- checkerHelper[$"{Module}.ProcessKitUnit"] = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_Check(unit, step);
- endHelper[$"{Module}.ProcessKitUnit"] = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_End(unit, step);
- startHelper[$"{Module}.HeliumPumpUnit"] = (ProcessUnitBase unit, RecipeStep step) => HeliumPumpUnit_Start(unit, step);
- checkerHelper[$"{Module}.HeliumPumpUnit"] = (ProcessUnitBase unit, RecipeStep step) => HeliumPumpUnit_Check(unit, step);
- endHelper[$"{Module}.HeliumPumpUnit"] = (ProcessUnitBase unit, RecipeStep step) => HeliumPumpUnit_End(unit, step);
- startHelper[$"{Module}.Kepler2200GasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => Kepler2200GasControlUnit_Start(unit, step);
- checkerHelper[$"{Module}.Kepler2200GasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => Kepler2200GasControlUnit_Check(unit, step);
- endHelper[$"{Module}.Kepler2200GasControlUnit"] = (ProcessUnitBase unit, RecipeStep step) => Kepler2200GasControlUnit_End(unit, step);
- startHelper[$"{Module}.HeaterUnit"] = (ProcessUnitBase unit, RecipeStep step) => HeaterUnit_Start(unit, step);
- checkerHelper[$"{Module}.HeaterUnit"] = (ProcessUnitBase unit, RecipeStep step) => HeaterUnit_Check(unit, step);
- endHelper[$"{Module}.HeaterUnit"] = (ProcessUnitBase unit, RecipeStep step) => HeaterUnit_End(unit, step);
- startHelper[$"{Module}.RFBoxUnit"] = (ProcessUnitBase unit, RecipeStep step) => RFBoxUnit_Start(unit, step);
- checkerHelper[$"{Module}.RFBoxUnit"] = (ProcessUnitBase unit, RecipeStep step) => RFBoxUnit_Check(unit, step);
- endHelper[$"{Module}.RFBoxUnit"] = (ProcessUnitBase unit, RecipeStep step) => RFBoxUnit_End(unit, step);
- startHelper[$"{Module}.MagnetUnit"] = (ProcessUnitBase unit, RecipeStep step) => MagnetUnit_Start(unit, step);
- checkerHelper[$"{Module}.MagnetUnit"] = (ProcessUnitBase unit, RecipeStep step) => MagnetUnit_Check(unit, step);
- endHelper[$"{Module}.MagnetUnit"] = (ProcessUnitBase unit, RecipeStep step) => MagnetUnit_End(unit, step);
- //_fdc = new Fdc(Module);
- }
- private RState PressureByPressureModeUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as PressureByPressureModeUnit;
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- _PressureToleranceChecker.IsStable = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- toleranceObjects.Add(new ToleranceObject("Pressure", ProcessUnit.StartValue, ProcessUnit.StartValueWarningRange, ProcessUnit.StartValueAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- _PressureToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- if (ProcessUnit.PressureUnitMode == PressureUnitMode.Pressure)
- {
- if (Chamber.SetPVPressure(ProcessUnit.StartValue))
- {
- return RState.Running;
- }
- }
- else if (ProcessUnit.PressureUnitMode == PressureUnitMode.Valve)
- {
- if (Chamber.SetPVPostion(ProcessUnit.StartValue))
- {
- return RState.Running;
- }
- }
- return RState.Failed;
- }
- private RState PressureByPressureModeUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as PressureByPressureModeUnit;
- if (ProcessUnit.EnableRamp)
- {
- if (ProcessUnit.PressureUnitMode == PressureUnitMode.Pressure)
- {
- if (Chamber.SetPVPressure(ProcessUnit.StartValue + (int)((ProcessUnit.TargetValue - ProcessUnit.StartValue) * step.RampFactor())))
- return RState.Running;
- else
- return RState.Failed;
- }
- else if (ProcessUnit.PressureUnitMode == PressureUnitMode.Valve)
- {
- if (Chamber.SetPVPostion(ProcessUnit.StartValue + (int)((ProcessUnit.TargetValue - ProcessUnit.StartValue) * step.RampFactor())))
- return RState.Running;
- else
- return RState.Failed;
- }
- }
- if (ProcessUnit.PressureUnitMode == PressureUnitMode.Pressure && ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _PressureToleranceChecker.Monitor(Chamber.PendulumPressure);
- }
- else if (ProcessUnit.PressureUnitMode == PressureUnitMode.Valve && ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _PressureToleranceChecker.Monitor(Chamber.PendulumPosition);
- }
- return RState.Running;
- }
- private void PressureByPressureModeUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as PressureByPressureModeUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _PressureToleranceChecker.End();
- }
- }
- private RState TCPUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- _isEnableMatchC1C2Offset = SC.GetValue<bool>($"{Module}.Match.EnableC1C2StepOffset");
- _matchC1C2OffsetValue = SC.GetValue<int>($"{Module}.Match.C1C2StepOffsetValue");
- var ProcessUnit = unit as TCPUnit;
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- toleranceObjects.Add(new ToleranceObject("RF", ProcessUnit.RFPower, ProcessUnit.RFPowerWarningRange, ProcessUnit.RFPowerAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- _RFToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- float p1;
- float p2;
- if (ProcessUnit.C1 > 0)
- {
- p1 = ProcessUnit.C1;
- }
- else
- {
- p1 = ProcessUnit.AutoC1;
- }
- if (ProcessUnit.C2 > 0)
- {
- p2 = ProcessUnit.C2;
- }
- else
- {
- p2 = ProcessUnit.AutoC2;
- }
- if (_isEnableMatchC1C2Offset == false || Math.Abs(Chamber.RFMatchC1 - p1) > _matchC1C2OffsetValue || Math.Abs(Chamber.RFMatchC2 - p2) > _matchC1C2OffsetValue)
- {
- if (!Chamber.SetMatchPosition(p1, p2))
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed duo to Source RF Match Write C1 C2 failed ");
- return RState.Failed;
- }
- }
- if (ProcessUnit.RFPower > 5)
- {
- Chamber.GeneratorSetpower(ProcessUnit.RFPower);
- Chamber.GeneratorPowerOn(true);
- }
- else
- {
- Chamber.GeneratorSetpower(0);
- Chamber.GeneratorPowerOn(false);
- }
- if (ProcessUnit.MatchWorkMode == MatchWorkMode.Auto)
- {
- Chamber.SetMatchWorkMode(MatchWorkMode.Auto);
- }
- else if (ProcessUnit.MatchWorkMode == MatchWorkMode.Manual)
- {
- Chamber.SetMatchWorkMode(MatchWorkMode.Manual);
- }
- _scRFPowerAlarmTime = SC.GetValue<double>($"{Chamber.Name}.Rf.ReflectPowerAlarmTime");
- rfMatchC1.Clear();
- rfMatchC1.Clear();
- rfMatchC1C2Index = 0;
- return RState.Running;
- }
- private RState TCPUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as TCPUnit;
- if (ProcessUnit.MaxReflectedPower > 0 && Chamber.ReflectPower > ProcessUnit.MaxReflectedPower && step.ElapsedTime() > _scRFPowerAlarmTime * 1000)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, RF Reflect Power:{Chamber.ReflectPower} exceeds the Max Limit:{ProcessUnit.MaxReflectedPower}");
- return RState.Failed;
- }
- if (step.ElapsedTime() > m_RecipeHead.RFHoldTime * 1000)
- {
- Chamber.GeneratorSetpower(0);
- Chamber.GeneratorPowerOn(false);
- return RState.Failed;
- }
- if (step.ElapsedTime() > rfMatchC1C2Index * 1000)
- {
- rfMatchC1.Add(Chamber.RFMatchC1);
- rfMatchC2.Add(Chamber.RFMatchC2);
- rfMatchC1C2Index += 1;
- }
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _RFToleranceChecker.Monitor(Chamber.ForwardPower);
- }
- return RState.Running;
- }
- private void TCPUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as TCPUnit;
- if (rfMatchC1.Count >= 6)
- {
- float allValue = 0;
- for (int i = 4; i < rfMatchC1.Count; i++)
- {
- allValue += rfMatchC1[i];
- }
- var average = allValue / (rfMatchC1.Count - 4);
- ProcessUnit.AutoC1 = (int)average;
- }
- if (rfMatchC2.Count >= 6)
- {
- float allValue = 0;
- for (int i = 4; i < rfMatchC2.Count; i++)
- {
- allValue += rfMatchC2[i];
- }
- var average = allValue / (rfMatchC2.Count - 4);
- ProcessUnit.AutoC2 = (int)average;
- }
- rfMatchC1.Clear();
- rfMatchC2.Clear();
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _RFToleranceChecker.End();
- }
- }
- private RState BiasUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- _isEnableBiasMatchC1C2Offset = SC.GetValue<bool>($"{Module}.BiasMatch.EnableC1C2StepOffset");
- _biasMatchC1C2OffsetValue = SC.GetValue<int>($"{Module}.BiasMatch.C1C2StepOffsetValue");
- var ProcessUnit = unit as BiasUnit;
- _BiasReflectPowerOverCount = 0;
- _BiasReflectPowerOverFlag = false;
- float p1;
- float p2;
- if (ProcessUnit.BiasC1 > 0)
- {
- p1 = ProcessUnit.BiasC1;
- }
- else
- {
- p1 = ProcessUnit.AutoBiasC1;
- }
- if (ProcessUnit.BiasC2 > 0)
- {
- p2 = ProcessUnit.BiasC2;
- }
- else
- {
- p2 = ProcessUnit.AutoBiasC2;
- }
- if (_isEnableBiasMatchC1C2Offset == false || Math.Abs(Chamber.BiasRFMatchC1 - p1) > _biasMatchC1C2OffsetValue || Math.Abs(Chamber.BiasRFMatchC2 - p2) > _biasMatchC1C2OffsetValue)
- {
- Chamber.SetBiasMatchPosition(p1, p2);
- }
- if (ProcessUnit.BiasRFPower > 5)
- {
- Chamber.GeneratorBiasPowerOn(true);
- if ((ProcessUnit.EnableRamp == false))
- {
- Chamber.GeneratorBiasSetpower(ProcessUnit.BiasRFPower);
- }
- }
- else
- {
- Chamber.GeneratorBiasPowerOn(false);
- Chamber.GeneratorBiasSetpower(0);
- }
- if (ProcessUnit.BiasMatchWorkMode == MatchWorkMode.Auto)
- {
- Chamber.SetBiasMatchWorkMode(MatchWorkMode.Auto);
- }
- else if (ProcessUnit.BiasMatchWorkMode == MatchWorkMode.Manual)
- {
- Chamber.SetBiasMatchWorkMode(MatchWorkMode.Manual);
- }
- if (ProcessUnit.BiasGeneratorMode == GeneratorMode.Pulsing)
- {
- Chamber.SetBiasPulseMode(true);
- Chamber.SetBiasPulseRateFreq(ProcessUnit.PulseRateFreq);
- Chamber.SetDiasPulseDutyCycle(ProcessUnit.PulseDutyCycle);
- }
- else
- {
- Chamber.SetBiasPulseMode(false);
- }
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- toleranceObjects.Add(new ToleranceObject("BiasRF", ProcessUnit.BiasRFPower, ProcessUnit.RFPowerWarningRange, ProcessUnit.RFPowerAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- _BiasRFToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- _scBiasRFPowerAlarmTime = SC.GetValue<double>($"{Chamber.Name}.BiasRf.ReflectPowerAlarmTime");
- biasRfMatchC1.Clear();
- biasRfMatchC1.Clear();
- biasRfMatchC1C2Index = 0;
- biasRFSetPointFlag = true;
- return RState.Running;
- }
- private RState BiasUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- //var _scPowerAlarmTime = SC.GetValue<double>($"{Chamber.Name}.BiasRf.PowerAlarmTime");
- var ProcessUnit = unit as BiasUnit;
- if (ProcessUnit.BiasMaxReflectedPower > 0 && Chamber.BiasReflectPower > ProcessUnit.BiasMaxReflectedPower && step.ElapsedTime() > _scBiasRFPowerAlarmTime * 1000)
- {
- if (!_BiasReflectPowerOverFlag)
- {
- _BiasReflectPowerOverFlag = true;
- LOG.Write(eEvent.WARN_PROCESS, Chamber.Module, $"Step:{step.StepNo} warning! Bias Reflect Power:{Chamber.BiasReflectPower} exceeds the Max Limit:{ProcessUnit.BiasMaxReflectedPower} in {_scBiasRFPowerAlarmTime}s");
- }
- ++_BiasReflectPowerOverCount;
- if (_BiasReflectPowerOverCount > 20)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, Bias Reflect Power:{Chamber.BiasReflectPower} exceeds the Max Limit:{ProcessUnit.BiasMaxReflectedPower} in {_scBiasRFPowerAlarmTime}s");
- return RState.Failed;
- }
- }
- if (_BiasReflectPowerOverFlag && ProcessUnit.BiasMaxReflectedPower > 0 && Chamber.BiasReflectPower < ProcessUnit.BiasMaxReflectedPower)
- {
- //标志位置为false 重新开始计算
- _BiasReflectPowerOverFlag = false;
- _BiasReflectPowerOverCount = 0;
- }
- if (m_RecipeHead.BiasRFHoldTime != null && step.ElapsedTime() > m_RecipeHead.BiasRFHoldTime * 1000)
- {
- Chamber.GeneratorBiasSetpower(0);
- Chamber.GeneratorBiasPowerOn(false);
- return RState.Failed;
- }
- if (step.ElapsedTime() > biasRfMatchC1C2Index * 1000)
- {
- biasRfMatchC1.Add(Chamber.BiasRFMatchC1);
- biasRfMatchC2.Add(Chamber.BiasRFMatchC2);
- biasRfMatchC1C2Index += 1;
- }
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _BiasRFToleranceChecker.Monitor(Chamber.BiasForwardPower);
- }
- if (ProcessUnit.EnableRamp)
- {
- //if (step.ElapsedTime() <= 500*cycleIndex)
- //{
- // return RState.Running;
- //}
- //cycleIndex += 1;
- if (ProcessUnit.TargetMode == TargetMode.Cycle)
- {
- if (biasRFSetPointFlag == true)
- {
- biasRFSetPointFlag = false;
- Chamber.GeneratorBiasSetpower((float)((ProcessUnit.BiasRFPower + (float)((float)(ProcessUnit.TargetBiasRFPower - ProcessUnit.BiasRFPower) / ((float)(loopsteps - 1) / (float)(currentStepIndex))))));
- }
- //float rampFactor = (float)currentStepIndex / (float)(loopsteps-1);
- //double rampFactor = step.RampFactor();
- //Chamber.GeneratorBiasSetpower((float)((ProcessUnit.BiasRFPower+ (ProcessUnit.TargetBiasRFPower - ProcessUnit.BiasRFPower)/(loopsteps)*currentStepIndex) + ((double)(ProcessUnit.TargetBiasRFPower - ProcessUnit.BiasRFPower) / ((double)loopsteps)) * rampFactor));
- }
- else
- {
- //double rampFactor = step.RampFactor();
- //Chamber.GeneratorBiasSetpower((float)(ProcessUnit.BiasRFPower + (ProcessUnit.TargetBiasRFPower - ProcessUnit.BiasRFPower) * rampFactor));
- }
- }
- return RState.Running;
- }
- private void BiasUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as BiasUnit;
- //Chamber.GeneratorBiasSetpower(0);
- //Chamber.GeneratorBiasPowerOn(false);
- if (biasRfMatchC1.Count >= 6)
- {
- float allValue = 0;
- for (int i = 4; i < biasRfMatchC1.Count; i++)
- {
- allValue += biasRfMatchC1[i];
- }
- var average = allValue / (biasRfMatchC1.Count - 4);
- ProcessUnit.AutoBiasC1 = (int)average;
- }
- if (biasRfMatchC2.Count >= 6)
- {
- float allValue = 0;
- for (int i = 4; i < biasRfMatchC2.Count; i++)
- {
- allValue += biasRfMatchC2[i];
- }
- var average = allValue / (biasRfMatchC2.Count - 4);
- ProcessUnit.AutoBiasC2 = (int)average;
- }
- biasRfMatchC1.Clear();
- biasRfMatchC1.Clear();
- biasRfMatchC1C2Index = 0;
- //cycleIndex = 0;
- biasRFSetPointFlag = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _BiasRFToleranceChecker.End();
- }
- }
- private RState GasControlUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.OpenValve(ValveType.GasFinal, true);
- var ProcessUnit = unit as GasControlUnit;
- if (ProcessUnit.Gas1 >= 1)
- {
- Chamber.FlowGas(0, ProcessUnit.Gas1);
- }
- else
- {
- Chamber.FlowGas(0, 0);
- }
- if (ProcessUnit.Gas2 >= 1)
- {
- Chamber.FlowGas(1, ProcessUnit.Gas2);
- }
- else
- {
- Chamber.FlowGas(1, 0);
- }
- if (ProcessUnit.Gas3 >= 1)
- {
- Chamber.FlowGas(2, ProcessUnit.Gas3);
- }
- else
- {
- Chamber.FlowGas(2, 0);
- }
- if (ProcessUnit.Gas4 >= 1)
- {
- Chamber.FlowGas(3, ProcessUnit.Gas4);
- }
- else
- {
- Chamber.FlowGas(3, 0);
- }
- if (ProcessUnit.Gas5 >= 1)
- {
- Chamber.FlowGas(4, ProcessUnit.Gas5);
- }
- else
- {
- Chamber.FlowGas(4, 0);
- }
- if (ProcessUnit.Gas6 >= 1)
- {
- Chamber.FlowGas(5, ProcessUnit.Gas6);
- }
- else
- {
- Chamber.FlowGas(5, 0);
- }
- if (ProcessUnit.Gas7 >= 1)
- {
- Chamber.FlowGas(6, ProcessUnit.Gas7);
- }
- else
- {
- Chamber.FlowGas(6, 0);
- }
- if (ProcessUnit.Gas8 >= 1)
- {
- Chamber.FlowGas(7, ProcessUnit.Gas8);
- }
- else
- {
- Chamber.FlowGas(7, 0);
- }
- _GasFlowToleranceChecker.IsStable = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- toleranceObjects.Add(new ToleranceObject("Gas1", ProcessUnit.Gas1, ProcessUnit.Gas1WarningRange, ProcessUnit.Gas1AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas2", ProcessUnit.Gas2, ProcessUnit.Gas2WarningRange, ProcessUnit.Gas2AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas3", ProcessUnit.Gas3, ProcessUnit.Gas3WarningRange, ProcessUnit.Gas3AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas4", ProcessUnit.Gas4, ProcessUnit.Gas4WarningRange, ProcessUnit.Gas4AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas5", ProcessUnit.Gas5, ProcessUnit.Gas5WarningRange, ProcessUnit.Gas5AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas6", ProcessUnit.Gas6, ProcessUnit.Gas6WarningRange, ProcessUnit.Gas6AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas7", ProcessUnit.Gas7, ProcessUnit.Gas7WarningRange, ProcessUnit.Gas7AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas8", ProcessUnit.Gas8, ProcessUnit.Gas8WarningRange, ProcessUnit.Gas8AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- _GasFlowToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- return RState.Running;
- }
- private RState GasControlUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as GasControlUnit;
- if (ProcessUnit.EnableRamp)
- {
- double rampFactor = step.RampFactor();
- Chamber.FlowGas(0, ProcessUnit.Gas1 + (ProcessUnit.Gas1Target - ProcessUnit.Gas1) * rampFactor);
- Chamber.FlowGas(1, ProcessUnit.Gas2 + (ProcessUnit.Gas2Target - ProcessUnit.Gas2) * rampFactor);
- Chamber.FlowGas(2, ProcessUnit.Gas3 + (ProcessUnit.Gas3Target - ProcessUnit.Gas3) * rampFactor);
- Chamber.FlowGas(3, ProcessUnit.Gas4 + (ProcessUnit.Gas4Target - ProcessUnit.Gas4) * rampFactor);
- Chamber.FlowGas(4, ProcessUnit.Gas5 + (ProcessUnit.Gas5Target - ProcessUnit.Gas5) * rampFactor);
- Chamber.FlowGas(5, ProcessUnit.Gas6 + (ProcessUnit.Gas6Target - ProcessUnit.Gas6) * rampFactor);
- Chamber.FlowGas(6, ProcessUnit.Gas7 + (ProcessUnit.Gas7Target - ProcessUnit.Gas7) * rampFactor);
- Chamber.FlowGas(7, ProcessUnit.Gas8 + (ProcessUnit.Gas8Target - ProcessUnit.Gas8) * rampFactor);
- }
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _GasFlowToleranceChecker.Monitor(Chamber.MFC1FeedBack, Chamber.MFC2FeedBack, Chamber.MFC3FeedBack, Chamber.MFC4FeedBack, Chamber.MFC5FeedBack, Chamber.MFC6FeedBack, Chamber.MFC7FeedBack, Chamber.MFC8FeedBack);
- }
- return RState.Running;
- }
- private void GasControlUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as GasControlUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _GasFlowToleranceChecker.End();
- }
- }
- private RState VenusSEGasControlUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.OpenValve(ValveType.GasFinal, true);
- var ProcessUnit = unit as VenusSEGasControlUnit;
- Chamber.FlowGas(0, ProcessUnit.Gas1);
- if (ProcessUnit.Gas1 >= 1)
- {
- Chamber.OpenValve(ValveType.PV11, true);
- }
- Chamber.FlowGas(1, ProcessUnit.Gas2);
- if (ProcessUnit.Gas2 >= 1)
- {
- Chamber.OpenValve(ValveType.PV21, true);
- }
- Chamber.FlowGas(2, ProcessUnit.Gas3);
- if (ProcessUnit.Gas3 >= 1)
- {
- Chamber.OpenValve(ValveType.PV31, true);
- }
- Chamber.FlowGas(3, ProcessUnit.Gas4);
- if (ProcessUnit.Gas4 >= 1)
- {
- Chamber.OpenValve(ValveType.PV41, true);
- }
- Chamber.FlowGas(4, ProcessUnit.Gas5);
- if (ProcessUnit.Gas5 >= 1)
- {
- Chamber.OpenValve(ValveType.PV51, true);
- }
- Chamber.FlowGas(5, ProcessUnit.Gas6);
- if (ProcessUnit.Gas6 >= 1)
- {
- Chamber.OpenValve(ValveType.PV61, true);
- }
- Chamber.FlowGas(6, ProcessUnit.Gas7);
- if (ProcessUnit.Gas7 >= 1)
- {
- Chamber.OpenValve(ValveType.PV71, true);
- }
- Chamber.FlowGas(7, ProcessUnit.Gas8);
- if (ProcessUnit.Gas8 >= 1)
- {
- Chamber.OpenValve(ValveType.PV81, true);
- }
- Chamber.FlowGas(8, ProcessUnit.Gas9);
- if (ProcessUnit.Gas9 >= 1)
- {
- Chamber.OpenValve(ValveType.PV91, true);
- }
- Chamber.FlowGas(9, ProcessUnit.Gas10);
- if (ProcessUnit.Gas10 >= 1)
- {
- Chamber.OpenValve(ValveType.PVA1, true);
- }
- Chamber.FlowGas(10, ProcessUnit.Gas11);
- if (ProcessUnit.Gas11 >= 1)
- {
- Chamber.OpenValve(ValveType.PVB1, true);
- }
- Chamber.FlowGas(11, ProcessUnit.Gas12);
- if (ProcessUnit.Gas12 >= 1)
- {
- Chamber.OpenValve(ValveType.PVC1, true);
- }
- _GasFlowToleranceChecker.IsStable = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- toleranceObjects.Add(new ToleranceObject("Gas1", ProcessUnit.Gas1, ProcessUnit.Gas1WarningRange, ProcessUnit.Gas1AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas2", ProcessUnit.Gas2, ProcessUnit.Gas2WarningRange, ProcessUnit.Gas2AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas3", ProcessUnit.Gas3, ProcessUnit.Gas3WarningRange, ProcessUnit.Gas3AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas4", ProcessUnit.Gas4, ProcessUnit.Gas4WarningRange, ProcessUnit.Gas4AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas5", ProcessUnit.Gas5, ProcessUnit.Gas5WarningRange, ProcessUnit.Gas5AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas6", ProcessUnit.Gas6, ProcessUnit.Gas6WarningRange, ProcessUnit.Gas6AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas7", ProcessUnit.Gas7, ProcessUnit.Gas7WarningRange, ProcessUnit.Gas7AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas8", ProcessUnit.Gas8, ProcessUnit.Gas8WarningRange, ProcessUnit.Gas8AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas9", ProcessUnit.Gas9, ProcessUnit.Gas9WarningRange, ProcessUnit.Gas9AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas10", ProcessUnit.Gas10, ProcessUnit.Gas10WarningRange, ProcessUnit.Gas10AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas11", ProcessUnit.Gas11, ProcessUnit.Gas11WarningRange, ProcessUnit.Gas11AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas12", ProcessUnit.Gas12, ProcessUnit.Gas12WarningRange, ProcessUnit.Gas12AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- _GasFlowToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- return RState.Running;
- }
- private RState VenusSEGasControlUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as VenusSEGasControlUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _GasFlowToleranceChecker.Monitor(Chamber.MFC1FeedBack, Chamber.MFC2FeedBack, Chamber.MFC3FeedBack, Chamber.MFC4FeedBack, Chamber.MFC5FeedBack, Chamber.MFC6FeedBack, Chamber.MFC7FeedBack, Chamber.MFC8FeedBack, Chamber.MFC9FeedBack, Chamber.MFC10FeedBack, Chamber.MFC11FeedBack, Chamber.MFC12FeedBack);
- }
- return RState.Running;
- }
- private void VenusSEGasControlUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.OpenValve(ValveType.PV11, false);
- Chamber.OpenValve(ValveType.PV21, false);
- Chamber.OpenValve(ValveType.PV31, false);
- Chamber.OpenValve(ValveType.PV41, false);
- Chamber.OpenValve(ValveType.PV51, false);
- Chamber.OpenValve(ValveType.PV61, false);
- Chamber.OpenValve(ValveType.PV71, false);
- Chamber.OpenValve(ValveType.PV81, false);
- Chamber.OpenValve(ValveType.PV91, false);
- Chamber.OpenValve(ValveType.PVA1, false);
- Chamber.OpenValve(ValveType.PVB1, false);
- Chamber.OpenValve(ValveType.PVC1, false);
- Chamber.FlowGas(0, 0);
- Chamber.FlowGas(1, 0);
- Chamber.FlowGas(2, 0);
- Chamber.FlowGas(3, 0);
- Chamber.FlowGas(4, 0);
- Chamber.FlowGas(5, 0);
- Chamber.FlowGas(6, 0);
- Chamber.FlowGas(7, 0);
- Chamber.FlowGas(8, 0);
- Chamber.FlowGas(9, 0);
- Chamber.FlowGas(10, 0);
- Chamber.FlowGas(11, 0);
- Chamber.FlowGas(12, 0);
- var ProcessUnit = unit as VenusSEGasControlUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _GasFlowToleranceChecker.End();
- }
- }
- private RState VenusDEGasControlUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.OpenValve(ValveType.GasFinal, true);
- var ProcessUnit = unit as VenusDEGasControlUnit;
- Chamber.FlowGas(0, ProcessUnit.Gas1);
- if (ProcessUnit.Gas1 >= 1)
- {
- Chamber.OpenValve(ValveType.PV11, true);
- }
- Chamber.FlowGas(1, ProcessUnit.Gas2);
- if (ProcessUnit.Gas2 >= 1)
- {
- Chamber.OpenValve(ValveType.PV21, true);
- }
- Chamber.FlowGas(2, ProcessUnit.Gas3);
- if (ProcessUnit.Gas3 >= 1)
- {
- Chamber.OpenValve(ValveType.PV31, true);
- }
- Chamber.FlowGas(3, ProcessUnit.Gas4);
- if (ProcessUnit.Gas4 >= 1)
- {
- Chamber.OpenValve(ValveType.PV41, true);
- }
- Chamber.FlowGas(4, ProcessUnit.Gas5);
- if (ProcessUnit.Gas5 >= 1)
- {
- Chamber.OpenValve(ValveType.PV51, true);
- }
- Chamber.FlowGas(5, ProcessUnit.Gas6);
- if (ProcessUnit.Gas6 >= 1)
- {
- Chamber.OpenValve(ValveType.PV61, true);
- }
- Chamber.FlowGas(6, ProcessUnit.Gas7);
- if (ProcessUnit.Gas7 >= 1)
- {
- Chamber.OpenValve(ValveType.PV71, true);
- }
- Chamber.FlowGas(7, ProcessUnit.Gas8);
- if (ProcessUnit.Gas8 >= 1)
- {
- Chamber.OpenValve(ValveType.PV81, true);
- }
- Chamber.FlowGas(8, ProcessUnit.Gas9);
- if (ProcessUnit.Gas9 >= 1)
- {
- Chamber.OpenValve(ValveType.PV91, true);
- }
- Chamber.FlowGas(9, ProcessUnit.Gas10);
- if (ProcessUnit.Gas10 >= 1)
- {
- Chamber.OpenValve(ValveType.PVA1, true);
- }
- Chamber.FlowGas(10, ProcessUnit.Gas11);
- if (ProcessUnit.Gas11 >= 1)
- {
- Chamber.OpenValve(ValveType.PVB1, true);
- }
- Chamber.FlowGas(11, ProcessUnit.Gas12);
- if (ProcessUnit.Gas12 >= 1)
- {
- Chamber.OpenValve(ValveType.PVC1, true);
- }
- _GasFlowToleranceChecker.IsStable = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- toleranceObjects.Add(new ToleranceObject("Gas1", ProcessUnit.Gas1, ProcessUnit.Gas1WarningRange, ProcessUnit.Gas1AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas2", ProcessUnit.Gas2, ProcessUnit.Gas2WarningRange, ProcessUnit.Gas2AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas3", ProcessUnit.Gas3, ProcessUnit.Gas3WarningRange, ProcessUnit.Gas3AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas4", ProcessUnit.Gas4, ProcessUnit.Gas4WarningRange, ProcessUnit.Gas4AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas5", ProcessUnit.Gas5, ProcessUnit.Gas5WarningRange, ProcessUnit.Gas5AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas6", ProcessUnit.Gas6, ProcessUnit.Gas6WarningRange, ProcessUnit.Gas6AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas7", ProcessUnit.Gas7, ProcessUnit.Gas7WarningRange, ProcessUnit.Gas7AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas8", ProcessUnit.Gas8, ProcessUnit.Gas8WarningRange, ProcessUnit.Gas8AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas9", ProcessUnit.Gas9, ProcessUnit.Gas9WarningRange, ProcessUnit.Gas9AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas10", ProcessUnit.Gas10, ProcessUnit.Gas10WarningRange, ProcessUnit.Gas10AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas11", ProcessUnit.Gas11, ProcessUnit.Gas11WarningRange, ProcessUnit.Gas11AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- toleranceObjects.Add(new ToleranceObject("Gas12", ProcessUnit.Gas12, ProcessUnit.Gas12WarningRange, ProcessUnit.Gas12AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- _GasFlowToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- return RState.Running;
- }
- private RState VenusDEGasControlUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as VenusDEGasControlUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _GasFlowToleranceChecker.Monitor(Chamber.MFC1FeedBack, Chamber.MFC2FeedBack, Chamber.MFC3FeedBack, Chamber.MFC4FeedBack, Chamber.MFC5FeedBack, Chamber.MFC6FeedBack, Chamber.MFC7FeedBack, Chamber.MFC8FeedBack, Chamber.MFC9FeedBack, Chamber.MFC10FeedBack, Chamber.MFC11FeedBack, Chamber.MFC12FeedBack);
- }
- return RState.Running;
- }
- private void VenusDEGasControlUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.OpenValve(ValveType.PV11, false);
- Chamber.OpenValve(ValveType.PV21, false);
- Chamber.OpenValve(ValveType.PV31, false);
- Chamber.OpenValve(ValveType.PV41, false);
- Chamber.OpenValve(ValveType.PV51, false);
- Chamber.OpenValve(ValveType.PV61, false);
- Chamber.OpenValve(ValveType.PV71, false);
- Chamber.OpenValve(ValveType.PV81, false);
- Chamber.OpenValve(ValveType.PV91, false);
- Chamber.OpenValve(ValveType.PVA1, false);
- Chamber.OpenValve(ValveType.PVB1, false);
- Chamber.OpenValve(ValveType.PVC1, false);
- Chamber.FlowGas(0, 0);
- Chamber.FlowGas(1, 0);
- Chamber.FlowGas(2, 0);
- Chamber.FlowGas(3, 0);
- Chamber.FlowGas(4, 0);
- Chamber.FlowGas(5, 0);
- Chamber.FlowGas(6, 0);
- Chamber.FlowGas(7, 0);
- Chamber.FlowGas(8, 0);
- Chamber.FlowGas(9, 0);
- Chamber.FlowGas(10, 0);
- Chamber.FlowGas(11, 0);
- Chamber.FlowGas(12, 0);
- var ProcessUnit = unit as VenusDEGasControlUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _GasFlowToleranceChecker.End();
- }
- }
- private RState ESCHVUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ESCHVUnit;
- if (ProcessUnit.ESCClampValtage > 0)
- {
- Chamber.SetESCClampVoltage(ProcessUnit.ESCClampValtage);
- }
- else
- {
- Chamber.SetESCClampVoltage(0);
- Chamber.OnOffSetESCHV(false);
- }
- Chamber.SetBacksideHePressure(ProcessUnit.BacksideHelium);
- Chamber.SetBacksideHeThreshold(ProcessUnit.MinHeFlow, ProcessUnit.MaxHeFlow);
- //List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- //if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- //{
- // toleranceObjects.Add(new ToleranceObject("ESCTemperature", ProcessUnit.ESCTemperature, ProcessUnit.ESCTemperatureWarningRange, ProcessUnit.ESCTemperatureAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- // toleranceObjects.Add(new ToleranceObject("WallTemperature", ProcessUnit.WallTemperature, ProcessUnit.WallTemperatureWarningRange, ProcessUnit.WallTemperatureAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
- // _HeliumToleranceChecker.Start(toleranceObjects);
- //}
- return RState.Running;
- }
- private RState ESCHVUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ESCHVUnit;
- if (Chamber.BackSideHeOutOfRange && step.ElapsedTime() > ProcessUnit.CheckDelay)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, Backside Helium out of range.");
- return RState.Failed;
- }
- //if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- //{
- // return _HeliumToleranceChecker.Monitor(Chamber.ESCTemperature,Chamber.WallTemperature);
- //}
- return RState.Running;
- }
- private void ESCHVUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.SetBacksideHeThreshold(0, 0);
- //var ProcessUnit = unit as ESCHVUnit;
- //if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- //{
- // _HeliumToleranceChecker.End();
- //}
- }
- private RState ESCHV8InchUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ESCHV8InchUnit;
- if (ProcessUnit.ESCClampValtage > 0)
- {
- Chamber.SetESCClampVoltage(ProcessUnit.ESCClampValtage);
- }
- else
- {
- Chamber.SetESCClampVoltage(0);
- Chamber.OnOffSetESCHV(false);
- }
- Chamber.SetBacksideHePressure(ProcessUnit.BacksideHelium);
- Chamber.SetBacksideOutHePressure(ProcessUnit.BacksideOutHelium);
- Chamber.SetBacksideHeThreshold(ProcessUnit.MinHeFlow, ProcessUnit.MaxHeFlow);
- Chamber.SetBacksideOutHeThreshold(ProcessUnit.MinOutHeFlow, ProcessUnit.MaxOutHeFlow);
- return RState.Running;
- }
- private RState ESCHV8InchUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ESCHV8InchUnit;
- if (Chamber.BackSideHeOutOfRange && step.ElapsedTime() > ProcessUnit.CheckDelay)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, Backside Helium1 out of range.");
- return RState.Failed;
- }
- if (Chamber.BackSideOutHeOutOfRange && step.ElapsedTime() > ProcessUnit.OutCheckDelay)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, Backside Helium2 out of range.");
- return RState.Failed;
- }
- return RState.Running;
- }
- private void ESCHV8InchUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.SetBacksideHeThreshold(0, 0);
- Chamber.SetBacksideOutHeThreshold(0, 0);
- }
- private RState ProcessKitUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ProcessKitUnit;
- if (Chamber.SetLiftPin(ProcessUnit.LiftPinPostion, out string reason))
- {
- return RState.Running;
- }
- else
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed. Target Position:{ProcessUnit.LiftPinPostion}");
- return RState.Failed;
- }
- }
- private RState ProcessKitUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- //var ProcessUnit = unit as ProcessKitUnit;
- return RState.Running;
- }
- private void ProcessKitUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- }
- private RState HeliumPumpUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as HeliumPumpUnit;
- if (!ProcessUnit.HeliumPumpState)
- return RState.Running;
- if (Chamber.ChamberWaferSize == 8)
- {
- if (Chamber.SetHeliumPump(ProcessUnit.HeliumPumpState) && Chamber.SetOutHeliumPump(ProcessUnit.HeliumPumpState))
- {
- return RState.Running;
- }
- else
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed. Target Helium Pump:{ProcessUnit.HeliumPumpState}");
- return RState.Failed;
- }
- }
- else
- {
- if (Chamber.SetHeliumPump(ProcessUnit.HeliumPumpState))
- {
- return RState.Running;
- }
- else
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed. Target Helium Pump:{ProcessUnit.HeliumPumpState}");
- return RState.Failed;
- }
- }
- }
- private RState HeliumPumpUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- return RState.Running;
- }
- private void HeliumPumpUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as HeliumPumpUnit;
- if (!ProcessUnit.HeliumPumpState)
- return;
- if (Chamber.ChamberWaferSize == 8)
- {
- if (!Chamber.SetHeliumPump(false) || !Chamber.SetOutHeliumPump(false))
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed. Target Helium Pump:{ProcessUnit.HeliumPumpState}");
- }
- }
- else
- {
- if (!Chamber.SetHeliumPump(false))
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed. Target Helium Pump:{ProcessUnit.HeliumPumpState}");
- }
- }
- }
- private RState MagnetUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as MagnetUnit;
- if (Chamber.MagnetSetpower(ProcessUnit.MagnetIntensity) && Chamber.SetFieldRatio(ProcessUnit.FieldRatio) && Chamber.SetWaveform(ProcessUnit.MagnetWaveform))
- {
- return RState.Running;
- }
- else
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed duo to Magnet Write Intensity failed");
- return RState.Failed;
- }
- }
- private RState MagnetUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessMagnetUnit = unit as MagnetUnit;
- if (ProcessMagnetUnit.ToleranceMode != ToleranceMode.None)
- {
- return _MagnetToleranceChecker.Monitor(Chamber.MagnetIntensity);
- }
- return RState.Running;
- }
- private void MagnetUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessMagnetUnit = unit as MagnetUnit;
- if (ProcessMagnetUnit.ToleranceMode != ToleranceMode.None)
- {
- _MagnetToleranceChecker.End();
- }
- }
- #region Kepler2200 Units
- private RState Kepler2200PressureByPressureModeUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as Kepler2200PressureByPressureModeUnit;
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- _PressureToleranceChecker.IsStable = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- toleranceObjects.Add(new ToleranceObject("Pressure", ProcessUnit.StartValue, ProcessUnit.StartValueWarningRange, ProcessUnit.StartValueAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- _PressureToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- if (ProcessUnit.PressureUnitMode == PressureUnitMode.Pressure)
- {
- if (Chamber.SetPVPressure(ProcessUnit.StartValue))
- {
- return RState.Running;
- }
- }
- else if (ProcessUnit.PressureUnitMode == PressureUnitMode.Valve)
- {
- if (Chamber.SetPVPostion(ProcessUnit.StartValue))
- {
- return RState.Running;
- }
- }
- return RState.Failed;
- }
- private RState Kepler2200PressureByPressureModeUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as Kepler2200PressureByPressureModeUnit;
- if (ProcessUnit.PressureUnitMode == PressureUnitMode.Pressure && ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _PressureToleranceChecker.Monitor(Chamber.PendulumPressure);
- }
- else if (ProcessUnit.PressureUnitMode == PressureUnitMode.Valve && ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _PressureToleranceChecker.Monitor(Chamber.PendulumPosition);
- }
- return RState.Running;
- }
- private void Kepler2200PressureByPressureModeUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as Kepler2200PressureByPressureModeUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _PressureToleranceChecker.End();
- }
- }
- private RState RFUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- _isEnableMatchC1C2Offset = SC.GetValue<bool>($"{Module}.Match.EnableC1C2StepOffset");
- _matchC1C2OffsetValue = SC.GetValue<int>($"{Module}.Match.C1C2StepOffsetValue");
- var ProcessUnit = unit as RFUnit;
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- toleranceObjects.Add(new ToleranceObject("RFPower", ProcessUnit.RFPower, ProcessUnit.RFPowerWarningRange, ProcessUnit.RFPowerAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("RFReflectedPower", 0, ProcessUnit.RFReflectedPowerWarningRange, ProcessUnit.RFReflectedPowerAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- _RFToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- float p1;
- float p2;
- if (ProcessUnit.C1 > 0)
- {
- p1 = ProcessUnit.C1;
- }
- else
- {
- p1 = ProcessUnit.AutoC1;
- }
- if (ProcessUnit.C2 > 0)
- {
- p2 = ProcessUnit.C2;
- }
- else
- {
- p2 = ProcessUnit.AutoC2;
- }
- if (_isEnableMatchC1C2Offset == false || Math.Abs(Chamber.RFMatchC1 - p1) > _matchC1C2OffsetValue || Math.Abs(Chamber.RFMatchC2 - p2) > _matchC1C2OffsetValue)
- {
- if (!Chamber.SetMatchPosition(p1, p2))
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed duo to Source RF Match Write C1 C2 failed ");
- return RState.Failed;
- }
- }
- if (ProcessUnit.RFPower > 5)
- {
- Chamber.GeneratorSetpower(ProcessUnit.RFPower);
- Chamber.GeneratorPowerOn(true);
- }
- else
- {
- //Chamber.GeneratorSetpower(0);
- Chamber.GeneratorPowerOn(false);
- }
- if (ProcessUnit.MatchWorkMode == MatchWorkMode.Auto)
- {
- Chamber.SetMatchWorkMode(MatchWorkMode.Auto);
- }
- else if (ProcessUnit.MatchWorkMode == MatchWorkMode.Manual)
- {
- Chamber.SetMatchWorkMode(MatchWorkMode.Manual);
- }
- _scRFPowerAlarmTime = SC.GetValue<double>($"{Chamber.Name}.Rf.ReflectPowerAlarmTime");
- rfMatchC1.Clear();
- rfMatchC1.Clear();
- rfMatchC1C2Index = 0;
- //_RfReflectPowerOverCounter = 0;
- return RState.Running;
- }
- private RState RFUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as RFUnit;
- //if (ProcessUnit.MaxReflectedPower > 0 && Chamber.ReflectPower > ProcessUnit.MaxReflectedPower && step.ElapsedTime() > _scRFPowerAlarmTime * 1000)
- //{
- // _RfReflectPowerOverCounter += 1;
- // if (_RfReflectPowerOverCounter > 10)
- // {
- // LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, RF Reflect Power:{Chamber.ReflectPower} exceeds the Max Limit:{ProcessUnit.MaxReflectedPower}");
- // return RState.Failed;
- // }
- //}
- //else
- //{
- // _RfReflectPowerOverCounter = 0;
- //}
- if (Chamber.ForwardPower>5 && step.ElapsedTime() > m_RecipeHead.RFHoldTime * 1000)
- {
- Chamber.GeneratorSetpower(0);
- Chamber.GeneratorPowerOn(false);
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, RF On Over {m_RecipeHead.RFHoldTime} s");
- return RState.Failed;
- }
- if (step.ElapsedTime() > rfMatchC1C2Index * 1000)
- {
- rfMatchC1.Add(Chamber.RFMatchC1);
- rfMatchC2.Add(Chamber.RFMatchC2);
- rfMatchC1C2Index += 1;
- }
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _RFToleranceChecker.Monitor(Chamber.ForwardPower,Chamber.ReflectPower);
- }
- return RState.Running;
- }
- private void RFUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as RFUnit;
- if (rfMatchC1.Count >= 6)
- {
- float allValue = 0;
- for (int i = 4; i < rfMatchC1.Count; i++)
- {
- allValue += rfMatchC1[i];
- }
- var average = allValue / (rfMatchC1.Count - 4);
- ProcessUnit.AutoC1 = (int)average;
- }
- if (rfMatchC2.Count >= 6)
- {
- float allValue = 0;
- for (int i = 4; i < rfMatchC2.Count; i++)
- {
- allValue += rfMatchC2[i];
- }
- var average = allValue / (rfMatchC2.Count - 4);
- ProcessUnit.AutoC2 = (int)average;
- }
- rfMatchC1.Clear();
- rfMatchC2.Clear();
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _RFToleranceChecker.End();
- }
- }
- private RState Kepler2200GasControlUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- Chamber.OpenValve(ValveType.GasFinal, true);
- var ProcessUnit = unit as Kepler2200GasControlUnit;
- if (ProcessUnit.Gas1 >= 1)
- {
- Chamber.FlowGas(0, ProcessUnit.Gas1);
- }
- else
- {
- Chamber.FlowGas(0, 0);
- }
- if (ProcessUnit.Gas2 >= 1)
- {
- Chamber.FlowGas(1, ProcessUnit.Gas2);
- }
- else
- {
- Chamber.FlowGas(1, 0);
- }
- if (ProcessUnit.Gas3 >= 1)
- {
- Chamber.FlowGas(2, ProcessUnit.Gas3);
- }
- else
- {
- Chamber.FlowGas(2, 0);
- }
- if (ProcessUnit.Gas4 >= 1)
- {
- Chamber.FlowGas(3, ProcessUnit.Gas4);
- }
- else
- {
- Chamber.FlowGas(3, 0);
- }
- if (ProcessUnit.Gas5 >= 1)
- {
- Chamber.FlowGas(4, ProcessUnit.Gas5);
- }
- else
- {
- Chamber.FlowGas(4, 0);
- }
- if (ProcessUnit.Gas6 >= 1)
- {
- Chamber.FlowGas(5, ProcessUnit.Gas6);
- }
- else
- {
- Chamber.FlowGas(5, 0);
- }
- if (ProcessUnit.Gas7 >= 1)
- {
- Chamber.FlowGas(6, ProcessUnit.Gas7);
- }
- else
- {
- Chamber.FlowGas(6, 0);
- }
- if (ProcessUnit.Gas8 >= 1)
- {
- Chamber.FlowGas(7, ProcessUnit.Gas8);
- }
- else
- {
- Chamber.FlowGas(7, 0);
- }
- _GasFlowToleranceChecker.IsStable = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- toleranceObjects.Add(new ToleranceObject("Gas1", ProcessUnit.Gas1, ProcessUnit.Gas1WarningRange, ProcessUnit.Gas1AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("Gas2", ProcessUnit.Gas2, ProcessUnit.Gas2WarningRange, ProcessUnit.Gas2AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("Gas3", ProcessUnit.Gas3, ProcessUnit.Gas3WarningRange, ProcessUnit.Gas3AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("Gas4", ProcessUnit.Gas4, ProcessUnit.Gas4WarningRange, ProcessUnit.Gas4AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("Gas5", ProcessUnit.Gas5, ProcessUnit.Gas5WarningRange, ProcessUnit.Gas5AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("Gas6", ProcessUnit.Gas6, ProcessUnit.Gas6WarningRange, ProcessUnit.Gas6AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("Gas7", ProcessUnit.Gas7, ProcessUnit.Gas7WarningRange, ProcessUnit.Gas7AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- toleranceObjects.Add(new ToleranceObject("Gas8", ProcessUnit.Gas8, ProcessUnit.Gas8WarningRange, ProcessUnit.Gas8AlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- _GasFlowToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- return RState.Running;
- }
- private RState Kepler2200GasControlUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as Kepler2200GasControlUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _GasFlowToleranceChecker.Monitor(Chamber.MFC1FeedBack, Chamber.MFC2FeedBack, Chamber.MFC3FeedBack, Chamber.MFC4FeedBack, Chamber.MFC5FeedBack, Chamber.MFC6FeedBack, Chamber.MFC7FeedBack, Chamber.MFC8FeedBack);
- }
- return RState.Running;
- }
- private void Kepler2200GasControlUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as Kepler2200GasControlUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _GasFlowToleranceChecker.End();
- }
- }
- private RState RFBoxUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as RFBoxUnit;
- if (Chamber.SetRFBoxC1Position(ProcessUnit.C1))
- {
- return RState.Running;
- }
- else
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed duo to RFBox Write C1 failed ");
- return RState.Failed;
- }
- }
- private RState RFBoxUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- return RState.Running;
- }
- private void RFBoxUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- }
- private RState HeaterUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as HeaterUnit;
- bool isAutoRatio = SC.GetValue<bool>($"{Chamber.Module}.HighTemperatureHeater.IsEnableAutoRatio");
- var position = (HighTemperatureHeaterPosition)Enum.Parse(typeof(HighTemperatureHeaterPosition), ProcessUnit.SuspectPosition.ToString());
- if (!Chamber.HighTemperatureHeaterGotoPosition(position))
- {
- return RState.Failed;
- }
- if (ProcessUnit.HeaterTemp > 0)
- {
- Chamber.SetHighTemperatureHeaterTemperature(ProcessUnit.HeaterTemp);
- }
- if (ProcessUnit.HeaterRatio > 0 && isAutoRatio==false)
- {
- Chamber.SetHighTemperatureHeaterRatio(ProcessUnit.HeaterRatio);
- }
- _HighTemperatureToleranceChecker.IsStable = true;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
- toleranceObjects.Add(new ToleranceObject("HighTemperatureHeater Temperature", ProcessUnit.HeaterTemp, ProcessUnit.HeaterTempWarningRange, ProcessUnit.HeaterTempAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode, 10));
- _HighTemperatureToleranceChecker.Start(toleranceObjects, step.Type == StepType.Stable);
- }
- return RState.Running;
- }
- private RState HeaterUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as HeaterUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- return _HighTemperatureToleranceChecker.Monitor(Chamber.ChamberTemperature);
- }
- if (step.ElapsedTime() >= step.Time * 1000 - 500 && step.Type == StepType.Time)
- {
- if (ProcessUnit.SuspectPosition.ToString() != Chamber.HighTemperatureHeaterPosition.ToString())
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed duo to High Temperature Heater 在setp结束前未到达 {ProcessUnit.SuspectPosition.ToString()}");
- return RState.Failed;
- }
- }
- return RState.Running;
- }
- private void HeaterUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as HeaterUnit;
- if (ProcessUnit.ToleranceMode != ToleranceMode.None)
- {
- _HighTemperatureToleranceChecker.End();
- }
- }
- #endregion
- public bool LoadMethods(ProcessUnitBase unit)
- {
- var className = $"{Module}.{unit.GetType().Name}";
- if (startHelper.ContainsKey(className) && checkerHelper.ContainsKey(className) && endHelper.ContainsKey(className))
- {
- unit.starter = startHelper[className];
- unit.checker = checkerHelper[className];
- unit.end = endHelper[className];
- return true;
- }
- return false;
- }
- //public void fdcStop()
- //{
- // if (m_RecipeHead.Type == RecipeType.Process)
- // {
- // _fdc.Stop();
- // }
- //}
- //public void loopStep(bool isloop,int loopCount,int loopIndex)
- //{
- // isLoop = isloop;
- // loopsteps=loopCount;
- // currentStepIndex = loopIndex;
- //}
- private RState stepStarter(RecipeStep step)
- {
- step.StartStepTimer();
- if (_isInstalledEPD)
- {
- Chamber.EPDStepStart(step.EPDConfig, step.StepNo);
- if (step.Type == StepType.EndPoint)
- {
- _lastEPDStepTimeStopwatch.Restart();
- }
- }
- return RState.Running;
- }
- private RState stepChecker(RecipeStep step)
- {
- switch (step.Type)
- {
- case StepType.Time:
- //_fdc.OnMonitor();
- return step.ElapsedTime() >= step.Time * 1000 ? RState.End : RState.Running;
- case StepType.OverEtch:
- lastEPDStepTime = step.OverEtchPercent != null ? _lastEPDStepTimeStopwatch.ElapsedMilliseconds * step.OverEtchPercent / 100 : 0;
- return step.ElapsedTime() >= lastEPDStepTime ? RState.End : RState.Running;
- case StepType.EndPoint:
- if (step.MaxEndPointTime != null && step.ElapsedTime() > step.MaxEndPointTime * 1000)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} timeout, did not capture endpoint signal in {step.MaxEndPointTime} seconds");
- return RState.Failed;
- }
- else
- {
- if (Chamber.EPDCaptured)
- {
- if (step.MinEndPointTime != null && step.ElapsedTime() < step.MinEndPointTime * 1000)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} timeout, capture endpoint signal less than {step.MinEndPointTime} seconds");
- return RState.Failed;
- }
- else
- {
- return RState.End;
- }
- }
- else
- {
- return RState.Running;
- }
- //return Chamber.EPDCaptured ? RState.End : RState.Running;
- }
- case StepType.Stable:
- if (step.ElapsedTime() >= step.Time * 1000)
- {
- LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} timeout, did not Stable in {step.Time} seconds");
- return RState.Failed;
- }
- else
- {
- if (_GasFlowToleranceChecker.IsStable && _PressureToleranceChecker.IsStable && _HighTemperatureToleranceChecker.IsStable && step.ElapsedTime() >= 2000)
- {
- //_StableStopWach
- return RState.End;
- }
- else
- {
- //_StableStopWach.
- }
- }
- return RState.Running;
- }
- return RState.Running;
- }
- private RState stepEnder(RecipeStep step)
- {
- //if (step.Type == StepType.EndPoint)
- //{
- // Chamber.EPDStepStop();
- //}
- EAP_StepTime = Convert.ToInt32(step.ElapsedTime() / 1000);
- if (_isInstalledEPD)
- {
- Chamber.EPDStepStop();
- if (step.Type == StepType.EndPoint)
- {
- _lastEPDStepTimeStopwatch.Stop();
- }
- }
- //if (m_RecipeHead.Type == RecipeType.Process)
- //{
- // ProcessDataRecorder.StepEnd(_RecipeId, step.StepNo, _fdc.DataList);
- //}
- return RState.End;
- }
- public bool LoadStepFuns(RecipeStep step)
- {
- step.starter = stepStarter;
- step.checker = stepChecker;
- step.ender = stepEnder;
- //for (int i = 0; i < step.LstUnit.Count; i++)
- //{
- // var items = (step.LstUnit[i] as ProcessUnitBase).GetFDCItems();
- // if (items != null && items.Count > 0)
- // {
- // _fdc.AppendKeyValues(items);
- // }
- //}
- return true;
- }
- }
- }
|