Browse Source

Revise SRD velocity display; Modify velocity simulator; Modify SRD Stopposition;

niuyx 1 week ago
parent
commit
93180b356d

+ 15 - 0
CyberX8_RT/Config/Devices/AxisProviderCfg.xml

@@ -9,6 +9,7 @@
     <JogLimit>5</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>31.25</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Loader1.TiltB">
     <Driver>Beckhoff</Driver>
@@ -18,6 +19,7 @@
     <JogLimit>5</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>31.25</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Loader1.ShuttleA">
     <Driver>Beckhoff</Driver>
@@ -27,6 +29,7 @@
     <JogLimit>5</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>31.25</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Loader1.ShuttleB">
     <Driver>Beckhoff</Driver>
@@ -36,6 +39,7 @@
     <JogLimit>5</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>31.25</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Loader1.LSA">
     <Driver>Beckhoff</Driver>
@@ -45,6 +49,7 @@
     <JogLimit>720</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>31.25</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Loader1.LSB">
     <Driver>Beckhoff</Driver>
@@ -54,6 +59,7 @@
     <JogLimit>720</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>31.25</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Loader1.Rotation">
 	<Driver>Beckhoff</Driver>
@@ -63,6 +69,7 @@
     <JogLimit>5</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>31.25</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Transporter1.Gantry">
     <Driver>Beckhoff</Driver>
@@ -72,6 +79,7 @@
     <JogLimit>200</JogLimit>
 	<MinMoveTime>1.0</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Transporter1.Elevator">
     <Driver>Beckhoff</Driver>
@@ -82,6 +90,7 @@
     <JogLimit>25</JogLimit>
 	<MinMoveTime>1.0</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Transporter2.Gantry">
     <Driver>Beckhoff</Driver>
@@ -91,6 +100,7 @@
     <JogLimit>200</JogLimit>
 	<MinMoveTime>1.0</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="Transporter2.Elevator">
     <Driver>Beckhoff</Driver>
@@ -101,6 +111,7 @@
     <JogLimit>25</JogLimit>
 	<MinMoveTime>1.0</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   
   <Axis Name="PUF1.Rotation">
@@ -112,6 +123,7 @@
     <JogLimit>5</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="PUF1.Flip">
     <Driver>Beckhoff</Driver>
@@ -122,6 +134,7 @@
     <JogLimit>5</JogLimit>
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
   </Axis>
   <Axis Name="SRD1.Rotation">
     <Driver>Beckhoff</Driver>
@@ -135,6 +148,7 @@
     <!--ScaleFactor>21176</ScaleFactor-->
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>64</VelocityRate>
   </Axis> 
   <Axis Name="SRD2.Rotation">
     <Driver>Beckhoff</Driver>
@@ -148,5 +162,6 @@
     <!--ScaleFactor>21176</ScaleFactor-->
 	<MinMoveTime>0.5</MinMoveTime>
 	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>64</VelocityRate>
   </Axis>
 </Axes>

+ 2 - 2
CyberX8_RT/Config/Devices/GalilControllerCfg.xml

@@ -200,7 +200,7 @@
 		<GalilAxisConfig Name="SRD1.Rotation" Index="0" Type="GalilRotation" CNType="-1">
 			<Speed>529400</Speed>
 			<Acceleration>84000</Acceleration>
-			<Deceleration>84000</Deceleration>
+			<Deceleration>500000</Deceleration>
 			<HomingSpeed>2500</HomingSpeed>
 			<HomingOffset>0</HomingOffset>
 			<HomingTimeOut>60000</HomingTimeOut>
@@ -214,7 +214,7 @@
 		<GalilAxisConfig Name="SRD2.Rotation" Index="1" Type="GalilRotation" CNType="-1">
 			<Speed>529400</Speed>
 			<Acceleration>84000</Acceleration>
-			<Deceleration>84000</Deceleration>
+			<Deceleration>500000</Deceleration>
 			<HomingSpeed>2500</HomingSpeed>
 			<HomingOffset>0</HomingOffset>
 			<HomingTimeOut>60000</HomingTimeOut>

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

@@ -46,7 +46,7 @@ namespace CyberX8_RT.Devices.AXIS.GalilLipsel
 
         public RState Monitor()
         {
-            Runner.Run(StopPositionStep.SetStop, SetStop, CheckStop, _delay_2s)
+            Runner.Run(StopPositionStep.SetStop, SetStop, CheckStop, _delay_5s)
                 .Run(StopPositionStep.WriteTargePosition, () => { return WriteTargetPosition(); }, NullFun, 100)
                 .End(StopPositionStep.End, NullFun, 100);
             return Runner.Status;

+ 12 - 4
CyberX8_RT/Devices/AXIS/JetAxisBase.cs

@@ -37,7 +37,7 @@ namespace CyberX8_RT.Devices.AXIS
         protected const string PROFILE_VELOCITY = "ProfileVelocity";
         protected const string PROFILE_ACCEL = "ProfileAccel";
         protected const string PROFILE_DECEL = "ProfileDecel";
-        private const string TARGET_POSITION = "TargetPosition";
+        private const string TARGET_POSITION = "ReferencePosition";
         private const string MOTOR_POSITION = "MotorPosition";
         private const string ACTUAL_VELOCITY = "Velocity";
         private const string ACTUAL_TORQUE = "ActualTorque";
@@ -237,6 +237,10 @@ namespace CyberX8_RT.Devices.AXIS
         /// Motion Position比例
         /// </summary>
         protected double _motionPositionRation = 1;
+        /// <summary>
+        /// Actual Velocity比例
+        /// </summary>
+        protected double _velocityRate = 1;
         #endregion
 
         #region 属性
@@ -362,6 +366,7 @@ namespace CyberX8_RT.Devices.AXIS
                 _scaleFactor = beckhoffProviderAxis.ScaleFactor;
                 _jogLimit = beckhoffProviderAxis.JogLimit;
                 _motionPositionRation = beckhoffProviderAxis.MotorPositionRate;
+                _velocityRate = beckhoffProviderAxis.VelocityRate;
             }
             _galilAxisConfig = GalilControllerCfgManager.Instance.GetGalilAxisConfig(Module.ToString(),Name);
             if (_galilAxisConfig != null)
