|
@@ -50,6 +50,14 @@ namespace Venus_RT.Modules.PMs
|
|
|
|
|
|
public class PMEntity : Entity, IModuleEntity
|
|
|
{
|
|
|
+ public enum PMStatus
|
|
|
+ {
|
|
|
+ Not_Ready,
|
|
|
+ Ready_For_Pick,
|
|
|
+ Ready_For_Place,
|
|
|
+ Exchange_Ready,
|
|
|
+ }
|
|
|
+
|
|
|
public enum MSG
|
|
|
{
|
|
|
Home,
|
|
@@ -100,12 +108,21 @@ namespace Venus_RT.Modules.PMs
|
|
|
StopGasFlow,
|
|
|
RfPower,
|
|
|
MFCVerification,
|
|
|
+
|
|
|
+ // exchange wafer with TM
|
|
|
+ PreparePick,
|
|
|
+ PreparePlace,
|
|
|
+ LiftUpWafer,
|
|
|
+ DropDownWafer,
|
|
|
+ PickReady,
|
|
|
+ PlaceReady,
|
|
|
MaxMsg
|
|
|
}
|
|
|
|
|
|
private readonly JetPM _chamber;
|
|
|
|
|
|
public ModuleName Module { get; }
|
|
|
+ public PMStatus Status { get; private set; }
|
|
|
public Action<bool, bool> TransferPrepared;
|
|
|
|
|
|
private readonly PMHomeRoutine _home;
|
|
@@ -170,6 +187,10 @@ namespace Venus_RT.Modules.PMs
|
|
|
get { return _isOnline; }
|
|
|
}
|
|
|
public bool IsAutoMode => _AutoMode == AutoFlag.Auto;
|
|
|
+ public bool IsSlitDoorOpen => _chamber.CheckSlitDoorOpen();
|
|
|
+ public bool IsSlitDoorClose => _chamber.CheckSlitDoorClose();
|
|
|
+ public bool LiftPinIsDown => _chamber.LiftPinIsDown;
|
|
|
+ public bool LiftPinIsUp => _chamber.LiftPinIsUp;
|
|
|
|
|
|
public bool Check(int msg, out string reason, object[] objs)
|
|
|
{
|
|
@@ -355,8 +376,13 @@ namespace Venus_RT.Modules.PMs
|
|
|
fsm = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 50);
|
|
|
|
|
|
//Idle
|
|
|
- EnterExitTransition((int)PMState.Idle, FnIdle, (int)FSM_MSG.NONE, null);
|
|
|
- EnterExitTransition<PMState, FSM_MSG>(PMState.Error, fEnterError, FSM_MSG.NONE, null);
|
|
|
+ EnterExitTransition((int)PMState.Idle, FnIdle, (int)FSM_MSG.NONE, null);
|
|
|
+ EnterExitTransition<PMState, FSM_MSG>(PMState.Error, fEnterError, FSM_MSG.NONE, null);
|
|
|
+
|
|
|
+ EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPick, fnEnterPickReady, FSM_MSG.NONE, fnExitPickReady);
|
|
|
+ EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPlace, fnEnterPlaceReady, FSM_MSG.NONE, fnExitPlaceReady);
|
|
|
+ EnterExitTransition<PMState, FSM_MSG>(PMState.DropDownReady, fnEnterDropDownReady, FSM_MSG.NONE, fnExitDropDownReady);
|
|
|
+ EnterExitTransition<PMState, FSM_MSG>(PMState.LiftUpReady, fnEnterLiftUpReady, FSM_MSG.NONE, fnExitLiftUpReady);
|
|
|
|
|
|
|
|
|
//Home
|
|
@@ -472,6 +498,32 @@ namespace Venus_RT.Modules.PMs
|
|
|
Transition(PMState.MFCVerification, FSM_MSG.TIMER, FnMFCVerificationTimeout, PMState.Idle);
|
|
|
Transition(PMState.MFCVerification, MSG.Abort, FnAbortMFCVerification, PMState.Idle);
|
|
|
|
|
|
+ //////////////////////// Exchange Wafer with TM ///////////////////////////////////////////////////////
|
|
|
+ // Pick Wafer from PM
|
|
|
+ Transition(PMState.Idle, MSG.PreparePick, FnStartPreparePick, PMState.PreparePick);
|
|
|
+ Transition(PMState.PreparePick, MSG.Abort, FnAbortPreparePick, PMState.Idle);
|
|
|
+ Transition(PMState.PreparePick, FSM_MSG.TIMER, FnPreparePickTimeout, PMState.ReadyForPick);
|
|
|
+ Transition(PMState.ReadyForPick, MSG.Abort, FnAbortPick, PMState.Idle);
|
|
|
+ Transition(PMState.ReadyForPick, MSG.DropDownWafer, FnStartDropDownWafer, PMState.DropDownWafer);
|
|
|
+ Transition(PMState.DropDownWafer, FSM_MSG.TIMER, FnDropDownTimeout, PMState.DropDownReady);
|
|
|
+ Transition(PMState.DropDownReady, MSG.PickReady, FnStartFinishPick, PMState.FinishPick);
|
|
|
+ Transition(PMState.FinishPick, FSM_MSG.TIMER, FnFinishPickTimeout, PMState.Idle);
|
|
|
+
|
|
|
+
|
|
|
+ // Place Wafer to PM
|
|
|
+ Transition(PMState.Idle, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
|
|
|
+ Transition(PMState.PreparePlace, MSG.Abort, FnAbortPreparePlace, PMState.Idle);
|
|
|
+ Transition(PMState.PreparePlace, FSM_MSG.TIMER, FnPreparePlaceTimeout, PMState.ReadyForPlace);
|
|
|
+ Transition(PMState.ReadyForPlace, MSG.LiftUpWafer, FnStartLiftUpWafer, PMState.LiftUpWafer);
|
|
|
+ Transition(PMState.LiftUpWafer, FSM_MSG.TIMER, FnLiftUpTimeout, PMState.LiftUpReady);
|
|
|
+ Transition(PMState.LiftUpReady, MSG.PlaceReady, FnStartFinishPlace, PMState.FinishPlace);
|
|
|
+ Transition(PMState.ReadyForPlace, MSG.Abort, FnAortPlace, PMState.Idle);
|
|
|
+ Transition(PMState.FinishPlace, FSM_MSG.TIMER, FnFinishPlaceTimeout, PMState.Idle);
|
|
|
+
|
|
|
+
|
|
|
+ // Swap Wafer With PM
|
|
|
+ Transition(PMState.DropDownReady, MSG.PreparePlace, FnStartSwapPlace, PMState.PreparePlace);
|
|
|
+
|
|
|
Running = true;
|
|
|
|
|
|
WaferManager.Instance.SubscribeLocation(Module, 1);
|
|
@@ -514,9 +566,57 @@ namespace Venus_RT.Modules.PMs
|
|
|
|
|
|
private bool fEnterError(object[] objs)
|
|
|
{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnEnterPickReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Ready_For_Pick;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnExitPickReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Not_Ready;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnEnterPlaceReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Ready_For_Place;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnExitPlaceReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Not_Ready;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnEnterDropDownReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Exchange_Ready;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnExitDropDownReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Not_Ready;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnEnterLiftUpReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Exchange_Ready;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
+ private bool fnExitLiftUpReady(object[] objs)
|
|
|
+ {
|
|
|
+ Status = PMStatus.Not_Ready;
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
private bool FnError(object[] objs)
|
|
|
{
|
|
|
Running = false;
|
|
@@ -963,7 +1063,6 @@ namespace Venus_RT.Modules.PMs
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private bool FnStartRfPower(object[] param)
|
|
|
{
|
|
|
return _rfPowerRoutine.Start(param) == RState.Running;
|
|
@@ -1014,6 +1113,139 @@ namespace Venus_RT.Modules.PMs
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ #region Exchange wafer with TM
|
|
|
+ private bool FnStartPreparePick(object[] param)
|
|
|
+ {
|
|
|
+ if(!_chamber.SetLiftPin(MovementPosition.Up, out string reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!_chamber.SetSlitDoor(true, out reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool FnPreparePickTimeout(object[] param)
|
|
|
+ {
|
|
|
+ return _chamber.LiftPinIsUp && IsSlitDoorOpen;
|
|
|
+ }
|
|
|
+ private bool FnAbortPreparePick(object[] param)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FnStartFinishPick(object[] param)
|
|
|
+ {
|
|
|
+ if (!_chamber.SetSlitDoor(false, out string reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool FnAbortPick(object[] param)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool FnFinishPickTimeout(object[] param)
|
|
|
+ {
|
|
|
+ return IsSlitDoorClose;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FnStartDropDownWafer(object[] param)
|
|
|
+ {
|
|
|
+ if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return _chamber.SetLiftPin(MovementPosition.Down, out string _);
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FnDropDownTimeout(object[] param)
|
|
|
+ {
|
|
|
+ return _chamber.LiftPinIsDown;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FnStartPreparePlace(object[] param)
|
|
|
+ {
|
|
|
+ if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!_chamber.SetSlitDoor(true, out reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool FnPreparePlaceTimeout(object[] param)
|
|
|
+ {
|
|
|
+ return _chamber.LiftPinIsDown && IsSlitDoorOpen;
|
|
|
+ }
|
|
|
+ private bool FnAbortPreparePlace(object[] param)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FnStartLiftUpWafer(object[] param)
|
|
|
+ {
|
|
|
+ if (!_chamber.SetLiftPin(MovementPosition.Up, out string reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FnLiftUpTimeout(object[] param)
|
|
|
+ {
|
|
|
+ return _chamber.LiftPinIsUp;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FnStartFinishPlace(object[] param)
|
|
|
+ {
|
|
|
+ if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!_chamber.SetSlitDoor(false, out reason))
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool FnAortPlace(object[] param)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool FnFinishPlaceTimeout(object[] param)
|
|
|
+ {
|
|
|
+ return _chamber.LiftPinIsDown && IsSlitDoorClose;
|
|
|
+ }
|
|
|
+ private bool FnStartSwapPlace(object[] param)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
private void _debugRoutine()
|
|
|
{
|
|
|
int flag = 0;
|