Difference between revisions of "Axis Setup Procedure/zh-hans"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "{{Languages}} The steps below explain how to create and define an axis in the softMC controller. The following are required: * Running softMC (actual or simulated) * User in...")
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Languages}}
+
{{Languages|Axis_Setup_Procedure}}
The steps below explain how to create and define an axis in the softMC controller.
+
以下步骤说明如何在softMC控制器中创建和定义轴。
  
The following are required:
+
需要以下内容:
* Running softMC (actual or simulated)
+
* 运行softMC(实际或模拟)
* User interface (ControlStudio)
+
* 用户界面(ControlStudio)
  
  
== Step 1: Declare Axis ==
+
== 步骤 1: 声明轴 ==
In the first line of CONFIG.PRG file specify the number of axes that will be in use:
+
在CONFIG.PRG文件的第一行指定要使用的轴数:
 
<pre>
 
<pre>
 
Sys.Naxes = <number>
 
Sys.Naxes = <number>
Line 17: Line 17:
 
</pre>
 
</pre>
  
Send the CONFIG.PRG file to softMC and run it by issuing these two lines from terminal window:
+
通过从终端窗口发出这两行将CONFIG.PRG文件发送到softMC并来运行它:
 
<pre>
 
<pre>
 
send config.prg
 
send config.prg
Line 23: Line 23:
 
</pre>
 
</pre>
  
Now you have your axes defined, it is easy to check by issuing this command from terminal window:
+
现在您已经定义了轴,通过从终端窗口发出此命令很容易查看:
 
<pre>
 
<pre>
 
->?axislist
 
->?axislist
Line 29: Line 29:
 
</pre>
 
</pre>
  
== Step 2: Define Meaningful Axis Name ==
+
== 步骤2:定义有意义的轴名称 ==
System default axis names are not very user friendly (a1,a2,a3, etc.).
+
系统默认轴名称不是很友好(a1,a2,a3等)。
It is a good practice to give them more meaningful names. This is done in CONFIG.PRG file only, by assigning a new name to each axis (no double-quotes) to [[MC-Basic:axis.AXISNAME|<axis>.AxisName]] property.
+
给他们更有意义的名字是一个很好的做法。这只能在CONFIG.PRG文件中完成,通过[[MC-Basic:axis.AXISNAME|<axis>.AxisName]] 为每个轴(无双引号)分配一个新名称。
 +
 
 
<pre>
 
<pre>
 
Sys.Naxes = <number>
 
Sys.Naxes = <number>
Line 42: Line 43:
 
</pre>
 
</pre>
  
== Step 3: Prepare General Axis Setup ==
+
== 步骤3:准备普通轴设置 ==
To setup system axes, a setup program must be prepared. Let’s call it SETUP.PRG.<br/>
+
要设置系统轴,必须准备设置程序。 我们称之为SETUP.PRG。
'''Note''':<br/>
+
<br/>
* To access (write to) an axis property, the axis needs to be attached.
+
'''注意''':<br/>
* For some properties, the axis needs to be disabled.
+
* 要访问(写入)轴属性,需要附加轴。
 +
* 对于某些属性,轴需要禁用。
  
 
'''SETUP.PRG'''
 
'''SETUP.PRG'''
Line 69: Line 71:
 
</pre>
 
</pre>
  
==Step 4: Position Units Definition==
+
==步骤4:位置单位定义==
 
[[Image:GearMotor.png|GearMotor.png]]
 
[[Image:GearMotor.png|GearMotor.png]]
  
[[MC-Basic:axis.POSITIONFACTOR|<axis>.PositionFactor]] defines the position units that will be used in all position variables of the specified axis  (pcmd, pfb, etc.). It consists of the following:
+
[[MC-Basic:axis.POSITIONFACTOR|<axis>.PositionFactor]]定义将在指定轴的所有位置变量(pcmd,pfb等)中使用的位置单位。 它包括以下内容:
  
