Programmable Limit Switch

From SoftMC-Wiki
Revision as of 13:32, 11 October 2018 by Guy (talk | contribs) (in process)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language: [[::Programmable Limit Switch|English]]

TOP2.png

PLS Overview

A programmable limit switch (PLS) monitors position feedback on both real and simulated axes. When the axis reaches any of the defined PLS positions,
the PLS toggles the state of a specified system output, either digital or simulated.
A PLS offers more flexibility than a limit switch, as it allows many trip points and can be reconfigured on-the-fly.

PLS positions are defined in an array and must have values that are monotonic increasing.
Any number of positions can be defined for a PLS.

Any number of PLS switches can be defined for an element (axis or group). However, the number of defined PLS switches will have a direct affect on system performance.

The PLS is scanned at a rate of once per motion bus cycle.
Implementation of PLS in the Product includes three types of functionalty:

  • Axis-PLS: PLS positions defined for an axis
  • Path-PLS: PLS positions defined according to a motion path
  • High accuracy PLS: PLS positions are extrapolated and set based on system position, speed and acceleration. For use in high speed applications.

PLS Functional Description

Output State

A PLS toggles an output when a specified position is reached. The state is toggled each time the position is reached,
irrespective of the direction of motor travel.
AXY;PLS description.jpeg

PLS Polarity

The property PLSPolarity allows you to control the initial polarity of the PLS output, which is specified as 1 or 0. The default value is 0.
The output state is set when the PLS is enabled (PLSEnable).
The state of the output is determined by the axis position at the moment of PLSEnable, according to the following scheme:

If PCMD < PLSPosition[1]

Output = negative PLSPolarity (=1)

If PCMD >= PLSPosition[1] and PCMD < PLSPosition[2]

Output = PLSPolarity (=0)

If PCMD >= PLSPosition[2] and PCMD < PLSPosition[3]

Output = negative PLSPolarity (=1)

Consider the following example. The PLS positions are 10, 25, 30, 50 and 65. Polarity is 0. Once the PLS is enabled,
the output state will toggle on and off according to the location of the axis. Assuming PLS is enabled before position 10,
the output will toggle on at 10, remain on between 10 and 25, and toggle off between 25 and 30, and so on.

AXY;PLS plolarity description.jpeg

PLS Position Data

When a PLS is first defined, it does not have any associated positions. The CreatePLSData command is used to define the values for the PLS positions.
An unlimited number of PLS positions can be defined, but the array must be monotonic increasing.
PLS position values are always absolute (and not incremental). PLS positions are given in user units, and as such are affected by axis Displacement and PositionFactor properties.
Consider the following example. Positions 100 and 200 are specified, and the initial state of the digital output after enabling is 0.
The following table shows how the state of output changes as the position changes.

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)


AXY;Multiple PLS positions.jpeg

Hysteresis

If an axis stops at a specified PLS position, the state of the digital output may be continually toggled, due to slight oscillations in the actual axis position.
To accommodate this behavior, Product allows you to apply a hysteresis value around the output toggle positions.
Typically, 5 to 10 encoder counts (converted to position units) is sufficient.
The output state is toggled when the PLS position is reached and surpassed by the hysteresis value.
The following example shows a hysteresis value of 10; the output will toggle ON at position 110. It will toggle OFF at position 90.
If the axis driving the PLS stops at a PLS position within the hysterisis range, the PLS state does not change.
Hysteresis is necessary only if the system stops on or near a PLS position.
AXY;Hysteresis in PLS position.jpeg

Repetition Interval

PLS positions may be repeated continually at a specified interval of encoder counts.
The repetition interval must be both positive and greater than the absolute value difference between the lowest and highest PLS position values. That is:

Repetition Interval > abs(PLS_Pos_Max - PLS_Pos_Min)

Consider the following example:

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

The output state is toggled at -300, 100, 200, and at 1700 (-300 + 2000), 2100 (100+2000), 2200, and at 3700 (-300 + 2000 + 2000), and so on in the position direction.
In the negative direction, the output state is toggled at -1800 (200 - 2000), -1900 (100 - 2000), -2300 (-300 - 2000), -3800, and so on. AXY;PLS Repetition Interval.jpeg

Enable and Disable

When first defined, the PLS is disabled.
Once the PLS is enabled, the output is set according to the polarity and position, and the output pattern is generated.
The PLS must be disabled when modifying PLS properties.

PLS Commands and Properties

PLS Commands and Properties.

The following commands and properties are used for defining and using PLS functionality in a Product system.

MC-Basic Command/Property Description
COMMON | DIM] SHARED <PLS name> AS PLS <''axis''> <''output''><br> Command Declares a PLS variable. The name of the element and the output associated with the PLS are specified in the declaration.
CreatePlsData Command Creates a PLS data table containing the positions associated with a defined PLS.
DeletePls Command Deletes a defined PLS and all actions associated with that PLS.
PLSList Command Returns a list of the PLS names defined in the system.
WithPLS Command Nodal assignment of path-PLS. Enables path-PLS at the start of motion.
The specified PLSes will be enabled during execution of the specified motion and disabled when the motion ends.
HWAssistance Property Enables/disables high-accuracy (hardware-enabled) PLS mode.
HWIOtime Property Returns the current contents of the hardware time buffers. Applicable only to high-accuracy PLS.
PLSAxisName/PLSElementName Property Returns the name of the axis or group for which the specified PLS is defined.
PLSDelayTime Property Returns the current contents of the PLS time buffers.
PLSEnable Property Enables or disables the PLS functionality.
PLSHysteresis Property Sets or queries the hysteresis level of a PLS.
PLSOutput Property Sets or queries the system output associated with a PLS.
PLSPolarity Property Sets or queries the initial polarity associated with a PLS.
PLSPosition Property Sets or queries an individual PLS position.
PLSPropagationDelay Property Expresses the elapsed time from the moment the position command is sent to the drive until it is set as a command value in the drive’s position loop.
PLSPropagationDisableDelay Property Propagation delay value, used when the PLS sets the external device to the disabled state.
PLSPropagationEnableDelay Property Propagation delay value, used when the PLS sets the external device to the enabled state.
PLSRelatedTo Property Flag used by PLSSource to define whether relative PLS position values are computed relative to the start of motion or the target position.
PLSRepeat Property Sets or queries the repetition interval of the PLS positions.