@@ -813,6 +818,7 @@ namespace CyberX8_RT.Devices.AXIS
             GalilAxisSubscribeUpdateVariable(ACTUAL_TORQUE);
             GalilAxisSubscribeUpdateVariable(ACTUAL_VELOCITY);
             GalilAxisSubscribeUpdateVariable(FORWARD_LIMIT);
+            GalilAxisSubscribeUpdateVariable(TARGET_POSITION);
         }
 
         /// <summary>
@@ -881,7 +887,11 @@ namespace CyberX8_RT.Devices.AXIS
             }
             if(variable == ACTUAL_VELOCITY)
             {
-                MotionData.ActualVelocity = Math.Round((int)value / _scaleFactor, 2);
+                MotionData.ActualVelocity = Math.Round((int)value / _scaleFactor / _velocityRate, 2);
+            }
+            if(variable == TARGET_POSITION)
+            {
+                MotionData.TargetPosition = Math.Round((int)value / _scaleFactor, 2);
             }
         }
 
@@ -1134,7 +1144,6 @@ namespace CyberX8_RT.Devices.AXIS
         /// <returns></returns>
         public bool WriteAbsolutePosition(int absolutePosition)
         {
-            MotionData.TargetPosition= absolutePosition / _scaleFactor;
             return GalilControllerCfgManager.Instance.SetAxisCommand(Module, Name, "PA", absolutePosition);
         }
         /// <summary>
@@ -1210,7 +1219,6 @@ namespace CyberX8_RT.Devices.AXIS
         /// <returns></returns>
         public bool WriteDP(int dp)
         {
-            MotionData.TargetPosition = 0;
             bool result= GalilControllerCfgManager.Instance.SetAxisCommand(Module, Name, "DP", dp);
             if (result)
             {

+ 6 - 1
CyberX8_Simulator/Devices/GalilSocketSimulator.cs

@@ -79,6 +79,10 @@ namespace CyberX8_Simulator.Devices
         /// </summary>
         private Dictionary<string, double> _motorPositionRateDic = new Dictionary<string, double>();
         /// <summary>
+        /// Velocity比例系数字典(index - motorPositionRate)
+        /// </summary>
+        private Dictionary<string, double> _velocityRateDic = new Dictionary<string, double>();
+        /// <summary>
         /// Key:dataName - Value:GalilDI
         /// </summary>
         public Dictionary<string, GalilDI> InputDataNameDIDic = new Dictionary<string, GalilDI>();
@@ -253,6 +257,7 @@ namespace CyberX8_Simulator.Devices
                             if (_nameAxisList[i] == item.Name)
                             {
                                 _motorPositionRateDic[item.Name] = item.MotorPositionRate;
+                                _velocityRateDic[item.Name] = item.VelocityRate;
                             }
                         }
                     }
@@ -600,7 +605,7 @@ namespace CyberX8_Simulator.Devices
         /// <param name="index"></param>
         private void UpdateAxisData(int index, SimulatorMotionData data)
         {
-            _galilControlData.GalilAxisDatas[index].Velocity = data.TargetVelocity;
+            _galilControlData.GalilAxisDatas[index].Velocity = (int)(data.TargetVelocity * _velocityRateDic[_nameAxisList[index]]);
             _galilControlData.GalilAxisDatas[index].MotorPosition = (int)(data.ActualPosition / _motorPositionRateDic[_nameAxisList[index]]);
             _galilControlData.GalilAxisDatas[index].ReferencePosition = data.TargetPosition;
             _galilControlData.GalilAxisDatas[index].Torque = data.ActualTorque;

+ 1 - 1
CyberX8_Themes/UserControls/SRDMoveControl.xaml

@@ -75,7 +75,7 @@
                 <ColumnDefinition Width="65"></ColumnDefinition>
             </Grid.ColumnDefinitions>
             <TextBox Grid.Column="0" Text="{Binding ElementName=self,Path=InputRotationSpeed,Mode=TwoWay}"  Width="50" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Right" FontSize="16"  Height="22" />
-            <TextBox IsEnabled="False"  Grid.Column="1" Text="rmp" Width="45" FontWeight="Bold" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="15"  Height="22" />
+            <TextBox IsEnabled="False"  Grid.Column="1" Text="rpm" Width="45" FontWeight="Bold" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="15"  Height="22" />
         </Grid>
 
     </Grid>

+ 1 - 0
Framework/Common/Beckhoff/AxisProvider/BeckhoffProviderAxis.cs

@@ -25,5 +25,6 @@ namespace MECF.Framework.Common.Beckhoff.AxisProvider
 
         public double MotorPositionRate { get; set; }
 
+        public double VelocityRate { get; set; }
     }
 }