Infosys在阅读器中打开 / AI 翻译

EL5131 | 1-Channel-Incremental Encoder Interface, 5 V with 2 parameterizable 24 V DC Outputs · 0 次阅读

Detect counting direction

The terminal can be parameterized as follows via index 0x8001:1C "Direction inversion hysteresis":

or

Detect counting direction

  • Setting the hysteresis, via index 0x8001:1C "Direction inversion hysteresis" = 0
  • To detect the counting direction, the position value of the last PLC cycle (pos 1) is subtracted from the position value of the current PLC cycle (pos 2).
  • The result is output during the next PLC cycle via index 0x6002:13 "Direction inversion detected". A positive result is interpreted as a positive direction of rotation (0x6002:13 "Direction inversion detected" = 0), a negative result as a negative direction of rotation (0x6002:13 "Direction inversion detected" = 1).

0x8001:1C "Direction inversion hysteresis" = 0

Change in position

Direction of rotation

0x6002:13 "Direction inversion detected"

pos 2 - pos 1 > 0

Positive direction of rotation (CW)

0

pos 2 - pos 1 < 0

Negative direction of rotation (CCW)

1

pos 2 - pos 1 = 0

No change of direction of rotation

No state change

Counter overflow

No change of direction of rotation

No state change

Counter underflow

No change of direction of rotation

No state change

  • When the terminal is started up, a positive direction of rotation is assumed in the first PLC cycle (0x6002:13 "Direction inversion detected" = 0), since a second position value is initially missing for the calculation.
  • If an overflow (0x6000:05 "Counter overflow") or underflow (0x60n00:04 "Counter underflow") of the counter value is detected, the result is corrected internally for the next PLC cycle. See figure (A) below.
  • If the counter value is changed externally via the C track or the Latch extern input and this leads to a negative position jump, this is indicated via process data 0x6002:13 "Direction inversion detected". See figure (B) below
  • If reversion of rotation (index 0x8000:0E "Reversion of rotation" = TRUE) is enabled, the logic of the direction of rotation detection also changes.
Detect counting direction 1:Fig.160: Detection of the counting direction

Detect reversion of rotation

  • Input of the hysteresis in number of increments, via index 0x8001:1C "Direction inversion hysteresis". A value greater than 0 must be selected.
  • If a direction inversion is detected, an internal counter evaluates the edges detected directly one after the other for each direction of rotation and compares them with the number entered in index 0x8001:1C.
  • If the counter value exceeds the value entered in index 0x8001:1C, the bit in index 0x6002:13 "Direction inversion detected" is set during the next PLC cycle. The bit remains active for one cycle only.
  • The bit remains active if a further direction inversion is detected within the next cycle.
  • The hysteresis is considered separately for each PLC cycle, so the counter is restarted for each cycle. There is no monitoring across PLC cycles.
  • If reversion of rotation (index 0x8000:0E "Reversion of rotation" = TRUE) is enabled, the logic of the direction of rotation detection also changes.
  • If several changes of direction occur within one PLC cycle, the display only indicates that at least one change of direction has been detected.
Detect counting direction 2:Fig.161: Detection of reversion of rotation

Standstill monitoring

Detection of direction inversion can also be used for standstill monitoring. If an almost constant counter value is expected, the hysteresis (index 0x80n1:1C) can be used to monitor whether the value is within the window. A slight jitter of the counter value is therefore still accepted as a permissible value. If this value is exceeded, bit 0x6002:13 "Direction inversion detected" is set during the next PLC cycle.

  • If the direction changes again within the hysteresis [number of increments] specified in index 0x8001:1C, no change of direction is indicated (standstill). See figure (A) below.
  • If the hysteresis [number of increments] specified in index 0x8001:1C is exceeded after a change of direction, the change of direction is indicated in the next cycle by setting the "Direction inversion detected" bit in index 0x6002:13. See figure (B) below.
Detect counting direction 3:Fig.162: Standstill monitoring with hysteresis and detection of reversion of rotation
Detect counting direction 4:

Drifting of the counter value

Reliable detection of a drifting counter value can only be guaranteed if the value in index 0x8001:1C "Direction inversion hysteresis" is "1", or by additional monitoring of the counter value in the PLC.