|
@@ -14,6 +14,7 @@ using MECF.Framework.Common.Schedulers;
|
|
|
using System.Collections.Generic;
|
|
|
using System;
|
|
|
using Aitex.Core.RT.Device;
|
|
|
+using MECF.Framework.Common.DBCore;
|
|
|
|
|
|
namespace Venus_RT.Modules.TM
|
|
|
{
|
|
@@ -45,8 +46,14 @@ namespace Venus_RT.Modules.TM
|
|
|
OpenSlitDoor,
|
|
|
PickPrepare,
|
|
|
Picking,
|
|
|
+ QueryPickAWCData,
|
|
|
+ SavePickAWCData,
|
|
|
+ CheckPickAWCData,
|
|
|
PlacePrepare,
|
|
|
Placing,
|
|
|
+ QueryPlaceAWCData,
|
|
|
+ SavePlaceAWCData,
|
|
|
+ CheckPlaceAWCData,
|
|
|
CloseSlitDoor,
|
|
|
NotifyDone,
|
|
|
}
|
|
@@ -65,6 +72,14 @@ namespace Venus_RT.Modules.TM
|
|
|
private Hand _placeHand;
|
|
|
double maxPressureDifference;
|
|
|
|
|
|
+
|
|
|
+ private bool _pickQueryAWC;
|
|
|
+ private bool _placeQueryAWC;
|
|
|
+ private Hand _hand;
|
|
|
+ private DateTime _starttime;
|
|
|
+ private int _robotTransferAWCOffset;
|
|
|
+
|
|
|
+
|
|
|
public MFPMSwapRoutine(JetTM tm, ITransferRobot robot) : base(ModuleName.TMRobot)
|
|
|
{
|
|
|
_JetTM = tm;
|
|
@@ -129,6 +144,23 @@ namespace Venus_RT.Modules.TM
|
|
|
_pickDelayTime = SC.GetValue<int>($"{_targetModule}.PickDelayTime");
|
|
|
_placeDelayTime = SC.GetValue<int>($"{_targetModule}.PlaceDelayTime");
|
|
|
maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
|
|
|
+
|
|
|
+ int queryAWCType = SC.GetValue<int>($"TM.QueryAWCOption");
|
|
|
+ if (queryAWCType == 1)
|
|
|
+ {
|
|
|
+ _pickQueryAWC = true;
|
|
|
+ }
|
|
|
+ else if (queryAWCType == 2)
|
|
|
+ {
|
|
|
+ _placeQueryAWC = true;
|
|
|
+ }
|
|
|
+ else if (queryAWCType == 3)
|
|
|
+ {
|
|
|
+ _pickQueryAWC = true;
|
|
|
+ _placeQueryAWC = true;
|
|
|
+ }
|
|
|
+ _robotTransferAWCOffset = SC.GetValue<int>("TM.EnterPMAWCAlarmLimit");
|
|
|
+
|
|
|
return Runner.Start(Module, $"Swap with {_targetModule}");
|
|
|
}
|
|
|
|
|
@@ -181,8 +213,18 @@ namespace Venus_RT.Modules.TM
|
|
|
.Wait(SwapWithHeaterStep.WaitPressreStable, TMPMPressureIsOK, _delay_60s)
|
|
|
.Run(SwapWithHeaterStep.OpenSlitDoor, OpenPMSlitDoor, OpenPMSlitDoorIsOK)
|
|
|
.Run(SwapWithHeaterStep.Picking, Picking, WaitPickDone)
|
|
|
+
|
|
|
+ .RunIf(SwapWithHeaterStep.QueryPickAWCData, _pickQueryAWC, QueryAWC, WaitRobotQueryDone)
|
|
|
+ .RunIf(SwapWithHeaterStep.SavePickAWCData, _pickQueryAWC, RecordAWCData, NullFun)
|
|
|
+ .RunIf(SwapWithHeaterStep.CheckPickAWCData, _pickQueryAWC, CheckAwc)
|
|
|
+
|
|
|
.Run(SwapWithHeaterStep.PlacePrepare, PlacePrepare, IsModuleReadyForPlace)
|
|
|
.Run(SwapWithHeaterStep.Placing, Placing, WaitPlaceDone)
|
|
|
+
|
|
|
+ .RunIf(SwapWithHeaterStep.QueryPlaceAWCData, _placeQueryAWC, QueryAWC, WaitRobotQueryDone)
|
|
|
+ .RunIf(SwapWithHeaterStep.SavePlaceAWCData, _placeQueryAWC, RecordAWCData, NullFun)
|
|
|
+ .RunIf(SwapWithHeaterStep.CheckPlaceAWCData, _placeQueryAWC, CheckAwc)
|
|
|
+
|
|
|
.Run(SwapWithHeaterStep.CloseSlitDoor, ClosePMSlitDoor, ClosePMSlitDoorIsOK)
|
|
|
.End(SwapWithHeaterStep.NotifyDone, NotifyPMDone, _delay_50ms);
|
|
|
break;
|
|
@@ -292,6 +334,9 @@ namespace Venus_RT.Modules.TM
|
|
|
Runner.Stop($"不允许Pick,传片位置信号满足,但不在Position1");
|
|
|
return false;
|
|
|
}
|
|
|
+ _hand = _pickHand;
|
|
|
+ _starttime=DateTime.Now;
|
|
|
+
|
|
|
return _robot.Pick(_targetModule, _targetSlot, _pickHand);
|
|
|
|
|
|
//if (_jetPM.PreparePickIsOK())
|
|
@@ -304,7 +349,58 @@ namespace Venus_RT.Modules.TM
|
|
|
// return false;
|
|
|
//}
|
|
|
}
|
|
|
+ private bool QueryAWC()
|
|
|
+ {
|
|
|
+ return _robot.QueryAwc();
|
|
|
+ }
|
|
|
+ private bool RecordAWCData()
|
|
|
+ {
|
|
|
+
|
|
|
+ //已经move后的数据
|
|
|
+ string _origin_module = $"LP{WaferManager.Instance.GetWafer(_targetModule, _targetSlot).OriginStation}";
|
|
|
+ int _origin_slot = WaferManager.Instance.GetWafer(_targetModule, _targetSlot).OriginSlot;
|
|
|
+ //查询完毕 插入数据
|
|
|
+ OffsetDataRecorder.RecordOffsetData(
|
|
|
+ Guid.NewGuid().ToString(),
|
|
|
+ ModuleName.TMRobot, 0,
|
|
|
+ _targetModule, _targetSlot,
|
|
|
+ _origin_module, _origin_slot,
|
|
|
+ _hand, RobotArmPan.None,
|
|
|
+ _robot.Offset_X, _robot.Offset_Y, _robot.Offset_D,
|
|
|
+ _starttime, DateTime.Now);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool CheckAwc()
|
|
|
+ {
|
|
|
+ if (Math.Abs(_robot.Offset_X) > _robotTransferAWCOffset)
|
|
|
+ {
|
|
|
+ Stop($"Check AWC 失败, 当前 X AWC [{_robot.Offset_X}um], 高于Alarm最大值: [{_robotTransferAWCOffset}]um");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (Math.Abs(_robot.Offset_Y) > _robotTransferAWCOffset)
|
|
|
+ {
|
|
|
+ Stop($"Check AWC 失败, 当前 Y AWC [{_robot.Offset_Y}um], 高于Alarm最大值: [{_robotTransferAWCOffset}]um");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
+ private bool WaitRobotQueryDone()
|
|
|
+ {
|
|
|
+ if (_robot.Status == RState.Running)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else if (_robot.Status == RState.End)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Runner.Stop($"TM Robot Query Awc failed, {_robot.Status}");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
private bool WaitPickDone()
|
|
|
{
|
|
|
if (_robot.Status == RState.Running)
|
|
@@ -336,6 +432,8 @@ namespace Venus_RT.Modules.TM
|
|
|
Runner.Stop($"不允许Place,传片位置信号满足,但不在Position1");
|
|
|
return false;
|
|
|
}
|
|
|
+ _hand = _placeHand;
|
|
|
+ _starttime = DateTime.Now;
|
|
|
return _robot.Place(_targetModule, _targetSlot, _placeHand);
|
|
|
|
|
|
}
|