Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

QUADRATURE DECODER.

RSS
LAD 2 - --- Total Rungs in File = 6

0000

Quadrature Decoder with Up Down Counter. This logic takes inputs from a quadrature encoder and return a relative position in
Counter C12:0.ACC.
Useful as a potentiometer or thumbwheel replacement. Also good for machine position feedback.
Make sure that your PLC scan rate is at least 2X the maximum encoder input rate.
This rung detects channel A & B transitions.
Quadrature Encoder
Quadrature Encoder
Quadrature Encoder
Channel A Leading
Channel A Leading
Channel A
Edge OSR
Edge One Shot
B10:0
B11:0
B11:0
OSR
0
0
4
Quadrature Encoder
Channel B
B10:0
1
Quadrature Encoder
Channel A
B10:0
0
Quadrature Encoder
Channel B
B10:0
1

Quadrature Encoder
Channel B Leading
Edge OSR
B11:0
OSR
1

Quadrature Encoder
Channel B Leading
Edge One Shot
B11:0

Quadrature Encoder
Channel A Trailing
Edge OSR
B11:0
OSR
2

Quadrature Encoder
Channel A Trailing
Edge One Shot
B11:0

Quadrature Encoder
Channel B Trailing
Edge OSR
B11:0
OSR
3

Quadrature Encoder
Channel B Trailing
Edge One Shot
B11:0

Detect clockwise (positive) rotation.


Quadrature Encoder
Channel A Leading
Edge One Shot
B11:0

Quadrature Encoder
Channel B
B10:0

Quadrature Encoder
Channel B Leading
Edge One Shot
B11:0

Quadrature Encoder
Channel A
B10:0

Quadrature Encoder
Channel A Trailing
Edge One Shot
B11:0

Quadrature Encoder
Channel B
B10:0

0001

Page 1

1 = Clockwise
Rotation
0 = Counter
Clockwise Rotation
B11:0
L
8

Wednesday, February 07, 2001 - 14:32:07

QUADRATURE DECODER.RSS
LAD 2 - --- Total Rungs in File = 6
Quadrature Encoder
Channel B Trailing
Edge One Shot
B11:0

Quadrature Encoder
Channel A
B10:0

Detect Counter-Clockwise (negative) rotation.


Quadrature Encoder
Channel A Leading
Edge One Shot
B11:0

Quadrature Encoder
Channel B
B10:0

Quadrature Encoder
Channel B Leading
Edge One Shot
B11:0

Quadrature Encoder
Channel A
B10:0

Quadrature Encoder
Channel A Trailing
Edge One Shot
B11:0

Quadrature Encoder
Channel B
B10:0

Quadrature Encoder
Channel B Trailing
Edge One Shot
B11:0

Quadrature Encoder
Channel A
B10:0

0002

1 = Clockwise
Rotation
0 = Counter
Clockwise Rotation
B11:0
U
8

Incerment or decrement encoder position.


B10/5 and B10/6 can be used to provide limit stops.
Quadrature Encoder
Channel A Leading
Edge One Shot
B11:0
0003
4
Quadrature Encoder
Channel B Leading
Edge One Shot
B11:0
5

Page 2

Wednesday, February 07, 2001 - 14:32:12

QUADRATURE DECODER.RSS
LAD 2 - --- Total Rungs in File = 6

Quadrature Encoder
Channel A Trailing
Edge One Shot
B11:0
6
Quadrature Encoder
Channel B Trailing
Edge One Shot
B11:0
7

Enable Encoder Count


Up
B10:0

1 = Clockwise
Rotation
0 = Counter
Clockwise Rotation
B11:0

Enable Encoder Count


Down
B10:0

1 = Clockwise
Rotation
0 = Counter
Clockwise Rotation
B11:0

Reset the Encoder Position


Reset Encoder
Position to Zero
B10:0
0004

Relative Encoder
Position
CTU
Count Up
Counter
C12:0
Preset
32767<
Accum
0<

Relative Encoder
Position
CTD
Count Down
Counter
C12:0
Preset
32767<
Accum
0<

CU
DN

CD
DN

Relative Encoder
Position
C12:0
RES

4
0005

Page 3

END

Wednesday, February 07, 2001 - 14:32:13

You might also like