Browse Source

fix the bug in Pendulum Valve for FullRangePressure && fix the bug of Pump/Vent in VenusSE && add check before VCE move in z-axis

zhouhr 1 year ago
parent
commit
4e783f1934

+ 4 - 0
Venus/Venus_RT/Config/TM/DeviceModelVenusDE_MF.xml

@@ -47,6 +47,10 @@
 						infoText="" warningText="" alarmText="" />
 		<IoSensor id="VCEBProtrusionSensor" display="VCEB Protrusion Sensor"  schematicId="" unit="" di="DI_VCEB_Protrusion" isLowAsNormal="" textOutTrigValue="false"
 						infoText="" warningText="" alarmText="" />
+		<IoSensor id="ROBOTNotExtendVCEA" display="ROBOT Not Extend VCEA"  schematicId="" unit="" di="DI_ROBOT_TO_VCEA_RETRACT" isLowAsNormal="" textOutTrigValue="false"
+						infoText="" warningText="" alarmText="" />
+		<IoSensor id="ROBOTNotExtendVCEB" display="ROBOT Not Extend VCEB"  schematicId="" unit="" di="DI_ROBOT_TO_VCEB_RETRACT" isLowAsNormal="" textOutTrigValue="false"
+				infoText="" warningText="" alarmText="" />
 	</IoSensors>
 	<IoCylinders assembly="Venus_RT" classType="Venus_RT.Devices.IoCylinder">
 		<IoCylinder id="VCEASlitDoor" display="VCEA Slit Door" schematicId="" unit="" doMotorRelay=""

BIN
Venus/Venus_RT/Config/TM/DeviceModelVenusSE_MF.xml


+ 1 - 1
Venus/Venus_RT/Devices/JetVenusDEPM.cs

@@ -1284,7 +1284,7 @@ namespace Venus_RT.Devices
         => _pendulumValve.SetPosition(position);
 
         public override bool SetPVPressure(float pressure)
-        => _pendulumValve.SetPressure(pressure / 10);
+        => _pendulumValve.SetPressure(pressure);
 
         public override bool SetSlitDoor(bool open, out string reason)
         {

+ 18 - 17
Venus/Venus_RT/Devices/PendulumValve.cs

@@ -311,23 +311,24 @@ namespace Venus_RT.Devices
                             Double pressure;
                             if (Double.TryParse(data[1], out pressure))
                             {
-                                if ((m_JetChamber == JetChamber.Kepler2200A || m_JetChamber == JetChamber.Kepler2200B))
-                                {
-                                    //Pressure = Convert.ToSingle(ConvertPressureUnit.ConvertmTorrToPa(pressure * _pressure_ful_range / 1000000));
-                                    Pressure = Convert.ToSingle( pressure * _pressure_ful_range / 1000000);
-                                }
-                                else if (m_JetChamber == JetChamber.VenusSE)
-                                {
-                                    Pressure = Convert.ToSingle(pressure) / 100;
-                                }
-                                else if (m_JetChamber == JetChamber.VenusDE)
-                                {
-                                    Pressure = Convert.ToSingle(pressure);
-                                }
-                                else
-                                {
-                                    Pressure = Convert.ToSingle(pressure) * _pressure_ful_range / 1000000;
-                                }
+                                Pressure = Convert.ToSingle(pressure) * _pressure_ful_range / 1000000;
+                                //if ((m_JetChamber == JetChamber.Kepler2200A || m_JetChamber == JetChamber.Kepler2200B))
+                                //{
+                                //    //Pressure = Convert.ToSingle(ConvertPressureUnit.ConvertmTorrToPa(pressure * _pressure_ful_range / 1000000));
+                                //    Pressure = Convert.ToSingle( pressure * _pressure_ful_range / 1000000);
+                                //}
+                                //else if (m_JetChamber == JetChamber.VenusSE)
+                                //{
+                                //    Pressure = Convert.ToSingle(pressure) / 100;
+                                //}
+                                //else if (m_JetChamber == JetChamber.VenusDE)
+                                //{
+                                //    Pressure = Convert.ToSingle(pressure);
+                                //}
+                                //else
+                                //{
+                                //    Pressure = Convert.ToSingle(pressure) * _pressure_ful_range / 1000000;
+                                //}
                             }
                                 
                         }

+ 11 - 0
Venus/Venus_RT/Devices/TM/HongHuDETM.cs

@@ -66,6 +66,8 @@ namespace Venus_RT.Devices.TM
         private readonly IoSensor _VCEBLOCKEDSensor;
         private readonly IoSensor _VCEAProtrusionSensor;
         private readonly IoSensor _VCEBProtrusionSensor;