* Motor encoder resolution seen through the motion bus (See EtherCAT, SERCOS, CanOPEN). How many counts are there in one motor revolution - stored in pos_units global variable (for each axis differently).
+
* 通过运动总线看到的电机编码器分辨率(参见EtherCAT,SERCOS,CanOPEN)。 电机旋转一圈中有多少计数 - 存储在pos_units全局变量中(对于每个轴不同)。
* Gear ratio (M:N) and/or the pitch of the linear screw  (mm/rev).
 
  
:*Rotary axes:
+
* 齿轮比(M:N)和/或直线螺杆的螺距(mm / rev)。
::For position in degrees PositionFactor is:PFAC = Pos_Units *(M/N)/360
+
 
 +
:*旋转轴:
 +
::对于以度为单位的位置PositionFactor是:PFAC = Pos_Units *(M / N)/ 360
 +
 
 +
:*线性轴:
 +
::位置为毫米PositionFactor是PFAC = Pos_Units)/MPITCH
  
:*Linear axes:
 
::For position in millimeters PositionFactor is:PFAC = Pos_Units)/MPITCH
 
  
 
[[Image:LinMotor.png|LinMotor.png]]
 
[[Image:LinMotor.png|LinMotor.png]]
  
See Motion Bus setup for pos_units and MPITCH setup
+
请参考运动总线设置pos_units和MPITCH设置
  
==Step 5: Direction of Movement ==
+
==步骤5:运动方向 ==
Positive direction of drive's position increments does not have to match the desired positive direction of user axis (Upwards, Left-Right, Counterclockwise). Therefore <axis>.direction flag is to be used:
+
驱动器位置增量的正方向不必与用户轴的所需正方向(向上,向左,向右逆时针)匹配。 因此,将使用<axis> .direction标志:
 
<pre>
 
<pre>
 
<axis>.Direction = {1|-1}
 
<axis>.Direction = {1|-1}
 
</pre>
 
</pre>
  
Value of '''-1''' indicates direction inversion.
+
'''-1'''的值表示方向反转。
  
==Step 6: Velocity, Acceleration, Jerk Units ==
+
==步骤6:速度,加速度,加加速度单位==
Velocity/acceleration/jerk units do not have to match position units. Units can be user-defined. For all the derivative units (velocity, acceleration, jerk), the default time scale is in milliseconds; therefore scaling is needed.
+
速度/加速度/加加速度单位不必与位置单位相匹配。 单位可以由用户定义。 对于所有派生单位(速度,加速度,加加速度),默认时间刻度以毫秒为单位,因此需要改变比例。
  
To use position units per second for velocity, the following must be defined:
+
要使用每秒位置单位的速度,必须定义以下内容:
 
<pre>
 
<pre>
 
<axis>.VelocityFactor = <axis>.PositionFactor/1000
 
<axis>.VelocityFactor = <axis>.PositionFactor/1000
 
</pre>
 
</pre>
In this case if the user sets the position in millimeters the velocity will be '''mm/sec'''
+
在这种情况下,如果用户以毫米为单位设置位置,则速度将为'''mm/sec'''
  
To define velocity in '''RPM''' of the motor:
+
'''RPM'''定义电机的速度
 
<pre>
 
<pre>
 
<axis>.VelocityFactor = Pos_Units /1000/60
 
<axis>.VelocityFactor = Pos_Units /1000/60
 
</pre>
 
</pre>
  
Acceleration and jerk units are the same; their default values are expressed in velocity and acceleration units per milliseconds. Thus, in order to set them per seconds, they need to be set as:
+
加速度和加加速度单位是一样的; 它们的默认值以每毫秒的速度和加速度单位表示。 因此,为了每秒设置它们,它们需要设置为:
 
<pre>
 
<pre>
 
<axis>.AccelerationFactor = <axis>. VelocityFactor /1000
 
<axis>.AccelerationFactor = <axis>. VelocityFactor /1000
Line 115: Line 119:
 
</pre>
 
</pre>
  
==Step 7: Units Summary==
+
==步骤7:单位总结==
Position, velocity, acceleration and jerk units are set by:
+
位置,速度,加速度和加加速度单位由以下设置:
 
<pre>
 
