123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Routine;
- using MECF.Framework.Common.Utilities;
- using CyberX8_Core;
- using CyberX8_RT.Devices.AXIS;
- using CyberX8_RT.Devices.AXIS.CANOpen;
- using CyberX8_RT.Modules.PUF;
- using CyberX8_RT.Modules;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using MECF.Framework.Common.CommonData.Loader;
- using CyberX8_RT.Modules.Transporter;
- using MECF.Framework.Common.WaferHolder;
- namespace CyberX8_RT.Devices.Loader
- {
- public class LoaderLoadRoutine : RoutineBase, IRoutine
- {
- private enum LoadStep
- {
- CheckPreCondition,
- WSClampOn,
- WSSideClampOn,
- WSSideClampOnCheck,
- BernoulliBladderOn,
- BernoulliBladderOnCheck,
- TranslateBladderOff,
- TranslateBladderOffCheck,
- CRSGotoUnlock,
- CRSGotoUnlockWait,
- BernoulliN2On,
- BernoulliN2OnCheck,
- BernoulliBladderOff,
- BernoulliBladderOffCheck,
- TiltGotoFloat,
- TiltGotoFloatWait,
- ReBernoulliBladderOn,
- ReBernoulliBladderOnCheck,
- TiltGotoVertical,
- TiltGotoVerticalWait,
- CRSVacuumValue,
- CRSVacuumValueCheck,
- ShuttleGotoClose,
- ShuttleGotoCloseWait,
- ReCRSVacuumValue,
- ReCRSVacuumValueCheck,
- DoorLockOn,
- DoorLockOnCheck,
- WSBladderOn,
- WSBladderOnCheck,
- TransBladderOn,
- TransBladderOnCheck,
- TransHighOff,
- TransHighOffCheck,
- CRSGotoSetUp,
- CRSGotoSetUpWait,
- CRSGotoLock,
- CRSGotoLockWait,
- BernoulliN2Off,
- BernoulliN2OffCheck,
- WSBladderOff,
- WSBladderOffCheck,
- CRSReleaseDelay,
- CRSVacuumOff,
- CRSVacuumOffCheck,
- TranslateBladderReleaseDelay,
- ReTranslateBladderOff,
- ReTranslateBladderOffCheck,
- TranslateHighPresOff,
- TranslateHighPresOffCheck,
- HomingCRSAxis,
- HomingCRSAxisWait,
- CRSHomedGotoSetUp,
- CRSHomedGotoSetUpCheck,
- End
- }
- #region 内部变量
- private string _side = "";
- private int _crsVacuumReleaseDelayInMilliseconds = 250;
- private int _translateOutDelayInMilliseconds = 250;
- private JetAxisBase _crsAxis;
- private JetAxisBase _tiltAxis;
- private JetAxisBase _shuttleAxis;
- private JetAxisBase _rotationAxis;
- private LoaderCommonDevice _loaderCommonDevice;
- private LoaderSideDevice _sideDevice;
- private LoaderCommonWaferHolderSideClampRoutine _waferHolderSideClampRoutine;
- private LoaderSideBernoulliBladderRoutine _bernoulliBladderRoutine;
- private LoaderSideTransBladderRoutine _transBladderRoutine;
- private LoaderSideBernoulliN2PressureRoutine _bernoulliN2PressureRoutine;
- private LoaderSideVacuumAndLevelCheckRoutineRoutine _vacuumAndLevelCheckRoutineRoutine;
- private LoaderSideVacuumLevelCheckRoutine _vacuumLevelCheckRoutine;
- private LoaderSideDoorLockRoutine _doorLockRoutine;
- private LoaderSideWhBladderRoutine _whBladderRoutine;
- private LoaderSideTransHighRoutine _transHighPressureRoutine;
- #endregion
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="module"></param>
- public LoaderLoadRoutine(string module,string side) : base(module)
- {
- _side = side;
- }
-
- /// <summary>
- /// 中止
- /// </summary>
- public void Abort()
- {
- Runner.Stop("Manual Abort");
- }
- /// <summary>
- /// 监控
- /// </summary>
- /// <returns></returns>
- public RState Monitor()
- {
- Runner.Run(LoadStep.CheckPreCondition,CheckPreCondition,_delay_1ms)
- //1.0 WS Clamp On
- .Run(LoadStep.WSClampOn, WaferHolderClampOn,_delay_1ms)
- //1.1 WSSideClampOn
- .Run(LoadStep.WSSideClampOn, () => { return _waferHolderSideClampRoutine.Start(true) == RState.Running; },_delay_1ms)
- .WaitWithStopCondition(LoadStep.WSSideClampOnCheck, () => { return CommonFunction.CheckRoutineEndState(_waferHolderSideClampRoutine); },
- () => CheckRoutineStopStatus(_waferHolderSideClampRoutine,"WaferHolder Side Clamp on failed"))
- //1.2 BernoulliBladderOn
- .Run(LoadStep.BernoulliBladderOn, () => { return _bernoulliBladderRoutine.Start(true) == RState.Running; },_delay_1ms)
- .WaitWithStopCondition(LoadStep.BernoulliBladderOnCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliBladderRoutine); },
- () => CheckRoutineStopStatus(_bernoulliBladderRoutine, "BernoulliBladder On failed"))
- //1.3 TranslateBladderOff
- .Run(LoadStep.TranslateBladderOff, () => { return _transBladderRoutine.Start(false) == RState.Running; },_delay_1ms)
- .WaitWithStopCondition(LoadStep.TranslateBladderOffCheck, () => { return CommonFunction.CheckRoutineEndState(_transBladderRoutine); },
- () => CheckRoutineStopStatus(_transBladderRoutine,"TransBladder Off failed"))
- //1.4 CRS Goto Unlock
- .Run(LoadStep.CRSGotoUnlock, () => { return AxisPosition(_crsAxis,"Unlock"); }, NullFun, _delay_1ms)
- .WaitWithStopCondition(LoadStep.CRSGotoUnlockWait, () => { return _crsAxis.Status == RState.End; },
- ()=>CheckAxisMotionStopStatus(_crsAxis))
- //1.5 BernoulliN2 On
- .Run(LoadStep.BernoulliN2On, () => { return _bernoulliN2PressureRoutine.Start(true)==RState.Running; },_delay_1ms)
- .WaitWithStopCondition(LoadStep.BernoulliN2OnCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliN2PressureRoutine); },
- () => CheckRoutineStopStatus(_bernoulliN2PressureRoutine, "BernoulliN2 On failed"))
- //1.6 Bernoulli Bladder Off
- .Run(LoadStep.BernoulliBladderOff, () => { return _bernoulliBladderRoutine.Start(false) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.BernoulliBladderOffCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliBladderRoutine); },
- () => CheckRoutineStopStatus(_bernoulliBladderRoutine, "BernoulliBladder Off failed"))
- //1.7 Tilt Goto Float
- .Run(LoadStep.TiltGotoFloat, () => { return AxisPosition(_tiltAxis,"FLOAT"); }, NullFun, _delay_1ms)
- .WaitWithStopCondition(LoadStep.TiltGotoFloatWait, () => { return _tiltAxis.Status == RState.End; },
- () => CheckAxisMotionStopStatus(_tiltAxis))
- //1.8 Re Bernoulli Bladder On
- .Run(LoadStep.ReBernoulliBladderOn, () => { return _bernoulliBladderRoutine.Start(true) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.ReBernoulliBladderOnCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliBladderRoutine); },
- () => CheckRoutineStopStatus(_bernoulliBladderRoutine, "ReBernoulliBladder On failed"))
- //1.9 Tilt Goto Vertical
- .Run(LoadStep.TiltGotoVertical, () => { return AxisPosition(_tiltAxis,"VERT"); }, NullFun, _delay_1ms)
- .WaitWithStopCondition(LoadStep.TiltGotoVerticalWait, () => { return _tiltAxis.Status == RState.End; },
- () => CheckAxisMotionStopStatus(_tiltAxis))
- //2.0 CRS Vacuum Check
- .Run(LoadStep.CRSVacuumValue, () => { return _vacuumLevelCheckRoutine.Start(true) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.CRSVacuumValueCheck, () => { return CommonFunction.CheckRoutineEndState(_vacuumLevelCheckRoutine); },
- () => CheckRoutineStopStatus(_vacuumLevelCheckRoutine, "CRS Vacuum Check failed"))
- //2.1 Shuttle Goto CLOSED
- .Run(LoadStep.ShuttleGotoClose, () => { return AxisPosition(_shuttleAxis,"CLOSED"); }, NullFun, _delay_1ms)
- .WaitWithStopCondition(LoadStep.ShuttleGotoCloseWait, () => { return _shuttleAxis.Status == RState.End; },
- () => CheckAxisMotionStopStatus(_shuttleAxis))
- //2.2 Re CRS Vacuum Check
- .Run(LoadStep.ReCRSVacuumValue, () => { return _vacuumLevelCheckRoutine.Start(true) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.ReCRSVacuumValueCheck, () => { return CommonFunction.CheckRoutineEndState(_vacuumLevelCheckRoutine); },
- () => CheckRoutineStopStatus(_vacuumLevelCheckRoutine, "Re CRS Vacuum Check failed"))
- //2.3 Dor Lock On
- .Run(LoadStep.DoorLockOn, () => { return _doorLockRoutine.Start(true) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.DoorLockOnCheck, () => { return CommonFunction.CheckRoutineEndState(_doorLockRoutine); },
- () => CheckRoutineStopStatus(_doorLockRoutine,"Door lock failed"))
- //2.4 WS Bladder On
- .Run(LoadStep.WSBladderOn, () => { return _whBladderRoutine.Start(true) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.WSBladderOnCheck, () => { return CommonFunction.CheckRoutineEndState(_whBladderRoutine); },
- () => CheckRoutineStopStatus(_whBladderRoutine,"WSBladder On failed"))
- //2.5 Trans Bladder On
- .Run(LoadStep.TransBladderOn, () => { return _transBladderRoutine.Start(true) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.TransBladderOnCheck, () => { return CommonFunction.CheckRoutineEndState(_transBladderRoutine); },
- () => CheckRoutineStopStatus(_transBladderRoutine,"TransBladder On failed"))
- //2.5 Trans High Off
- .Run(LoadStep.TransHighOff, () => { return _transHighPressureRoutine.Start(false) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.TransHighOffCheck, () => { return CommonFunction.CheckRoutineEndState(_transHighPressureRoutine); },
- () => CheckRoutineStopStatus(_transHighPressureRoutine, "Trans High Off failed"))
- //2.6 CRS Goto SetUp
- .Run(LoadStep.CRSGotoSetUp, () => { return AxisPosition(_crsAxis,"Setup"); }, NullFun, _delay_1ms)
- .WaitWithStopCondition(LoadStep.CRSGotoSetUpWait, () => { return _crsAxis.Status == RState.End; },
- () => CheckAxisMotionStopStatus(_crsAxis))
- //2.7 CRS Goto Lock
- .Run(LoadStep.CRSGotoLock, () => { return AxisPosition(_crsAxis,"Lock"); }, NullFun, _delay_1ms)
- .WaitWithStopCondition(LoadStep.CRSGotoLockWait, () => { return _crsAxis.Status == RState.End; },
- () => CheckAxisMotionStopStatus(_crsAxis))
- //2.8 Bernoulli N2 Off
- .Run(LoadStep.BernoulliN2Off, () => { return _bernoulliN2PressureRoutine.Start(false) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.BernoulliN2OffCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliN2PressureRoutine); },
- () => CheckRoutineStopStatus(_bernoulliN2PressureRoutine, "Bernoulli N2 Off failed"))
- //2.9 WS Bladder Off
- .Run(LoadStep.WSBladderOff, () => { return _whBladderRoutine.Start(false) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.WSBladderOffCheck, () => { return CommonFunction.CheckRoutineEndState(_whBladderRoutine); },
- () => CheckRoutineStopStatus(_whBladderRoutine, "WS Bladder Off failed"))
- //3.0 CRS Release Delay
- .Delay(LoadStep.CRSReleaseDelay,_crsVacuumReleaseDelayInMilliseconds)
- //3.1 CRS Vacuum Off
- .Run(LoadStep.CRSVacuumOff, () => { return _vacuumAndLevelCheckRoutineRoutine.Start(false) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.CRSVacuumOffCheck, () => { return CommonFunction.CheckRoutineEndState(_vacuumAndLevelCheckRoutineRoutine); },
- () => CheckRoutineStopStatus(_vacuumAndLevelCheckRoutineRoutine, "LS Vacuum Off failed"))
- //3.2 Translate Bladder Release Delay
- .Delay(LoadStep.TranslateBladderReleaseDelay,_translateOutDelayInMilliseconds)
- //3.3 Trans Bladder Off
- .Run(LoadStep.ReTranslateBladderOff, () => { return _transBladderRoutine.Start(false) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.ReTranslateBladderOffCheck, () => { return CommonFunction.CheckRoutineEndState(_transBladderRoutine); },
- () => CheckRoutineStopStatus(_transBladderRoutine, "Trans Bladder Off failed"))
- //3.3 Trans High Off
- .Run(LoadStep.TranslateHighPresOff, () => { return _transHighPressureRoutine.Start(false) == RState.Running; }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.TranslateHighPresOffCheck, () => { return CommonFunction.CheckRoutineEndState(_transHighPressureRoutine); },
- () => CheckRoutineStopStatus(_transHighPressureRoutine, "Trans High Off failed"))
- //3.4 Home CRS Axis
- .Run(LoadStep.HomingCRSAxis, CRSHome,_delay_1ms)
- .WaitWithStopCondition(LoadStep.HomingCRSAxisWait, () => { return _crsAxis.Status == RState.End; },
- () => CheckCRSHomeStopStatus())
- .Run(LoadStep.CRSHomedGotoSetUp, () => { return AxisPosition(_crsAxis,"Setup"); }, _delay_1ms)
- .WaitWithStopCondition(LoadStep.CRSHomedGotoSetUpCheck, () => { return _crsAxis.Status == RState.End; },
- ()=>CheckAxisMotionStopStatus(_crsAxis))
- .End(LoadStep.End,UpdateWaferHolderLipCRSUsed);
- return Runner.Status;
- }
- /// <summary>
- /// Wafer Holder Clamp On
- /// </summary>
- /// <returns></returns>
- private bool WaferHolderClampOn()
- {
- bool result = _loaderCommonDevice.WaferHolderClampOnAction();
- if (!result)
- {
- NotifyError(eEvent.ERR_LOADER, "Wafer Shuttle Clamp on faied", 0);
- }
- return result;
- }
- /// <summary>
- /// 检验WSSideClampOn异常状态
- /// </summary>
- /// <returns></returns>
- private bool CheckWSSideClampOnStopStatus()
- {
- bool result = CommonFunction.CheckRoutineStopState(_waferHolderSideClampRoutine);
- if (result)
- {
- NotifyError(eEvent.ERR_LOADER, "WS Clamp On failed", 0);
- }
- return result;
- }
- /// <summary>
- /// 检验TranslateBladderOff异常状态
- /// </summary>
- /// <returns></returns>
- private bool CheckRoutineStopStatus(IRoutine routine, string error)
- {
- bool result = CommonFunction.CheckRoutineStopState(routine);
- if (result)
- {
- NotifyError(eEvent.ERR_LOADER, $"{error}", 0);
- }
- return result;
- }
- /// <summary>
- /// Axis goto position
- /// </summary>
- /// <param name="axis"></param>
- /// <param name="station"></param>
- /// <returns></returns>
- private bool AxisPosition(JetAxisBase axis, string station)
- {
- bool result = axis.PositionStation(station);
- if (!result)
- {
- NotifyError(eEvent.ERR_LOADER, $"{axis.Module} goto {station} failed", 0);
- }
- return result;
- }
- /// <summary>
- /// 检验电机运动异常状态
- /// </summary>
- /// <param name="axis"></param>
- /// <returns></returns>
- private bool CheckAxisMotionStopStatus(JetAxisBase axis)
- {
- bool result = axis.Status == RState.Failed || axis.Status == RState.Timeout;
- if (result)
- {
- NotifyError(eEvent.ERR_LOADER, $"{axis.Module} motion failed", 0);
- }
- return result;
- }
- /// <summary>
- /// CRS Home
- /// </summary>
- /// <returns></returns>
- private bool CRSHome()
- {
- bool result = _crsAxis.Home();
- if (!result)
- {
- NotifyError(eEvent.ERR_LOADER, "LS Axis home failed", 0);
- }
- return result;
- }
- /// <summary>
- /// 检验CRS home异常状态
- /// </summary>
- /// <returns></returns>
- private bool CheckCRSHomeStopStatus()
- {
- bool result=_crsAxis.Status==RState.Failed||_crsAxis.Status==RState.Timeout;
- if (result)
- {
- NotifyError(eEvent.ERR_LOADER, "LS Axis home failed", 0);
- }
- return result;
- }
- /// <summary>
- /// 启动
- /// </summary>
- /// <param name="objs"></param>
- /// <returns></returns>
- public RState Start(params object[] objs)
- {
- _crsAxis = GetCrsAxis();
- _tiltAxis = GetTiltAxis();
- _shuttleAxis= GetShuttleAxis();
- _loaderCommonDevice = DEVICE.GetDevice<LoaderCommonDevice>($"Loader1.Common");
- _rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.Loader1}.Rotation");
- _sideDevice = DEVICE.GetDevice<LoaderSideDevice>($"{Module}.{_side}");
- _waferHolderSideClampRoutine = new LoaderCommonWaferHolderSideClampRoutine(ModuleName.Loader1.ToString());
- _vacuumLevelCheckRoutine = new LoaderSideVacuumLevelCheckRoutine($"{Module}.{_side}");
- _doorLockRoutine = new LoaderSideDoorLockRoutine($"{Module}.{_side}");
- _whBladderRoutine = new LoaderSideWhBladderRoutine($"{Module}.{_side}");
- _transHighPressureRoutine = new LoaderSideTransHighRoutine($"{Module}.{_side}");
- _bernoulliBladderRoutine = new LoaderSideBernoulliBladderRoutine($"{Module}.{_side}");
- _transBladderRoutine = new LoaderSideTransBladderRoutine($"{Module}.{_side}");
- _bernoulliN2PressureRoutine = new LoaderSideBernoulliN2PressureRoutine($"{Module}.{_side}");
- _vacuumAndLevelCheckRoutineRoutine = new LoaderSideVacuumAndLevelCheckRoutineRoutine($"{Module}.{_side}");
- if (SC.ContainsItem("Loader1.LSVacuumReleaseDelayInMilliseconds"))
- {
- _crsVacuumReleaseDelayInMilliseconds = SC.GetValue<int>("Loader1.LSVacuumReleaseDelayInMilliseconds");
- }
- if (SC.ContainsItem("Loader1.TranslateOutDelayInMilliseconds"))
- {
- _translateOutDelayInMilliseconds = SC.GetValue<int>("Loader1.TranslateOutDelayInMilliseconds");
- }
- Runner.Start(Module, "Load");
- return RState.Running;
- }
- /// <summary>
- /// 获取Shuttle轴对象
- /// </summary>
- /// <returns></returns>
- private JetAxisBase GetShuttleAxis()
- {
- switch (_side)
- {
- case "SideA":
- return DEVICE.GetDevice<JetAxisBase>($"{Module}.ShuttleA");
- default:
- return DEVICE.GetDevice<JetAxisBase>($"{Module}.ShuttleB");
- }
- }
- /// <summary>
- /// 获取CRS轴对象
- /// </summary>
- /// <returns></returns>
- private JetAxisBase GetCrsAxis()
- {
- switch(_side)
- {
- case "SideA":
- return DEVICE.GetDevice<JetAxisBase>($"{Module}.LSA");
- default:
- return DEVICE.GetDevice<JetAxisBase>($"{Module}.LSB");
- }
- }
- /// <summary>
- /// 获取Tilt轴对象
- /// </summary>
- /// <returns></returns>
- private JetAxisBase GetTiltAxis()
- {
- switch (_side)
- {
- case "SideA":
- return DEVICE.GetDevice<JetAxisBase>($"{Module}.TiltA");
- default:
- return DEVICE.GetDevice<JetAxisBase>($"{Module}.TiltB");
- }
- }
- /// <summary>
- /// 检验前置条件
- /// </summary>
- /// <returns></returns>
- private bool CheckPreCondition()
- {
- if(!CheckHomeCondition())
- {
- return false;
- }
- if(!CheckAxisCondition())
- {
- return false;
- }
- if(!StatusCheck())
- {
- return false;
- }
- if(!CRSVacuumCheck())
- {
- return false;
- }
- return true;
- }
- /// <summary>
- /// 检验Home条件
- /// </summary>
- /// <returns></returns>
- private bool CheckHomeCondition()
- {
- //检验PUF、Loader Transporter,Robot均Homed
- if (ModuleHelper.IsInstalled(ModuleName.PUF1))
- {
- PUFEntity puf1Entity = Singleton<RouteManager>.Instance.GetModule<PUFEntity>(ModuleName.PUF1.ToString());
- if (!puf1Entity.IsHomed)
- {
- NotifyError(eEvent.ERR_LOADER, "PUF1 is not homed",-1);
- return false;
- }
- }
- if (ModuleHelper.IsInstalled(ModuleName.PUF2))
- {
- PUFEntity puf2Entity = Singleton<RouteManager>.Instance.GetModule<PUFEntity>(ModuleName.PUF2.ToString());
- if (!puf2Entity.IsHomed)
- {
- NotifyError(eEvent.ERR_LOADER, "PUF2 is not homed",-1);
- return false;
- }
- }
- if (ModuleHelper.IsInstalled(ModuleName.Transporter2))
- {
- TransporterEntity loaderTransportEntity = Singleton<RouteManager>.Instance.GetModule<TransporterEntity>(ModuleName.Transporter2.ToString());
- if (!loaderTransportEntity.IsHomed)
- {
- NotifyError(eEvent.ERR_LOADER, "Loader Transporter is not homed",-1);
- return false;
- }
- }
- return true;
- }
- /// <summary>
- /// 检验Axis我们的
- /// </summary>
- /// <param name="side"></param>
- /// <returns></returns>
- private bool CheckAxisCondition()
- {
- if(!_rotationAxis.IsHomed)
- {
- NotifyError(eEvent.ERR_LOADER, $"rotation is not homed",-1);
- return false;
- }
- if (!_shuttleAxis.IsHomed)
- {
- NotifyError(eEvent.ERR_LOADER, $"{_shuttleAxis.Name} is not homed",-1);
- return false;
- }
- if (!_tiltAxis.IsHomed)
- {
- NotifyError(eEvent.ERR_LOADER, $"{_tiltAxis.Name} is not homed", -1);
- return false;
- }
- if (!_crsAxis.IsHomed)
- {
- NotifyError(eEvent.ERR_LOADER, $"{_crsAxis.Name} is not homed",-1);
- return false;
- }
- double rotationPosition = _rotationAxis.MotionData.MotorPosition;
- if (!_rotationAxis.CheckPositionIsInStation(rotationPosition, "LOADA") &&
- !_rotationAxis.CheckPositionIsInStation(rotationPosition, "SERVICEB"))
- {
- NotifyError(eEvent.ERR_LOADER, $"rotation {rotationPosition} not in LOADA and SERVICEB", -1);
- return false;
- }
- double shuttlePosition=_shuttleAxis.MotionData.MotorPosition;
- if (!_shuttleAxis.CheckPositionIsInStation(shuttlePosition, "OPEN") &&
- !_shuttleAxis.CheckPositionIsInStation(shuttlePosition, "OPENB"))
- {
- NotifyError(eEvent.ERR_LOADER, $"shuttle {shuttlePosition} not in OPEN and OPENB",-1);
- return false;
- }
- double tiltPosition = _tiltAxis.MotionData.MotorPosition;
- if (!_tiltAxis.CheckPositionIsInStation(tiltPosition, "HORI"))
- {
- NotifyError(eEvent.ERR_LOADER, $"tilt {tiltPosition} not in HORI", -1);
- return false;
- }
- double crsPosition=_crsAxis.MotionData.MotorPosition;
- if (_crsAxis.CheckPositionIsEmpty(crsPosition))
- {
- NotifyError(eEvent.ERR_LOADER, $"crs {crsPosition} not at station",-1);
- return false;
- }
- return true;
- }
- /// <summary>
- /// Status Check
- /// </summary>
- /// <param name="side"></param>
- /// <returns></returns>
- private bool StatusCheck()
- {
- //Facility:CDA,N2,Vaccum均Enable且在正常范围
- //Side WaferPresent
- LoaderSideData sideData = _sideDevice.SideData;
- bool isSimulator = SC.GetValue<bool>("System.IsSimulatorMode");
- if (!sideData.WaferPresent&&!isSimulator)
- {
- NotifyError(eEvent.ERR_LOADER, "side wafer not present", -1);
- return false;
- }
- if (sideData.DoorUpperLocked || sideData.DoorLowerLocked)
- {
- NotifyError(eEvent.ERR_LOADER, "Door Lock is not off", -1);
- return false;
- }
- return true;
- }
- /// <summary>
- /// CRS Vacuum Check
- /// </summary>
- /// <param name="side"></param>
- /// <returns></returns>
- private bool CRSVacuumCheck()
- {
- //CRS Vacuum检验
- LoaderSideData sideData = _sideDevice.SideData;
- if (!sideData.CRSVacuum)
- {
- NotifyError(eEvent.ERR_LOADER, "LS Vacuum is off",-1);
- return false;
- }
- if (SC.ContainsItem($"{Module}.LSVacuumHighLimit"))
- {
- double crsVacuumHighLimit = SC.GetValue<double>($"{Module}.LSVacuumHighLimit");
- if (sideData.CRSVacuumValue >= crsVacuumHighLimit || sideData.CRSVacuumValue >= 0)
- {
- NotifyError(eEvent.ERR_LOADER, "LS Vacuum value is invalid", -1);
- return false;
- }
- }
- //WS Bladder,WS Bladder Pressure压力应该大于设定值WSBladderPressure
- if (!sideData.WHBladder)
- {
- NotifyError(eEvent.ERR_LOADER, "WS Bladder is off",-1);
- return false;
- }
- if (SC.ContainsItem($"{Module}.WSBladderPressure"))
- {
- double wsBladderPressure = SC.GetValue<double>($"{Module}.WSBladderPressure");
- if (sideData.WHBladderPressure <= wsBladderPressure)
- {
- NotifyError(eEvent.ERR_LOADER, $"WS Bladder Pressure value should be more than {wsBladderPressure}", -1);
- return false;
- }
- }
- //Translate Bladder/High Pres,且Sensor处于Retracted
- if (sideData.TransBladder)
- {
- NotifyError(eEvent.ERR_LOADER, "TransBladder is on",-1);
- return false;
- }
- if (sideData.TransHigh)
- {
- NotifyError(eEvent.ERR_LOADER, "Trans High is on", -1);
- return false;
- }
- if (!sideData.TransRetracted)
- {
- NotifyError(eEvent.ERR_LOADER, "Translate Retracted is off",-1);
- return false;
- }
- //Bernoulli Bladder
- if (!sideData.BernoulliBladder)
- {
- NotifyError(eEvent.ERR_LOADER, "BernoulliBladder is off", -1);
- return false;
- }
- if (sideData.BernoulliExtended)
- {
- NotifyError(eEvent.ERR_LOADER, "Bernoulli is Extended",-1);
- return false;
- }
- //Bernoulli N2
- if (sideData.BernoulliN2)
- {
- double minBernoulliN2Pressure = SC.GetValue<double>($"{Module}.MinBernoulliN2Pressure");
- if (sideData.BernoulliPressure <= minBernoulliN2Pressure)
- {
- NotifyError(eEvent.ERR_LOADER, "Bernoulli N2 is On,but N2 Pressure is less min setting parameter", -1);
- return false;
- }
- }
- //Wafer Shuttle Present
- LoaderCommonData commonData = _loaderCommonDevice.CommonData;
- if (!commonData.WaferHolderPresent)
- {
- NotifyError(eEvent.ERR_LOADER, "Wafer Shuttle is absent",-1);
- return false;
- }
- //WS Clamp
- if (!commonData.WaferHolderClamp)
- {
- NotifyError(eEvent.ERR_LOADER, "Wafer Shuttle Clamp is off", -1);
- return false;
- }
- //Drip Tray Fluid
- if (commonData.DripTrayFluid)
- {
- NotifyError(eEvent.ERR_LOADER, "Drip Tray Fluid is on",-1);
- return false;
- }
- return true;
- }
- /// <summary>
- /// 更新WaferHolder LipCRS用量
- /// </summary>
- /// <returns></returns>
- private bool UpdateWaferHolderLipCRSUsed()
- {
- WaferHolderInfo waferHolderInfo = WaferHolderManager.Instance.GetWaferHolder("Loader");
- if (waferHolderInfo != null)
- {
- if (!string.IsNullOrEmpty(waferHolderInfo.CrsAId)&&_side=="SideA")
- {
- waferHolderInfo.CrsATotalUses++;
- WaferHolderManager.Instance.UpdateWaferHolderInfo(waferHolderInfo);
- }
- if (!string.IsNullOrEmpty(waferHolderInfo.CrsBId) && _side == "SideB")
- {
- waferHolderInfo.CrsBTotalUses++;
- WaferHolderManager.Instance.UpdateWaferHolderInfo(waferHolderInfo);
- }
- }
- return true;
- }
- }
- }
|