+        private readonly IoSensor _ROBOTNotExtendVCEA;
+        private readonly IoSensor _ROBOTNotExtendVCEB;
 
         //控制门信号
         private readonly IoCylinder _VCEASlitDoor;
@@ -294,6 +296,9 @@ namespace Venus_RT.Devices.TM
         public bool TMExtendPMCEnable => _TMExtendPMCEnable.Value;
         public bool TMExtendPMDEnable => _TMExtendPMDEnable.Value;
 
+        public override bool RobotNotExtendVCEA => _ROBOTNotExtendVCEA.Value;
+        public override bool RobotNotExtendVCEB => _ROBOTNotExtendVCEB.Value;
+
         public override double TMPressure => _TMPressure.Value;
         public override double VCEAPressure => _VCEAPressure.Value;
         public override double VCEBPressure => _VCEBPressure.Value;
@@ -349,6 +354,10 @@ namespace Venus_RT.Devices.TM
             _VCEBLOCKEDSensor = DEVICE.GetDevice<IoSensor>($"{Module}.VCEBLOCKEDSensor");
             _VCEAProtrusionSensor = DEVICE.GetDevice<IoSensor>($"{Module}.VCEAProtrusionSensor");
             _VCEBProtrusionSensor = DEVICE.GetDevice<IoSensor>($"{Module}.VCEBProtrusionSensor");
+            _ROBOTNotExtendVCEA = DEVICE.GetDevice<IoSensor>($"{Module}.ROBOTNotExtendVCEA");
+            _ROBOTNotExtendVCEB = DEVICE.GetDevice<IoSensor>($"{Module}.ROBOTNotExtendVCEB");
+
+
             _VCEASlitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.VCEASlitDoor}");
             _VCEBSlitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.VCEBSlitDoor}");
             _PMASlitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.PMASlitDoor}");
@@ -462,6 +471,8 @@ namespace Venus_RT.Devices.TM
             return false;
         }
 
+        
+
         public override void ReleaseVent(ModuleName Module)
         {
             if ((Module == ModuleName.VCEA && _ventStatus == VentStatus.VCEAVenting) || 

+ 36 - 1
Venus/Venus_RT/Devices/TM/HongHuTM.cs

@@ -51,6 +51,7 @@ namespace Venus_RT.Devices
         private readonly IoSensor _VCEVACSensor;
         private readonly IoSensor _VCEATMSensor;
         private readonly IoSensor _TMATMSensor;
+        private readonly IoSensor _ROBOTNotExtendVCE;
 
         //控制门信号
         private readonly IoCylinder _VCESlitDoor;
@@ -77,7 +78,7 @@ namespace Venus_RT.Devices
         private double TMVACTargetPressure;
         private double VCEATMTargetPressure;
         private double VCEVACTargetPressure;
-
+        private VentStatus _ventStatus = VentStatus.Idle;
         #endregion
 
         #region 暴露变量
@@ -210,6 +211,7 @@ namespace Venus_RT.Devices
         public bool TMExtendPMBEnable => _TMExtendPMBEnable.Value;
         public bool TMExtendPMCEnable => _TMExtendPMCEnable.Value;
 
+        public override bool RobotNotExtendVCE => _ROBOTNotExtendVCE.Value;
         public override double TMPressure => _TMPressure.Value;
         public override double VCEPressure => _VCEPressure.Value;
 
@@ -243,6 +245,7 @@ namespace Venus_RT.Devices
             _VCESlitDoorCloseEnable = DEVICE.GetDevice<IoSensor>($"{Module}.{VenusDevice.VCESlitDoorCloseEnable}");
             _PMASlitDoorCloseEnable = DEVICE.GetDevice<IoSensor>($"{Module}.{VenusDevice.PMASlitDoorCloseEnable}");
             _PMBSlitDoorCloseEnable = DEVICE.GetDevice<IoSensor>($"{Module}.{VenusDevice.PMBSlitDoorCloseEnable}");
+            _ROBOTNotExtendVCE = DEVICE.GetDevice<IoSensor>($"{Module}.ROBOTNotExtendVCE");
 
             _TMVACSensor = DEVICE.GetDevice<IoSensor>($"{Module}.{VenusDevice.TMVACSensor}");
             _VCEVACSensor = DEVICE.GetDevice<IoSensor>($"{Module}.{VenusDevice.VCEVACSensor}");
@@ -320,6 +323,38 @@ namespace Venus_RT.Devices
                 _PressureControl.SetMode(false);
             }
         }