<pre>
 
<axis>.PositionFactor = …
 
<axis>.PositionFactor = …
Line 125: Line 129:
 
</pre>
 
</pre>
  
==Step 8: Position Limits==
+
==步骤8:位置限制==
Setting  position range of an axis.
+
设定轴的位置范围。
Setting maximum position:
+
设置最大位置:
 
  <axis>.Pmax = … and enabling /disabling it: <axis>.PmaxEn = {0|1}
 
  <axis>.Pmax = … and enabling /disabling it: <axis>.PmaxEn = {0|1}
Setting minimum position:
+
设置最小位置:
 
  <axis>.Pmin = … and enabling /disabling it: <axis>.PminEn = {0|1}
 
  <axis>.Pmin = … and enabling /disabling it: <axis>.PminEn = {0|1}
Setting the axis type:
+
设置轴类型:
 
  <axis>.AxisType = 0 ‘ For linear axes
 
  <axis>.AxisType = 0 ‘ For linear axes
 
  <axis>.AxisType = 1 ‘ For rotary axes
 
  <axis>.AxisType = 1 ‘ For rotary axes
For rotary axes rollover can be defined:
+
可以定义旋转轴翻转:
Enabling/Disabling it:  
+
启用/禁用它:  
 
  <axis>.PositionRollOverEnable  = {0|1}
 
  <axis>.PositionRollOverEnable  = {0|1}
Setting the whole range:  
+
设置整个范围:  
 
  <axis>. PositionRollOver
 
  <axis>. PositionRollOver
Setting the low value:  
+
设置低值:  
 
  <axis>. PositionRollOverMin
 
  <axis>. PositionRollOverMin
  
Note: If the enable flag is not set, the corresponding value does not need to be set.
+
注意:如果未设置使能标志,则不需要设置相应的值。
  
 
[[Image:Axis-PLIM.PNG|500px]]
 
[[Image:Axis-PLIM.PNG|500px]]
  
==Step 9: Motion Bus Units ==
+
== 步骤9:运动总线单元 ==
Depending on the type of motion bus (EtherCAT, SERCOS, CANopen) and drive used, several parameters are available for the user to adjust (but are not necessarily needed):
+
根据运动总线(EtherCAT,SERCOS,CANopen)的类型和所使用的驱动器,可以使用多个参数进行调整(但不一定需要):
  
If micro-interpolation is turned on in the drive, the velocity sent to drive must be properly scaled; this is done with (for counts per ms):
+
如果在驱动器中打开微插补,则发送到驱动器的速度必须适当地缩放; 这是完成的(每ms的计数):
 
<pre>
 
<pre>
 
<axis>.MotionBusVelocityScale = 0
 
<axis>.MotionBusVelocityScale = 0
 
<axis>.MotionBusVelocityBase = 1
 
<axis>.MotionBusVelocityBase = 1
 
</pre>
 
</pre>
If a limited drive’s position range is used (other then integer 32 bits):
+
如果使用有限的驱动器位置范围(不包括整数32位):
 
<pre>
 
<pre>
 
<axis>.CountMin = <drive min position value>
 
<axis>.CountMin = <drive min position value>
Line 160: Line 164:
 
</pre>
 
</pre>
  
==Step 10: Motion Parameters==
+
==步骤10:运动参数==
Motion parameters are grouped into velocity, acceleration and jerk values. All have maximum values for overall limitations, and motion-default values that are used when motion is executed.
+
运动参数分为速度,加速度和加加速度值。 所有这些都具有总体限制的最大值和运动执行时使用的运动默认值。
  
 
{| class="wikitable" margin-left: 10px; color: red; border-style: solid; border-width: 3px"
 
{| class="wikitable" margin-left: 10px; color: red; border-style: solid; border-width: 3px"
| Motion default value is:
+
| 运动默认值为:
| [[MC-Basic:axis.VELOCITYCRUISE|'''<axis>.VelocityCruise''']]
+
| [[MC-Basic:element.VELOCITYCRUISE|'''<axis>.VelocityCruise''']]
 
|}
 
|}
  
