首次上传

This commit is contained in:
hanqiangqiang
2026-03-24 15:04:02 +08:00
commit 2e080a8764
1392 changed files with 406579 additions and 0 deletions
@@ -0,0 +1,62 @@
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
namespace SicModules.EFEMs.Routines
{
public class EFEMHomeRoutine : EfemBaseRoutine
{
enum RoutineStep
{
Home,
Home2,
TimeDelay1,
TimeDelay2,
TimeDelay3,
WaitReady1,
WaitReady2
}
private int _homeTimeout1;
private int _homeTimeout2;
public EFEMHomeRoutine()
{
Name = "RobortHome";
}
public override Result Start(params object[] objs)
{
Reset();
_homeTimeout1 = SC.GetValue<int>("WaferRobot.HomeTimeout");
_homeTimeout2 = SC.GetValue<int>("TrayRobot.HomeTimeout");
return Result.RUN;
}
public override Result Monitor()
{
try
{
RobotHomeExcute((int)RoutineStep.Home, WaferRobot, _homeTimeout1);
RobotHomeExcute((int)RoutineStep.Home2, TrayRobot, _homeTimeout2);
TimeDelay((int)RoutineStep.TimeDelay1, 2);
CheckRobotReady((int)RoutineStep.WaitReady1, WaferRobot, _homeTimeout1);
CheckRobotReady((int)RoutineStep.WaitReady2, TrayRobot, _homeTimeout2);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
}
}
@@ -0,0 +1,752 @@
using System;
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Device.Devices;
using Aitex.Core.RT.Device.Unit;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.SubstrateTrackings;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners.HiWinAligner;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.EFEM;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
using SicModules.Devices;
using static MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase.RobotBaseDevice;
namespace SicModules.EFEMs.Routines
{
public class EfemBaseRoutine : ModuleRoutine, IRoutine
{
private RobotBaseDevice _waferRobot = null;
private RobotBaseDevice _trayRobot = null;
private IEFEM _efemDevice;
public IoSensor _loadTrayHomeSensor; //Tray定位
public IoSensor _loadWaferPlaced; //上下对射,检测Wafer有无
public IoSensor _loadTrayPresence; //检测托盘有无
public IoSensor _cassAL6Inch; //6寸检测
public IoSensor _cassAR6Inch; //6寸检测
public IoSensor _cassBL6Inch; //6寸检测
public IoSensor _cassALWaferConvex; //凸片检测
public IoSensor _cassARWaferConvex; //凸片检测
public IoSensor _cassBLWaferConvex; //凸片检测
private IoInterLockEx _tmIoInterLock;
public IoLift4 _llLift;
public IoClaw _loadWaferClaw;
public IoLift4 _unLoadLift;
public IoClaw _unLoadWaferClaw;
private HwAlignerGuide _alignerDevice = null;
protected RobotBaseDevice WaferRobot
{
get { return _waferRobot; }
}
protected RobotBaseDevice TrayRobot
{
get { return _trayRobot; }
}
protected IEFEM EfemDevice
{
get { return _efemDevice; }
}
public EfemBaseRoutine() : base(ModuleName.EFEM.ToString())
{
_waferRobot = DEVICE.GetDevice<SicWaferRobot>($"WaferRobot.WaferRobot");
_trayRobot = DEVICE.GetDevice<SicTrayRobot>($"TrayRobot.TrayRobot");
_efemDevice = DEVICE.GetDevice<SicEFEM>($"EFEM.EFEM");
_loadTrayHomeSensor = DEVICE.GetDevice<IoSensor>($"TM.LoadTrayHomeSensor");
_alignerDevice = DEVICE.GetDevice<HwAlignerGuide>($"TM.HiWinAligner");
_loadWaferPlaced = DEVICE.GetDevice<IoSensor>($"TM.LLWaferPlaced");
_loadTrayPresence = DEVICE.GetDevice<IoSensor>($"TM.LLTrayPresence");
_cassBLWaferConvex = DEVICE.GetDevice<IoSensor>($"TM.CassBLWaferConvexSensor");
_cassALWaferConvex = DEVICE.GetDevice<IoSensor>($"TM.CassALWaferConvexSensor");
_cassARWaferConvex = DEVICE.GetDevice<IoSensor>($"TM.CassARWaferConvexSensor");
_cassAL6Inch = DEVICE.GetDevice<IoSensor>($"TM.CassALInch6Sensor");
_cassAR6Inch = DEVICE.GetDevice<IoSensor>($"TM.CassARInch6Sensor");
_cassBL6Inch = DEVICE.GetDevice<IoSensor>($"TM.CassBLInch6Sensor");
_tmIoInterLock = DEVICE.GetDevice<IoInterLockEx>("TM.IoInterLock");
_llLift= DEVICE.GetDevice<IoLift4>($"LoadLock.LLLift");
_unLoadLift= DEVICE.GetDevice<IoLift4>($"UnLoad.UnLoadLift");
_loadWaferClaw = DEVICE.GetDevice<IoClaw>($"LoadLock.LLWaferClaw");
_unLoadWaferClaw = DEVICE.GetDevice<IoClaw>($"UnLoad.UnLoadWaferClaw");
}
public virtual Result Start(params object[] objs)
{
return Result.DONE;
}
public virtual Result Monitor()
{
return Result.DONE;
}
public virtual void Abort()
{
}
protected void CheckTraySensor(int id)
{
Tuple<bool, Result> ret = Execute(id, () =>
{
if (SC.GetValue<bool>($"System.IsSimulatorMode"))
{
return true;
}
return _loadTrayPresence.Value;
});
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Sensor[DI-32] check no tray");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void ClearRobortExtendToDO(int id)
{
Tuple<bool, Result> ret = Execute(id, () =>
{
Notify("Clear RobortExtendTO DO");
_tmIoInterLock.DoATMRobotExtendLoaLSideEnable = false;
_tmIoInterLock.DoATMRobotExtendLoaRSideEnable = false;
_tmIoInterLock.DoATMRobotExtendUnloadEnable = false;
return true;
});
}
protected void Pick(int id, RobotBaseDevice robot, ModuleName source, int slot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Pick from {source} {slot + 1} use Blade1 ");
if (!robot.Pick(MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotArmEnum.Blade1, source.ToString(), slot))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
return true;
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Pick failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
robot.Abort();
Stop(string.Format("pick timeout, can not complete in {0} seconds", timeout));
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void ExtendForPick(int id, RobotBaseDevice robot, ModuleName source, int slot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"ExtendForPick from {source} {slot + 1} use Blade1 ");
if (!robot.CheckToPostMessage(RobotMsg.ExtendForPick, RobotArmEnum.Blade1, source.ToString(), slot))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
return true;
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"ExtendForPick failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop(string.Format("ExtendForPick timeout, can not complete in {0} seconds", timeout));
robot.Abort();
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void ExtendForPlace(int id, RobotBaseDevice robot, ModuleName source, int slot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"ExtendForPlace to {source} {slot + 1} use Blade1 ");
if (!robot.CheckToPostMessage(RobotMsg.ExtendForPlace, MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotArmEnum.Blade1, source.ToString(), slot))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
return true;
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"ExtendForPlace failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop(string.Format("ExtendForPlace timeout, can not complete in {0} seconds", timeout));
robot.Abort();
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void RobotActionComplete(int id, RobotBaseDevice robot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Robot Action Complete ");
if (!robot.CheckToPostMessage(RobotMsg.ActionDone))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
return true;
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Robot Action failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop(string.Format("Robot Action timeout, can not complete in {0} seconds", timeout));
robot.Abort();
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void Place(int id, RobotBaseDevice robot, ModuleName source, int slot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Place wafer to {source} {slot + 1} use Blade1 ");
if (!robot.Place(MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotArmEnum.Blade1, source.ToString(), slot))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
return true;
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Place failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
robot.Abort();
Stop(string.Format("Place timeout, can not complete in {0} seconds", timeout));
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void CheckWaferStatuBeforePick(int id, RobotBaseDevice robot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Check Wafer Status Before Pick");
if (!robot.ExecuteCommand(new object[] { true }))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
{
if (WaferManager.Instance.CheckHasWafer(robot.Name, 0))
{
EV.PostWarningLog(ModuleName.EFEM.ToString(), "Robot Check Has Wafer!");
return null;
}
return true;
}
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Place failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
robot.Abort();
Stop(string.Format("Place timeout, can not complete in {0} seconds", timeout));
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void CheckWaferStatuAfterPlace(int id, RobotBaseDevice robot,int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Check Wafer Status After Place");
if (!robot.ExecuteCommand(new object[] { true}))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
{
if (WaferManager.Instance.CheckHasWafer(robot.Name, 0))
{
EV.PostWarningLog(ModuleName.EFEM.ToString(), "Place Finished and Robot Check Has Wafer!");
return null;
}
return true;
}
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Place failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
robot.Abort();
Stop(string.Format("Place timeout, can not complete in {0} seconds", timeout));
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void CheckTrayStatuBeforePick(int id, RobotBaseDevice robot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Check Tray Status Before Pick");
if (!robot.ExecuteCommand(new object[] { true }))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
{
if (WaferManager.Instance.CheckHasTray(ModuleHelper.Converter(robot.Name), 0))
{
EV.PostWarningLog(ModuleName.EFEM.ToString(), "Robot Check Has Tray!");
return null;
}
return true;
}
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Place failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
robot.Abort();
Stop(string.Format("Place timeout, can not complete in {0} seconds", timeout));
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void Map(int id, RobotBaseDevice robot, ModuleName source, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Mapping wafer {source}");
if (!robot.WaferMapping(source))
{
robot.IsBusy = false;
return false;
}
return true;
}, () =>
{
if (robot.IsReady())
return true;
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
Stop($"Mapping failed, error {robot.ErrorCode}");
robot.Abort();
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
robot.Abort();
Stop(string.Format("Mapping timeout, can not complete in {0} seconds", timeout));
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void CheckRobotReady(int id, RobotBaseDevice robot, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"{robot.Name} Check robot ready");
return true;
}, () =>
{
if (robot.IsReady())
return true;
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT)
{
robot.Abort();
Stop($"{robot.Name} timeout, can not complete in {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
public void RobotHomeExcute(int id, RobotBaseDevice robot, int timeout)
{
Tuple<bool, Result> ret = Execute(id, () =>
{
Notify($"{robot.Name} Execute home");
if (!robot.Home(null))
{
EV.PostAlarmLog(Module, $"{robot.Name} Can not home robot");
return false;
}
return true;
});
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
robot.Abort();
Stop($"{robot.Name} home timeout over {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void CloseVacuum(int id, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Close Vacuum");
_alignerDevice.CloseVacuum();
return true;
}, () =>
{
//return !_alignerDevice.IsBusy;
return true;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop($"Aligner Close Vacuum Timeout, over {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void SetWaferRobortExtendToDO(int id, ModuleName target, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify("Set RobortExtendTO DO");
_tmIoInterLock.DoATMRobotExtendLoaLSideEnable = false;
_tmIoInterLock.DoATMRobotExtendLoaRSideEnable = false;
_tmIoInterLock.DoATMRobotExtendUnloadEnable = false;
if (ModuleHelper.IsLoadLock(target) || target == ModuleName.Load)
{
if (!_tmIoInterLock.SetWaferRobotExtendLoadEnable(true, out string reasen))
{
Notify(reasen);
return false;
}
}
else if (target == ModuleName.UnLoad)
{
if (!_tmIoInterLock.SetWaferRobotExtendUnLoadEnable(true, out string reasen))
{
Notify(reasen);
return false;
}
}
return true;
}, () =>
{
if (ModuleHelper.IsLoadLock(target) || target == ModuleName.Load)
{
return _tmIoInterLock.DiATMRobotExtendLoadLSideEnableFB;
}
else if (target == ModuleName.UnLoad)
{
return _tmIoInterLock.DiATMRobotExtendUnloadEnableFB;
}
return true;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop($"Set Robot extend to Do timeout over {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void SetTrayRobortExtendToDO(int id, ModuleName target, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify("Set RobortExtendTO DO");
_tmIoInterLock.DoATMRobotExtendLoaLSideEnable = false;
_tmIoInterLock.DoATMRobotExtendLoaRSideEnable = false;
_tmIoInterLock.DoATMRobotExtendUnloadEnable = false;
if (ModuleHelper.IsLoadLock(target) || target == ModuleName.Load)
{
if (!_tmIoInterLock.SetTrayRobotExtendLoadEnable(true, out string reasen))
{
Notify(reasen);
return false;
}
}
return true;
}, () =>
{
if (ModuleHelper.IsLoadLock(target) || target == ModuleName.Load)
{
return _tmIoInterLock.DiATMRobotExtendLoadRSideEnableFB;
}
return true;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop($"Set Robot extend to Do timeout over {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void CheckLoadTrayPresence(int id)
{
Tuple<bool, Result> ret = Execute(id, () =>
{
if (SC.GetValue<bool>("LoadLock.TrayPresenceCheckEnable"))
{
if (!_loadTrayPresence.Value)
{
EV.PostAlarmLog(Module, $"check load Tray Presence sensor false,no Tray in load");
return false;
}
}
return true;
});
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
}
}
@@ -0,0 +1,298 @@
using System;
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadLocks;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.UnLoad;
using SicModules.LLs;
using SicModules.LLs.Routines;
using SicModules.TMs;
using SicModules.UnLoads;
using SicModules.UnLoads.Routines;
namespace SicModules.EFEMs.Routines
{
public class EfemSlitValveRoutine : EfemBaseRoutine
{
enum RoutineStep
{
ServoRoutine,
LiftRoutine,
CheckPressureCondition,
CheckPressure,
SetSlitValve,
CheckPressureCondition2,
TimeDlay1
}
private int _motionTimeout = 30;
private ModuleName _paramTarget; //目标腔体
private ModuleName _robot; //机械手
private bool _paramIsOpen; //是否开门
private bool _bothPressureIsATM; //判断两边压力是否都为ATM
private SicTM _tm;
private LoadLock _loadLock;
private UnLoad _unLoad;
private LoadLockServoToRoutine _llServoToRoutine;
private UnLoadServoToRoutine _unLoadServoToRoutine;
private LoadLockLiftRoutine _llLiftRoutine;
private UnLoadLiftRoutine _unLoadLiftRoutine;
private double _maxPressureDiffOpenSlitValve = SC.GetValue<double>("EFEM.MaxPressureDiffOpenSlitValve");
public void Init(ModuleName targetModule,ModuleName robot, bool isOpen)
{
_paramTarget = targetModule;
_robot = robot;
_paramIsOpen = isOpen;
Name = isOpen ? "Open Slit Valve" : "Close Slit Valve";
}
public EfemSlitValveRoutine()
{
Module = ModuleName.EFEM.ToString();
Name = "EFEMSlitValue";
_tm = DEVICE.GetDevice<SicTM>($"{ ModuleName.System.ToString()}.{ ModuleName.TM.ToString()}");
_loadLock= DEVICE.GetDevice<SicLoadLock>($"{ ModuleName.LoadLock.ToString()}.{ ModuleName.LoadLock.ToString()}");
_unLoad = DEVICE.GetDevice<SicUnLoad>($"{ ModuleName.UnLoad.ToString()}.{ ModuleName.UnLoad.ToString()}");
_llServoToRoutine = new LoadLockServoToRoutine(ModuleName.LoadLock);
_unLoadServoToRoutine = new UnLoadServoToRoutine(ModuleName.UnLoad);
_llLiftRoutine = new LoadLockLiftRoutine();
_unLoadLiftRoutine = new UnLoadLiftRoutine();
}
public override Result Start(params object[] objs)
{
Reset();
//只有LoadLock和UnLoad需要开门
if (_robot == ModuleName.WaferRobot)
{
if (_paramTarget != ModuleName.LoadLock && _paramTarget != ModuleName.Load && _paramTarget != ModuleName.UnLoad)
{
return Result.DONE;
}
}
else if (_robot == ModuleName.TrayRobot)
{
if (_paramTarget != ModuleName.LoadLock)
{
return Result.DONE;
}
}
else
{
return Result.DONE;
}
if (_paramIsOpen)
{
if (EfemDevice.CheckSlitValveOpen(_paramTarget, _robot))
{
return Result.DONE;
}
//判断TM到LoadLock或者UnLoad的门是否关上
if (!_tm.CheckSlitValveClose(_paramTarget))
{
EV.PostWarningLog(Module, $"can not open slit valve {_paramTarget}, {_paramTarget} to TM slit valve not closed, can not open at same time");
return Result.FAIL;
}
if (!EfemDevice.CheckSlitValveClose(ModuleName.LoadLock, ModuleName.WaferRobot)) //此门是必须要关上的
{
EV.PostWarningLog(Module, $"can not open slit valve {_paramTarget}, {ModuleName.LoadLock} to Efem slit valve not closed, can not open at same time");
return Result.FAIL;
}
if (!EfemDevice.CheckSlitValveClose(ModuleName.UnLoad, _robot))
{
EV.PostWarningLog(Module, $"can not open slit valve {_paramTarget}, {ModuleName.UnLoad} to Efem slit valve not closed, can not open at same time");
return Result.FAIL;
}
if (!EfemDevice.CheckSlitValveClose(ModuleName.LoadLock, _robot))
{
EV.PostWarningLog(Module, $"can not open slit valve {_paramTarget}, {ModuleName.LoadLock} to Efem slit valve not closed, can not open at same time");
return Result.FAIL;
}
_motionTimeout = SC.GetValue<int>("System.SlitValveMotionTimeout");
_llServoToRoutine.Init(SC.GetValue<double>("LoadLock.AtmPressureBase"));
_unLoadServoToRoutine.Init(SC.GetValue<double>("UnLoad.AtmPressureBase"));
_llLiftRoutine.Init(false);
_unLoadLiftRoutine.Init(false);
}
else
{
if (EfemDevice.CheckSlitValveClose(_paramTarget, _robot))
{
return Result.DONE;
}
}
Notify("Start");
return Result.RUN;
}
public override Result Monitor()
{
try
{
//开门之前需要对两边腔体进行气压调节,降Lift
if (_paramIsOpen)
{
if (_paramTarget == ModuleName.LoadLock)
{
CheckPressureConditionATM((int)RoutineStep.CheckPressureCondition, _paramTarget);//先判断Load腔是否在大气,因为EFEM始终在大气
if (!_bothPressureIsATM)
{
ExecuteRoutine((int)RoutineStep.ServoRoutine, _llServoToRoutine);
ExecuteRoutine((int)RoutineStep.LiftRoutine, _llLiftRoutine);
}
}
else if (_paramTarget == ModuleName.UnLoad)
{
CheckPressureConditionATM((int)RoutineStep.CheckPressureCondition, _paramTarget);//先判断UnLoad腔是否在大气
if (!_bothPressureIsATM)
{
ExecuteRoutine((int)RoutineStep.ServoRoutine, _unLoadServoToRoutine);
ExecuteRoutine((int)RoutineStep.LiftRoutine, _unLoadLiftRoutine);
}
}
CheckPressureCondition((int)RoutineStep.CheckPressureCondition2,_paramTarget);
}
SetSlitValve((int)RoutineStep.SetSlitValve, _paramTarget, _robot, _paramIsOpen, _motionTimeout);
TimeDelay((int)RoutineStep.TimeDlay1, 1);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException)
{
return Result.FAIL;
}
Notify("Finished");
return Result.DONE;
}
public void CheckPressureConditionATM(int id, ModuleName target)
{
Tuple<bool, Result> ret = Execute(id, () =>
{
Notify($"check pressure condition to open {target} slit valve");
double targetPressure = 0.0;
if (target == ModuleName.LoadLock)
{
targetPressure = _loadLock.ChamberPressure;
}
else
{
targetPressure = _unLoad.ChamberPressure;
}
_bothPressureIsATM = Math.Abs(EfemDevice.AtmPressureBase - targetPressure) <= _maxPressureDiffOpenSlitValve;
return true;
});
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
public void CheckPressureCondition(int id, ModuleName target)
{
Tuple<bool, Result> ret = Execute(id, () =>
{
Notify($"check {target} pressure is atm");
double targetPressure = 0.0;
if (target == ModuleName.LoadLock)
{
targetPressure = _loadLock.ChamberPressure;
}
else
{
targetPressure = _unLoad.ChamberPressure;
}
if (Math.Abs(EfemDevice.AtmPressureBase - targetPressure) > _maxPressureDiffOpenSlitValve)
{
Stop($"pressure difference {Math.Abs(EfemDevice.AtmPressureBase - targetPressure):F3} between Efem and {target} exceed tolerance {_maxPressureDiffOpenSlitValve}");
return false;
}
return true;
});
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
public void SetSlitValve(int id, ModuleName module,ModuleName _robort, bool isOpen, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"set slit valve {module} " + (isOpen ? "Open" : "Close"));
if (!EfemDevice.SetSlitValve(module, _robort, isOpen, out string reason))
{
Stop(reason);
return false;
}
return true;
}, () =>
{
return isOpen ? EfemDevice.CheckSlitValveOpen(module, _robort) : EfemDevice.CheckSlitValveClose(module, _robort);
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop($"can not complete in {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
}
}
@@ -0,0 +1,54 @@
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
namespace SicModules.EFEMs.Routines
{
public class TrayRobotHomeRoutine : EfemBaseRoutine
{
enum RoutineStep
{
Home,
TimeDelay,
WaitReady,
}
private int _homeTimeout;
public TrayRobotHomeRoutine()
{
Name = "TrayRobotHome";
}
public override Result Start(params object[] objs)
{
Reset();
_homeTimeout = SC.GetValue<int>("TrayRobot.HomeTimeout");
return Result.RUN;
}
public override Result Monitor()
{
try
{
RobotHomeExcute((int)RoutineStep.Home, TrayRobot, _homeTimeout);
TimeDelay((int)RoutineStep.TimeDelay, 2);
CheckRobotReady((int)RoutineStep.WaitReady, TrayRobot, _homeTimeout);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
}
}
@@ -0,0 +1,82 @@
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
namespace SicModules.EFEMs.Routines
{
public class TrayRobotMapRoutine : EfemBaseRoutine
{
enum RoutineStep
{
CheckRobotReady,
RobotMap,
TimeDelay1,
}
public TrayRobotMapRoutine()
{
Module = ModuleName.EFEM.ToString();
Name = "TrayRobortPick";
}
private ModuleName _source;
private int _motionTimeOut = 10;
public void Init(ModuleName source)
{
_source = source;
}
public override Result Start(params object[] objs)
{
Reset();
if (_source == ModuleName.LoadLock || _source == ModuleName.UnLoad)
{
return Result.DONE;
}
if (_source == ModuleName.CassBL)
{
//检测凸片Sensor和有无Sensor
if (_cassBLWaferConvex.Value)
{
EV.PostWarningLog(Module, $"Can not map,{_source} check wafer convex");
return Result.FAIL;
}
if (!_cassBL6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not map,{_source} sensor check no cassette");
return Result.FAIL;
}
}
_motionTimeOut = SC.GetConfigItem($"{ModuleName.TrayRobot}.MotionTimeout").IntValue;
return Result.RUN;
}
public override Result Monitor()
{
try
{
CheckRobotReady((int)RoutineStep.CheckRobotReady, WaferRobot, _motionTimeOut); //判断机械手当前是否空闲
Map((int)RoutineStep.RobotMap, TrayRobot, _source, _motionTimeOut); //机械手吸住,收回
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
}
}
@@ -0,0 +1,158 @@
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.SubstrateTrackings;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots;
using SicModules.LLs;
using SicModules.LLs.Routines;
namespace SicModules.EFEMs.Routines
{
public class TrayRobotPickRoutine : EfemBaseRoutine
{
/* Pick From Cassette,LoadLock(需要开门),Aligner/Unload(需要开门)
* 1.判断目标是否有Wafer
* 2.判断是否需要开门(包括气压等)
* 3.判断顶针是否上升
* 4.伸出,吸住
* 5.ActionDone
* 6.关门
*
*/
//private LoadLock _loadLock;
private EfemSlitValveRoutine _efemSlitValveOpenRoutine = new EfemSlitValveRoutine();
private EfemSlitValveRoutine _efemSlitValveCloseRoutine = new EfemSlitValveRoutine();
private LoadLockLiftRoutine _loadLockLiftDown = new LoadLockLiftRoutine();
private ModuleName _source;
private int _sourceSlot;
private int _pickTimeout;
enum RoutineStep
{
OpenSlitValve,
SetLiftUp,
CheckRobotReady,
PickComplete,
SetLiftDown,
TimeDelay1,
CloseSlitValve,
SetExtendToDo,
Pick,
CheckTrayStatuBeforePick,
ClearRobortExtendToDo
}
public TrayRobotPickRoutine()
{
Module = ModuleName.EFEM.ToString();
Name = "TrayRobortPick";
}
public void Init(ModuleName source, int sourceSlot)
{
_source = source;
_sourceSlot = sourceSlot;
}
public override Result Start(params object[] objs)
{
Reset();
if (WaferManager.Instance.CheckHasTray(ModuleName.TrayRobot, 0))
{
Stop("Can not pick,TrayRobot has wafer");
return Result.FAIL;
}
//Pick之前先,根据Sensor检测是否有盘
if (!WaferManager.Instance.CheckHasTray(_source, _sourceSlot))
{
EV.PostWarningLog(Module, $"Can not pick, {_source} slot {_sourceSlot} no tray");
return Result.FAIL;
}
if (TrayRobot.RobotState != RobotStateEnum.Idle)
{
EV.PostWarningLog(Module, $"Can not pick, WaferRobot is not Idle");
return Result.FAIL;
}
if (_source == ModuleName.CassBL)
{
//检测凸片Sensor和有无Sensor
if (_cassBLWaferConvex.Value)
{
EV.PostWarningLog(Module, $"Can not pick,{_source} check wafer convex");
return Result.FAIL;
}
if (!_cassBL6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not pick,{_source} sensor check no cassette");
return Result.FAIL;
}
}
if (_source == ModuleName.LoadLock && !_llLift.IsDown)
{
EV.PostWarningLog(Module, $"Can not pick,{_source} lift is not in down position!");
return Result.FAIL;
}
_efemSlitValveOpenRoutine.Init(_source, ModuleName.TrayRobot, true);
_efemSlitValveCloseRoutine.Init(_source, ModuleName.TrayRobot, false);
_loadLockLiftDown.Init(false);
_pickTimeout = SC.GetConfigItem($"{ModuleName.TrayRobot}.MotionTimeout").IntValue;
return Result.RUN;
}
public override Result Monitor()
{
try
{
if (_source == ModuleName.LoadLock)
{
CheckRobotReady((int)RoutineStep.CheckRobotReady, TrayRobot, _pickTimeout);
CheckTrayStatuBeforePick((int)RoutineStep.CheckTrayStatuBeforePick, TrayRobot, 10); //Pick前先检查
ExecuteRoutine((int)RoutineStep.OpenSlitValve, _efemSlitValveOpenRoutine); //打开闸板阀
SetTrayRobortExtendToDO((int)RoutineStep.SetExtendToDo, _source, 10); //设置ExtendToDO,用于检测InterLock
Pick((int)RoutineStep.Pick, TrayRobot, _source, _sourceSlot, _pickTimeout);
ClearRobortExtendToDO((int)RoutineStep.ClearRobortExtendToDo);
TimeDelay((int)RoutineStep.TimeDelay1, 1);
ExecuteRoutine((int)RoutineStep.CloseSlitValve, _efemSlitValveCloseRoutine); //关闭闸板阀
}
else
{
CheckRobotReady((int)RoutineStep.CheckRobotReady, TrayRobot, _pickTimeout);
CheckTrayStatuBeforePick((int)RoutineStep.CheckTrayStatuBeforePick, TrayRobot, 10); //Pick前先检查
Pick((int)RoutineStep.Pick, TrayRobot, _source, _sourceSlot, _pickTimeout); //机械手到位,夹爪打开
ClearRobortExtendToDO((int)RoutineStep.ClearRobortExtendToDo);
}
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
public override void Abort()
{
TrayRobot.Abort();
base.Abort();
}
}
}
@@ -0,0 +1,207 @@
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.SubstrateTrackings;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots;
using SicModules.Devices;
using SicModules.LLs;
using SicModules.LLs.Routines;
namespace SicModules.EFEMs.Routines
{
public class TrayRobotPlaceRoutine : EfemBaseRoutine
{
/* 1.Place to LoadLock(需要开门)/Cassette
* 2.判断目标是否无Tray,判断Robot是否有Tray
* 3.判断是否需要开门(包括气压等)
* 4.判断顶针是否下降
* 5.伸出
* 6.托盘旋转到定位角
* 7.托盘对中(夹紧放开)
* 8.关门
*/
private LoadRotationHomeOffsetRoutine _loadRotationHomeRoutine = new LoadRotationHomeOffsetRoutine();
private EfemSlitValveRoutine _efemSlitValveOpenRoutine = new EfemSlitValveRoutine();
private EfemSlitValveRoutine _efemSlitValveCloseRoutine = new EfemSlitValveRoutine();
private LoadLockLiftRoutine _loadLockLiftDown = new LoadLockLiftRoutine();
//private LoadLockTrayAlignerRoutine _trayAligner = new LoadLockTrayAlignerRoutine();
private LoadLockTrayClawRoutine _trayClamp = new LoadLockTrayClawRoutine();
private LoadLockTrayClawRoutine _trayUnClamp = new LoadLockTrayClawRoutine();
private IoLoadRotation _llRotation = null;
private ModuleName _source;
private int _sourceSlot;
private int _placeTimeout;
private double _homeOffset;
private int _loadRotationTimeOut = 60;
enum RoutineStep
{
OpenSlitValve,
SetLiftUp,
CheckRobotReady,
PickComplete,
SetLiftDown,
Place,
TrayAligner,
TrayClamp,
TrayUnClamp,
CloseSlitValve,
TrayUnClamp1,
LoadRotationRelativeHome,
FindPositionSensor,
SetExtendToDo,
ClearRobortExtendToDo,
CheckTraySensor,
TimeDelay1,
TimeDelay2,
TimeDelay3,
TimeDelay4,
}
public TrayRobotPlaceRoutine()
{
Module = ModuleName.EFEM.ToString();
Name = "TrayRobortPlace";
_llRotation = DEVICE.GetDevice<IoLoadRotation>("Load.Rotation");
}
public void Init(ModuleName sourseMod,int sourceSlt)
{
_source = sourseMod;
_sourceSlot = sourceSlt;
}
public override Result Start(params object[] objs)
{
Reset();
if (!WaferManager.Instance.CheckHasTray(ModuleName.TrayRobot, 0))
{
Stop("Can not place,TrayRobot no tray");
return Result.FAIL;
}
//Place之前先,根据Sensor检测是否有盘
if (WaferManager.Instance.CheckHasTray(_source, _sourceSlot))
{
EV.PostWarningLog(Module, $"Can not place, {_source} slot {_sourceSlot} has tray");
return Result.FAIL;
}
if (TrayRobot.RobotState != RobotStateEnum.Idle)
{
EV.PostWarningLog(Module, $"Can not place, WaferRobot is not Idle");
EV.PostWarningLog(Module, $"Can not place, TrayRobot is not Idle");
return Result.FAIL;
}
//LoadLock传感器是否需要检测有Tray盘
if (_source == ModuleName.LoadLock || _source == ModuleName.Load)
{
if (_loadTrayPresence.Value)
{
EV.PostWarningLog(Module, $"Can not place,{_source} sensor[DI-32] check have tray");
return Result.FAIL;
}
if (!_llLift.IsDown)
{
EV.PostWarningLog(Module, $"Can not place,{_source} lift is not in down position!");
return Result.FAIL;
}
}
else if (_source == ModuleName.CassBL)
{
//检测凸片Sensor和有无Sensor
if (_cassBLWaferConvex.Value)
{
EV.PostWarningLog(Module, $"Can not place,{_source} check wafer convex");
return Result.FAIL;
}
if (!_cassBL6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not place,{_source} sensor check no cassette");
return Result.FAIL;
}
}
_loadRotationTimeOut = SC.GetValue<int>("LoadLock.LoadRotation.RotationTimeOut");
_efemSlitValveOpenRoutine.Init(_source, ModuleName.TrayRobot, true);
_efemSlitValveCloseRoutine.Init(_source, ModuleName.TrayRobot, false);
_loadLockLiftDown.Init(false);
_trayClamp.Init(true);
_trayUnClamp.Init(false);
_placeTimeout = SC.GetConfigItem($"{ModuleName.TrayRobot}.MotionTimeout").IntValue;
_homeOffset = SC.GetConfigItem($"LoadLock.LoadRotation.HomeOffset").DoubleValue;
return Result.RUN;
}
public override Result Monitor()
{
try
{
/* DI_LoadTrayPresence 托盘有无
* DI_LoadWaferPlaced Wafer有无
* DI_LoadHomeTraySensor 托盘测距
*/
if (_source == ModuleName.LoadLock)
{
ExecuteRoutine((int)RoutineStep.TrayUnClamp1, _trayUnClamp); //夹爪打开
ExecuteRoutine((int)RoutineStep.OpenSlitValve, _efemSlitValveOpenRoutine); //打开闸板阀
SetTrayRobortExtendToDO((int)RoutineStep.SetExtendToDo, _source, 10); //设置ExtendToDO,用于检测InterLock
CheckRobotReady((int)RoutineStep.CheckRobotReady, TrayRobot, _placeTimeout); //判断机械手当前是否空闲
Place((int)RoutineStep.Place, TrayRobot, _source, _sourceSlot, _placeTimeout); //机械手
ClearRobortExtendToDO((int)RoutineStep.ClearRobortExtendToDo);
CheckTraySensor((int)RoutineStep.CheckTraySensor);
//对中
ExecuteRoutine((int)RoutineStep.TrayClamp, _trayClamp); //夹爪关闭
TimeDelay((int)RoutineStep.TimeDelay2, 1);//延迟1s
ExecuteRoutine((int)RoutineStep.TrayUnClamp, _trayUnClamp); //夹爪打开
//ExecuteRoutine((int)RoutineStep.LoadRotationRelativeHome, _loadRotationHomeRoutine); //Tray找原点
//TimeDelay((int)RoutineStep.TimeDelay1, 1);
ExecuteRoutine((int)RoutineStep.CloseSlitValve, _efemSlitValveCloseRoutine); //关闭闸板阀
}
else
{
CheckRobotReady((int)RoutineStep.CheckRobotReady, TrayRobot, _placeTimeout); //判断机械手当前是否空闲
SetTrayRobortExtendToDO((int)RoutineStep.SetExtendToDo, _source, 10); //设置ExtendToDO,用于检测InterLock
Place((int)RoutineStep.Place, TrayRobot, _source, _sourceSlot, _placeTimeout); //机械手
ClearRobortExtendToDO((int)RoutineStep.ClearRobortExtendToDo);
}
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
}
}
@@ -0,0 +1,54 @@
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
namespace SicModules.EFEMs.Routines
{
public class WaferRobotHomeRoutine : EfemBaseRoutine
{
enum RoutineStep
{
Home,
TimeDelay,
WaitReady,
}
private int _homeTimeout1;
public WaferRobotHomeRoutine()
{
Name = "WaferRobotHome";
}
public override Result Start(params object[] objs)
{
Reset();
_homeTimeout1 = SC.GetValue<int>("WaferRobot.HomeTimeout");
return Result.RUN;
}
public override Result Monitor()
{
try
{
RobotHomeExcute((int)RoutineStep.Home, WaferRobot, _homeTimeout1);
TimeDelay((int)RoutineStep.TimeDelay, 2);
CheckRobotReady((int)RoutineStep.WaitReady, WaferRobot, _homeTimeout1);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
}
}
@@ -0,0 +1,118 @@
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
namespace SicModules.EFEMs.Routines
{
public class WaferRobotMapRoutine : EfemBaseRoutine
{
/* Pick From Cassette,LoadLock(需要开门),Aligner/Unload(需要开门)
* 1.判断目标是否有Wafer
* 2.判断是否需要开门(包括气压等)
* 3.判断顶针是否上升
* 4.伸出,吸住
* 5.ActionDone
* 6.关门
*
*/
private ModuleName _source;
private int _pickTimeout;
enum RoutineStep
{
OpenSlitValve,
SetClawOpen,
SetLiftUp,
CheckRobotReady,
SetClawOpen2,
SetClaw,
PickComplete,
SetLiftDown,
SetLiftDown2,
TimeDelay1,
ExtendForPick,
Pick,
}
public WaferRobotMapRoutine()
{
Module = ModuleName.EFEM.ToString();
Name = "WaferRobortMap";
}
public void Init(ModuleName sourseMod)
{
_source = sourseMod;
}
public override Result Start(params object[] objs)
{
Reset();
if (!ModuleHelper.IsCassette(_source))
{
return Result.DONE;
}
if (_source == ModuleName.CassAL)
{
//检测凸片Sensor和有无Sensor
if (_cassALWaferConvex.Value)
{
EV.PostWarningLog(Module, $"Can not map,{_source} check wafer convex");
return Result.FAIL;
}
if (!_cassAL6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not map,{_source} sensor check no cassette");
return Result.FAIL;
}
}
else if (_source == ModuleName.CassAR)
{
//检测凸片Sensor和有无Sensor
if (_cassARWaferConvex.Value)
{
EV.PostWarningLog(Module, $"Can not map,{_source} check wafer convex");
return Result.FAIL;
}
if (!_cassAR6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not map,{_source} sensor check no cassette");
return Result.FAIL;
}
}
_pickTimeout = SC.GetConfigItem($"{ModuleName.WaferRobot}.MotionTimeout").IntValue;
return Result.RUN;
}
public override Result Monitor()
{
try
{
CheckRobotReady((int)RoutineStep.CheckRobotReady, WaferRobot, _pickTimeout); //判断机械手当前是否空闲
Map((int)RoutineStep.Pick, WaferRobot, _source, _pickTimeout); //机械手吸住,收回
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
}
}
@@ -0,0 +1,248 @@
using Aitex.Core.Common;
using Aitex.Core.RT.Device.Unit;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.SubstrateTrackings;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots;
using SicModules.LLs;
using SicModules.LLs.Routines;
using SicModules.UnLoads;
using SicModules.UnLoads.Routines;
namespace SicModules.EFEMs.Routines
{
public class WaferRobotPickRoutine : EfemBaseRoutine
{
private EfemSlitValveRoutine _efemSlitValveOpenRoutine = new EfemSlitValveRoutine();
private EfemSlitValveRoutine _efemSlitValveCloseRoutine = new EfemSlitValveRoutine();
private UnLoadLiftRoutine _unLoadLiftDown = new UnLoadLiftRoutine();
private UnLoadLiftRoutine _unLoadLiftUp = new UnLoadLiftRoutine();
private UnLoadClawRoutine _unLoadClaw = new UnLoadClawRoutine();
private UnLoadClawRoutine _unLoadClawOpen = new UnLoadClawRoutine();
private LoadLockLiftRoutine _loadLockLiftDown = new LoadLockLiftRoutine();
private LoadLockLiftRoutine _loadLockLiftUp = new LoadLockLiftRoutine();
private LoadLockClawRoutine _loadLockClaw = new LoadLockClawRoutine();
private LoadLockClawRoutine _loadLockClawOpen= new LoadLockClawRoutine();
private LoadRotationHomeOffsetRoutine _loadRotationHomeRoutine = new LoadRotationHomeOffsetRoutine();
//private AlignerAlignRoutine _alignRoutine = new AlignerAlignRoutine();
private ModuleName _source;
private int _sourceSlot;
private int _pickTimeout;
private bool _isSimulator = false;
enum RoutineStep
{
CheckWaferStatuBeforePick,
OpenSlitValve,
SetClawOpen,
SetLiftUp,
CheckRobotReady,
SetClawOpen2,
SetClaw,
PickComplete,
SetLiftDown,
SetLiftDown2,
TimeDelay1,
ExtendForPick,
CloaseSlitValve,
Pick,
CloseVacuum,
SetExtendToDo,
ClearRobortExtendToDo,
CheckWaferStatusByRq,
LoadRotationHome,
}
public WaferRobotPickRoutine()
{
Module = ModuleName.EFEM.ToString();
Name = "WaferRobortPick";
}
public void Init(ModuleName source, int sourceSlot)
{
_source = source;
_sourceSlot = sourceSlot;
}
public override Result Start(params object[] objs)
{
Reset();
if (WaferManager.Instance.CheckHasWafer(ModuleName.WaferRobot, 0))
{
Stop("Can not pick,WaferRobot has wafer");
return Result.FAIL;
}
//Pick之前先,检查source是否有Wafer
if (!WaferManager.Instance.CheckHasWafer(_source, _sourceSlot))
{
EV.PostWarningLog(Module, $"Can not pick, {_source} slot {_sourceSlot} no wafer");
return Result.FAIL;
}
if (WaferRobot.RobotState != RobotStateEnum.Idle)
{
EV.PostWarningLog(Module, $"Can not pick, WaferRobot is not Idle");
return Result.FAIL;
}
if (_source == ModuleName.CassAL)
{
//检测凸片Sensor和有无Sensor
if (_cassALWaferConvex.Value)
{
EV.PostWarningLog(Module, $"Can not pick,{_source} check wafer convex");
return Result.FAIL;
}
if (!_cassAL6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not pick,{_source} sensor check no cassette");
return Result.FAIL;
}
if (WaferManager.Instance.GetWafer(_source, _sourceSlot).WaferStatus != WaferStatus.Normal)
{
EV.PostWarningLog(Module, $"Can not pick,wafer statu is error!");
return Result.FAIL;
}
}
else if (_source == ModuleName.CassAR)
{
//检测凸片Sensor和有无Sensor
if (_cassARWaferConvex.Value)
{
EV.PostWarningLog(Module, $"Can not pick,{_source} check wafer convex");
return Result.FAIL;
}
if (!_cassAR6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not pick,{_source} sensor check no cassette");
return Result.FAIL;
}
if (WaferManager.Instance.GetWafer(_source, _sourceSlot).WaferStatus != WaferStatus.Normal)
{
EV.PostWarningLog(Module, $"Can not pick,wafer statu is error!");
return Result.FAIL;
}
}
else if (_source == ModuleName.Load || _source == ModuleName.LoadLock)
{
//夹爪打开,顶针在低位,说明没Wafer
if (_loadWaferClaw.State == ClawStateEnum.Open && !_llLift.IsDown)
{
EV.PostWarningLog(Module, $"Can not pick, Load Claw is open,Make sure wafer and Tray has Separated!");
return Result.FAIL;
}
}
else if (_source == ModuleName.UnLoad)
{
//夹爪打开,顶针在低位,说明没Wafer
if (_unLoadWaferClaw.State == ClawStateEnum.Open && !_unLoadLift.IsDown)
{
EV.PostWarningLog(Module, $"Can not pick, UnLoad Claw is open,Make sure wafer and Tray has Separated!");
return Result.FAIL;
}
}
_isSimulator = SC.GetValue<bool>($"System.IsSimulatorMode");
_pickTimeout = SC.GetConfigItem($"{ModuleName.WaferRobot}.MotionTimeout").IntValue;
_efemSlitValveOpenRoutine.Init(_source, ModuleName.WaferRobot, true);
_efemSlitValveCloseRoutine.Init(_source, ModuleName.WaferRobot, false);
_unLoadLiftDown.Init(false);
_unLoadLiftUp.Init(true);
_unLoadClaw.Init(true);
_unLoadClawOpen.Init(false);
_loadLockLiftDown.Init(false);
_loadLockLiftUp.Init(true);
_loadLockClaw.Init(true,true);
_loadLockClawOpen.Init(true,false);
return Result.RUN;
}
public override Result Monitor()
{
try
{
if (_source == ModuleName.Aligner && !_isSimulator)
{
//关Aligner真空吸
CloseVacuum((int)RoutineStep.CloseVacuum, 15);
}
//判断机械手当前是否空闲
CheckRobotReady((int)RoutineStep.CheckRobotReady, WaferRobot, _pickTimeout);
//开始前先检查Wafer
CheckWaferStatuBeforePick((int)RoutineStep.CheckWaferStatuBeforePick, WaferRobot, 10);
//执行Load Tray 找原点
if ((_source == ModuleName.Load || _source == ModuleName.LoadLock) && WaferManager.Instance.CheckHasTray(_source, _sourceSlot))
{
ExecuteRoutine((int)RoutineStep.LoadRotationHome, _loadRotationHomeRoutine);
}
ExecuteRoutine((int)RoutineStep.OpenSlitValve, _efemSlitValveOpenRoutine); //打开闸板阀
SetWaferRobortExtendToDO((int)RoutineStep.SetExtendToDo, _source, 10); //设置ExtendToDO,用于检测InterLock
if (_source == ModuleName.UnLoad)
{
ExecuteRoutine((int)RoutineStep.SetLiftUp, _unLoadLiftUp); //UnLoad,顶针上升
}
else if (_source == ModuleName.LoadLock || _source == ModuleName.Load)
{
ExecuteRoutine((int)RoutineStep.SetLiftUp, _loadLockLiftUp); //Load,顶针上升
}
ExtendForPick((int)RoutineStep.ExtendForPick, WaferRobot, _source, _sourceSlot, _pickTimeout); //机械手到位
if(_source == ModuleName.UnLoad)
{
ExecuteRoutine((int)RoutineStep.SetClawOpen, _unLoadClawOpen); //UnLoad夹爪松开
ExecuteRoutine((int)RoutineStep.SetLiftDown, _unLoadLiftDown);
}
else if (_source == ModuleName.LoadLock || _source == ModuleName.Load)
{
ExecuteRoutine((int)RoutineStep.SetClawOpen, _loadLockClawOpen); //Load夹爪松开
ExecuteRoutine((int)RoutineStep.SetLiftDown, _loadLockLiftDown);
}
Pick((int)RoutineStep.Pick, WaferRobot, _source, _sourceSlot, _pickTimeout); //机械手吸住,收回
ClearRobortExtendToDO((int)RoutineStep.ClearRobortExtendToDo);
TimeDelay((int)RoutineStep.TimeDelay1, 1);
ExecuteRoutine((int)RoutineStep.CloaseSlitValve, _efemSlitValveCloseRoutine); //关闭闸板阀
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
public override void Abort()
{
WaferRobot.Abort();
base.Abort();
}
}
}
@@ -0,0 +1,307 @@
using System;
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.Routine;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.SubstrateTrackings;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners.HiWinAligner;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots;
using SicModules.LLs;
using SicModules.LLs.Routines;
using SicModules.UnLoads;
using SicModules.UnLoads.Routines;
namespace SicModules.EFEMs.Routines
{
public class WaferRobotPlaceRoutine : EfemBaseRoutine
{
/* 1.Place to LoadLock(需要开门)/Aligner/Cassette
* 2.判断目标是否无Wafer,判断Robot是否有Wafer
* 3.判断是否需要开门(包括气压等)
* 4.判断顶针是否上升
* 5.伸出
* 6.判断顶针上升
* 7.ActionDone
* 8.关门
*
机械手伸进来
顶针顶起来
夹爪夹住
夹爪松开
机械手退出
顶针下降
*/
private EfemSlitValveRoutine _efemSlitValveOpenRoutine = new EfemSlitValveRoutine();
private EfemSlitValveRoutine _efemSlitValveCloseRoutine = new EfemSlitValveRoutine();
private LoadLockLiftRoutine _loadLockLiftDown = new LoadLockLiftRoutine();
private LoadLockLiftRoutine _loadLockLiftUp = new LoadLockLiftRoutine();
private LoadLockClawRoutine _loadLockClaw = new LoadLockClawRoutine();
private LoadLockClawRoutine _loadLockClawOpen = new LoadLockClawRoutine();
private UnLoadLiftRoutine _unLoadLiftDown = new UnLoadLiftRoutine();
private UnLoadLiftRoutine _unLoadLiftUp = new UnLoadLiftRoutine();
private UnLoadClawRoutine _unLoadClaw = new UnLoadClawRoutine();
private UnLoadClawRoutine _unLoadClawOpen = new UnLoadClawRoutine();
private HwAlignerGuide _alignerDevice;
private ModuleName _target;
private int _targetSlot;
private int _placeTimeout;
private int _alignerMoveTimeOut = 10;
private bool _isSimulator = false;
enum RoutineStep
{
SetLiftDown0,
AlignerMoveTo,
OpenSlitValve,
SetLiftUp,
CheckRobotReady,
ExtendForPlace,
PickComplete,
SetLiftDown,
CloseSlitValve,
TimeDelay1,
Place,
SetClawOpen1,
SetClawOpen2,
SetClaw,
AlignerCheckWafer,
SetExtendToDo,
ClearRobortExtendToDo,
CheckWaferStatusByRq
}
public WaferRobotPlaceRoutine()
{
Module = ModuleName.EFEM.ToString();
Name = "WaferRobotPlace";
_alignerDevice = DEVICE.GetDevice<HwAlignerGuide>($"TM.HiWinAligner");
}
public void Init(ModuleName targetModule, int targetSlt)
{
_target = targetModule;
_targetSlot = targetSlt;
}
public override Result Start(params object[] objs)
{
Reset();
if (!WaferManager.Instance.CheckHasWafer(ModuleName.WaferRobot, 0))
{
Stop("Can not place,WaferRobot no wafer");
return Result.FAIL;
}
//Place之前先,根据Sensor检测是否有盘
if (WaferManager.Instance.CheckHasWafer(_target, _targetSlot))
{
EV.PostWarningLog(Module, $"Can not place, {_target} slot {_targetSlot} has wafer");
return Result.FAIL;
}
if (WaferRobot.RobotState != RobotStateEnum.Idle)
{
EV.PostWarningLog(Module, $"Can not place, WaferRobot is not Idle");
return Result.FAIL;
}
//LoadLock传感器是否需要检测有Wafer
//if (_target == ModuleName.LoadLock || _target == ModuleName.Load)
//{
// if (_loadWaferPlaced.Value)
// {
// EV.PostWarningLog(Module, $"Can not place,{_target} sensor[DI-35] check have wafer");
// return Result.FAIL;
// }
//}
if (_target == ModuleName.CassAL)
{
if (!_cassAL6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not place,{_target} sensor check no cassette");
return Result.FAIL;
}
}
else if (_target == ModuleName.CassAR)
{
if (!_cassAR6Inch.Value)
{
EV.PostWarningLog(Module, $"Can not place,{_target} sensor check no cassette");
return Result.FAIL;
}
}
_efemSlitValveOpenRoutine.Init(_target, ModuleName.WaferRobot, true);
_efemSlitValveCloseRoutine.Init(_target, ModuleName.WaferRobot, false);
_loadLockLiftDown.Init(false);
_loadLockLiftUp.Init(true);
_loadLockClaw.Init(true,true);
_loadLockClawOpen.Init(true, false);
_unLoadLiftDown.Init(false);
_unLoadLiftUp.Init(true);
_unLoadClaw.Init(true);
_unLoadClawOpen.Init(false);
_placeTimeout = SC.GetConfigItem($"{ModuleName.WaferRobot}.MotionTimeout").IntValue;
_isSimulator = SC.GetValue<bool>($"System.IsSimulatorMode");
_alignerMoveTimeOut = SC.GetValue<int>("HiWinAligner.AlignerMoveToCenterTimeOut");
return Result.RUN;
}
public override Result Monitor()
{
try
{
if (_target == ModuleName.Aligner && !_isSimulator)
{
AlignerCheckHaveWafer((int)RoutineStep.AlignerCheckWafer, 15); //发送指令检测是否有Wafer
AlignerMoveToRobotPutPalce((int)RoutineStep.AlignerMoveTo, _alignerMoveTimeOut); //Aligner移动至测量中心点
}
if (_target == ModuleName.LoadLock)
{
ExecuteRoutine((int)RoutineStep.SetLiftDown0, _loadLockLiftDown);
ExecuteRoutine((int)RoutineStep.SetClawOpen1, _loadLockClawOpen); //夹爪打开
}
else if (_target == ModuleName.UnLoad)
{
ExecuteRoutine((int)RoutineStep.SetLiftDown0, _unLoadLiftDown);
ExecuteRoutine((int)RoutineStep.SetClawOpen1, _unLoadClawOpen); //夹爪打开
}
ExecuteRoutine((int)RoutineStep.OpenSlitValve, _efemSlitValveOpenRoutine); //打开闸板阀
SetWaferRobortExtendToDO((int)RoutineStep.SetExtendToDo, _target, 10); //设置ExtendToDO,用于检测InterLock
CheckRobotReady((int)RoutineStep.CheckRobotReady, WaferRobot, _placeTimeout); //判断机械手当前是否空闲
ExtendForPlace((int)RoutineStep.ExtendForPlace, WaferRobot, _target, _targetSlot, _placeTimeout); //伸出,关真空
//夹爪打开,顶针上升
if (_target == ModuleName.LoadLock)
{
ExecuteRoutine((int)RoutineStep.SetLiftUp, _loadLockLiftUp);
}
else if (_target == ModuleName.UnLoad)
{
ExecuteRoutine((int)RoutineStep.SetLiftUp, _unLoadLiftUp);
}
Place((int)RoutineStep.Place, WaferRobot, _target, _targetSlot, _placeTimeout); //机械手收回
if (_target == ModuleName.LoadLock)
{
ExecuteRoutine((int)RoutineStep.SetClaw, _loadLockClaw);
ExecuteRoutine((int)RoutineStep.SetLiftDown, _loadLockLiftDown);
}
else if (_target == ModuleName.UnLoad)
{
ExecuteRoutine((int)RoutineStep.SetClaw, _unLoadClaw);
ExecuteRoutine((int)RoutineStep.SetLiftDown, _unLoadLiftDown);
}
ClearRobortExtendToDO((int)RoutineStep.ClearRobortExtendToDo);
TimeDelay((int)RoutineStep.TimeDelay1, 1);
CheckWaferStatuAfterPlace((int)RoutineStep.CheckWaferStatusByRq, WaferRobot, 10); //结束后检查Wafer
ExecuteRoutine((int)RoutineStep.CloseSlitValve, _efemSlitValveCloseRoutine); //关闭闸板阀
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException ex)
{
LOG.Error(ex.ToString());
return Result.FAIL;
}
Notify($"Finish");
return Result.DONE;
}
public override void Abort()
{
WaferRobot.Abort();
WaferRobot.Stop();
base.Abort();
}
protected void AlignerMoveToRobotPutPalce(int id, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Move to Robot Put Place");
_alignerDevice.MoveToRobotPutPlace();
return true;
}, () =>
{
return !_alignerDevice.IsBusy;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop($"Aligner Move to Robot Put Place Timeout, over {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
protected void AlignerCheckHaveWafer(int id, int timeout)
{
Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
{
Notify($"Aligner check wafer exist or not");
_alignerDevice.CheckWaferLoad();
return true;
}, () =>
{
if (!_alignerDevice.IsBusy)
{
if (_alignerDevice.HaveWafer)
{
Notify($"Check result : aligner have wafer, can not place to aligner");
return null;
}
else
{
return true;
}
}
return false;
}, timeout * 1000);
if (ret.Item1)
{
if (ret.Item2 == Result.FAIL)
{
throw (new RoutineFaildException());
}
else if (ret.Item2 == Result.TIMEOUT) //timeout
{
Stop($"Aligner Move to Robot Put Place Timeout, over {timeout} seconds");
throw (new RoutineFaildException());
}
else
throw (new RoutineBreakException());
}
}
}
}