Angle positions of the shaft are represented
by bright and dark spots on the code disk. There are different
possibilities to code a position.
Binary Code
The two-state code generates a value from powers to the base of 2.
For example the number 10 is illustrated as follows:
The corresponding Binary number is 1010.
The
code is a multistep code, i.e. the change from one position to another
can cause a shift of several bits. Scanning this code on a code disc
would generate a problem, as due to process tolerances changes in the
different tracks would not occur simultaneously. As a consequence
invalid position values could be given. Image 6 makes this problem
clear: The change from position 7 into position 8 . If bit 23 altered
state before bits 20, 21 or 23 then all bits would be dark resulting in
an value of 15 being given. The solution is a one step code for example
gray-code.
Gray-Code
Gray
code is a one step code, i.e. only one single bit changes from one
position to the next. The transfer from one position can be slightly
shifted by imprecise scanning, but it is not possible that this would
cause incorrect position values to be given.
Another
advantage of the gray code is the easy reversibility. The counting
direction can easily be changed by inverting the most significant bit.
Therefore it is possible to change the counter direction just by using
the complement-entry.
The
gray code has to be converted into a binary code, because the single
bits of the gray code don?t have a determined value. This is done by a
code converter, that consists of a cascaded of XORs´.
Gray-Excess-Code
The
"ordinary" single step gray code is valid for resolutions which can be
described as a power to the base of 2. For other resolutions the range
of gray code combinations is limited by concentric trimming. This range
doesn't begin at 0, but is shifted by a determined value.
For
evaluation half of the difference between the original and the reduced
resolution is subtracted from the calculated binary value.
Resolutions,
for example 360° for angle determination, are often realized with this
code (Gray code 9 bit cut at both sides by 76 steps equals 360 steps)