Velocity is set according to maximum axis physical limit (drives/motor capabilities and mechanical limitations):
+
速度根据轴最大物理极限(驱动/电机性能和机械限制)设置:
 
   <axis>.Vmax  
 
   <axis>.Vmax  
  
 
{| class="wikitable" margin-left: 10px; color: red; border-style: solid; border-width: 3px"
 
{| class="wikitable" margin-left: 10px; color: red; border-style: solid; border-width: 3px"
| Motion default values are:
+
| 运动默认值为:
| [[MC-Basic:axis.ACCELERATION|'''<axis>.Acceleration''']] <br> [[MC-Basic:axis.DECELERATION |'''<axis>.Deceleration''' ]]
+
| [[MC-Basic:element.ACCELERATION|'''<axis>.Acceleration''']] <br> [[MC-Basic:element.DECELERATION|'''<axis>.Deceleration''' ]]
 
|}
 
|}
Acceleration is set according to maximum axis physical limits (Max drive/motor current, axis load) in user units:
+
加速度根据用户单位的最大轴物理极限(最大驱动/电机电流,轴负载)设置:
 
   <axis>.Amax
 
   <axis>.Amax
 
   <axis>.Dmax
 
   <axis>.Dmax
Line 181: Line 185:
 
{| class="wikitable" margin-left: 10px; color: red; border-style: solid; border-width: 3px"
 
{| class="wikitable" margin-left: 10px; color: red; border-style: solid; border-width: 3px"
 
| Motion default value is:
 
| Motion default value is:
| [[MC-Basic:axis.JERK|'''<axis>.Jerk''']]
+
| [[MC-Basic:element.JERK|'''<axis>.Jerk''']]
 
|}
 
|}
Jerk  is the third time-derivation of position, if smooth profiles are used it needs to be defined a good rule of thumb is to set J=BW*A, where J – jerk, A – acceleration, BW- control Bandwidth (Hz).
+
Jerk是位置的第三次推导,如果使用平滑曲线,需要定义一个很好的经验法则是设置J = BW * A,其中J-加速度,A加速度,BW-控制带宽(Hz)。
 
   <axis>.JerkMax
 
   <axis>.JerkMax
  
==Step 11: Safety Parameters==
+
==步骤11:安全参数==
Maximum allowed position error (PE). PE is defined as a difference between the position command and position feedback. Due to communication delay of the motion bus and processing time of the drive (micro-interpolation) position command of the several samples before the current is compared to the currently obtained position feedback of the drive:
+
最大允许位置误差(PE)。 PE定义为位置指令和位置反馈之间的差异。由于运动总线的通信延迟以及将电流与当前获得的驱动器的位置反馈进行比较之前的几个样本的驱动(微插补)位置命令的处理时间:
   <axis>.PositionErrorMax – max allowed position error during in user units.
+
   <axis>.PositionErrorMax – 用户单位内最大允许位置错误。
   <axis>.PositionErrorDelay – number of samples used for delay computation.
+
   <axis>.PositionErrorDelay – 用于延迟计算的样本数。
  
Velocity (Runaway) Protection, the feedback velocity of the motor is checked every sample (recommended to be set to 120% of the <axis>.VelocityMax)
+
速度(失速)保护,每个样品检查电机的反馈速度(推荐设置为<axis>.VelocityMax的120%)
 
   <axis>.VelocityOverSpeed
 
   <axis>.VelocityOverSpeed
  
Sanity Threshold, as a final protection against unintentional jumps (recommended to be set to 1000% of <axis>.VelocityMax):
+
Sanity Threshold作为防止意外跳转的最终保护(建议设置为<axis> .VelocityMax的1000%):
 
   <axis>.VelocitySafetyLimit
 
   <axis>.VelocitySafetyLimit
  
Torque Error – only if axis dynamic model is turned on
+
扭矩错误 - 仅当轴动态模型打开时
 
   <axis>.TorqueMaxError
 
   <axis>.TorqueMaxError
  
==Step 12: Smoothness==
+
==步骤12:平滑==
  
