AXY:PLS Software Specification
Contents
Refer to
Introduction
A programmable limit switch (PLS) is a mechanism which triggers a system output when a specified axis position is reached. The PLS implementation in the softMC has the following features:
- Multiple position specifications
- PLS pattern repetition
- Position hysteresis
- Enabling and disabling of PLS
- The output may be digital or virtual
Purpose
This article specifies the PLS functionality as it is implemented in the softMC. The functionality is described and the supporting commands are defined.
Definitions
PLS – Programmable limit switch.
PLS – Position specified in the PLS command, at which the state of the output is toggled.
Digital output – Can be mapped to a device that resides on the motion bus, to either one of the drive outputs, or to EtherCAT/CAN I/O block.
(Local is not supported in firmware version 5.0 and later; it is supported only in legacy SERCOS II motion controller.)
Soft output – One of the 32 virtual outputs.
Method
PLS Functional Description
PLS Polarity
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.
For example: consider the following PLS whose positions are 10, 25, 30, 50, 65, and polarity is 0, as shown in this figure.
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.
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.
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.
Position | Output State |
0 | 0 |
100 | 1 (Toggle) |
150 | 1 (No change) |
200 | 0 (Toggle) |
210 | 0 (No change yet) |
200 | 1 (Toggle again) |
150 | 1 (No change) |
100 | 0 (Toggle again) |
If the axis position were to oscillate around a specified PLS position, the output would be triggered each time the specified position was crossed.
The initial output state is specified implicitly by the user. The output is set to this state when the PLS is enabled.
PLS Position Data
The PLS position data will be stored in a data structure that belongs to the PLS mechanism. This data structure will be explicitly created, using the CreatePlsData command. The PLS data will have read/write access. The PLS position data must be monotonic (in order for a PLS to be enabled), and this is the responsibility of the user.
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, in the above example, the hysteresis value was 10, say, then the output would be changed from Low to High at position 110. It would be changed back to Low when the position went back down to 90.
Repetition Interval
PLS positions may be continually repeated at a specified interval. Thus if a PLS position of 100, say, were specified, with a repetition interval of 2000, the the output state would be toggled at 100, and again at 2100, 4100, etc in the positive direction, and at -1900, -3900 etc in the negative direction.
The repetition interval must be positive, and must be greater than the absolute value difference between the least and greatest PLS position values. That is:
Repetition Interval > abs(PLS_Pos_Max - PLS_Pos_Min)
Example:
- PLS Position values: -300, 100, 200
- Repetition Interval: 2000
- 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 ouptut state will be toggled at -1800 (200 - 2000), -1900 (100 - 2000), -2300 (-300 - 2000), -3800 etc.
PLS Constraints
- The number of PLSes will 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.
- The number of PLS positions defined per PLS will not be limited.
- More than one PLS may be defined per axis.
- PLSes will be scanned at the motion bus cycle rate.
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