Difference between revisions of "AXY:PLS Software Specification/zh-hans"

From SoftMC-Wiki
Jump to: navigation, search
Line 30: Line 30:
  
 
== PLS极性 ==
 
== PLS极性 ==
The output polarity is determined via the polarity property of the PLS. This property determines the output polarity of the first entry of the PLS position table i.e. in the segment between the first and second entries. If the actual location of the axis is elsewhere, the output polarity will be determined accordingly so when the axis will reach the first segment the polarity will be as indicated.
+
输出极性由PLS的极性决定。该属性确定PLS位置表的第一条目的输出极性,即在第一和第二条目之间的段中。如果轴的实际位置在别处,则相应地确定输出极性,因此当轴将到达第一段时,极性将如图所示。
  
For example: consider the following PLS whose positions are 10, 25, 30, 50, 65, and polarity is 0, as shown in this figure.
+
例如: 考虑以下PLS,其位置为10,25,30,50,65,极性为0,如图所示。
 
   
 
   
 
[[File:AXY;PLS plolarity description.jpeg|Figure 1a: Programmable Limit Switch polarity description|480px]]
 
[[File:AXY;PLS plolarity description.jpeg|Figure 1a: Programmable Limit Switch polarity description|480px]]
  
As can be seen, the polarity of the first segment (between 10-25) is as indicated by the polarity (1). Enabling the PLS in any other segment will cause the output to be as indicated in the figure.
+
可以看出,第一段的极性(在10-25之间)如极性(1)所示。 在任何其他段中启用PLS将导致输出如图所示。
  
== Output State ==
+
== 输出状态 ==
A PLS causes an output (digital or virtual) to be triggered when a specified axis position is reached. The initial state of the output will be determined by the PLS polarity property. When the position is reached, the state of the output is toggled. The state is also toggled each time the position is reached, irrespective of the direction of motor travel.
+
当达到指定的轴位置时,PLS会触发输出(数字或模拟)。输出的初始状态将由PLS极性属性决定。当达到位置时,输出的状态被触发。每当达到位置时也会切换状态,而不考虑电机的转动方向。
 
   
 
   
 
[[File:AXY;PLS description.jpeg|Figure 1b: Programmable Limit Switch description|480px]]
 
[[File:AXY;PLS description.jpeg|Figure 1b: Programmable Limit Switch description|480px]]
  
 
+
可以指定多个位置,在这种情况下,当达到每个位置时,数字输出的状态将被触发。例如,注意以下PLS规范:指定位置为100和200,启用后数字输出的初始状态为0.下表说明了输出状态如何随位置变化而变化。
Multiple positions may be specified, in which case the state of the digital output will be toggled as each position is reached. For example, consider the following PLS specification: positions 100 and 200 are specified, and the initial state of the digital output after enabling is 0. The following table illustrates how the state of output changes with changing position.
 
  
 
{|border="0" cellpadding="3" cellspacing="0"  
 
{|border="0" cellpadding="3" cellspacing="0"  
Line 51: Line 50:
 
|0||0
 
|0||0
 
|-
 
|-
|100||1 (Toggle)
+
|100||1 (触发)
 
|-
 
|-
|150||1 (No change)
+
|150||1 (没有变化)
 
|-
 
|-
|200||0 (Toggle)
+
|200||0 (触发)
 
|-
 
|-
|210||0 (No change yet)
+
|210||0 (还没有变化)
 
|-
 
|-
|200||1 (Toggle again)
+
|200||1 (再次触发)
 
|-
 
|-
|150||1 (No change)
+
|150||1 (没有变化)
 
|-
 
|-
|100||0 (Toggle again)
+
|100||0 (再次触发)
 
|-
 
|-
 
|}
 
|}
Line 70: Line 69:
 
[[File:AXY;Multiple PLS positions.jpeg|Figure 2: Multiple PLS positions|480px]]
 
[[File:AXY;Multiple PLS positions.jpeg|Figure 2: Multiple PLS positions|480px]]
  
If the axis position were to oscillate around a specified PLS position, the output would be triggered each time the specified position was crossed.
+
如果轴位置围绕指定的PLS位置振荡,则每当指定位置被越过时,输出将被触发。
  
The initial output state is specified implicitly by the user. The output is set to this state when the PLS is enabled.
+
初始输出状态由用户隐式指定。 当PLS启用时,输出设置为此状态。
  
