Browse Source

Revise GalilHomeStep;

niuyx 1 week ago
parent
commit
a8d6545300

+ 2 - 1
CyberX8_RT/Devices/AXIS/Galil/GalilHomeRoutine.cs

@@ -67,10 +67,11 @@ namespace CyberX8_RT.Devices.AXIS.Galil
                     return _axis.MotionData.StopCode == HOME_STOP_CODE&&!_axis.IsRun; },CheckErrorOrWarning,_timeout)
                 .Delay(HomeStep.DPDelay,1000)
                 .Run(HomeStep.DP, () => { return _axis.WriteDP(_homingOffset); }, _delay_1ms)
-                .Delay(HomeStep.WaitDP, 1000)
+                .Wait(HomeStep.WaitDP, () => { return Math.Round(Math.Abs(_axis.MotionData.MotorPosition - _homingOffset / _axis.ScaleFactor), 2) <= _axis.ToleranceDefault; }, _delay_1s)
                 .End(HomeStep.End,NullFun,100);
             return Runner.Status;
         }
+        
         /// <summary>
         /// 检验是否出错或告警
         /// </summary>

+ 2 - 1
CyberX8_RT/Devices/AXIS/GalilLipsel/GalilLipselHomeRoutine.cs

@@ -85,10 +85,11 @@ namespace CyberX8_RT.Devices.AXIS.GalilLipsel
                 .WaitWithStopCondition(HomeStep.CheckForwardMotion, CheckRightMotionEnd, CheckErrorOrWarning, _timeout)
                 .Delay(HomeStep.DPDelay, 1000)
                 .Run(HomeStep.DP, () => { return _axis.WriteDP(_homingOffset); }, _delay_1ms)
-                .Delay(HomeStep.WaitDP, 1000)
+                .Wait(HomeStep.WaitDP, () => { return Math.Round(Math.Abs(_axis.MotionData.MotorPosition - _homingOffset / _axis.ScaleFactor), 2) <= _axis.ToleranceDefault; }, _delay_1s)
                 .End(HomeStep.End,NullFun,100);
             return Runner.Status;
         }
+        
         /// <summary>
         /// 检验运动(一直运动至motionposition不再变小为止)
         /// </summary>

+ 1 - 1
CyberX8_RT/Devices/AXIS/GalilRotation/GalilRotationHomeRoutine.cs

@@ -67,7 +67,7 @@ namespace CyberX8_RT.Devices.AXIS.Galil
                     return _axis.MotionData.StopCode == HOME_STOP_CODE&&!_axis.IsRun; },CheckErrorOrWarning,_timeout)
                 .Delay(HomeStep.DPDelay,1000)
                 .Run(HomeStep.DP, () => { return _axis.WriteDP(_homingOffset); }, _delay_1ms)
-                .Delay(HomeStep.WaitDP, 1000)
+                .Wait(HomeStep.WaitDP, () => { return Math.Round(Math.Abs(_axis.MotionData.MotorPosition - _homingOffset / _axis.ScaleFactor), 2) <= _axis.ToleranceDefault; }, _delay_1s)
                 .End(HomeStep.End,NullFun,100);
             return Runner.Status;
         }

+ 8 - 0
CyberX8_RT/Devices/AXIS/JetAxisBase.cs

@@ -320,6 +320,14 @@ namespace CyberX8_RT.Devices.AXIS
         /// 所有io变量是否初始化
         /// </summary>
         public bool IOInitialized { get { return AllIoVariableInitialized(); } }
+        /// <summary>
+        /// ScaleFactor
+        /// </summary>
+        public double ScaleFactor { get { return _scaleFactor; } }
+        /// <summary>
+        /// ScaleFactor
+        /// </summary>
+        public double ToleranceDefault { get { return _stationAxis.ToleranceDefault; } }
         #endregion
         /// <summary>
         /// 构造函数