Different profile types are available, ranging from very smooth S-curves (Trapezoidal Acceleration, Sine Acceleration) to less smooth but faster Trapezoidal Velocity, to totally edgy profiles (Constant Velocity) by setting these two parameters:
+
可以使用不同的曲线类型,从非常平滑的S曲线(梯形加速度,正弦加速度)到不太平滑但更快的梯形速度,通过设置这两个参数来达到完全前进的曲线(恒速):
:<axis>.Smooth defined automatic (0-100) or manual smoothing (-1)
+
:<axis>.Smooth 定义自动(0-100)或手动平滑(-1)
:<axis>.PrfType specifies profile more precisely (Trapezoidal Velocity, Trapezoidal Acceleration, Sine Acceleration)
+
:<axis>.PrfType 更精确地指定曲线(梯形速度,梯形加速度,正弦加速度)
  
==Step 13: Axis Setup - Complete Example: the SetAxis Subroutine==
+
==步骤13:轴设置 - 完整示例:SetAxis子程序==
  
 
<pre>
 
<pre>
Line 241: Line 245:
 
end sub
 
end sub
 
</pre>
 
</pre>
==Step 14: Motion Bus EtherCAT Example ==
+
== 步骤14:运动总线EtherCAT示例 ==
  
Position Units
+
位置单位
:First read the motor encoder resolution (MENCRES – SDO:0x20F1:0)
+
:首先读取电机编码器分辨率(MENCRES – SDO:0x20F1:0)
 
::MENCRES      =  EC_SDO_READ(<addr>,0x20f1,0)  
 
::MENCRES      =  EC_SDO_READ(<addr>,0x20f1,0)  
  
Then set (value of 1) the configured number of motor shaft revolutions and number of driving shaft revolutions. The gear ratio is calculated by the following:
+
然后设置(值1)组态的电机轴转数和驱动轴转数。 齿轮比通过以下计算
 +
:
 
:Fieldbus CANopen Gear Motor Shaft Scaling  (FBGMS – SDO0x2091:0)
 
:Fieldbus CANopen Gear Motor Shaft Scaling  (FBGMS – SDO0x2091:0)
 
:Fieldbus CANopen Gear Driving Shaft Scaling (FBGDS – SDO0x2091:1)
 
:Fieldbus CANopen Gear Driving Shaft Scaling (FBGDS – SDO0x2091:1)
 
::gear ratio = FBGMS / FBGDS
 
::gear ratio = FBGMS / FBGDS
  
==Step 15: Extra - Dynamic Model ==
+
==步骤15:超动态模型==
 +
 
 +
扭矩缩放
 +
:<axis>.TorqueFactor – 根据电机KT参数
  
Torque Scaling
+
限制
:<axis>.TorqueFactor – according to the Motor KT parameter
 
  
Limits
+
:<axis>.TorqueMax – 最大电机扭矩
:<axis>.TorqueMax – maximum motor torque
 
  
Dynamic Model  Parameters
+
动态模型参数
 
:axis.DYNAMICMODEL[..] = <…>
 
:axis.DYNAMICMODEL[..] = <…>

Latest revision as of 03:30, 24 November 2017

语言: English  • 中文(简体)‎

以下步骤说明如何在softMC控制器中创建和定义轴。

需要以下内容:

  • 运行softMC(实际或模拟)
  • 用户界面(ControlStudio)


步骤 1: 声明轴

在CONFIG.PRG文件的第一行指定要使用的轴数:

Sys.Naxes = <number>
…
Program
…
End Program

通过从终端窗口发出这两行将CONFIG.PRG文件发送到softMC并来运行它:

send config.prg
reset all

现在您已经定义了轴,通过从终端窗口发出此命令很容易查看:

->?axislist
A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16,A17

步骤2:定义有意义的轴名称

系统默认轴名称不是很友好(a1,a2,a3等)。 给他们更有意义的名字是一个很好的做法。这只能在CONFIG.PRG文件中完成,通过<axis>.AxisName 为每个轴(无双引号)分配一个新名称。