+
+
+        public override bool TryGetVent(ModuleName mod)
+        {
+            //Self
+            if ((mod == ModuleName.VCE1 && _ventStatus == VentStatus.VCE1Venting) ||
+                (mod == ModuleName.TM && _ventStatus == VentStatus.TMVenting))
+                return true;
+
+            //Idle
+            if (mod == ModuleName.VCE1 && _ventStatus == VentStatus.Idle)
+            {
+                _ventStatus = VentStatus.VCE1Venting;
+                return true;
+            }
+            if (mod == ModuleName.TM && _ventStatus == VentStatus.Idle)
+            {
+                _ventStatus = VentStatus.TMVenting;
+                return true;
+            }
+            LOG.Write(eEvent.WARN_DEFAULT_WARN, mod, $"cannot Vent {mod},as {_ventStatus}!");
+            //locked
+            return false;
+        }
+
+        public override void ReleaseVent(ModuleName Module)
+        {
+            if ((Module == ModuleName.VCE1 && _ventStatus == VentStatus.VCE1Venting) ||
+                (Module == ModuleName.TM && _ventStatus == VentStatus.TMVenting))
+                _ventStatus = VentStatus.Idle;
+        }
+
         public override bool TurnSlitDoor(ModuleName mod, bool bOn)
         {
             double MaxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");

+ 5 - 0
Venus/Venus_RT/Devices/TM/TMBase.cs

@@ -83,11 +83,15 @@ namespace Venus_RT.Devices.TM
         public virtual bool VCECassPresent { get; }
         public virtual bool VCEACassPresent { get; }
         public virtual bool VCEBCassPresent { get; }
+        public virtual bool VCELOCKED { get; }
         public virtual bool VCEALOCKED { get; }
         public virtual bool VCEBLOCKED { get; }
         public virtual bool VCEProtrusion { get; }
         public virtual bool VCEAProtrusion { get; }
         public virtual bool VCEBProtrusion { get; }
+        public virtual bool RobotNotExtendVCEA { get; }
+        public virtual bool RobotNotExtendVCEB { get; }
+        public virtual bool RobotNotExtendVCE { get; }
         public virtual PumpState PumpingState { get; }
 
         public TMBase(string module) : base(module, module, module, module)
@@ -105,6 +109,7 @@ namespace Venus_RT.Devices.TM
             return true;
         }
 
+
         public virtual void CloseModuleAllValves(ModuleName module)
         {
 

+ 10 - 1
Venus/Venus_RT/Devices/VCE/HongHuVce.cs

@@ -11,6 +11,7 @@ using MECF.Framework.Common.SubstrateTrackings;
 using MECF.Framework.RT.ModuleLibrary.VceModules;
 using System;
 using System.Collections.Generic;
+using System.Configuration;
 using System.IO.Ports;
 using System.Linq;
 using System.Text;
@@ -310,7 +311,7 @@ namespace Venus_RT.Devices.VCE
                     case ModuleName.VCE1:
                         //2024-05-20 16:35:34 泓浒四边形硬件还未实现
                         //DEVICE.GetDevice<HongHuTM>("SETM").VCEACassPresent
-                        return true;
+                        return _vcedoorflag;
                     case ModuleName.VCEA:
                         if (DEVICE.GetDevice<HongHuDETM>("TM").VCEACassPresent)
                         {
@@ -341,6 +342,7 @@ namespace Venus_RT.Devices.VCE
             }
         }
         public override bool OutDoorIsOpen => _OutDoorIsOpen;
+        private bool _vcedoorflag;
 
         private bool _hasProtrusion
         {
@@ -386,6 +388,7 @@ namespace Venus_RT.Devices.VCE
         public HongHuVce(int slot, ModuleName moduleName) : base(slot, moduleName)
         {
             _moduleName = moduleName;
+            _vcedoorflag = false;
             _IsAsciiMode = true;
             _portname = SC.GetStringValue($"{moduleName}.Port");
             _serialport = new AsyncSerialPort(_portname, 9600, 8, Parity.None, StopBits.One, _newline, _IsAsciiMode);
@@ -476,6 +479,12 @@ namespace Venus_RT.Devices.VCE
                                         case VceCommand.GotoLP:
                                             _currentSlot = 0;
                                             break;
+                                        case VceCommand.DoorClose:
+                                            _vcedoorflag = false;
+                                            break;
+                                        case VceCommand.DoorOpen:
+                                            _vcedoorflag = true;
+                                            break;
                                     }
                                     _status = RState.End;
                                     break;

+ 19 - 0
Venus/Venus_RT/Modules/TM/VenusEntity/SETMEntity.cs

@@ -188,6 +188,25 @@ namespace Venus_RT.Modules.TM.VenusEntity
             }
         }
 