== PLS Position Data ==
+
== PLS位置数据 ==
The PLS position data is stored in a data structure that belongs to the PLS mechanism. This data structure is explicitly created, using the CreatePlsData command.
+
PLS位置数据存储在属于PLS机制的数据结构中。 使用CreatePlsData命令显式创建此数据结构。
  
The PLS data has read/write access. The user must ensure that the PLS position data is monotonic (to allow a PLS to be enabled).
+
PLS数据具有读/写访问权限。 用户必须确保PLS位置数据是单调的(以允许启用PLS)。
  
== Hysteresis ==
+
== 滞后 ==
If the axis were to stop on a specified PLS position, the state of the digital output may be continually toggled, due to slight instability in the actual axis position. In this case, a hysteresis value may optionally be specified. The output state will be toggled when the PLS position is reached, and is passed by the hysteresis value. If, as shown in this example, the hysteresis value is 10, then the output will change from Low to High at position 110. It will revert to Low when the position goes down to 90.
+
如果轴在指定的PLS位置停止,则由于实际轴位置的轻微不稳定性,数字输出的状态可能会持续触发。在这种情况下,可以选择指定滞后值。当并通过滞后值达到PLS位置时,输出状态将被触发。如在本示例中,如果滞后值为10,则输出将在位置110处从低电平变为高电平。当位置下降至90时,将返回到低电平。
 
   
 
   
 
[[File:AXY;Hysteresis_in_PLS_position.jpeg|Figure 3: Hysteresis in PLS position|480px]]
 
[[File:AXY;Hysteresis_in_PLS_position.jpeg|Figure 3: Hysteresis in PLS position|480px]]
  
== Repetition Interval ==
+
== 重复间隔 ==
PLS positions may be continually repeated at a specified interval. Thus if a PLS position of 100, for example, is specified with a repetition interval of 2000, then the output state will be toggled at 100, and again at 2100, 4100, and so on, in the positive direction, and at -1900, -3900, and so on in the negative direction.
+
可以以指定的间隔持续重复PLS位置。因此如果PLS位置指定为100,例如,重复间隔为2000,则在正方向上,输出状态在100位置上触发,再次在2100,4100,等位置上触发。并且在负方向上,在 -1900, -3900等位置上触发。
  
The repetition interval must be positive, and it must be greater than the absolute value difference between the least and greatest PLS position values. That is:
+
重复间隔必须为正,并且必须大于最小和最大PLS位置值之间的绝对值差. :
  
 
Repetition Interval > abs(PLS_Pos_Max - PLS_Pos_Min)
 
Repetition Interval > abs(PLS_Pos_Max - PLS_Pos_Min)
  
Example:
+
示例:
  
 
* PLS Position values: -300, 100, 200
 
* PLS Position values: -300, 100, 200
Line 97: Line 96:
 
* Polarity: 0
 
* Polarity: 0
  
The output state will be toggled at -300, 100, 200, as well as at 1700 (-300 + 2000), 2100 (100+2000), 2200, and at 3700 (-300 + 2000 + 2000) etc. In the negative direction, the output state will be toggled at -1800 (200 - 2000), -1900 (100 - 2000), -2300 (-300 - 2000), -3800 etc.
+
输出状态在-300, 100, 200触发,同样在1700 (-300 + 2000), 2100 (100+2000), 2200, 3700 (-300 + 2000 + 2000) 等位置触发。 在负方向上输出状态在-1800 (200 - 2000), -1900 (100 - 2000), -2300 (-300 - 2000), -3800等位置触发。
 
   
 
   
 
[[File:AXY;PLS Repetition Interval.jpeg|Figure 4: PLS Repetition Interval|480px]]
 
[[File:AXY;PLS Repetition Interval.jpeg|Figure 4: PLS Repetition Interval|480px]]
  
== PLS Constraints ==
+
== PLS 约束 ==
* The number of PLSes is not be limited by the system. It is understood that there is a direct tradeoff between the number of PLSes defined and the system performance.
+
* PLS的数量不受系统限制。 可以理解为定义的PLS数量与系统性能之间存在直接的权衡。
* The number of PLS positions defined per PLS is not be limited.
+
* 每个PLS定义的PLS位置的数量不受限制。
* More than one PLS may be defined per axis.
+
* 每个轴可以定义多个PLS。
* PLSes are scanned at the motion bus cycle rate.
+
* PLSes以运动总线循环速率扫描
  