Sys.Naxes = <number>
…
Program
	a1.AxisName = Xaxis
	a2.AxisName = Lift
…
End Program

步骤3:准备普通轴设置

要设置系统轴,必须准备设置程序。 我们称之为SETUP.PRG。
注意:

  • 要访问(写入)轴属性,需要附加轴。
  • 对于某些属性,轴需要禁用。

SETUP.PRG

Program
	Call SetAxis(a1)
	Call SetAxis(a2)	
	…
End Program

Sub SetAxis(ax as generic axis)
With ax
	Attach
		En = 0
		…
		<stuff goes here>
		…
	Detach
End With
End Sub

步骤4:位置单位定义

GearMotor.png

<axis>.PositionFactor定义将在指定轴的所有位置变量(pcmd,pfb等)中使用的位置单位。 它包括以下内容:

  • 通过运动总线看到的电机编码器分辨率(参见EtherCAT,SERCOS,CanOPEN)。 电机旋转一圈中有多少计数 - 存储在pos_units全局变量中(对于每个轴不同)。
  • 齿轮比(M:N)和/或直线螺杆的螺距(mm / rev)。
  • 旋转轴:
对于以度为单位的位置PositionFactor是:PFAC = Pos_Units *(M / N)/ 360
  • 线性轴:
位置为毫米PositionFactor是PFAC = Pos_Units)/MPITCH


LinMotor.png

请参考运动总线设置pos_units和MPITCH设置

步骤5:运动方向

驱动器位置增量的正方向不必与用户轴的所需正方向(向上,向左,向右逆时针)匹配。 因此,将使用<axis> .direction标志:

<axis>.Direction = {1|-1}

-1的值表示方向反转。

步骤6:速度,加速度,加加速度单位

速度/加速度/加加速度单位不必与位置单位相匹配。 单位可以由用户定义。 对于所有派生单位(速度,加速度,加加速度),默认时间刻度以毫秒为单位,因此需要改变比例。

要使用每秒位置单位的速度,必须定义以下内容:

<axis>.VelocityFactor = <axis>.PositionFactor/1000

在这种情况下,如果用户以毫米为单位设置位置,则速度将为mm/sec

RPM定义电机的速度

<axis>.VelocityFactor = Pos_Units /1000/60

加速度和加加速度单位是一样的; 它们的默认值以每毫秒的速度和加速度单位表示。 因此,为了每秒设置它们,它们需要设置为:

<axis>.AccelerationFactor = <axis>. VelocityFactor /1000
<axis>.JerkFactor        = <axis>. AccelerationFactor /1000

步骤7:单位总结

位置,速度,加速度和加加速度单位由以下设置:

<axis>.PositionFactor = …
<axis>.Direction = …
<axis>.VelocityFactor = …
<axis>.AccelerationFactor = …
<axis>.JerkFactor = …

步骤8:位置限制

设定轴的位置范围。 设置最大位置:

<axis>.Pmax = … and enabling /disabling it: <axis>.PmaxEn = {0|1}

设置最小位置:

<axis>.Pmin = … and enabling /disabling it: <axis>.PminEn = {0|1}

设置轴类型:

<axis>.AxisType = 0 ‘ For linear axes
<axis>.AxisType = 1 ‘ For rotary axes

可以定义旋转轴翻转: 启用/禁用它:

<axis>.PositionRollOverEnable  = {0|1}

设置整个范围:

<axis>. PositionRollOver

设置低值:

<axis>. PositionRollOverMin

注意:如果未设置使能标志,则不需要设置相应的值。

Axis-PLIM.PNG

步骤9:运动总线单元

根据运动总线(EtherCAT,SERCOS,CANopen)的类型和所使用的驱动器,可以使用多个参数进行调整(但不一定需要):

如果在驱动器中打开微插补,则发送到驱动器的速度必须适当地缩放; 这是完成的(每ms的计数):

<axis>.MotionBusVelocityScale = 0
<axis>.MotionBusVelocityBase = 1

如果使用有限的驱动器位置范围(不包括整数32位):