+        public bool VCECanMove(ModuleName VCEName)
+        {
+            switch (RtInstance.ConfigType)
+            {
+                case ConfigType.VenusSE:
+                    if(_tm.VCESlitDoorClosed(VCEName))
+                        return true;
+                    else
+                        return _tm.RobotNotExtendVCE;
+                case ConfigType.VenusDE:
+                    if (_tm.VCESlitDoorClosed(VCEName))
+                        return true;
+                    else
+                        return VCEName == ModuleName.VCEA ? _tm.RobotNotExtendVCEA : _tm.RobotNotExtendVCEB;
+                default:
+                    return false;
+            }
+        }
+
         private bool _IsOnline;
         public bool IsOnline => _IsOnline;
 

+ 102 - 17
Venus/Venus_RT/Modules/VCE/VceEntity.cs

@@ -121,6 +121,8 @@ namespace Venus_RT.Modules.VCE
         public int CurrentSlot => _vce.CurrentSlot;
         public int MoveSlot => moveSlot;
 
+        
+
         public VCEModuleBase VCEDevice => _vce;
 
         //public int CurrentSlot => currentSlot;
@@ -430,13 +432,23 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartGotoLP(object[] param)
         {
-            if (_vce.GotoLP())
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
             {
-                targetSlot = -1;
-                return true;
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
             }
             else
-                return false;
+            {
+                if (_vce.GotoLP())
+                {
+                    targetSlot = -1;
+                    return true;
+                }
+                else
+                    return false;
+            }
+            
 
         }
 
@@ -485,7 +497,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartSafeUnLoad(object[] param)
         {
-            return _unloadRoutine.Start(param) == RState.Running;
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _unloadRoutine.Start(param) == RState.Running;
         }
 
         private bool fnSafeLoadTimeout(object[] param)
@@ -506,7 +525,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartLoadWithSMIF(object[] param)
         {
-            return _loadwithSMIFRoutine.Start(param) == RState.Running;
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _loadwithSMIFRoutine.Start(param) == RState.Running;
         }
 
         private bool fnLoadWithSMIFAbort(object[] param)
@@ -534,7 +560,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartUnLoadWithSMIF(object[] param)
         {
-            return _unloadwithSMIFRoutine.Start(param) == RState.Running;
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _unloadwithSMIFRoutine.Start(param) == RState.Running;
         }
 
         private bool fnUnLoadWithSMIFAbort(object[] param)
@@ -562,7 +595,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartSafeLoad(object[] param)
         {
-            return _loadRoutine.Start(param) == RState.Running;
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _loadRoutine.Start(param) == RState.Running;
         }
 
         private bool fnSafeLoadAbort(object[] param)
@@ -590,7 +630,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartLoadPrepare(object[] param)
         {
-            return _prepareRoutine.Start(param) == RState.Running;
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _prepareRoutine.Start(param) == RState.Running;
         }
 
         private bool fnReadingMapTimeout(object[] param)
@@ -617,13 +664,23 @@ namespace Venus_RT.Modules.VCE
         //升降到槽位
         private bool fnStartGoto(object[] param)
         {
-            if (_vce.Goto(Convert.ToInt32(param[0].ToString())))
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
             {
-                targetSlot = Convert.ToInt32(param[0]);
-                return true;
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
             }
             else
-                return false;
+            {
+                if (_vce.Goto(Convert.ToInt32(param[0].ToString())))
+                {
+                    targetSlot = Convert.ToInt32(param[0]);
+                    return true;
+                }
+                else
+                 return false; 
+            }
+            
         }
 
         private bool fnGotingTimeout(object[] param)
@@ -647,7 +704,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartHome(object[] param)
         {
-            return _homeRoutine.Start(param) == RState.Running;
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed,_modulename,$"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _homeRoutine.Start(param) == RState.Running;
         }
 
         private bool fnHomeTimeout(object[] param)
@@ -718,7 +782,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartMapping(object[] param)
         {
-            return _vce.Map();
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _vce.Map();
         }
 
         private bool fnMappingTimeout(object[] param)
@@ -734,7 +805,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartLoading(object[] param)
         {
-            return _vce.Load();
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _vce.Load();
         }
 
         private bool fnLoadingTimeout(object[] param)
@@ -750,7 +828,14 @@ namespace Venus_RT.Modules.VCE
 
         private bool fnStartUnLoading(object[] param)
         {
-            return _vce.UnLoad();
+            if (!Singleton<RouteManager>.Instance.seTM.VCECanMove(_modulename))
+            {
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} cannot move as {_modulename}SlitDoor is Open and Robot not extend sensor is off!");
+                PostMsg(VceMSG.Error);
+                return false;
+            }
+            else
+                return _vce.UnLoad();
         }
 
         private bool fnUnLoadingTimeout(object[] param)