== Enable and Disable ==
+
== 启用和禁用 ==
After being defined, a PLS is disabled (output pattern is not generated). The output is set when the PLS is enabled. The output is set to the defined initial state. PLS properties are changed only when the PLS is disabled. Each enabled PLS requires CPU resources. Conserve those resources by disabling the unused PLS(s). [[MC-Basic:pls.PLSENABLE|PLSEnable]] controls the status of the PLS:
+
定义后,禁用PLS(不生成输出模式)。 当PLS被使能时,输出被设置。 输出设置为定义的初始状态。只有当PLS被禁用时,才能更改PLS属性。每个启用的PLS都需要CPU资源。通过禁用未使用的PLS(s)来节省这些资源。 [[MC-Basic:pls.PLSENABLE|PLSEnable]] 控制PLS的状态。
 
  MyPLS.PlsEnable = ON | OFF
 
  MyPLS.PlsEnable = ON | OFF
PLSENABLE queries the status of a PLS:
+
PLSENABLE查询PLS的状态:
 
  ?MyPls.PlsEnable
 
  ?MyPls.PlsEnable
 
  if(MyPLS.PlsEnable = OFF)
 
  if(MyPLS.PlsEnable = OFF)
 
  . . .
 
  . . .
or drives events:
+
或驱动事件:
 
  EventOn MyEvent MyPLS.PlsOutput = ON
 
  EventOn MyEvent MyPLS.PlsOutput = ON
  
==PLS Output State==
+
==PLS 输出状态==
Query the digital output associated with the PLS to query the state of the PLS output.<br/>
+
查询与PLS关联的数字输出,以查询PLS输出的状态。<br/>
For example, assume the PLS output is assigned to
+
例如,假设PLS输出被分配给SYSTEM.DOUT.1。 要确定PLS的输出状态,请查询SYSTEM.DOUT.1的状态:
SYSTEM.DOUT.1. To determine the output state of the PLS, query the state
 
of SYSTEM.DOUT.1:
 
 
  -->?Sys.Dout.1
 
  -->?Sys.Dout.1
 
  0 | 1
 
  0 | 1
  
==Example==
+
==示例==
 
===Step 1===
 
===Step 1===
Declare the PLS with [[MC-Basic:COMMON SHARED ... AS PLS|<nowiki>COMMON SHARED <PLS name> AS PLS</nowiki>]] in Config.Prg or at the
+
在Config.Prg或终端中使用[[MC-Basic:COMMON SHARED ... AS PLS|<nowiki>COMMON SHARED <PLS name> AS PLS</nowiki>]]声明PLS。您必须命名PLS,指定驱动PLS的轴,并命名要由PLS控制的输出。例如:
terminal. You must name the PLS, specify the axis that drives the PLS, and
 
name an output to be controlled by the PLS. For example:
 
 
  Common Shared MyPLS as PLS A1 System.Dout.1
 
  Common Shared MyPLS as PLS A1 System.Dout.1
sets up MyPLS as a PLS driven by axis A1 connected to SYSTEM.DOUT.1.
+
将MyPLS设置为由连接到SYSTEM.DOUT.1的轴A1驱动的PLS。
The output can be a digital output (SYSTEM.DOUT.1 through DOUT.20) or it
+
输出可以是数字输出(SYSTEM.DOUT.1到DOUT.20)或者可以是模拟输出之一(SYSTEM.VOUT.1到VOUT.32).
can be one of the virtual outputs (SYSTEM.VOUT.1 through VOUT.32).
+
在Common Shared as PLS执行后, PLS禁用。
After the Common Shared as PLS executes, the PLS is disabled.
+
PLS的属性设置为:
Properties of the PLS are set as:
+
*单个PLS位置存在于0
*A single PLS position exists at 0.
+
*初始输出极性为1
*The initial output polarity is 1.
+
*PLSREPEAT设置为0.
*PLSREPEAT is set to 0.
+
*滞后设置为0.<br/>
*The hysteresis is set to 0.<br/>
+
只要PLS保持禁用,可以明确设置这些属性。
These properties may be set explicitly, as long as the PLS remains disabled.
+
您可以使用PLSOUTPUT来检查与给定PLS相关联的输出。
You can check which output is associated with a given PLS using
 
PLSOUTPUT.
 
  
 
===Step 2===
 
===Step 2===

Revision as of 10:02, 15 May 2017

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

参考

介绍