<axis>.CountMin = <drive min position value>
<axis>.CountMax = <drive max position value>

步骤10:运动参数

运动参数分为速度,加速度和加加速度值。 所有这些都具有总体限制的最大值和运动执行时使用的运动默认值。

运动默认值为: <axis>.VelocityCruise

速度根据轴最大物理极限(驱动/电机性能和机械限制)设置:

 <axis>.Vmax 
运动默认值为: <axis>.Acceleration
<axis>.Deceleration

加速度根据用户单位的最大轴物理极限(最大驱动/电机电流,轴负载)设置:

 <axis>.Amax
 <axis>.Dmax
Motion default value is: <axis>.Jerk

Jerk是位置的第三次推导,如果使用平滑曲线,需要定义一个很好的经验法则是设置J = BW * A,其中J-加速度,A加速度,BW-控制带宽(Hz)。

 <axis>.JerkMax

步骤11:安全参数

最大允许位置误差(PE)。 PE定义为位置指令和位置反馈之间的差异。由于运动总线的通信延迟以及将电流与当前获得的驱动器的位置反馈进行比较之前的几个样本的驱动(微插补)位置命令的处理时间:

 <axis>.PositionErrorMax – 用户单位内最大允许位置错误。
 <axis>.PositionErrorDelay – 用于延迟计算的样本数。

速度(失速)保护,每个样品检查电机的反馈速度(推荐设置为<axis>.VelocityMax的120%)

 <axis>.VelocityOverSpeed

Sanity Threshold作为防止意外跳转的最终保护(建议设置为<axis> .VelocityMax的1000%):

 <axis>.VelocitySafetyLimit

扭矩错误 - 仅当轴动态模型打开时

 <axis>.TorqueMaxError

步骤12:平滑

可以使用不同的曲线类型,从非常平滑的S曲线(梯形加速度,正弦加速度)到不太平滑但更快的梯形速度,通过设置这两个参数来达到完全前进的曲线(恒速):

<axis>.Smooth 定义自动(0-100)或手动平滑(-1)
<axis>.PrfType 更精确地指定曲线(梯形速度,梯形加速度,正弦加速度)

步骤13:轴设置 - 完整示例:SetAxis子程序

sub SetRotAxis(ax as generic axis, byval minval as double , byval maxval as double)
  with ax
    attach
      En = 0
      AxisType = 1
      PositionFactor = pos_unit/360
      VelocityFactor = PositionFactor /1000
      AccelerationFactor = VelocityFactor /1000
      Jerkfactor = AccelerationFactor /1000
      VelocityMax = 1000
      AccelerationMax = 10000
      DecelerationMax= 10000
      JerkMax = 20*amax
      VelocityCruise = 0.5*VelocityMax
      Acceleration = AccelerationMax 
      Deceleration = DecelerationMax
      Jerk = JerkMax 
      PrfType = -1
      Smooth = -1
      VelocityOverspeed = 1.2*VelocityMax
      VelocitySafetyLimit = 10*VelocityMax
      PositionErrorDelay = 2
      PositionErrorMax  = 1
      PositionMax = maxval
      PositionMin = minval
      PositionMaxEn = 1
      PositionMinEn = 1
      PositionRolloverEnable = 0
   detach
  end with
end sub

步骤14:运动总线EtherCAT示例

位置单位

首先读取电机编码器分辨率(MENCRES – SDO:0x20F1:0)
MENCRES = EC_SDO_READ(<addr>,0x20f1,0)

然后设置(值1)组态的电机轴转数和驱动轴转数。 齿轮比通过以下计算

Fieldbus CANopen Gear Motor Shaft Scaling (FBGMS – SDO0x2091:0)
Fieldbus CANopen Gear Driving Shaft Scaling (FBGDS – SDO0x2091:1)
gear ratio = FBGMS / FBGDS

步骤15:超动态模型

扭矩缩放

<axis>.TorqueFactor – 根据电机KT参数

限制

<axis>.TorqueMax – 最大电机扭矩

动态模型参数

axis.DYNAMICMODEL[..] = <…>