Speed compensated gray code output: option "-g, Gray code position output – Electro Cam 5000 Series User Manual

Page 44

Advertising
background image

5-3 Programming, Optional Features

Speed Compensated Gray Code Output: Option “-G”

Gray Code Position Output

-

( Units with the "G" Option)

Pl

µ

s Controls with the Gray Code output option output eight

bit Gray Code position information on the last eight outputs.
The position output takes into account the control's Offset
value. Therefore, the Gray Code position matches the
position shown on the control's position display. The Gray
Code position output can be Speed Compensated as a
group of outputs as shown below.

The Ladder Diagram shown on the right will convert the
eight bit Gray Code output signal (G0-G7) from the PLuS
control to a binary number (B0-B7) during each scan of the
PLC. Because only one bit changes state per Gray Code
increment, the decoding process is error free and does not
require the use of latching or handshaking circuitry. The
value of the Binary result will always be in the range of zero
to 255 because the eight bit Gray Code divides each
revolution into 256 uniform increments. Ladder rungs which
follow the conversion can compare the rotary position value
to known positions for control of machine devices that must
operate at specific positions within the overall machine
cycle. The rotary position of the machine cycle can also be
used to gate input sensors and shift register functions.

Converting Gray Code to Binary involves a sequence of
“Exclusive OR” operations. It is simple to program this same
conversion logic in other programming languages besides
ladder logic. In addition to decoding the rotary position of the
encoder, controls with arithmetic capability can be
programmed to offset position if required.

16 outputs

CHN 9-16

9 = LSB, 16 = MSB

24 outputs

CHN 17-24

17 = LSB, 24 = MSB

48 outputs

CHN 41-48

41 = LSB, 48 = MSB

G7

B7

G6

G6

B7

B6

B7

B6

G5

G5

B6

B5

B5

B5

G4

G4

B4

B4

B4

G3

G3

B3

B3

B3

G2

G2

B2

B2

B2

G1

G1

B1

B1

B1

G0

G0

B0

Gray Code Conversion Ladder

G0 - G7 = Gray Code Input Bits from PLuS
control to PLC

B0 - B7 = Binary Equivalent of Gray Code
Position from PLuS control

FCN 4 - Gray Code Speed Compensation
(Setup or Master program enable must be active)

Speed Compensation is the ability of the control to
automatically advance an output's setpoints as the machine
speeds up. The Gray Code position output can be Speed
Compensated as a group by entering a speed comp value
into the first channel of the Gray Code outputs (Least
Significant Bit). All of the Gray Code output channels will
be compensated by this same amount. The channels to
enter Gray Code speed comp into are as follows:

16 output system:

output channel 9 (9 = LSB)

24 output system:

output channel 17 (17 = LSB)

48 output system:

output channel 41 (41 = LSB)

Speed compensation is set in Degrees/1000 RPM,
regardless of the scale factor being used. If the response of
the device is known, the amount of Speed Comp required
can be calculated:

Speed Comp (Deg/1000 RPM) = 6 x response (in mSec)
EX: 20 mSec response: 6 x 20 = 120 (Deg/1000 RPM

2nd

Press CHN key
to select 1st Gray
Code output #
(no other Gray
Code outputs can
be selected)

3rd

FCN 4 ENT

1st If FCN 4
not shown press:

Press number keys followed by
ENT to change Speed Comp
value
OR
DEC and INC keys can be
used to adjust Speed Comp
value in 1Deg/1000 RPM steps.

Present Speed Comp
value for Gray Code
shown

1st Gray Code

Output Channel

Selected

Note: 1 Degree/1000 RPM resolution allows Speed Comp
to be adjusted very accurately. However, it may be neces-
sary to make larger changes to the Speed Comp value to
see a change in machine performance. A change of 6
degrees/1000 RPM is needed to make a 1 mSec difference
to the device being controlled.

G0 = LSB, G7 = MSB

Advertising