可编程限位开关(PLS)是在达到指定轴位置时触发系统输出的机构。softMC中的PLS实现具有以下特点:

  • 多位置规格
  • PLS模式重复
  • 位置滞后
  • 启用和禁用PLS
  • 输出可以是数字或模拟的

本文详细说明在softMC中PLS实现的功能。 描述功能并定义支持的命令。

定义

PLS – 可编程限位开关

PLS – 在PLS命令中指定的位置,其输出状态被切换。

Digital output – 可以映射到位于运动总线上的设备,驱动器输出中的任一个或 EtherCAT/CAN I/O模块。
(固件版本5.0及更高版本不支持本地; 它只支持传统的SERCOS II运动控制器。)

Soft output – 32个虚拟输出之一

PLS位置在数组中定义,允许您更改PLS位置的各个值。这个数组必须单调增加。 定义的位置数量和PLS数量没有限制。初始输出极性由Pls Polarity 指定。当PLS被使能时,输出状态被设置。

PLS功能描述

PLS极性

输出极性由PLS的极性决定。该属性确定PLS位置表的第一条目的输出极性,即在第一和第二条目之间的段中。如果轴的实际位置在别处,则相应地确定输出极性,因此当轴将到达第一段时,极性将如图所示。

例如: 考虑以下PLS,其位置为10,25,30,50,65,极性为0,如图所示。

Figure 1a: Programmable Limit Switch polarity description

可以看出,第一段的极性(在10-25之间)如极性(1)所示。 在任何其他段中启用PLS将导致输出如图所示。

输出状态

当达到指定的轴位置时,PLS会触发输出(数字或模拟)。输出的初始状态将由PLS极性属性决定。当达到位置时,输出的状态被触发。每当达到位置时也会切换状态,而不考虑电机的转动方向。

Figure 1b: Programmable Limit Switch description

可以指定多个位置,在这种情况下,当达到每个位置时,数字输出的状态将被触发。例如,注意以下PLS规范:指定位置为100和200,启用后数字输出的初始状态为0.下表说明了输出状态如何随位置变化而变化。

Position Output State
0 0
100 1 (触发)
150 1 (没有变化)
200 0 (触发)
210 0 (还没有变化)
200 1 (再次触发)
150 1 (没有变化)
100 0 (再次触发)


Figure 2: Multiple PLS positions

如果轴位置围绕指定的PLS位置振荡,则每当指定位置被越过时,输出将被触发。

初始输出状态由用户隐式指定。 当PLS启用时,输出设置为此状态。

PLS位置数据

PLS位置数据存储在属于PLS机制的数据结构中。 使用CreatePlsData命令显式创建此数据结构。

PLS数据具有读/写访问权限。 用户必须确保PLS位置数据是单调的(以允许启用PLS)。

滞后

如果轴在指定的PLS位置停止,则由于实际轴位置的轻微不稳定性,数字输出的状态可能会持续触发。在这种情况下,可以选择指定滞后值。当并通过滞后值达到PLS位置时,输出状态将被触发。如在本示例中,如果滞后值为10,则输出将在位置110处从低电平变为高电平。当位置下降至90时,将返回到低电平。

Figure 3: Hysteresis in PLS position

重复间隔

可以以指定的间隔持续重复PLS位置。因此如果PLS位置指定为100,例如,重复间隔为2000,则在正方向上,输出状态在100位置上触发,再次在2100,4100,等位置上触发。并且在负方向上,在 -1900, -3900等位置上触发。

重复间隔必须为正,并且必须大于最小和最大PLS位置值之间的绝对值差. 即:

Repetition Interval > abs(PLS_Pos_Max - PLS_Pos_Min)

示例:

  • PLS Position values: -300, 100, 200
  • Repetition Interval: 2000
  • Polarity: 0

输出状态在-300, 100, 200触发,同样在1700 (-300 + 2000), 2100 (100+2000), 2200, 和 3700 (-300 + 2000 + 2000) 等位置触发。 在负方向上输出状态在-1800 (200 - 2000), -1900 (100 - 2000), -2300 (-300 - 2000), -3800等位置触发。

Figure 4: PLS Repetition Interval

PLS 约束

  • PLS的数量不受系统限制。 可以理解为定义的PLS数量与系统性能之间存在直接的权衡。
  • 每个PLS定义的PLS位置的数量不受限制。
  • 每个轴可以定义多个PLS。
  • PLSes以运动总线循环速率扫描

启用和禁用

定义后,禁用PLS(不生成输出模式)。 当PLS被使能时,输出被设置。 输出设置为定义的初始状态。只有当PLS被禁用时,才能更改PLS属性。每个启用的PLS都需要CPU资源。通过禁用未使用的PLS(s)来节省这些资源。 PLSEnable 控制PLS的状态。

MyPLS.PlsEnable = ON | OFF

PLSENABLE查询PLS的状态:

?MyPls.PlsEnable
if(MyPLS.PlsEnable = OFF)
. . .

或驱动事件:

EventOn MyEvent MyPLS.PlsOutput = ON

PLS 输出状态

查询与PLS关联的数字输出,以查询PLS输出的状态。
例如,假设PLS输出被分配给SYSTEM.DOUT.1。 要确定PLS的输出状态,请查询SYSTEM.DOUT.1的状态:

-->?Sys.Dout.1
0 | 1

示例

Step 1

在Config.Prg或终端中使用COMMON SHARED <PLS name> AS PLS声明PLS。您必须命名PLS,指定驱动PLS的轴,并命名要由PLS控制的输出。例如:

Common Shared MyPLS as PLS A1 System.Dout.1

将MyPLS设置为由连接到SYSTEM.DOUT.1的轴A1驱动的PLS。 输出可以是数字输出(SYSTEM.DOUT.1到DOUT.20)或者可以是模拟输出之一(SYSTEM.VOUT.1到VOUT.32). 在Common Shared as PLS执行后, PLS禁用。 PLS的属性设置为:

  • 单个PLS位置存在于0
  • 初始输出极性为1
  • PLSREPEAT设置为0.
  • 滞后设置为0.

只要PLS保持禁用,可以明确设置这些属性。 您可以使用PLSOUTPUT来检查与给定PLS相关联的输出。

Step 2

Create the PLS data structure and define PLS positions. The number of defined positions is not explicitly limited. A call to CreatePlsData creates an array of n positions that stores the position data. The array is 1- based and an error is generated if you attempt to access an index outside of the array bounds. For example:

CreatePLSData 4 MyPLS
MyPLS.PLSPosition[1] = 1000
MyPLS.PLSPosition[2] = 1100

As a short form, you can use PPOS in place of PlsPosition :

MyPLS.Ppos[3] = 2000
MyPLS.Ppos[4] = 2200

You cannot change PLS positions when the PLS is enabled. Position values must be increasing monotonically.

Step 3

Set the polarity. PLSPOLARITY defaults to OFF, indicating the PLS state should be OFF after the first position. Change PlsPolarity to ON to invert the state.

MyPLS.PLSPolarity = ON

Change PlsPolarity only if the PLS is disabled.

Step 4

Set PlsRepeat . If you want the PLS to repeat, set the value of PLSREPEAT to a non-zero, positive number. For example, to have the PLS repeat every 10,000 position units, enter:

MyPLS.PLSRepeat = 10000

PLSREPEAT defaults to 0, indicating that there is no repetition. Change PLSREPEAT only when the PLS is disabled.

Step 5

Set PlsHysteresis, if the application requires it. Hysteresis is only necessary if the system does stop on or near a PLS position. Normally, a PLSHYSTERESIS of 5 or 10 counts of encoder (converted to position units) or 2 or 3 counts of resolver resolution is sufficient.

MyPLS.PLSHysteresis = 0.01

Step 6

Enable the PLS Enter:

MyPLS.PLSEnable = ON

There are a few other PLS functions you may need:

  • Change Polarity

The default output state of a PLS is 0. Change this initial state by modifying PLSPOLARITY.

MyPLS.PLSPolarity = 1

The PLS must be disabled when changing this setting.

  • Query the Name
Query the name of the axis driving the PLS:
? MyPLS.PLSAxisName

returns the axis associated with the PLS (A1).

  • Disable the PLS
Disable the PLS. For example:
MyPLS.PLSEnable = OFF

You must disable a PLS to change PLS properties. Disabling a PLS also helps conserve CPU resources.

  • Delete a PLS

Delete a PLS to remove it from the system only when the PLS is disable and there are no tasks in memory. For example:

DeletePLS MyPLS

Command Set

A PLS is defined using the syntax for variable declaration. The following PLS properties are defined:

  • PLS name
  • Axis
  • Output name
  • One or more PLS positions
  • Optional initial output state
  • Optional repetition interval
  • Optional hysteresis setting

PLS Commands